feat(sequencer): AutomineSequencer for single-sequencer e2e tests#23354
Draft
spalladino wants to merge 4 commits into
Draft
feat(sequencer): AutomineSequencer for single-sequencer e2e tests#23354spalladino wants to merge 4 commits into
spalladino wants to merge 4 commits into
Conversation
A minimal, deterministic, queue-driven sequencer for e2e tests that don't exercise block-building or consensus. Reuses SequencerPublisher, FullNodeCheckpointsBuilder, and GlobalVariableBuilder; skips proposer-turn checks, validator orchestration, attestations, pipelining, P2P gossip, timetable enforcement, and event emission. Uses anvil setAutomine(true) with no interval mining; pre-sets next L1 block timestamp at slot boundaries when needed. Mempool-driven builds and explicit warp/buildEmptyBlock requests share a single serial queue and never interleave. Requires aztecTargetCommitteeSize=0 on the deployed rollup (the e2e default) so empty CommitteeAttestationsAndSigners is accepted by L1.
…chestration Adds the AUTOMINE_E2E_OPTS preset that opts a single-sequencer non-block-building test into the AutomineSequencer path. Adds a useAutomineSequencer flag to SetupOptions for the fixture to branch on. Adds four getters to AztecNodeService (getWorldStateSynchronizer, getL1ToL2MessageSource, getEpochCache, getGlobalVariableBuilder) so the test fixture can construct an AutomineSequencer alongside an otherwise-headless node (disableValidator + dontStartSequencer).
…ture Adds a useAutomineSequencer config flag. When set, AztecNodeService.createAndSync constructs an AutomineSequencer inside the existing validator-enabled branch, reusing the same L1 deps (l1TxUtils, publisher manager, publisher factory, checkpoints builder) instead of going through SequencerClient.new. AztecNodeService.mineBlock routes to AutomineSequencer.buildEmptyBlock when the automine path is wired. CheatCodes.warpL2TimeAtLeastTo delegates to the queue when an AutomineSequencer is wired, so existing test helpers work unchanged. Adds the AutomineSequencer + AutomineSequencerDeps + AutomineSequencerConstants exports from sequencer-client, exposes getPublisherConfigFromSequencerConfig, and adds a USE_AUTOMINE_SEQUENCER env var. Adds e2e_automine_smoke.test.ts exercising sequential txs, parallel txs, warp, and mineBlock under AUTOMINE_E2E_OPTS.
Without waiting, the next mempool-driven build picks up a stale tip and L1 rejects the propose with Rollup__InvalidArchive — the freshly-built header points at the pre-publish lastArchive, but L1's lastArchive has already advanced to the just-published checkpoint. Also cap the smoke-test warp at 24s (2 slots) so it doesn't cross the L1 proof-submission window and trigger a separate prune-related code path.
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
E2e tests outside of
e2e_p2p,e2e_epochs,e2e_slashing, ande2e_block_buildingdon't exercise block-building or consensus — they just need their tx to land. Running them on the productionSequencer(~1100 LOC) +CheckpointProposalJob(~850 LOC) with 12s slot cadence is pure overhead: every test pays for proposer-turn checks, pipelining bookkeeping, validator attestations, and slot-aligned waits that aren't being tested. This PR explores giving those tests a minimal, deterministic, queue-driven alternative that runs txs effectively as fast as the block builder allows.Approach
Adds an
AutomineSequenceralongside the production one. It reusesSequencerPublisher,FullNodeCheckpointsBuilder, andGlobalVariableBuilder; skips proposer-turn checks, validator orchestration, attestations, pipelining, P2P gossip, timetable enforcement, and event emission. Anvil runs in automine mode with no interval mining; the sequencer pre-sets next L1 block timestamps at slot boundaries only when needed. All test time control (warps, empty-block requests) shares a single serial queue with mempool-driven builds — the three never interleave. RequiresaztecTargetCommitteeSize == 0(the e2e default), so an emptyCommitteeAttestationsAndSignersis accepted by L1 via theverifyProposer/verifyAttestationsearly-return atValidatorSelectionLib.sol:244-249.Changes
AutomineSequencer(~370 LOC) with serial queue + mempool poller,buildIfPending/buildEmptyBlock/warpTo/warpBy. Wait for archiver to surface the published checkpoint before returning to avoidRollup__InvalidArchiveon the next build.useAutomineSequencerconfig flag.AztecNodeService.createAndSyncconstructs the AutomineSequencer inside the existing validator-enabled branch from the same L1 deps (l1TxUtils, publisher manager, publisher factory, checkpoints builder) instead of going throughSequencerClient.new.mineBlockroutes toAutomineSequencer.buildEmptyBlockwhen wired. Adds getters forWorldStateSynchronizer,L1ToL2MessageSource,EpochCache,GlobalVariableBuilder, andAutomineSequencer.CheatCodes.warpL2TimeAtLeastTodelegates to the queue when an AutomineSequencer is wired, so existing test helpers (warpL2TimeAtLeastBy, etc.) work unchanged.AUTOMINE_E2E_OPTSpreset,useAutomineSequencerflag onSetupOptions, ande2e_automine_smoke.test.tsexercising sequential txs, parallel txs, warp, andmineBlock.Plan:
/home/santiago/.claude/plans/i-had-anotehr-agent-snazzy-forest.md(codex-reviewed). Smoke test passes locally (4/4, ~78s wall time). Next steps: migrate the first batch of single-sequencer tests toAUTOMINE_E2E_OPTS.