Repository navigation
[wip] snapshots: align state files to block file boundary on startup - #20508
Closed
AskAlexSharov wants to merge 1 commit into
Closed
AskAlexSharov wants to merge 1 commit into
AskAlexSharov wants to merge 1 commit into
Conversation
The preverified snapshot set may include state domain files whose committed block number extends past the block file boundary. This causes "behind commitment" errors on fresh sync because SeekCommitment returns a block number that TxNums doesn't cover. After downloading snapshots and opening the aggregator files, read the commitment "state" key via a temporary temporal RO tx. If the committed block exceeds FrozenBlocks(), iteratively remove the highest state files (across all dirs: domain, idx, history, accessor), de-register them from the downloader via seeder.Delete(), and strip from preverified.toml. The alignment only runs on fresh start — if TxNums already covers all frozen blocks (checked via a temporal RO tx), the node previously indexed past the boundary and alignment is skipped. Includes: - isStateDomainFile() filter to avoid deleting block snapshot files - findHighestStateFileStartStep returns (step, found) for step-0 safety - Debug logging for alignment decisions - Unit tests for all helper functions
4 of 5 tasks
sudeepdino008
self-requested a review
April 13, 2026 06:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Split out from #20503.