refactor(e2e): fast block build config in e2e tests#23340
Draft
spalladino wants to merge 10 commits into
Draft
Conversation
4af2626 to
db4ec58
Compare
…rp paths mine(), evmMine(), and mineEmptyBlock() now call syncDateProvider() after mining so TestDateProvider follows L1 time without callers needing to do it manually. Remove now-redundant dateProvider.setTime() calls from three e2e test sites.
…tcher markAsProven loop Adds CheckpointAutoProver, an event-driven helper that subscribes to the sequencer's checkpoint-published event, waits for the local archiver to promote the checkpoint (verified via getL2Tips + getBlocks), then calls rollupCheatCodes.markAsProven(checkpointNumber). Replaces the periodic polling loop in AnvilTestWatcher.
…tcher Stop starting AnvilTestWatcher in e2e tests. Anvil now runs in interval mining mode at ethereumSlotDuration after L1 deploy, so warpTimeIfNeeded and syncDateProviderToL1IfBehind are unnecessary. The markAsProven loop is replaced by CheckpointAutoProver when testOnlyAutoProveAfterPublish is true (default via FAST_E2E_SETUP_OPTS). AnvilTestWatcher class stays in the tree for the sandbox/local-network entrypoint. The opt-in automineL1Setup option is removed (three callers cleaned up).
Canary for the AnvilTestWatcher-removal work in this PR. Exercises: - chain advances under interval mining + pipelining - 20 sequential dependent txs land in distinct blocks - proven tip advances via CheckpointAutoProver Uses FAST_E2E_SETUP_OPTS, the new preset added in this PR.
Missed in batch 2 because of its third argument (syncChainTip: 'checkpointed').
… and migrate to FAST_E2E_SETUP_OPTS
9208a79 to
1e675e8
Compare
…TUP_OPTS Both already used PIPELINING_SETUP_OPTS. The plan flagged them as second-batch out of caution; verified neither has hand-rolled cc.eth.warp/dateProvider.setTime helpers that would conflict with the wave-1 cheat-code audit.
1e675e8 to
d9922ef
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.
Motivation
AnvilTestWatcherpolls every 200ms and silently mutates global state from three differentRunningPromises — proving, dateProvider sync, and L1 time warping. The wiring difference between e2e and sandbox makes failures (the gistf3cdad44…two-dateProvider-read race,e2e_pruned_blocksfinalized-stuck-at-0, blacklist huge-warp wedges) hard to diagnose. Deleting it from e2e in favor of deterministic per-responsibility replacements gets us:anvil_setIntervalMining), no surprise warps.dateProvidermutates only when a cheat code explicitly warps L1, atomically with the RPC.The
AnvilTestWatcherclass stays in the tree so sandbox / local-network can keep using it. This PR only changes the e2e fixture wiring.Approach
Full design in
KILL_ANVIL_TEST_WATCHER_PLAN.md. Codex round-2 reviewed and corrections folded in (slot math, stricter auto-prove wait,setNextBlockTimestamp/mine()audit, second-batch deferrals).What's landed
Foundation
feat(e2e): add FAST_E2E_SETUP_OPTS preset with single-block fast-mode timing— preset + timetable unit test (3.75sblock budget,20spublishing deadline).feat(testing): add CheckpointAutoProver helper— replaces the watcher'smarkAsProvenloop. Unit tests cover wait pattern + queue + stop.fix(ethereum): atomically sync TestDateProvider in cheat-code mine/warp paths—mine(),evmMine(),mineEmptyBlock()syncTestDateProvider. Removes redundant manualsetTimeat three call sites.refactor(e2e): unconditional anvil interval mining + drop AnvilTestWatcher—fixtures/setup.tsintegration: dropautomineL1Setup, unconditionalsetIntervalMining, default-skipwatcher.start(), wireCheckpointAutoProver. Removes redundantsetIsMarkingAsProven(false)from 8 call sites.test(e2e): add e2e_fast_config smoke test— canary exercising 20 sequential txs in distinct blocks + proven-tip advancement.Migrations (47 tests total, 4 commits)
test(e2e): migrate first batch of single-sequencer tests— 10 tests.test(e2e): migrate second batch of single-sequencer tests— 22 tests.test(e2e): migrate e2e_amm to FAST_E2E_SETUP_OPTS— 1 test (had a third setup arg, missed in batch 2).test(e2e): thread opts through TokenContractTest + NestedContractTest— 2 base classes threaded withopts?: Partial<SetupOptions>, 14 tests migrated (8 token + 4 nested + 2 base classes).Held back from this PR
e2e_2_pxes— two PXEs behind one sequencer; more sync-sensitive. Migrate in a follow-up after first-batch CI is green.e2e_cheat_codes— exercisessetNextBlockTimestampandmine()directly. Wave-1 cheat-code audit deliberately did NOT add atomicdateProvidersync tosetNextBlockTimestamp(it schedules but doesn't mine — sync happens at the subsequent mine). Tests readingdateProvider.now()right aftersetNextBlockTimestampwould see the old value; needs hand audit.e2e_lending_contract— hand-rolled time helpers in itscc.eth.warpsimulator. Needs normalization before migration.BlacklistTokenContractTest(7 suites) — huge time warps wedge the pipelined publisher AND hit B7. Blocked on source fix, not a watcher issue.Explicitly out of scope (separate PRs)
sp/publisher-simulation-cleanup.simulatePublicCallsqueries unsealed checkpoint).publisher_manager.tssecond-round funder silence.invalidateInFlightCheckpointsBefore(slot)for huge-warp scenarios.Status
Draft. Foundation + smoke test + 47 migrated tests in place. Mark non-draft to trigger e2e CI. Consider
ci-no-fail-fastfor the first run so we see all failures at once.