Skip to content
Open
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
1 change: 1 addition & 0 deletions yarn-project/archiver/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export * from './archiver.js';
export * from './modules/data_source_base.js';
export * from './modules/data_store_updater.js';
export * from './config.js';
export * from './errors.js';

export { type L1PublishedData } from './structs/published.js';
export {
Expand Down
22 changes: 18 additions & 4 deletions yarn-project/aztec-node/src/aztec-node/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Archiver, createArchiver } from '@aztec/archiver';
import { Archiver, L1ToL2MessagesNotReadyError, createArchiver } from '@aztec/archiver';
import { BBCircuitVerifier, BatchChonkVerifier, QueuedIVCVerifier } from '@aztec/bb-prover';
import { TestCircuitVerifier } from '@aztec/bb-prover/test';
import { type BlobClientInterface, createBlobClientWithFileStores } from '@aztec/blob-client/client';
Expand All @@ -20,6 +20,7 @@ import { retryUntil } from '@aztec/foundation/retry';
import { count } from '@aztec/foundation/string';
import { DateProvider, Timer } from '@aztec/foundation/timer';
import { MembershipWitness, SiblingPath } from '@aztec/foundation/trees';
import { isErrorClass } from '@aztec/foundation/types';
import { type KeyStore, KeystoreManager, loadKeystores, mergeKeystores } from '@aztec/node-keystore';
import { trySnapshotSync, uploadSnapshot } from '@aztec/node-lib/actions';
import { createForwarderL1TxUtilsFromSigners, createL1TxUtilsFromSigners } from '@aztec/node-lib/factories';
Expand Down Expand Up @@ -1516,11 +1517,24 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, AztecNodeDeb
// the world state tree so simulation can take them into account. We detect if the next block would
// start a new checkpoint by checking if the proposed checkpoint's block number matches the latest block number,
// which means the next block would be the first block of the next checkpoint.
const targetCheckpoint = CheckpointNumber(
(l2Tips.proposedCheckpoint.checkpoint.number ?? CheckpointNumber.ZERO) + 1,
);
const nextCheckpointMessages: Fr[] | undefined =
l2Tips.proposedCheckpoint.block.number === l2Tips.proposed.number
? await this.l1ToL2MessageSource.getL1ToL2Messages(
CheckpointNumber((l2Tips.proposedCheckpoint.checkpoint.number ?? CheckpointNumber.ZERO) + 1),
)
? await this.l1ToL2MessageSource.getL1ToL2Messages(targetCheckpoint).catch(err => {
if (isErrorClass(err, L1ToL2MessagesNotReadyError)) {
this.log.warn(
`L1-to-L2 messages for checkpoint ${targetCheckpoint} are not ready yet (simulating without them)`,
);
} else {
this.log.error(
`Failed to get L1-to-L2 messages for checkpoint ${targetCheckpoint} (simulating without them)`,
err,
);
}
return undefined;
})
: undefined;

// Request a new fork of the world state at the latest block number, and apply any overrides and next checkpoint messages to it before simulation
Expand Down
8 changes: 2 additions & 6 deletions yarn-project/end-to-end/src/e2e_avm_simulator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { AvmTestContract } from '@aztec/noir-test-contracts.js/AvmTest';

import { jest } from '@jest/globals';

import { PIPELINING_SETUP_OPTS } from './fixtures/fixtures.js';
import { ensureAccountContractsPublished, setup } from './fixtures/utils.js';

const TIMEOUT = 600_000;
Expand All @@ -22,17 +23,12 @@ describe('e2e_avm_simulator', () => {
let teardown: () => Promise<void>;

beforeAll(async () => {
// TODO(kill-non-pipelined): runs under legacy until §6 B7 (simulator + inboxLag mismatch in
// AztecNodeService.simulatePublicCalls) is fixed. Test uses `.simulate(...)` heavily and
// observed Rollup__InvalidArchive cascade ~12min into the run, consistent with archiver/L1
// drift triggered by pipelined simulate path. Same un-opt-in pattern as e2e_bot
// (commit e32ea4fb60) and e2e_fees/failures (commit eb542676f8).
({
teardown,
wallet,
aztecNode,
accounts: [defaultAccountAddress],
} = await setup(1));
} = await setup(1, { ...PIPELINING_SETUP_OPTS, aztecProofSubmissionEpochs: 640 }));
await ensureAccountContractsPublished(wallet, [defaultAccountAddress]);
});

Expand Down
16 changes: 7 additions & 9 deletions yarn-project/end-to-end/src/e2e_bot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { EmbeddedWallet } from '@aztec/wallets/embedded';

import { jest } from '@jest/globals';

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

describe('e2e_bot', () => {
Expand All @@ -36,15 +37,11 @@ describe('e2e_bot', () => {

beforeAll(async () => {
const [botAccount] = await getInitialTestAccountsData();
// TODO(palla/pipelining): re-opt-in once public-call simulation handles `inboxLag`. Under
// pipelining with `inboxLag=2`, `AztecNodeService.simulatePublicCalls` queries
// `getL1ToL2Messages(proposedCheckpoint+1)` at checkpoint boundaries and throws
// `L1ToL2MessagesNotReadyError` because that checkpoint isn't yet sealed on L1 (see
// server.ts:1508 + message_store.ts:233). This breaks the bridge/amm/cross-chain bot flows.
// The `transaction-bot` cluster additionally needs the bot's `minFeePadding` bumped to
// `PIPELINED_FEE_PADDING` (the bot overrides the wallet padding via
// `wallet.setMinFeePadding(config.minFeePadding)` in `bot/src/factory.ts:60`).
const setupResult = await setup(0, { initialFundedAccounts: [botAccount] });
const setupResult = await setup(0, {
...PIPELINING_SETUP_OPTS,
aztecProofSubmissionEpochs: 640,
initialFundedAccounts: [botAccount],
});
({
teardown,
aztecNode,
Expand All @@ -70,6 +67,7 @@ describe('e2e_bot', () => {
...getBotDefaultConfig(),
followChain: 'CHECKPOINTED',
botMode: 'transfer',
minFeePadding: PIPELINED_FEE_PADDING,
};
bot = await Bot.create(config, wallet, aztecNode, undefined, new BotStore(await openTmpStore('bot')));
});
Expand Down
12 changes: 5 additions & 7 deletions yarn-project/end-to-end/src/e2e_fees/failures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ExecutionPayload } from '@aztec/stdlib/tx';

import { jest } from '@jest/globals';

import { U128_UNDERFLOW_ERROR } from '../fixtures/fixtures.js';
import { PIPELINING_SETUP_OPTS, U128_UNDERFLOW_ERROR } from '../fixtures/fixtures.js';
import { expectMapping } from '../fixtures/utils.js';
import { FeesTest } from './fees_test.js';

Expand All @@ -37,12 +37,10 @@ describe('e2e_fees failures', () => {
const t = new FeesTest('failures', 3, { coinbase });

beforeAll(async () => {
// TODO(kill-non-pipelined): runs under legacy until §6 B7 (simulator + inboxLag mismatch in
// AztecNodeService.simulatePublicCalls) is fixed. Under pipelining with `inboxLag=2`,
// `simulatePublicCalls` queries `getL1ToL2Messages(proposedCheckpoint+1)` at checkpoint
// boundaries and throws `L1ToL2MessagesNotReadyError`. Same root cause as e2e_bot
// (un-opt-in commit e32ea4fb60); 4/5 tests in this suite hit it via `.simulate(...)`.
await t.setup();
// 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.applyFPCSetup();
({ wallet, aliceAddress, sequencerAddress, bananaCoin, bananaFPC, gasSettings } = t);
aztecNode = t.aztecNode;
Expand Down
12 changes: 5 additions & 7 deletions yarn-project/end-to-end/src/e2e_fees/private_payments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { TX_ERROR_INSUFFICIENT_FEE_PAYER_BALANCE } from '@aztec/stdlib/tx';

import { jest } from '@jest/globals';

import { PIPELINING_SETUP_OPTS } from '../fixtures/fixtures.js';
import { expectMapping } from '../fixtures/utils.js';
import type { TestWallet } from '../test-wallet/test_wallet.js';
import { proveInteraction } from '../test-wallet/utils.js';
Expand All @@ -31,13 +32,10 @@ describe('e2e_fees private_payment', () => {
const t = new FeesTest('private_payment');

beforeAll(async () => {
// TODO(kill-non-pipelined): runs under legacy until §6 B7 (simulator + inboxLag mismatch in
// AztecNodeService.simulatePublicCalls) is fixed. Under pipelining with `inboxLag=2`,
// `simulatePublicCalls` queries `getL1ToL2Messages(proposedCheckpoint+1)` at checkpoint
// boundaries and throws `L1ToL2MessagesNotReadyError`. Same root cause as e2e_bot
// (un-opt-in commit e32ea4fb60) and e2e_fees/failures (eb542676f8); all 6 tests in this
// suite hit it via `getBananaPublicBalanceFn` -> `.simulate(...)`.
await t.setup();
// 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.applyFPCSetup();
await t.applyFundAliceWithBananas();
({ wallet, aliceAddress, bobAddress, sequencerAddress, bananaCoin, bananaFPC, gasSettings, aztecNode } = t);
Expand Down
Loading