@aztec/end-to-end 1.0.0-nightly.20250708 → 1.0.0-staging.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dest/bench/client_flows/client_flows_benchmark.d.ts +1 -1
  2. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  3. package/dest/bench/client_flows/client_flows_benchmark.js +2 -2
  4. package/dest/bench/utils.js +1 -1
  5. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +1 -1
  6. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  7. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +1 -1
  8. package/dest/e2e_epochs/epochs_test.d.ts +2 -15
  9. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  10. package/dest/e2e_epochs/epochs_test.js +3 -59
  11. package/dest/e2e_fees/fees_test.d.ts +1 -1
  12. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  13. package/dest/e2e_fees/fees_test.js +2 -2
  14. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  15. package/dest/e2e_p2p/p2p_network.js +1 -2
  16. package/dest/e2e_p2p/shared.d.ts +1 -1
  17. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  18. package/dest/fixtures/e2e_prover_test.d.ts +1 -1
  19. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  20. package/dest/fixtures/e2e_prover_test.js +1 -2
  21. package/dest/fixtures/setup_p2p_test.d.ts +0 -2
  22. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  23. package/dest/fixtures/setup_p2p_test.js +1 -27
  24. package/dest/fixtures/snapshot_manager.d.ts +1 -1
  25. package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
  26. package/dest/fixtures/snapshot_manager.js +4 -7
  27. package/dest/fixtures/utils.d.ts +4 -16
  28. package/dest/fixtures/utils.d.ts.map +1 -1
  29. package/dest/fixtures/utils.js +31 -51
  30. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  31. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  32. package/dest/simulators/lending_simulator.d.ts +1 -1
  33. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  34. package/dest/spartan/setup_test_wallets.d.ts +0 -5
  35. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  36. package/dest/spartan/setup_test_wallets.js +6 -70
  37. package/dest/spartan/utils.d.ts +2 -21
  38. package/dest/spartan/utils.d.ts.map +1 -1
  39. package/dest/spartan/utils.js +4 -6
  40. package/package.json +35 -35
  41. package/src/bench/client_flows/client_flows_benchmark.ts +2 -2
  42. package/src/bench/utils.ts +1 -1
  43. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +1 -1
  44. package/src/e2e_epochs/epochs_test.ts +22 -90
  45. package/src/e2e_fees/fees_test.ts +2 -2
  46. package/src/e2e_p2p/p2p_network.ts +1 -2
  47. package/src/e2e_p2p/shared.ts +1 -1
  48. package/src/fixtures/e2e_prover_test.ts +2 -3
  49. package/src/fixtures/setup_p2p_test.ts +1 -39
  50. package/src/fixtures/snapshot_manager.ts +4 -4
  51. package/src/fixtures/utils.ts +31 -63
  52. package/src/shared/uniswap_l1_l2.ts +1 -1
  53. package/src/simulators/lending_simulator.ts +1 -1
  54. package/src/spartan/setup_test_wallets.ts +4 -81
  55. package/src/spartan/utils.ts +3 -7
@@ -15,7 +15,7 @@ import {
15
15
  type Wallet,
16
16
  createLogger,
17
17
  } from '@aztec/aztec.js';
18
- import { CheatCodes } from '@aztec/aztec/testing';
18
+ import { CheatCodes } from '@aztec/aztec.js/testing';
19
19
  import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
20
20
  import { type DeployL1ContractsArgs, RollupContract, createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
21
21
  import { ChainMonitor } from '@aztec/ethereum/test';
@@ -145,7 +145,7 @@ export class ClientFlowsBenchmark {
145
145
  await context.aztecNode.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
146
146
 
147
147
  const rollupContract = RollupContract.getFromConfig(context.aztecNodeConfig);
148
- this.chainMonitor = new ChainMonitor(rollupContract, context.dateProvider, this.logger, 200).start();
148
+ this.chainMonitor = new ChainMonitor(rollupContract, this.logger, 200).start();
149
149
 
150
150
  return this;
151
151
  }
@@ -160,7 +160,7 @@ export async function createNewPXE(node: AztecNode, contract: BenchmarkingContra
160
160
  const l1Contracts = await node.getL1ContractAddresses();
161
161
  const { l1ChainId, rollupVersion } = await node.getNodeInfo();
162
162
  const pxeConfig = {
163
- l2BlockBatchSize: 50,
163
+ l2BlockBatchSize: 200,
164
164
  l2BlockPollingIntervalMS: 100,
165
165
  dataDirectory: undefined,
166
166
  dataStoreMapSizeKB: 1024 * 1024,
@@ -10,7 +10,7 @@ import {
10
10
  type PXE,
11
11
  createLogger,
12
12
  } from '@aztec/aztec.js';
13
- import { CheatCodes } from '@aztec/aztec/testing';
13
+ import { CheatCodes } from '@aztec/aztec.js/testing';
14
14
  import {
15
15
  type DeployL1ContractsReturnType,
16
16
  type ExtendedViemWalletClient,
@@ -19,14 +19,9 @@ import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
19
19
  import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
20
20
  import { ProverNode, ProverNodePublisher } from '@aztec/prover-node';
21
21
  import type { TestProverNode } from '@aztec/prover-node/test';
22
- import {
23
- type SequencerClient,
24
- type SequencerEvents,
25
- type SequencerPublisher,
26
- SequencerState,
27
- } from '@aztec/sequencer-client';
22
+ import type { SequencerPublisher } from '@aztec/sequencer-client';
28
23
  import type { TestSequencerClient } from '@aztec/sequencer-client/test';
29
- import type { EthAddress, L2BlockNumber } from '@aztec/stdlib/block';
24
+ import type { L2BlockNumber } from '@aztec/stdlib/block';
30
25
  import { type L1RollupConstants, getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
31
26
  import { tryStop } from '@aztec/stdlib/interfaces/server';
32
27
 
@@ -46,15 +41,23 @@ export const WORLD_STATE_BLOCK_HISTORY = 2;
46
41
  export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
47
42
  export const ARCHIVER_POLL_INTERVAL = 50;
48
43
 
49
- export type EpochsTestOpts = Partial<SetupOptions> & { numberOfAccounts?: number };
50
-
51
- export type TrackedSequencerEvent = {
52
- [K in keyof SequencerEvents]: Parameters<SequencerEvents[K]>[0] & {
53
- type: K;
54
- sequencerIndex: number;
55
- validator: EthAddress;
56
- };
57
- }[keyof SequencerEvents];
44
+ export type EpochsTestOpts = Partial<
45
+ Pick<
46
+ SetupOptions,
47
+ | 'startProverNode'
48
+ | 'aztecProofSubmissionEpochs'
49
+ | 'aztecEpochDuration'
50
+ | 'proverTestDelayMs'
51
+ | 'l1PublishRetryIntervalMS'
52
+ | 'txPropagationMaxQueryAttempts'
53
+ | 'proverNodeConfig'
54
+ | 'ethereumSlotDuration'
55
+ | 'aztecSlotDuration'
56
+ | 'initialValidators'
57
+ | 'mockGossipSubNetwork'
58
+ | 'disableAnvilTestWatcher'
59
+ >
60
+ > & { numberOfAccounts?: number };
58
61
 
59
62
  /**
60
63
  * Tests building of epochs using fast block times and short epochs.
@@ -137,7 +140,7 @@ export class EpochsTestContext {
137
140
  this.rollup = RollupContract.getFromConfig(context.config);
138
141
 
139
142
  // Loop that tracks L1 and L2 block numbers and logs whenever there's a new one.
140
- this.monitor = new ChainMonitor(this.rollup, context.dateProvider, this.logger).start();
143
+ this.monitor = new ChainMonitor(this.rollup, this.logger).start();
141
144
 
142
145
  // This is hideous.
143
146
  // We ought to have a definite reference to the l1TxUtils that we're using in both places, provided by the test context.
@@ -201,15 +204,13 @@ export class EpochsTestContext {
201
204
 
202
205
  public createValidatorNode(
203
206
  privateKeys: `0x${string}`[],
204
- opts: Partial<AztecNodeConfig> & { txDelayerMaxInclusionTimeIntoSlot?: number; dontStartSequencer?: boolean } = {},
207
+ opts: Partial<AztecNodeConfig> & { dontStartSequencer?: boolean } = {},
205
208
  ) {
206
209
  this.logger.warn('Creating and syncing a validator node...');
207
210
  return this.createNode({ ...opts, disableValidator: false, validatorPrivateKeys: new SecretValue(privateKeys) });
208
211
  }
209
212
 
210
- private async createNode(
211
- opts: Partial<AztecNodeConfig> & { txDelayerMaxInclusionTimeIntoSlot?: number; dontStartSequencer?: boolean } = {},
212
- ) {
213
+ private async createNode(opts: Partial<AztecNodeConfig> & { dontStartSequencer?: boolean } = {}) {
213
214
  const suffix = (this.nodes.length + 1).toString();
214
215
  const { mockGossipSubNetwork } = this.context;
215
216
  const resolvedConfig = { ...this.context.config, ...opts };
@@ -236,22 +237,6 @@ export class EpochsTestContext {
236
237
  },
237
238
  ),
238
239
  );
239
-
240
- // REFACTOR: We're getting too much into the internals of the sequencer here.
241
- // We should have a single method for constructing an aztec node that returns a TestAztecNodeService
242
- // which directly exposes the delayer and sets any test config.
243
- if (opts.txDelayerMaxInclusionTimeIntoSlot !== undefined) {
244
- this.logger.info(
245
- `Setting tx delayer max inclusion time into slot to ${opts.txDelayerMaxInclusionTimeIntoSlot} seconds`,
246
- );
247
- const sequencer = node.getSequencer() as TestSequencerClient;
248
- const publisher = sequencer.sequencer.publisher;
249
- const dateProvider = this.context.dateProvider!;
250
- const delayed = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, dateProvider, this.L1_BLOCK_TIME_IN_S);
251
- delayed.delayer!.setMaxInclusionTimeIntoSlot(opts.txDelayerMaxInclusionTimeIntoSlot);
252
- publisher.l1TxUtils = delayed;
253
- }
254
-
255
240
  this.nodes.push(node);
256
241
  return node;
257
242
  }
@@ -343,7 +328,6 @@ export class EpochsTestContext {
343
328
  privateKeyToAccount(this.getNextPrivateKey()),
344
329
  this.l1Client.chain,
345
330
  ),
346
- this.context.dateProvider!,
347
331
  { ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S },
348
332
  );
349
333
  expect(await client.getBalance({ address: client.account.address })).toBeGreaterThan(0n);
@@ -361,56 +345,4 @@ export class EpochsTestContext {
361
345
  .catch(_ => false);
362
346
  expect(result).toBe(expectedSuccess);
363
347
  }
364
-
365
- public watchSequencerEvents(
366
- sequencers: SequencerClient[],
367
- getMetadata: (i: number) => Record<string, any> = () => ({}),
368
- ) {
369
- const stateChanges: TrackedSequencerEvent[] = [];
370
- const failEvents: TrackedSequencerEvent[] = [];
371
-
372
- // Note we do not include the 'tx-count-check-failed' event here, since it is fine if we dont build
373
- // due to lack of txs available.
374
- const failEventsKeys: (keyof SequencerEvents)[] = [
375
- 'block-build-failed',
376
- 'block-publish-failed',
377
- 'proposer-rollup-check-failed',
378
- ];
379
-
380
- const makeEvent = (
381
- i: number,
382
- eventName: keyof SequencerEvents,
383
- args: Parameters<SequencerEvents[keyof SequencerEvents]>[0],
384
- ) =>
385
- ({
386
- ...args,
387
- type: eventName,
388
- sequencerIndex: i + 2,
389
- ...getMetadata(i),
390
- }) as TrackedSequencerEvent;
391
-
392
- sequencers.forEach((sequencer, i) => {
393
- const sequencerIndex = i + 2;
394
- sequencer.getSequencer().on('state-changed', (args: Parameters<SequencerEvents['state-changed']>[0]) => {
395
- const noisyStates = [SequencerState.IDLE, SequencerState.PROPOSER_CHECK, SequencerState.SYNCHRONIZING];
396
- if (!noisyStates.includes(args.newState)) {
397
- const evt = makeEvent(i, 'state-changed', args);
398
- stateChanges.push(evt);
399
- this.logger.verbose(
400
- `Sequencer ${sequencerIndex} transitioned from state ${args.oldState} to state ${args.newState}`,
401
- evt,
402
- );
403
- }
404
- });
405
- failEventsKeys.forEach(eventName => {
406
- sequencer.getSequencer().on(eventName, (args: Parameters<SequencerEvents[typeof eventName]>[0]) => {
407
- const evt = makeEvent(i, eventName, args);
408
- failEvents.push(evt);
409
- this.logger.error(`Failed event ${eventName} from sequencer ${sequencerIndex}`, evt);
410
- });
411
- });
412
- });
413
-
414
- return { failEvents, stateChanges };
415
- }
416
348
  }
@@ -8,7 +8,7 @@ import {
8
8
  createLogger,
9
9
  sleep,
10
10
  } from '@aztec/aztec.js';
11
- import { CheatCodes } from '@aztec/aztec/testing';
11
+ import { CheatCodes } from '@aztec/aztec.js/testing';
12
12
  import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
13
13
  import {
14
14
  type DeployL1ContractsArgs,
@@ -125,7 +125,7 @@ export class FeesTest {
125
125
  await context.aztecNode.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
126
126
 
127
127
  const rollupContract = RollupContract.getFromConfig(context.aztecNodeConfig);
128
- this.chainMonitor = new ChainMonitor(rollupContract, context.dateProvider, this.logger, 200).start();
128
+ this.chainMonitor = new ChainMonitor(rollupContract, this.logger, 200).start();
129
129
 
130
130
  return this;
131
131
  }
@@ -335,8 +335,7 @@ export class P2PNetworkTest {
335
335
  const { prefilledPublicData } = await getGenesisValues(initialFundedAccounts);
336
336
  this.prefilledPublicData = prefilledPublicData;
337
337
 
338
- const rollupContract = RollupContract.getFromL1ContractsValues(this.ctx.deployL1ContractsValues);
339
- this.monitor = new ChainMonitor(rollupContract, this.ctx.dateProvider).start();
338
+ this.monitor = new ChainMonitor(RollupContract.getFromL1ContractsValues(this.ctx.deployL1ContractsValues)).start();
340
339
  this.monitor.on('l1-block', ({ timestamp }) => this.ctx.dateProvider.setTime(Number(timestamp) * 1000));
341
340
  }
342
341
 
@@ -10,7 +10,7 @@ import {
10
10
  getContractInstanceFromDeployParams,
11
11
  retryUntil,
12
12
  } from '@aztec/aztec.js';
13
- import type { RollupCheatCodes } from '@aztec/aztec/testing';
13
+ import type { RollupCheatCodes } from '@aztec/aztec.js/testing';
14
14
  import type { RollupContract, ViemClient } from '@aztec/ethereum';
15
15
  import { timesAsync } from '@aztec/foundation/collection';
16
16
  import type { SlashFactoryAbi } from '@aztec/l1-artifacts/SlashFactoryAbi';
@@ -14,7 +14,7 @@ import {
14
14
  type PXE,
15
15
  createLogger,
16
16
  } from '@aztec/aztec.js';
17
- import { CheatCodes } from '@aztec/aztec/testing';
17
+ import { CheatCodes } from '@aztec/aztec.js/testing';
18
18
  import {
19
19
  BBCircuitVerifier,
20
20
  type ClientProtocolCircuitVerifier,
@@ -291,7 +291,7 @@ export class FullProverTest {
291
291
  this.logger.verbose('Starting prover node');
292
292
  const proverConfig: ProverNodeConfig = {
293
293
  ...this.context.aztecNodeConfig,
294
- txCollectionNodeRpcUrls: [],
294
+ proverCoordinationNodeUrls: [],
295
295
  dataDirectory: undefined,
296
296
  proverId: this.proverAddress.toField(),
297
297
  realProofs: this.realProofs,
@@ -303,7 +303,6 @@ export class FullProverTest {
303
303
  txGatheringIntervalMs: 1000,
304
304
  txGatheringBatchSize: 10,
305
305
  txGatheringMaxParallelRequestsPerNode: 100,
306
- txGatheringTimeoutMs: 24_000,
307
306
  proverNodeFailedEpochStore: undefined,
308
307
  };
309
308
  const sponsoredFPCAddress = await getSponsoredFPCAddress();
@@ -5,9 +5,7 @@ import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
5
5
  import type { SentTx } from '@aztec/aztec.js';
6
6
  import { SecretValue } from '@aztec/foundation/config';
7
7
  import { addLogNameHandler, removeLogNameHandler } from '@aztec/foundation/log';
8
- import { bufferToHex } from '@aztec/foundation/string';
9
8
  import type { DateProvider } from '@aztec/foundation/timer';
10
- import type { ProverNodeConfig, ProverNodeDeps } from '@aztec/prover-node';
11
9
  import type { PXEService } from '@aztec/pxe/server';
12
10
  import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
13
11
 
@@ -15,7 +13,7 @@ import getPort from 'get-port';
15
13
  import { AsyncLocalStorage } from 'node:async_hooks';
16
14
 
17
15
  import { TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
18
- import { createAndSyncProverNode, getPrivateKeyFromIndex } from './utils.js';
16
+ import { getPrivateKeyFromIndex } from './utils.js';
19
17
  import { getEndToEndTestTelemetryClient } from './with_telemetry_utils.js';
20
18
 
21
19
  // Setup snapshots will create a node with index 0, and run extra bootstrap with
@@ -103,42 +101,6 @@ export async function createNode(
103
101
  return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
104
102
  }
105
103
 
106
- export async function createProverNode(
107
- config: AztecNodeConfig,
108
- tcpPort: number,
109
- bootstrapNode: string | undefined,
110
- addressIndex: number,
111
- proverNodeDeps: ProverNodeDeps & Required<Pick<ProverNodeDeps, 'dateProvider'>>,
112
- prefilledPublicData?: PublicDataTreeLeaf[],
113
- dataDirectory?: string,
114
- metricsPort?: number,
115
- loggerIdStorage?: AsyncLocalStorage<string>,
116
- ) {
117
- const createProverNode = async () => {
118
- const proverNodePrivateKey = getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex)!;
119
- const telemetry = getEndToEndTestTelemetryClient(metricsPort);
120
-
121
- const proverConfig: Partial<ProverNodeConfig> = {
122
- p2pIp: `127.0.0.1`,
123
- p2pPort: tcpPort ?? (await getPort()),
124
- p2pEnabled: true,
125
- peerCheckIntervalMS: TEST_PEER_CHECK_INTERVAL_MS,
126
- blockCheckIntervalMS: 1000,
127
- bootstrapNodes: bootstrapNode ? [bootstrapNode] : [],
128
- };
129
- const aztecNodeRpcTxProvider = undefined;
130
- return await createAndSyncProverNode(
131
- bufferToHex(proverNodePrivateKey),
132
- config,
133
- { ...proverConfig, dataDirectory },
134
- aztecNodeRpcTxProvider,
135
- prefilledPublicData,
136
- { ...proverNodeDeps, telemetry },
137
- );
138
- };
139
- return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createProverNode) : createProverNode();
140
- }
141
-
142
104
  export async function createValidatorConfig(
143
105
  config: AztecNodeConfig,
144
106
  bootstrapNodeEnr?: string,
@@ -15,7 +15,7 @@ import {
15
15
  waitForProven,
16
16
  } from '@aztec/aztec.js';
17
17
  import { deployInstance, registerContractClass } from '@aztec/aztec.js/deployment';
18
- import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
18
+ import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
19
19
  import { type BlobSinkServer, createBlobSinkServer } from '@aztec/blob-sink/server';
20
20
  import {
21
21
  type DeployL1ContractsArgs,
@@ -348,7 +348,7 @@ async function setupFromFresh(
348
348
  const ethCheatCodes = new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls);
349
349
 
350
350
  if (opts.l1StartTime) {
351
- await ethCheatCodes.warp(opts.l1StartTime, { resetBlockInterval: true });
351
+ await ethCheatCodes.warp(opts.l1StartTime);
352
352
  }
353
353
 
354
354
  const initialFundedAccounts = await generateSchnorrAccounts(numberOfInitialFundedAccounts);
@@ -443,11 +443,11 @@ async function setupFromFresh(
443
443
 
444
444
  let proverNode: ProverNode | undefined = undefined;
445
445
  if (opts.startProverNode) {
446
- logger.verbose('Creating and syncing a simulated prover node with p2p disabled...');
446
+ logger.verbose('Creating and syncing a simulated prover node...');
447
447
  proverNode = await createAndSyncProverNode(
448
448
  `0x${proverNodePrivateKey!.toString('hex')}`,
449
449
  aztecNodeConfig,
450
- { dataDirectory: path.join(directoryToCleanup, randomBytes(8).toString('hex')), p2pEnabled: false },
450
+ { dataDirectory: path.join(directoryToCleanup, randomBytes(8).toString('hex')) },
451
451
  aztecNode,
452
452
  prefilledPublicData,
453
453
  );
@@ -26,7 +26,7 @@ import {
26
26
  waitForPXE,
27
27
  } from '@aztec/aztec.js';
28
28
  import { deployInstance, registerContractClass } from '@aztec/aztec.js/deployment';
29
- import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
29
+ import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
30
30
  import { createBlobSinkClient } from '@aztec/blob-sink/client';
31
31
  import { type BlobSinkServer, createBlobSinkServer } from '@aztec/blob-sink/server';
32
32
  import { GENESIS_ARCHIVE_ROOT, SPONSORED_FPC_SALT } from '@aztec/constants';
@@ -57,7 +57,7 @@ import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
57
57
  import type { P2PClientDeps } from '@aztec/p2p';
58
58
  import { MockGossipSubNetwork, getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
59
59
  import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
60
- import { type ProverNode, type ProverNodeConfig, type ProverNodeDeps, createProverNode } from '@aztec/prover-node';
60
+ import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
61
61
  import {
62
62
  type PXEService,
63
63
  type PXEServiceConfig,
@@ -68,11 +68,7 @@ import type { SequencerClient } from '@aztec/sequencer-client';
68
68
  import type { TestSequencerClient } from '@aztec/sequencer-client/test';
69
69
  import { MemoryCircuitRecorder, SimulatorRecorderWrapper, WASMSimulator } from '@aztec/simulator/client';
70
70
  import { FileCircuitRecorder } from '@aztec/simulator/testing';
71
- import {
72
- type ContractInstanceWithAddress,
73
- getContractClassFromArtifact,
74
- getContractInstanceFromDeployParams,
75
- } from '@aztec/stdlib/contract';
71
+ import { getContractClassFromArtifact, getContractInstanceFromDeployParams } from '@aztec/stdlib/contract';
76
72
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
77
73
  import { tryStop } from '@aztec/stdlib/interfaces/server';
78
74
  import type { P2PClientType } from '@aztec/stdlib/p2p';
@@ -420,7 +416,7 @@ export async function setup(
420
416
  }
421
417
 
422
418
  if (opts.l1StartTime) {
423
- await ethCheatCodes.warp(opts.l1StartTime, { resetBlockInterval: true });
419
+ await ethCheatCodes.warp(opts.l1StartTime);
424
420
  }
425
421
 
426
422
  let publisherPrivKey = undefined;
@@ -509,7 +505,7 @@ export async function setup(
509
505
  if (opts.l2StartTime) {
510
506
  // This should only be used in synching test or when you need to have a stable
511
507
  // timestamp for the first l2 block.
512
- await ethCheatCodes.warp(opts.l2StartTime, { resetBlockInterval: true });
508
+ await ethCheatCodes.warp(opts.l2StartTime);
513
509
  }
514
510
 
515
511
  const dateProvider = new TestDateProvider();
@@ -568,20 +564,6 @@ export async function setup(
568
564
  p2pClientDeps = { p2pServiceFactory: getMockPubSubP2PServiceFactory(mockGossipSubNetwork) };
569
565
  }
570
566
 
571
- // Transactions built against the genesis state must be included in block 1, otherwise they are dropped.
572
- // To avoid test failures from dropped transactions, we ensure progression beyond genesis before proceeding.
573
- // For account deployments, we set minTxsPerBlock=1 and deploy accounts sequentially for guaranteed success.
574
- // If no accounts need deployment, we await an empty block to confirm network progression. After either path
575
- // completes, we restore the original minTxsPerBlock setting. The deployment and waiting for empty block is
576
- // handled by the if-else branches on line 632.
577
- // For more details on why the tx would be dropped see `validate_include_by_timestamp` function in
578
- // `noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/components/validation_requests.nr`.
579
- const originalMinTxsPerBlock = config.minTxsPerBlock;
580
- if (originalMinTxsPerBlock === undefined) {
581
- throw new Error('minTxsPerBlock is undefined in e2e test setup');
582
- }
583
- config.minTxsPerBlock = numberOfAccounts === 0 ? 0 : 1;
584
-
585
567
  config.p2pEnabled = opts.mockGossipSubNetwork || config.p2pEnabled;
586
568
  config.p2pIp = opts.p2pIp ?? config.p2pIp ?? '127.0.0.1';
587
569
  const aztecNode = await AztecNodeService.createAndSync(
@@ -593,11 +575,7 @@ export async function setup(
593
575
 
594
576
  if (sequencerClient) {
595
577
  const publisher = (sequencerClient as TestSequencerClient).sequencer.publisher;
596
- publisher.l1TxUtils = DelayedTxUtils.fromL1TxUtils(
597
- publisher.l1TxUtils,
598
- dateProvider,
599
- config.ethereumSlotDuration,
600
- );
578
+ publisher.l1TxUtils = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, config.ethereumSlotDuration);
601
579
  }
602
580
 
603
581
  let proverNode: ProverNode | undefined = undefined;
@@ -632,22 +610,33 @@ export async function setup(
632
610
  await cheatCodes.rollup.debugRollup();
633
611
  }
634
612
 
635
- // Below we continue with what we described in the long comment on line 571.
613
+ const sequencer = sequencerClient!.getSequencer();
614
+ const minTxsPerBlock = config.minTxsPerBlock;
615
+
616
+ if (minTxsPerBlock === undefined) {
617
+ throw new Error('minTxsPerBlock is undefined in e2e test setup');
618
+ }
619
+
620
+ // Transactions built against the genesis state must be included in block 1, otherwise they are dropped.
621
+ // To avoid test failures from dropped transactions, we ensure progression beyond genesis before proceeding.
622
+ // For account deployments, we set minTxsPerBlock=1 and deploy accounts sequentially for guaranteed success.
623
+ // If no accounts need deployment, we await an empty block to confirm network progression. After either path
624
+ // completes, we restore the original minTxsPerBlock setting.
625
+ // For more details on why the tx would be dropped see `validate_include_by_timestamp` function in
626
+ // `noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/components/validation_requests.nr`.
636
627
  let accountManagers: AccountManager[] = [];
637
628
  if (numberOfAccounts === 0) {
638
- logger.info('No accounts are being deployed, waiting for an empty block 1 to be mined');
629
+ // We wait until block 1 is mined to ensure that the network has progressed past genesis.
630
+ sequencer.updateConfig({ minTxsPerBlock: 0 });
639
631
  while ((await pxe.getBlockNumber()) === 0) {
640
632
  await sleep(2000);
641
633
  }
642
634
  } else {
643
- logger.info(
644
- `${numberOfAccounts} accounts are being deployed. Reliably progressing past genesis by setting minTxsPerBlock to 1 and waiting for the accounts to be deployed`,
645
- );
635
+ sequencer.updateConfig({ minTxsPerBlock: 1 });
646
636
  accountManagers = await deployFundedSchnorrAccounts(pxe, initialFundedAccounts.slice(0, numberOfAccounts));
647
637
  }
648
638
 
649
- // Now we restore the original minTxsPerBlock setting.
650
- sequencerClient!.getSequencer().updateConfig({ minTxsPerBlock: originalMinTxsPerBlock });
639
+ sequencer.updateConfig({ minTxsPerBlock });
651
640
 
652
641
  const wallets = await Promise.all(accountManagers.map(account => account.getWallet()));
653
642
  if (initialFundedAccounts.length < numberOfAccounts) {
@@ -821,26 +810,15 @@ export async function expectMappingDelta<K, V extends number | bigint>(
821
810
  expect(diffs).toEqual(expectedDiffs);
822
811
  }
823
812
 
824
- /**
825
- * Computes the address of the "canonical" SponosoredFPCContract. This is not a protocol contract
826
- * but by conventions its address is computed with a salt of 0.
827
- * @returns The address of the sponsored FPC contract
828
- */
829
- export function getSponsoredFPCInstance(): Promise<ContractInstanceWithAddress> {
830
- return Promise.resolve(
831
- getContractInstanceFromDeployParams(SponsoredFPCContract.artifact, {
832
- salt: new Fr(SPONSORED_FPC_SALT),
833
- }),
834
- );
835
- }
836
-
837
813
  /**
838
814
  * Computes the address of the "canonical" SponosoredFPCContract. This is not a protocol contract
839
815
  * but by conventions its address is computed with a salt of 0.
840
816
  * @returns The address of the sponsored FPC contract
841
817
  */
842
818
  export async function getSponsoredFPCAddress() {
843
- const sponsoredFPCInstance = await getSponsoredFPCInstance();
819
+ const sponsoredFPCInstance = await getContractInstanceFromDeployParams(SponsoredFPCContract.artifact, {
820
+ salt: new Fr(SPONSORED_FPC_SALT),
821
+ });
844
822
  return sponsoredFPCInstance.address;
845
823
  }
846
824
 
@@ -857,14 +835,6 @@ export async function setupSponsoredFPC(pxe: PXE) {
857
835
  return instance;
858
836
  }
859
837
 
860
- /**
861
- * Registers the SponsoredFPC in this PXE instance
862
- * @param pxe - The pxe client
863
- */
864
- export async function registerSponsoredFPC(pxe: PXE): Promise<void> {
865
- await pxe.registerContract({ instance: await getSponsoredFPCInstance(), artifact: SponsoredFPCContract.artifact });
866
- }
867
-
868
838
  export async function waitForProvenChain(node: AztecNode, targetBlock?: number, timeoutSec = 60, intervalSec = 1) {
869
839
  targetBlock ??= await node.getBlockNumber();
870
840
 
@@ -880,14 +850,13 @@ export function createAndSyncProverNode(
880
850
  proverNodePrivateKey: `0x${string}`,
881
851
  aztecNodeConfig: AztecNodeConfig,
882
852
  proverNodeConfig: Partial<ProverNodeConfig> & Pick<DataStoreConfig, 'dataDirectory'>,
883
- aztecNode: AztecNode | undefined,
853
+ aztecNode: AztecNode,
884
854
  prefilledPublicData: PublicDataTreeLeaf[] = [],
885
- proverNodeDeps: ProverNodeDeps = {},
886
855
  ) {
887
856
  return withLogNameSuffix('prover-node', async () => {
888
857
  // Disable stopping the aztec node as the prover coordination test will kill it otherwise
889
858
  // This is only required when stopping the prover node for testing
890
- const aztecNodeTxProvider = aztecNode && {
859
+ const aztecNodeTxProvider = {
891
860
  getTxByHash: aztecNode.getTxByHash.bind(aztecNode),
892
861
  getTxsByHash: aztecNode.getTxsByHash.bind(aztecNode),
893
862
  stop: () => Promise.resolve(),
@@ -902,7 +871,7 @@ export function createAndSyncProverNode(
902
871
  // Prover node config is for simulated proofs
903
872
  const proverConfig: ProverNodeConfig = {
904
873
  ...aztecNodeConfig,
905
- txCollectionNodeRpcUrls: [],
874
+ proverCoordinationNodeUrls: [],
906
875
  realProofs: false,
907
876
  proverAgentCount: 2,
908
877
  publisherPrivateKey: new SecretValue(proverNodePrivateKey),
@@ -912,7 +881,6 @@ export function createAndSyncProverNode(
912
881
  txGatheringIntervalMs: 1000,
913
882
  txGatheringBatchSize: 10,
914
883
  txGatheringMaxParallelRequestsPerNode: 10,
915
- txGatheringTimeoutMs: 24_000,
916
884
  proverNodeFailedEpochStore: undefined,
917
885
  ...proverNodeConfig,
918
886
  };
@@ -921,7 +889,7 @@ export function createAndSyncProverNode(
921
889
 
922
890
  const proverNode = await createProverNode(
923
891
  proverConfig,
924
- { ...proverNodeDeps, aztecNodeTxProvider, archiver: archiver as Archiver, l1TxUtils },
892
+ { aztecNodeTxProvider, archiver: archiver as Archiver, l1TxUtils },
925
893
  { prefilledPublicData },
926
894
  );
927
895
  getLogger().info(`Created and synced prover node`, { publisherAddress: l1TxUtils.client.account!.address });
@@ -9,7 +9,7 @@ import {
9
9
  computeAuthWitMessageHash,
10
10
  generateClaimSecret,
11
11
  } from '@aztec/aztec.js';
12
- import { CheatCodes } from '@aztec/aztec/testing';
12
+ import { CheatCodes } from '@aztec/aztec.js/testing';
13
13
  import {
14
14
  type DeployL1ContractsReturnType,
15
15
  type ExtendedViemWalletClient,
@@ -1,6 +1,6 @@
1
1
  // Convenience struct to hold an account's address and secret that can easily be passed around.
2
2
  import { AztecAddress, Fr } from '@aztec/aztec.js';
3
- import { CheatCodes } from '@aztec/aztec/testing';
3
+ import { CheatCodes } from '@aztec/aztec.js/testing';
4
4
  import type { RollupContract } from '@aztec/ethereum';
5
5
  import { pedersenHash } from '@aztec/foundation/crypto';
6
6
  import type { TestDateProvider } from '@aztec/foundation/timer';