fix(pxe): advance anchor past genesis when chain has moved (merge-train/spartan)#22710
Closed
AztecBot wants to merge 1 commit intomerge-train/spartanfrom
Closed
fix(pxe): advance anchor past genesis when chain has moved (merge-train/spartan)#22710AztecBot wants to merge 1 commit intomerge-train/spartanfrom
AztecBot wants to merge 1 commit intomerge-train/spartanfrom
Conversation
Collaborator
Author
|
Automatically closing this stale claudebox draft PR (no updates for 5+ days). Re-open if still needed. |
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.
Fixes the merge-train/spartan CI failure in
e2e_epochs/epochs_invalidate_block.parallel.test.ts(proposer invalidates previous checkpoint with multiple blocks while posting its own) failing withCircuit execution failed: Proving public value inclusion failed.Root cause
Same class of bug as #22679: a PXE anchored at the initial header while the world state advances past genesis. PR #22679's TS-side fix in
AztecNodeService.getWorldStatereplacedgetSnapshot(BlockNumber.ZERO)withgetCommitted()for the genesis-hash early return, butgetCommitted()returns the latest committed tree state (WorldStateRevision.LATEST), not the genesis state. Once the chain advances past block 0, the witness comes from the latest tree but the kernel circuit validates it against the genesis root inhistorical_header.state.partial.public_data_tree.root, andassert(is_leaf_in_tree, ...)instorage_read.nr:44fires.The race was made tighter by #22586 enabling
enableProposerPipelining: true, inboxLag: 2in this test: the world state advances past genesis well before the firstchain-checkpointedevent reaches the PXE, so a PXE withsyncChainTip: 'checkpointed'can be stuck at the initial header while the node has already moved on.The full node-side fix requires either C++ support for genesis-state queries or a new "genesis snapshot" API and is non-trivial. This PR applies a targeted PXE-side workaround.
Fix
In
BlockSynchronizer.doSync, afterblockStream.sync(), if the anchor is still at block 0 but the node's L2 tips have advanced, advance the anchor to the appropriate tip. Tip selection respectssyncChainTip, with a fallback toproposedCheckpoint/proposedwhen the configured tip is still at genesis. The helper short-circuits once the anchor is past block 0 (no-op on every subsequent sync) and is defensive againstgetL2Tips()failures.Verification
yarn workspace @aztec/pxe test src/block_synchronizer/block_synchronizer.test.ts— 12/12 pass.e2e_epochs/epochs_invalidate_block.parallel.test.ts"proposer invalidates previous checkpoint with multiple blocks while posting its own" — passes locally (~280 s).e2e_epochs/epochs_mbps_redistribution.test.ts(the test fix(world-state): treat historical block 0 queries as historical, not latest #22679 originally targeted) — 2/2 pass.Links
Follow-up
The underlying bug in
AztecNodeService.getWorldState(returning latest tree state for genesis-hash queries) should be properly fixed in the node, not the PXE. This PR unblocks merge-train/spartan; the node-side fix can be tracked separately.ClaudeBox log: https://claudebox.work/s/3a5c7418b1f6595c?run=1