test: count post-checkpoint batches in the rebuild anchor check - #48
Merged
Merged
Conversation
setup_recovery_round_trip_test asserted that the rebuilt batch tree is anchored at the checkpoint's resume nonce N. The rebuild anchors at N', which folds every batch accepted in (B, C] on top of N. With a 5 s max_batch_open, the sequencer keeps closing batches while the test mines to finality, so a batch sometimes lands after B before the stop. CI then failed with "left: 2, right: 1" while the rebuild was correct (checkpoint_block=31, stop_block=34, resume_nonce=2). The assertion now derives N' independently: it reads the rebuilt stop block C from history_state and counts, from the InputBox logs, the submitter's consecutive batch nonces from N in (B, C]. The rebuilt database cannot supply this count, because its acceptance projection starts after C.
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.
setup_recovery_round_trip_test asserted that the rebuilt batch tree is anchored at the checkpoint's resume nonce N. The rebuild anchors at N', which folds every batch accepted in (B, C] on top of N. With a 5 s max_batch_open, the sequencer keeps closing batches while the test mines to finality, so a batch sometimes lands after B before the stop. CI then failed with "left: 2, right: 1" while the rebuild was correct (checkpoint_block=31, stop_block=34, resume_nonce=2).
The assertion now derives N' independently: it reads the rebuilt stop block C from history_state and counts, from the InputBox logs, the submitter's consecutive batch nonces from N in (B, C]. The rebuilt database cannot supply this count, because its acceptance projection starts after C.