Skip to content

refactor: StateManagerImpl::take_tip#8343

Merged
mraszyk merged 3 commits intomasterfrom
mraszyk/refactor-take-tip
Jan 15, 2026
Merged

refactor: StateManagerImpl::take_tip#8343
mraszyk merged 3 commits intomasterfrom
mraszyk/refactor-take-tip

Conversation

@mraszyk
Copy link
Copy Markdown
Contributor

@mraszyk mraszyk commented Jan 14, 2026

This PR refactors StateManagerImpl::take_tip:

  • it inlines the case tip_height > StateManagerImpl::INITIAL_STATE_HEIGHT of the closure hash_at into the case snapshot.height > tip_height of a state obtained via state sync;
  • it replaces the ad-hoc implementation of the case tip_height == StateManagerImpl::INITIAL_STATE_HEIGHT by using StateManagerImpl::compute_certification_metadata so that the new implementation could be used also for tip heights other than StateManagerImpl::INITIAL_STATE_HEIGHT.

This PR also add a new metric state_manager_tip_hash_count tracking the number of tip heights whose state snapshot was not stored by this node and whose state hash was computed by this node. Currently, the only such state is the initial state and thus the metric is expected to be 1 in tests (starting from the initial state) and 0 in production (resuming from a checkpoint).

@mraszyk mraszyk marked this pull request as ready for review January 14, 2026 21:46
@mraszyk mraszyk requested a review from a team as a code owner January 14, 2026 21:46
@mraszyk mraszyk added this pull request to the merge queue Jan 15, 2026
Merged via the queue into master with commit aeacb5f Jan 15, 2026
62 of 64 checks passed
@mraszyk mraszyk deleted the mraszyk/refactor-take-tip branch January 15, 2026 11:11
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.

2 participants