Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type { TestWallet } from '../../test-wallet/test_wallet.js';
import {
MOCK_GOSSIP_MULTI_VALIDATOR_OPTS,
MultiNodeTestContext,
NO_REORG_SUBMISSION_EPOCHS,
buildMockGossipValidators,
} from '../multi_node_test_context.js';

Expand All @@ -26,7 +27,7 @@ const COMMITTEE_SIZE = VALIDATOR_COUNT - 2;
// Tests that a single AztecNodeService hosting multiple validator keys correctly signs attestations
// and filters signing to only active committee members. One node, 5 validators staked, committee
// size 3. Uses MultiNodeTestContext on the mock-gossip bus: all 5 validators on a single physical
// node, ethSlot=8s, aztecSlot=36s, epoch=2, proofSubEpochs=1024. Each it is an isolated CI job
// node, ethSlot=8s, aztecSlot=36s, epoch=2, proofSubEpochs=NO_REORG_SUBMISSION_EPOCHS. Each it is an isolated CI job
// (parallel convention).
describe('multi-node/block-production/multi_validator_node', () => {
jest.setTimeout(15 * 60 * 1000);
Expand All @@ -51,7 +52,7 @@ describe('multi-node/block-production/multi_validator_node', () => {
aztecEpochDuration: 2,
ethereumSlotDuration: 8,
aztecSlotDuration: 36,
aztecProofSubmissionEpochs: 1024,
aztecProofSubmissionEpochs: NO_REORG_SUBMISSION_EPOCHS,
anvilSlotsInAnEpoch: 4,
blockDurationMs: 6000,
minTxsPerBlock: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ import { privateKeyToAccount } from 'viem/accounts';

import { testSpan } from '../fixtures/timing.js';
import { getPrivateKeyFromIndex } from '../fixtures/utils.js';
import { NO_REORG_SUBMISSION_EPOCHS } from '../single-node/setup.js';
import {
SingleNodeTestContext,
type SingleNodeTestOpts,
type TrackedSequencerEvent,
} from '../single-node/single_node_test_context.js';

export { NO_REORG_SUBMISSION_EPOCHS, PROVING_SLOT_TIMING } from '../single-node/setup.js';
export {
WORLD_STATE_CHECKPOINT_HISTORY,
WORLD_STATE_BLOCK_CHECK_INTERVAL,
Expand Down Expand Up @@ -73,7 +75,7 @@ export const MOCK_GOSSIP_MULTI_VALIDATOR_OPTS = {
mockGossipSubNetwork: true,
skipInitialSequencer: true,
startProverNode: false,
aztecProofSubmissionEpochs: 1024,
aztecProofSubmissionEpochs: NO_REORG_SUBMISSION_EPOCHS,
numberOfAccounts: 0,
} as const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import { type Hex, decodeFunctionData, encodeFunctionData, multicall3Abi } from

import { getPrivateKeyFromIndex } from '../../fixtures/utils.js';
import { waitForBlockNumber } from '../../fixtures/wait_helpers.js';
import { setupBlockProducer } from '../setup.js';
import { NO_REORG_SUBMISSION_EPOCHS, setupBlockProducer } from '../setup.js';
import type { SingleNodeTestContext } from '../single_node_test_context.js';

// Tests that the sequencer can successfully process blocks when L1 block proposals are forwarded
// via a proxy contract (Forwarder). Also tests that a corrupted first propose call (failing with
// allowFailure:true) followed by a valid second call still produces blocks.
// Uses setupBlockProducer (no prover node) with numberOfAccounts:2, ethereumSlotDuration:4,
// aztecSlotDuration:12, aztecEpochDuration:32, aztecProofSubmissionEpochs:640, minTxsPerBlock:0 —
// aztecSlotDuration:12, aztecEpochDuration:32, aztecProofSubmissionEpochs:NO_REORG_SUBMISSION_EPOCHS, minTxsPerBlock:0 —
// production sequencer, anvil interval mining. The L1 interaction is Forwarder/Multicall3/Rollup
// contract interception for block-proposal routing, not cross-chain bridging.
describe('single-node/block-building/debug_trace', () => {
Expand Down Expand Up @@ -58,7 +58,7 @@ describe('single-node/block-building/debug_trace', () => {
// boundary at slot 6; the proposer-corruption test intercepts every propose and runs long
// enough to reach it, where the proposer selection changes and the propose silently reverts.
aztecEpochDuration: 32,
aztecProofSubmissionEpochs: 640,
aztecProofSubmissionEpochs: NO_REORG_SUBMISSION_EPOCHS,
inboxLag: 2,
});
({ aztecNode, logger, aztecNodeAdmin, config } = test.context);
Expand Down
7 changes: 4 additions & 3 deletions yarn-project/end-to-end/src/single-node/bot/bot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ import { jest } from '@jest/globals';

import { PIPELINED_FEE_PADDING, PIPELINING_SETUP_OPTS } from '../../fixtures/fixtures.js';
import { getPrivateKeyFromIndex, setup } from '../../fixtures/utils.js';
import { NO_REORG_SUBMISSION_EPOCHS } from '../setup.js';

// Tests the transaction bot implementations (transfer bot, AMM bot, cross-chain bot).
// Uses setup(0, PIPELINING_SETUP_OPTS + aztecProofSubmissionEpochs:640) with one node, production
// sequencer (ethereumSlotDuration=4s, aztecSlotDuration=12s, proofSubEpochs=640, minTxsPerBlock=0;
// Uses setup(0, PIPELINING_SETUP_OPTS + aztecProofSubmissionEpochs:NO_REORG_SUBMISSION_EPOCHS) with one node, production
// sequencer (ethereumSlotDuration=4s, aztecSlotDuration=12s, proofSubEpochs=NO_REORG_SUBMISSION_EPOCHS, minTxsPerBlock=0;
// aztecEpochDuration is the setup() default). The bridge-resume, setup-via-bridging, and
// cross-chain-bot subsuites actively drive L1 cross-chain bridging: fee-juice portal deposits,
// advanceInboxInProgress, and L2→L1 messages via CrossChainBot.
Expand All @@ -43,7 +44,7 @@ describe('single-node/bot/bot', () => {
const [botAccount] = await getInitialTestAccountsData();
const setupResult = await setup(0, {
...PIPELINING_SETUP_OPTS,
aztecProofSubmissionEpochs: 640,
aztecProofSubmissionEpochs: NO_REORG_SUBMISSION_EPOCHS,
additionallyFundedAccounts: [botAccount],
});
({
Expand Down
9 changes: 7 additions & 2 deletions yarn-project/end-to-end/src/single-node/fees/failures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ import { jest } from '@jest/globals';
import { PIPELINING_SETUP_OPTS, U128_UNDERFLOW_ERROR } from '../../fixtures/fixtures.js';
import { ensureAuthRegistryPublished } from '../../fixtures/setup.js';
import { expectMapping } from '../../fixtures/utils.js';
import { NO_REORG_SUBMISSION_EPOCHS } from '../setup.js';
import { FeesTest } from './fees_test.js';

// Fee behaviour when transactions revert. Uses FeesTest (prod sequencer, pipelining preset:
// ethSlot=4s, aztecSlot=12s, inboxLag=2, minTxsPerBlock=0, aztecEpochDuration=4,
// aztecProofSubmissionEpochs=640), fake in-proc prover node, and GasBridgingTestHarness for
// aztecProofSubmissionEpochs=NO_REORG_SUBMISSION_EPOCHS), fake in-proc prover node, and GasBridgingTestHarness for
// L1↔L2 fee-juice bridging. Auto-proving is disabled after setup so tests control proving themselves.
describe('single-node/fees/failures', () => {
// FeesTest.setup + applyFPCSetup chains many dependent txs which run at the
Expand All @@ -45,7 +46,11 @@ describe('single-node/fees/failures', () => {
// Shorter epochs (default 32 → 4) speed the per-test `advanceToNextEpoch + waitForProven`
// cycle: the prover-node submits a proof as soon as the epoch is complete, so ~8x shorter
// epochs ≈ ~8x faster proof cadence per cycle. Setup itself stays slot-bound.
await t.setup({ ...PIPELINING_SETUP_OPTS, aztecProofSubmissionEpochs: 640, aztecEpochDuration: 4 });
await t.setup({
...PIPELINING_SETUP_OPTS,
aztecProofSubmissionEpochs: NO_REORG_SUBMISSION_EPOCHS,
aztecEpochDuration: 4,
});
await t.applyFPCSetup();
({ wallet, aliceAddress, sequencerAddress, bananaCoin, bananaFPC, gasSettings } = t);
await ensureAuthRegistryPublished(wallet, aliceAddress);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { DEFAULT_MIN_FEE_PADDING } from '../../fixtures/fixtures.js';
import { waitForBlockNumber, waitForNodeCheckpoint } from '../../fixtures/wait_helpers.js';
import type { TestWallet } from '../../test-wallet/test_wallet.js';
import { proveInteraction } from '../../test-wallet/utils.js';
import { NO_REORG_SUBMISSION_EPOCHS } from '../setup.js';
import { FeesTest } from './fees_test.js';

/**
Expand Down Expand Up @@ -55,7 +56,7 @@ async function spikeL1BaseFeeUntilMinFee(

// Fee oracle and wallet fee-padding behaviour under L1 base-fee spikes and governance fee-config bumps.
// Uses FeesTest with a custom timing preset (ethSlot=4s, aztecSlot=12s, inboxLag=2, minTxsPerBlock=0,
// aztecProofSubmissionEpochs=640, manaTarget=4M, walletMinFeePadding=30) and fake in-proc prover node.
// aztecProofSubmissionEpochs=NO_REORG_SUBMISSION_EPOCHS, manaTarget=4M, walletMinFeePadding=30) and fake in-proc prover node.
// No token bridging involved — all L1 interaction is L1 base-fee cheat codes and Rollup oracle calls.
// (Category: single-node despite using FeesTest, since no cross-chain token transfer or fee-juice
// portal bridging occurs in any test body — L1 is active only for oracle updates.)
Expand All @@ -79,7 +80,7 @@ describe('single-node/fees/fee_settings', () => {
minTxsPerBlock: 0,
aztecSlotDuration: AZTEC_SLOT_DURATION,
ethereumSlotDuration: 4,
aztecProofSubmissionEpochs: 640,
aztecProofSubmissionEpochs: NO_REORG_SUBMISSION_EPOCHS,
walletMinFeePadding: 30,
manaTarget: 4_000_000n,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
import { jest } from '@jest/globals';

import { proveAndSendTxs } from '../../test-wallet/utils.js';
import { setupWithProver } from '../setup.js';
import { NO_REORG_SUBMISSION_EPOCHS, setupWithProver } from '../setup.js';
import { SingleNodeTestContext } from '../single_node_test_context.js';

jest.setTimeout(1000 * 60 * 10);
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('single-node/misc/missed_l1_slot', () => {
ethereumSlotDuration: 6,
aztecSlotDurationInL1Slots: L1_SLOTS_PER_L2_SLOT,
startProverNode: false,
aztecProofSubmissionEpochs: 1024,
aztecProofSubmissionEpochs: NO_REORG_SUBMISSION_EPOCHS,
// Required for the proposer's own broadcasts to route through the local
// proposal handler (the dummy p2p service drops them). Without this, the
// archiver's #proposedCheckpoints map stays empty and the pipelining
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ import { type TxReceipt, TxStatus } from '@aztec/stdlib/tx';
import { type Hex, decodeEventLog } from 'viem';

import { waitForL2ToL1Witness } from '../../fixtures/wait_helpers.js';
import { SingleNodeTestContext, jest, setupWithProver } from './setup.js';
import { NO_REORG_SUBMISSION_EPOCHS, SingleNodeTestContext, jest, setupWithProver } from './setup.js';

// Suite: verifies the AZIP-14 partial-proof multi-root Outbox design. Drives an EpochTestSettler
// manually to stage progressively deeper partial-proof roots (K=1, 2, 3) for the same epoch, then
// asserts: (a) the node picks the smallest covering root, (b) any covering root produces a valid
// consume tx, (c) the shared bitmap blocks double-spend, and (d) K=4 can be staged later.
// SingleNodeTestContext: single node, no prover, prod-seq, interval mining. Timing: ethSlot=default
// (8s/12s CI), aztecSlot=default, epoch=1000, proofSubmissionEpochs=1024 (v5: the disableAnvilTestWatcher
// override was removed and a perBlockAllocationMultiplier=1.3 was added so the first block of the
// (8s/12s CI), aztecSlot=default, epoch=32, proofSubmissionEpochs=NO_REORG_SUBMISSION_EPOCHS (v5: the
// disableAnvilTestWatcher override was removed and a perBlockAllocationMultiplier=1.3 was added so the first block of the
// now-up-to-5-block checkpoint has enough DA budget for the TestContract deploy tx). The test actively
// calls the Outbox L1 contract to consume L2-to-L1 messages → cross-chain.
describe('single-node/partial-proofs/multi_root', () => {
Expand All @@ -56,12 +56,11 @@ describe('single-node/partial-proofs/multi_root', () => {
// fallback DA gas for the TestContract deploy is based on a 4-block checkpoint, so give the
// first block enough of the checkpoint DA budget to include the deploy tx.
perBlockAllocationMultiplier: 1.3,
// Long epoch so 4 well-spaced checkpoints comfortably fit before the boundary.
aztecEpochDuration: 1000,
// Epoch long enough that the 4 well-spaced checkpoints fit before the boundary.
aztecEpochDuration: 32,
// Don't let the real prover land a partial proof under us. We drive Outbox state via the
// settler. `aztecProofSubmissionEpochs` >> test duration makes it impossible to enter the
// submission window.
aztecProofSubmissionEpochs: 1024,
// settler; a never-reorg window makes it impossible to enter the submission window.
aztecProofSubmissionEpochs: NO_REORG_SUBMISSION_EPOCHS,
startProverNode: false,
});
({ logger } = test);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { jest } from '@jest/globals';

import { setupWithProver } from '../setup.js';
import { NO_REORG_SUBMISSION_EPOCHS, PROVING_SLOT_TIMING, setupWithProver } from '../setup.js';
import { SingleNodeTestContext } from '../single_node_test_context.js';

jest.setTimeout(1000 * 60 * 10);

export { jest, setupWithProver, SingleNodeTestContext };
export { jest, setupWithProver, SingleNodeTestContext, NO_REORG_SUBMISSION_EPOCHS, PROVING_SLOT_TIMING };
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Logger } from '@aztec/aztec.js/log';
import type { ChainMonitor } from '@aztec/ethereum/test';
import { CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';

import { SingleNodeTestContext, jest, setupWithProver } from './setup.js';
import { PROVING_SLOT_TIMING, SingleNodeTestContext, jest, setupWithProver } from './setup.js';

// Co-located with the multi-root suite: both manually drive partial-epoch proving on a single node
// with a very long epoch. This one is the only coverage of the prover-node `startProof` path (the
Expand All @@ -15,10 +15,9 @@ describe('single-node/partial-proofs/single_root', () => {
let test: SingleNodeTestContext;

beforeEach(async () => {
// Run at the 4s/12s slot-cadence floor: the body waits in real wall-clock for the sequencer to publish
// empty checkpoints one per L2 slot, so a shorter slot shortens that wait. 12s is the floor for the
// 3s-block timing model. A clock warp here races the sequencer's building and trips EmptyEpochError.
test = await setupWithProver({ aztecEpochDuration: 1000, ethereumSlotDuration: 4, aztecSlotDurationInL1Slots: 3 });
// A clock warp here races the sequencer's building and trips EmptyEpochError, so this runs at the
// real-time PROVING_SLOT_TIMING floor. Long epoch so the partial-proof checkpoints fit before the boundary.
test = await setupWithProver({ ...PROVING_SLOT_TIMING, aztecEpochDuration: 1000 });
({ monitor, logger } = test);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import type { Logger } from '@aztec/aztec.js/log';
import { ChainMonitor } from '@aztec/ethereum/test';
import { sleep } from '@aztec/foundation/sleep';

import { SingleNodeTestContext, jest, setupWithProver } from './setup.js';
import {
NO_REORG_SUBMISSION_EPOCHS,
PROVING_SLOT_TIMING,
SingleNodeTestContext,
jest,
setupWithProver,
} from './setup.js';

const MAX_JOB_COUNT = 20;

Expand All @@ -25,28 +31,22 @@ describe('single-node/proving/long_proving_time', () => {
// So we delay proving of each circuit such that each epoch takes 3 epochs to prove.
const aztecEpochDuration = 2;
// The body is bounded by the real-wall-clock prover delay (a `sleep`, not the date provider, so warping
// cannot shrink it): a single agent serially sleeps `proverTestDelayMs` per circuit. Both the
// block-build cadence and the proving delay scale with the slot duration, so a shorter L1 slot scales
// the whole timeline down while keeping the delay-to-slot ratio — and hence the "proving lags block
// production by ~3 epochs" assertion — intact. The L2 slot stays at 3 L1 slots (12s): the timing model
// needs S >= ~8.5s with the default 3s block duration to fit one block per checkpoint, so 12s is the
// floor — an 8s slot derives 0 blocks per checkpoint and trips the timing-config guard.
const ethereumSlotDuration = 4;
const aztecSlotDurationInL1Slots = 3;
// cannot shrink it): a single agent serially sleeps `proverTestDelayMs` per circuit. Both the block-build
// cadence and the proving delay scale with the slot duration, so the PROVING_SLOT_TIMING floor scales the
// whole timeline down while keeping the delay-to-slot ratio — and hence the "proving lags block production
// by ~3 epochs" assertion — intact.
const { aztecSlotDuration } = SingleNodeTestContext.getSlotDurations({
aztecEpochDuration,
ethereumSlotDuration,
aztecSlotDurationInL1Slots,
...PROVING_SLOT_TIMING,
});
const epochDurationInSeconds = aztecSlotDuration * aztecEpochDuration;
const proverTestDelayMs = (epochDurationInSeconds * 1000 * 3) / 4;
// Each epoch takes ~3 epochs to prove, so the broker needs to keep results for
// at least that many epochs to avoid rejecting jobs as stale.
test = await setupWithProver({
aztecEpochDuration,
ethereumSlotDuration,
aztecSlotDurationInL1Slots,
aztecProofSubmissionEpochs: 1000, // Effectively don't re-org
...PROVING_SLOT_TIMING,
aztecProofSubmissionEpochs: NO_REORG_SUBMISSION_EPOCHS, // Effectively don't re-org
proverTestDelayMs,
proverNodeMaxPendingJobs: MAX_JOB_COUNT, // Prove multiple epochs concurrently
proverBrokerMaxEpochsToKeepResultsFor: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getEpochAtSlot } from '@aztec/stdlib/epoch-helpers';
import { jest } from '@jest/globals';

import type { EndToEndContext } from '../../fixtures/utils.js';
import { setupWithProver } from '../setup.js';
import { PROVING_SLOT_TIMING, setupWithProver } from '../setup.js';
import { SingleNodeTestContext } from '../single_node_test_context.js';

jest.setTimeout(1000 * 60 * 10);
Expand All @@ -27,17 +27,12 @@ describe('single-node/proving/multi_proof', () => {
// Don't start prover node during setup - we'll create and manage all prover nodes in the test
// This ensures we can apply delay patches before any prover starts proving.
//
// Run at the 4s/12s slot-cadence floor: the body is bounded by the production sequencer building epoch
// 0 on the real wall-clock (one empty block per L2 slot) plus the per-prover stagger
// (`index * ethereumSlotDuration` ms). Both scale with the slot duration, so a shorter slot shortens the
// timeline while keeping the stagger >=1 L1 slot apart (so the three provers still land their proofs on
// distinct L1 blocks). 12s is the floor: the timing model needs an L2 slot >= ~8.5s with the default 3s
// block to fit one block per checkpoint, so an 8s slot derives 0 blocks per checkpoint. The 6-slot epoch
// is kept so epoch 0 still reliably lands >=1 block.
// The per-prover stagger (`index * ethereumSlotDuration` ms) scales with the slot duration, so the
// PROVING_SLOT_TIMING floor keeps the timeline short while holding the stagger >=1 L1 slot apart (the
// three provers still land their proofs on distinct L1 blocks).
test = await setupWithProver({
startProverNode: false,
ethereumSlotDuration: 4,
aztecSlotDurationInL1Slots: 3,
...PROVING_SLOT_TIMING,
});
({ context, logger } = test);
});
Expand Down
Loading
Loading