fix(archiver): reconcile local blocks with L1 checkpoints by block number#23461
Merged
spalladino merged 1 commit intoMay 21, 2026
Merged
Conversation
…mber, not slot When the sequencer locally proposed block N at slot S1 and L1 mined a different block N at slot S2, pruneMismatchingLocalBlocks filtered by slot and missed the conflict, so the local block (and its contract data) was never pruned. The subsequent re-apply of L1's block N then threw "Contract instance ... already exists" and the archiver's serial queue got stuck retrying. Fixed by reconciling on blockNumber. The per-checkpoint trailing prune remains scoped by slot so speculative blocks at later slots (which may belong to a pending proposed checkpoint) are preserved. Also evict pending proposed checkpoints that referenced pruned blocks so they do not dangle after a conflict prune. Regression tests added in data_store_updater.test.ts.
c14aaa6 to
50d22cd
Compare
PhilWindle
approved these changes
May 21, 2026
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.
Motivation
When the sequencer locally proposed block N at slot S1 and L1 mined a different block N at slot S2 (same block number, different slot), the archiver's reconciliation in
pruneMismatchingLocalBlocksjoined local↔checkpoint blocks by slot and missed the conflict. The local block was never pruned and the subsequent re-apply of L1's block N threwContract instance ... already exists, cannot add again at block N. The archiver's serial queue then retried in a loop and wedged the data store — this is the cause of the e2e flake atyarn-project/end-to-end/src/composed/ha/e2e_ha_full.test.ts:693.Approach
pruneMismatchingLocalBlocksnow keys conflict detection onblockNumberonly, so a same-number-different-slot block is correctly detected as a conflict and pruned. The per-checkpoint trailing prune (which handles "local has extra blocks at the same slot as the published checkpoint") stays scoped by slot so speculative blocks at later slots that belong to a pending proposed checkpoint are preserved — this keeps the pipelining model inpromoteProposedToCheckpointedintact. After any prune, pending proposed checkpoints from the offending checkpoint number onwards are evicted so they do not dangle while referencing removed blocks.Changes
pruneMismatchingLocalBlocksjoins byblockNumberonly; trailing slot-scoped prune unchanged; newevictProposedCheckpointsForPrunedBlockshelper clears stale pending proposed checkpoints after a prune.data_store_updater.test.tscovering the e2e_ha scenario, the prune-by-number path without contract data, pipelining preservation, and eviction of higher-numbered proposed checkpoints chaining off pruned blocks.