Skip to content

feat: no state hashing during catch-up (state manager)#8424

Merged
mraszyk merged 36 commits intomasterfrom
mraszyk/no-state-hashing-during-catchup
Feb 24, 2026
Merged

feat: no state hashing during catch-up (state manager)#8424
mraszyk merged 36 commits intomasterfrom
mraszyk/no-state-hashing-during-catchup

Conversation

@mraszyk
Copy link
Contributor

@mraszyk mraszyk commented Jan 19, 2026

This PR optimizes the state manager to not hash the state at tip while catching up if consensus could deliver a certification for the tip height.

In more detail, the PR performs the following changes:

  • introduces a new field states.certifications storing certifications delivered optimistically by consensus for future heights (to be used when catching up);
  • take_tip uses the state hash from a certification in states.certifications if a certification at the tip height is available;
  • commit_and_certify reuses the certification from states.certification if a certification at the committed height is available;
  • deliver_state_certification stores a certification into states.certifications if no certification metadata are available for the certification height;
  • remove_inmemory_states_below and remove_states_below prunes states.certifications at heights less than latest_state_height and fast_forward_height (this way, we have at most MAX_CONSECUTIVE_ROUNDS_WITHOUT_STATE_CLONING + MAX_FUTURE_HEIGHTS_TO_CERTIFY = 30 plus the certification lag - the difference between the latest resident and the latest certified height - many certifications stored in states.certifications at any time);
  • a new method list_state_heights_to_certify is used by consensus to determine heights for which certifications should be delivered: [tip_height..min(tip_height + MAX_FUTURE_HEIGHTS_TO_CERTIFY, fast_forward_height)] \ {heights for which we already have certifications}.

The new functionality of the state manager is not yet invoked by consensus and thus the functionality is not yet effectively enabled by this PR.

@github-actions github-actions bot added the feat label Jan 19, 2026
@mraszyk mraszyk marked this pull request as ready for review January 19, 2026 19:30
@mraszyk mraszyk requested review from a team as code owners January 19, 2026 19:30
@mraszyk mraszyk marked this pull request as draft January 20, 2026 16:27
@mraszyk mraszyk force-pushed the mraszyk/no-state-hashing-during-catchup branch from f2633b1 to 6fb0bb4 Compare February 3, 2026 09:30
@mraszyk mraszyk force-pushed the mraszyk/no-state-hashing-during-catchup branch from 6fb0bb4 to a9e2cb9 Compare February 3, 2026 09:32
@mraszyk mraszyk changed the base branch from master to mraszyk/height-witness-in-certification February 3, 2026 09:32
Base automatically changed from mraszyk/height-witness-in-certification to master February 23, 2026 19:51
@mraszyk mraszyk marked this pull request as ready for review February 24, 2026 12:37
@mraszyk mraszyk added this pull request to the merge queue Feb 24, 2026
Merged via the queue into master with commit 1af1607 Feb 24, 2026
43 checks passed
@mraszyk mraszyk deleted the mraszyk/no-state-hashing-during-catchup branch February 24, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants