test(e2e): resolve remaining wait-code REFACTOR markers#24428
Open
spalladino wants to merge 3 commits into
Open
test(e2e): resolve remaining wait-code REFACTOR markers#24428spalladino wants to merge 3 commits into
spalladino wants to merge 3 commits into
Conversation
Finishes #24404's cleanup by resolving the 17 deferred // REFACTOR: wait-code markers in the e2e suite. Adopts a shared helper where one fits and extracts single-use polls into named local functions otherwise, preserving behavior. - ChainMonitor.waitForCheckpoint gains an opt-in guard that short-circuits on a fresh run() snapshot, avoiding the event-vs-poll already-satisfied race. - New RollupCheatCodes.waitForCheckpointBelow poll-only rollback waiter. - snapshot_sync adopts ChainMonitor.waitUntilCheckpoint. - FeesTest.waitForEpochProven encapsulates the advance-epoch + catch-up pair.
…tCheckpoint The opt-in short-circuit option said nothing about what it did. Rename it to checkCurrentCheckpoint and expand the JSDoc to spell out when to set it (latching state predicates) versus when not to (predicates that must observe the checkpoint live, e.g. one published mid-slot and then timed against wall-clock).
The prior commit extracted several single-use polls into functions defined inline in the test body and called on the spot, which is pure indirection. Move them to describe scope (closing over the test-context vars, parameterizing the it-locals) so the extraction actually reads as a named helper rather than a renamed block.
c235231 to
0c5bfa7
Compare
PhilWindle
approved these changes
Jul 2, 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
Cleanup finishing #24404's work. That PR adopted shared wait helpers across the e2e suite but deliberately deferred 17
// REFACTOR:wait-code markers as harder or ambiguous cases. This resolves all of them, leaving zero// REFACTOR:markers underend-to-end/src.Approach
All changes are behavior-preserving refactors: comparator direction, timeouts (with seconds-vs-ms conversions where a helper's unit differs), the
retryUntilfalsy-means-keep-polling contract, and side effects (loops that send txs / advance blocks / rotate the oracle keep doing so every tick) are all retained.API changes
New/changed test-only helpers (in
@aztec/ethereumtest utils and the e2e fees harness):ChainMonitor.waitForCheckpoint(match, opts)gains an opt-in flag. When set, it takes a freshrun()snapshot and short-circuits if the current checkpoint already satisfiesmatchbefore attaching the event listener. This closes an event-vs-poll already-satisfied race: a checkpoint could advance during a preceding wait and be missed by the purely event-driven path. The existing caller is unchanged.RollupCheatCodes.waitForCheckpointBelow(checkpoint, opts)— a poll-only waiter (mirroringwaitForEpoch/waitForSlot) that reads the L1 rollup contract until the pending checkpoint drops below a baseline (rollback detection). No node dependency.snapshot_syncnow adopts the existingChainMonitor.waitUntilCheckpoint(which has the already-satisfied guard) instead of a hand-rolled poll.FeesTest.waitForEpochProven()encapsulates the recurringadvanceToNextEpoch()+catchUpProvenChain()pair (adopted infailuresandprivate_payments).