Skip to content

test: count post-checkpoint batches in the rebuild anchor check - #48

Merged
GCdePaula merged 1 commit into
mainfrom
fix/rebuild-anchor-flake
Oct 1, 2026
Merged

GCdePaula merged 1 commit into
mainfrom
fix/rebuild-anchor-flake

Conversation

@GCdePaula

Copy link
Copy Markdown
Member

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.

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.

@stephenctw stephenctw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@GCdePaula
GCdePaula merged commit 27e55ce into main Oct 1, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants