fix(e2e): wait for checkpointed blocks in rediscovery test#22399
Open
fix(e2e): wait for checkpointed blocks in rediscovery test#22399
Conversation
## Summary
- Fix flaky `e2e_p2p/rediscovery.test.ts` caused by a race between uncheckpointed block pruning and PXE transaction simulation
- After `setupAccount()` deploys accounts, wait for blocks to reach `CHECKPOINTED` status before proceeding with the stop/restart cycle
- Refactor `deployAccounts` in `setup.ts` to accept optional `DeployOptions`, with `from: NO_FROM` always applied as the base
**Root cause**: After `setupAccount()` produces blocks, the test stops and restarts validator nodes. During the restart (~25s), the L1 clock advances past the block's slot. When restarted nodes sync, `pruneUncheckpointedBlocks()` removes the block because its slot has passed without a checkpoint. The PXE then fails simulating a transaction against the pruned block.
**Fix**: Pass `wait: { waitForStatus: TxStatus.CHECKPOINTED }` to `deployAccounts`, which waits for the deploy tx's block to be checkpointed before returning. This replaces the previous manual `retryUntil` loop.
CI log of the flake: http://ci.aztec-labs.com/19edb028126f87c3
Full analysis: https://gist.github.com/AztecBot/b4101abd080ebd536ac09e7c82188518
Co-authored-by: Phil Windle <philip.windle@gmail.com>
bc32c37 to
59a17ec
Compare
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
e2e_p2p/rediscovery.test.tscaused by a race between uncheckpointed block pruning and PXE transaction simulationsetupAccount()deploys accounts, wait for blocks to reachCHECKPOINTEDstatus before proceeding with the stop/restart cycledeployAccountsinsetup.tsto accept optionalDeployOptions, withfrom: NO_FROMalways applied as the baseRoot cause: After
setupAccount()produces blocks, the test stops and restarts validator nodes. During the restart (~25s), the L1 clock advances past the block's slot. When restarted nodes sync,pruneUncheckpointedBlocks()removes the block because its slot has passed without a checkpoint. The PXE then fails simulating a transaction against the pruned block.Fix: Pass
wait: { waitForStatus: TxStatus.CHECKPOINTED }todeployAccounts, which waits for the deploy tx's block to be checkpointed before returning. This replaces the previous manualretryUntilloop.CI log of the flake: http://ci.aztec-labs.com/19edb028126f87c3
Full analysis: https://gist.github.com/AztecBot/b4101abd080ebd536ac09e7c82188518