Skip to content

refactor(e2e): skip initial sequencer in p2p and epochs tests#22535

Merged
spalladino merged 6 commits into
merge-train/spartanfrom
palla/skip-initial-sequencer-in-e2e
Apr 21, 2026
Merged

refactor(e2e): skip initial sequencer in p2p and epochs tests#22535
spalladino merged 6 commits into
merge-train/spartanfrom
palla/skip-initial-sequencer-in-e2e

Conversation

@spalladino

Copy link
Copy Markdown
Contributor

Motivation

E2e tests that spin up their own validator nodes (P2P and epochs suites) were unnecessarily starting a sequencer on the initial setup node and waiting for it to mine block 1. With the genesis timestamp support from #22359, this initial block is no longer needed. The initial sequencer also interfered with P2P topology (sharing a validator key with test nodes) and wasted time in setup.

Approach

Added a dontStartSequencer option to the e2e setup() function that skips sequencer startup and block-1 waiting on the initial node. For P2P tests, the initial node becomes a lightweight archiver (no sequencer, no validator, no P2P), and the wallet is pointed at a test node for transaction propagation. For epochs tests, account deployment is deferred until validator nodes are running, then sequencers are stopped so the test body can restart them with specific configurations.

Changes

  • end-to-end (fixtures): Added dontStartSequencer option to SetupOptions. When set, passes it through to AztecNodeService.createAndSync() and skips block progression logic
  • end-to-end (P2P base class): Initial node starts with no sequencer/validator/P2P. Config cleaned up after setup so validator nodes don't inherit initial-node-only settings. Added setupWalletOnNode() method
  • end-to-end (epochs base class): Added deployTestAccounts() helper for deferred account deployment. Cleans dontStartSequencer from config so validator nodes don't inherit it
  • end-to-end (P2P tests): 9 test files updated to call setupWalletOnNode(nodes[0]) before setupAccount(). Removed now-unnecessary sequencer stop in reex.test.ts
  • end-to-end (epochs tests): 7 test files updated with dontStartSequencer: true, deferred account deployment via deployTestAccounts(), and stop-then-restart pattern for sequencers. epochs_ha_sync kept original approach (HA pairs with skipPublishingCheckpointsPercent need the initial sequencer for reliable account deployment)

Tests that create their own validator nodes no longer need the initial
sequencer from setup(). For P2P tests, the initial node is now a
lightweight archiver with no sequencer/validator/P2P. For epochs tests,
account deployment is deferred until validator nodes are running.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@spalladino spalladino added ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure ci-draft Run CI on draft PRs. labels Apr 14, 2026
spalladino and others added 5 commits April 14, 2026 20:42
Replace dontStartSequencer with skipInitialSequencer as a clean
setup-only option. Use SchnorrHardcodedKeyAccountContract for tests
that need accounts without on-chain deployment, avoiding the need
to start/stop sequencers during setup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- EpochsTestContext.setup auto-creates/registers hardcoded account when
  skipInitialSequencer is set (no manual handling in each test)
- Move schnorr_hardcoded_account_contract.ts from e2e_epochs/ to fixtures/
- Delete unused deployTestAccounts/registerTestAccounts methods
- Remove unnecessary setupWalletOnNode calls in P2P tests that don't
  need the wallet on a P2P node
- Remove redundant disableValidator: false from createValidatorConfig
- Move cross-chain contract deploy to test body in epochs_mbps.parallel

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- epochs_invalidate_block: query validator node for slash offenses (initial node has no slasher)
- add_rollup: fund regular Schnorr accounts alongside hardcoded account in P2P setup
- data_withholding_slash: send L2 txs through validator node (setupAccount no longer deploys)
- preferred_gossip_network: exclude P2P-disabled initial node from peer expectations

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…failures

gossip_network_no_cheat: With skipInitialSequencer, the first blocks
built by validators can fail to checkpoint (P2P not yet connected),
causing block pruning that invalidates tx references. Fix by allowing
empty blocks (minTxsPerBlock: 0) and waiting for the first checkpoint
to be published before submitting transactions.

epochs_mbps_redistribution: With skipInitialSequencer, the first block
was empty because sequencers built it before any txs arrived in the
mempool, wasting a sub-slot and pushing late txs into the next
checkpoint where redistribution doesn't carry over. Fix by sending
the first early tx to the mempool before starting sequencers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@spalladino spalladino marked this pull request as ready for review April 15, 2026 16:48
@spalladino spalladino removed the ci-draft Run CI on draft PRs. label Apr 15, 2026

@Maddiaa0 Maddiaa0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lovely

@spalladino spalladino merged commit 9a1ba0c into merge-train/spartan Apr 21, 2026
19 checks passed
@spalladino spalladino deleted the palla/skip-initial-sequencer-in-e2e branch April 21, 2026 12:05
chrismarino pushed a commit to chrismarino/aztec-packages that referenced this pull request May 5, 2026
BEGIN_COMMIT_OVERRIDE
fix(kv-store): ensure LMDB cursor is closed on iteration abort (AztecProtocol#22509)
fix(telemetry-client): use appropriate histogram buckets for L1 gas
prices (AztecProtocol#22512)
fix(telemetry-client): log warning when BatchSpanProcessor drops spans
(AztecProtocol#22511)
fix(stdlib): wrap HA signer databaseUrl in SecretValue (AztecProtocol#22510)
fix(prover-client): don't mark in-progress epoch N jobs as stale when
epoch N+1 starts (AztecProtocol#22508)
chore: (A-730) graceful shutdown for services in node startup failure
path (AztecProtocol#22112)
fix(prover-client): reject stale job promises and count timeouts toward
retry limit (AztecProtocol#21842)
feat(archiver): validate historical L1 log availability at startup
(AztecProtocol#22644)
fix(archiver): do not query MessageSent events by blockhash (AztecProtocol#22641)
refactor(e2e): skip initial sequencer in p2p and epochs tests (AztecProtocol#22535)
fix: handle missing L1 finalized block on devnets (AztecProtocol#22663)
fix(world-state): treat historical block 0 queries as historical, not
latest (AztecProtocol#22679)
fix(sequencer): re-check parent checkpoint validity before pipelined L1
submission (AztecProtocol#22586)
fix(world-state): make block 0 a first-class historical block (AztecProtocol#22711)
chore: show all running versions (AztecProtocol#22376)
chore: fix prettier inside worktrees (AztecProtocol#22557)
feat: use optimized verifier for rollup (AztecProtocol#21840)
fix(kv-store): skip pool creation on ephemeral deleteDb to unstick
browser tests (AztecProtocol#22693)
chore: rm claude lockfile (AztecProtocol#22718)
fix(e2e): wait for first checkpoint in fee_asset_price_oracle_gossip
test (AztecProtocol#22719)
chore(prover-node): track estimated L1 fee when proof publishing is
disabled (AztecProtocol#22691)
fix(ci): rerun squashed PR check on base branch change (AztecProtocol#22713)
feat(archiver): decouple calldata from blob fetching in L1 synchronizer
(AztecProtocol#22716)
refactor(e2e): enable pipelining in e2e_epochs tests (AztecProtocol#22544)
feat(p2p): reject and evict txs with insufficient max fee per gas
(AztecProtocol#22118)
refactor(world-state): always index block 0 regardless of initial tree
size (AztecProtocol#22724)
fix(e2e): fix redistribution test (AztecProtocol#22729)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants