Skip to content

fix(e2e): wait for checkpointed blocks in rediscovery test#22399

Open
AztecBot wants to merge 1 commit intonextfrom
claudebox/fix-rediscovery-flake
Open

fix(e2e): wait for checkpointed blocks in rediscovery test#22399
AztecBot wants to merge 1 commit intonextfrom
claudebox/fix-rediscovery-flake

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

@AztecBot AztecBot commented Apr 8, 2026

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

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Apr 8, 2026
@PhilWindle PhilWindle marked this pull request as ready for review April 8, 2026 11:56
## 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>
@AztecBot AztecBot force-pushed the claudebox/fix-rediscovery-flake branch from bc32c37 to 59a17ec Compare April 8, 2026 12:39
@AztecBot AztecBot enabled auto-merge April 8, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants