Skip to content

feat(sequencer): AutomineSequencer for single-sequencer e2e tests#23354

Draft
spalladino wants to merge 4 commits into
merge-train/spartanfrom
palla/automine-sequencer
Draft

feat(sequencer): AutomineSequencer for single-sequencer e2e tests#23354
spalladino wants to merge 4 commits into
merge-train/spartanfrom
palla/automine-sequencer

Conversation

@spalladino
Copy link
Copy Markdown
Contributor

Motivation

E2e tests outside of e2e_p2p, e2e_epochs, e2e_slashing, and e2e_block_building don't exercise block-building or consensus — they just need their tx to land. Running them on the production Sequencer (~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 AutomineSequencer alongside the production one. It reuses SequencerPublisher, FullNodeCheckpointsBuilder, and GlobalVariableBuilder; 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. Requires aztecTargetCommitteeSize == 0 (the e2e default), so an empty CommitteeAttestationsAndSigners is accepted by L1 via the verifyProposer / verifyAttestations early-return at ValidatorSelectionLib.sol:244-249.

Changes

  • sequencer-client: new AutomineSequencer (~370 LOC) with serial queue + mempool poller, buildIfPending/buildEmptyBlock/warpTo/warpBy. Wait for archiver to surface the published checkpoint before returning to avoid Rollup__InvalidArchive on the next build.
  • aztec-node: new useAutomineSequencer config flag. AztecNodeService.createAndSync constructs the AutomineSequencer inside the existing validator-enabled branch from the same L1 deps (l1TxUtils, publisher manager, publisher factory, checkpoints builder) instead of going through SequencerClient.new. mineBlock routes to AutomineSequencer.buildEmptyBlock when wired. Adds getters for WorldStateSynchronizer, L1ToL2MessageSource, EpochCache, GlobalVariableBuilder, and AutomineSequencer.
  • aztec/testing: CheatCodes.warpL2TimeAtLeastTo delegates to the queue when an AutomineSequencer is wired, so existing test helpers (warpL2TimeAtLeastBy, etc.) work unchanged.
  • end-to-end: new AUTOMINE_E2E_OPTS preset, useAutomineSequencer flag on SetupOptions, and e2e_automine_smoke.test.ts exercising sequential txs, parallel txs, warp, and mineBlock.

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 to AUTOMINE_E2E_OPTS.

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.
@spalladino spalladino added ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure labels May 18, 2026
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. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant