@aztec/end-to-end 0.82.3-nightly.20250330 → 0.82.3-nightly.20250403

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 (38) hide show
  1. package/dest/bench/client_flows/client_flows_benchmark.d.ts +15 -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 +51 -6
  4. package/dest/bench/client_flows/config.d.ts +14 -0
  5. package/dest/bench/client_flows/config.d.ts.map +1 -0
  6. package/dest/bench/client_flows/config.js +85 -0
  7. package/dest/bench/client_flows/data_extractor.js +1 -2
  8. package/dest/bench/utils.js +2 -2
  9. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  10. package/dest/e2e_fees/fees_test.js +2 -4
  11. package/dest/e2e_p2p/p2p_network.js +1 -1
  12. package/dest/fixtures/l1_to_l2_messaging.d.ts +2 -2
  13. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  14. package/dest/fixtures/l1_to_l2_messaging.js +2 -1
  15. package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
  16. package/dest/fixtures/setup_l1_contracts.js +1 -2
  17. package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
  18. package/dest/fixtures/snapshot_manager.js +4 -1
  19. package/dest/fixtures/utils.d.ts +0 -4
  20. package/dest/fixtures/utils.d.ts.map +1 -1
  21. package/dest/fixtures/utils.js +216 -238
  22. package/dest/shared/cross_chain_test_harness.d.ts +1 -1
  23. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  24. package/dest/shared/cross_chain_test_harness.js +2 -2
  25. package/dest/shared/uniswap_l1_l2.js +8 -6
  26. package/package.json +32 -32
  27. package/src/bench/client_flows/client_flows_benchmark.ts +69 -5
  28. package/src/bench/client_flows/config.ts +53 -0
  29. package/src/bench/client_flows/data_extractor.ts +2 -2
  30. package/src/bench/utils.ts +2 -2
  31. package/src/e2e_fees/fees_test.ts +1 -4
  32. package/src/e2e_p2p/p2p_network.ts +1 -1
  33. package/src/fixtures/l1_to_l2_messaging.ts +12 -3
  34. package/src/fixtures/setup_l1_contracts.ts +1 -2
  35. package/src/fixtures/snapshot_manager.ts +4 -1
  36. package/src/fixtures/utils.ts +235 -261
  37. package/src/shared/cross_chain_test_harness.ts +2 -2
  38. package/src/shared/uniswap_l1_l2.ts +8 -8
@@ -2,13 +2,13 @@ import { SchnorrAccountContractArtifact } from '@aztec/accounts/schnorr';
2
2
  import { deployFundedSchnorrAccounts, generateSchnorrAccounts, getDeployedTestAccounts, getDeployedTestAccountsWallets } from '@aztec/accounts/testing';
3
3
  import { createArchiver } from '@aztec/archiver';
4
4
  import { AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
5
- import { BatchCall, FeeJuicePaymentMethod, SignerlessWallet, createAztecNodeClient, createLogger, createPXEClient, makeFetch, waitForPXE } from '@aztec/aztec.js';
5
+ import { BatchCall, SignerlessWallet, createAztecNodeClient, createLogger, createPXEClient, makeFetch, waitForPXE } from '@aztec/aztec.js';
6
6
  import { deployInstance, registerContractClass } from '@aztec/aztec.js/deployment';
7
7
  import { SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee/testing';
8
8
  import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
9
9
  import { createBlobSinkClient } from '@aztec/blob-sink/client';
10
10
  import { createBlobSinkServer } from '@aztec/blob-sink/server';
11
- import { FEE_JUICE_INITIAL_MINT, GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH, SPONSORED_FPC_SALT } from '@aztec/constants';
11
+ import { GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH, SPONSORED_FPC_SALT } from '@aztec/constants';
12
12
  import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
13
13
  import { ForwarderContract, NULL_KEY, createL1Clients, deployL1Contracts, getL1ContractsConfigEnvVars, isAnvilTestChain, l1Artifacts } from '@aztec/ethereum';
14
14
  import { DelayedTxUtils, EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
@@ -17,16 +17,14 @@ import { EthAddress } from '@aztec/foundation/eth-address';
17
17
  import { Fr } from '@aztec/foundation/fields';
18
18
  import { retryUntil } from '@aztec/foundation/retry';
19
19
  import { TestDateProvider } from '@aztec/foundation/timer';
20
- import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
21
20
  import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
22
21
  import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
23
- import { ProtocolContractAddress, protocolContractTreeRoot } from '@aztec/protocol-contracts';
22
+ import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
24
23
  import { createProverNode } from '@aztec/prover-node';
25
24
  import { createPXEServiceWithSimulationProvider, getPXEServiceConfig } from '@aztec/pxe/server';
26
25
  import { WASMSimulator } from '@aztec/simulator/client';
27
26
  import { SimulationProviderRecorderWrapper } from '@aztec/simulator/testing';
28
27
  import { getContractClassFromArtifact, getContractInstanceFromDeployParams } from '@aztec/stdlib/contract';
29
- import { Gas } from '@aztec/stdlib/gas';
30
28
  import { getConfigEnvVars as getTelemetryConfig, initTelemetryClient } from '@aztec/telemetry-client';
31
29
  import { BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
32
30
  import { getGenesisValues } from '@aztec/world-state/testing';
@@ -34,7 +32,6 @@ import fs from 'fs/promises';
34
32
  import getPort from 'get-port';
35
33
  import { tmpdir } from 'os';
36
34
  import * as path from 'path';
37
- import { inspect } from 'util';
38
35
  import { getContract } from 'viem';
39
36
  import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
40
37
  import { foundry } from 'viem/chains';
@@ -71,7 +68,6 @@ export const getPrivateKeyFromIndex = (index)=>{
71
68
  };
72
69
  export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, chain = foundry)=>{
73
70
  const l1Data = await deployL1Contracts(l1RpcUrls, account, chain, logger, {
74
- l2FeeJuiceAddress: ProtocolContractAddress.FeeJuice.toField(),
75
71
  vkTreeRoot: getVKTreeRoot(),
76
72
  protocolContractTreeRoot,
77
73
  genesisArchiveRoot: args.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT),
@@ -155,7 +151,6 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
155
151
  };
156
152
  const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxeClient);
157
153
  const teardown = ()=>Promise.resolve();
158
- await setupCanonicalFeeJuice(pxeClient);
159
154
  logger.verbose('Constructing available wallets from already registered accounts...');
160
155
  const initialFundedAccounts = await getDeployedTestAccounts(pxeClient);
161
156
  const wallets = await getDeployedTestAccountsWallets(pxeClient);
@@ -191,221 +186,226 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
191
186
  */ export async function setup(numberOfAccounts = 1, opts = {
192
187
  customForwarderContractAddress: EthAddress.ZERO
193
188
  }, pxeOpts = {}, chain = foundry) {
194
- const config = {
195
- ...getConfigEnvVars(),
196
- ...opts
197
- };
198
- config.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS;
199
- // For tests we only want proving enabled if specifically requested
200
- config.realProofs = !!opts.realProofs;
201
- const logger = getLogger();
202
- // Create a temp directory for any services that need it and cleanup later
203
- const directoryToCleanup = path.join(tmpdir(), randomBytes(8).toString('hex'));
204
- await fs.mkdir(directoryToCleanup, {
205
- recursive: true
206
- });
207
- if (!config.dataDirectory) {
208
- config.dataDirectory = directoryToCleanup;
209
- }
210
189
  let anvil;
211
- if (!config.l1RpcUrls?.length) {
212
- if (!isAnvilTestChain(chain.id)) {
213
- throw new Error(`No ETHEREUM_HOSTS set but non anvil chain requested`);
190
+ try {
191
+ const config = {
192
+ ...getConfigEnvVars(),
193
+ ...opts
194
+ };
195
+ config.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS;
196
+ // For tests we only want proving enabled if specifically requested
197
+ config.realProofs = !!opts.realProofs;
198
+ // Only enforce the time table if requested
199
+ config.enforceTimeTable = !!opts.enforceTimeTable;
200
+ const logger = getLogger();
201
+ // Create a temp directory for any services that need it and cleanup later
202
+ const directoryToCleanup = path.join(tmpdir(), randomBytes(8).toString('hex'));
203
+ await fs.mkdir(directoryToCleanup, {
204
+ recursive: true
205
+ });
206
+ if (!config.dataDirectory) {
207
+ config.dataDirectory = directoryToCleanup;
214
208
  }
209
+ if (!config.l1RpcUrls?.length) {
210
+ if (!isAnvilTestChain(chain.id)) {
211
+ throw new Error(`No ETHEREUM_HOSTS set but non anvil chain requested`);
212
+ }
213
+ if (PXE_URL) {
214
+ throw new Error(`PXE_URL provided but no ETHEREUM_HOSTS set. Refusing to run, please set both variables so tests can deploy L1 contracts to the same Anvil instance`);
215
+ }
216
+ const res = await startAnvil({
217
+ l1BlockTime: opts.ethereumSlotDuration
218
+ });
219
+ anvil = res.anvil;
220
+ config.l1RpcUrls = [
221
+ res.rpcUrl
222
+ ];
223
+ }
224
+ // Enable logging metrics to a local file named after the test suite
225
+ if (isMetricsLoggingRequested()) {
226
+ const filename = path.join('log', getJobName() + '.jsonl');
227
+ logger.info(`Logging metrics to ${filename}`);
228
+ setupMetricsLogger(filename);
229
+ }
230
+ const ethCheatCodes = new EthCheatCodesWithState(config.l1RpcUrls);
231
+ if (opts.stateLoad) {
232
+ await ethCheatCodes.loadChainState(opts.stateLoad);
233
+ }
234
+ if (opts.l1StartTime) {
235
+ await ethCheatCodes.warp(opts.l1StartTime);
236
+ }
237
+ let publisherPrivKey = undefined;
238
+ let publisherHdAccount = undefined;
239
+ if (config.publisherPrivateKey && config.publisherPrivateKey != NULL_KEY) {
240
+ publisherHdAccount = privateKeyToAccount(config.publisherPrivateKey);
241
+ } else if (!MNEMONIC) {
242
+ throw new Error(`Mnemonic not provided and no publisher private key`);
243
+ } else {
244
+ publisherHdAccount = mnemonicToAccount(MNEMONIC, {
245
+ addressIndex: 0
246
+ });
247
+ const publisherPrivKeyRaw = publisherHdAccount.getHdKey().privateKey;
248
+ publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
249
+ config.publisherPrivateKey = `0x${publisherPrivKey.toString('hex')}`;
250
+ }
251
+ // Made as separate values such that keys can change, but for test they will be the same.
252
+ config.validatorPrivateKey = config.publisherPrivateKey;
215
253
  if (PXE_URL) {
216
- throw new Error(`PXE_URL provided but no ETHEREUM_HOSTS set. Refusing to run, please set both variables so tests can deploy L1 contracts to the same Anvil instance`);
254
+ // we are setting up against a remote environment, l1 contracts are assumed to already be deployed
255
+ return await setupWithRemoteEnvironment(publisherHdAccount, config, logger, numberOfAccounts);
217
256
  }
218
- const res = await startAnvil({
219
- l1BlockTime: opts.ethereumSlotDuration
220
- });
221
- anvil = res.anvil;
222
- config.l1RpcUrls = [
223
- res.rpcUrl
224
- ];
225
- }
226
- // Enable logging metrics to a local file named after the test suite
227
- if (isMetricsLoggingRequested()) {
228
- const filename = path.join('log', getJobName() + '.jsonl');
229
- logger.info(`Logging metrics to ${filename}`);
230
- setupMetricsLogger(filename);
231
- }
232
- const ethCheatCodes = new EthCheatCodesWithState(config.l1RpcUrls);
233
- if (opts.stateLoad) {
234
- await ethCheatCodes.loadChainState(opts.stateLoad);
235
- }
236
- if (opts.l1StartTime) {
237
- await ethCheatCodes.warp(opts.l1StartTime);
238
- }
239
- let publisherPrivKey = undefined;
240
- let publisherHdAccount = undefined;
241
- if (config.publisherPrivateKey && config.publisherPrivateKey != NULL_KEY) {
242
- publisherHdAccount = privateKeyToAccount(config.publisherPrivateKey);
243
- } else if (!MNEMONIC) {
244
- throw new Error(`Mnemonic not provided and no publisher private key`);
245
- } else {
246
- publisherHdAccount = mnemonicToAccount(MNEMONIC, {
247
- addressIndex: 0
248
- });
249
- const publisherPrivKeyRaw = publisherHdAccount.getHdKey().privateKey;
250
- publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
251
- config.publisherPrivateKey = `0x${publisherPrivKey.toString('hex')}`;
252
- }
253
- // Made as separate values such that keys can change, but for test they will be the same.
254
- config.validatorPrivateKey = config.publisherPrivateKey;
255
- if (PXE_URL) {
256
- // we are setting up against a remote environment, l1 contracts are assumed to already be deployed
257
- return await setupWithRemoteEnvironment(publisherHdAccount, config, logger, numberOfAccounts);
258
- }
259
- const initialFundedAccounts = opts.initialFundedAccounts ?? await generateSchnorrAccounts(opts.numberOfInitialFundedAccounts ?? numberOfAccounts);
260
- const { genesisBlockHash, genesisArchiveRoot, prefilledPublicData } = await getGenesisValues(initialFundedAccounts.map((a)=>a.address), opts.initialAccountFeeJuice, opts.genesisPublicData);
261
- const deployL1ContractsValues = opts.deployL1ContractsValues ?? await setupL1Contracts(config.l1RpcUrls, publisherHdAccount, logger, {
262
- ...opts,
263
- genesisArchiveRoot,
264
- genesisBlockHash
265
- }, chain);
266
- config.l1Contracts = deployL1ContractsValues.l1ContractAddresses;
267
- if (opts.fundRewardDistributor) {
268
- // Mints block rewards for 10000 blocks to the rewardDistributor contract
269
- const rewardDistributor = getContract({
270
- address: deployL1ContractsValues.l1ContractAddresses.rewardDistributorAddress.toString(),
271
- abi: l1Artifacts.rewardDistributor.contractAbi,
272
- client: deployL1ContractsValues.publicClient
273
- });
274
- const blockReward = await rewardDistributor.read.BLOCK_REWARD();
275
- const mintAmount = 10_000n * blockReward;
276
- const feeJuice = getContract({
277
- address: deployL1ContractsValues.l1ContractAddresses.feeJuiceAddress.toString(),
278
- abi: l1Artifacts.feeAsset.contractAbi,
279
- client: deployL1ContractsValues.walletClient
280
- });
281
- const rewardDistributorMintTxHash = await feeJuice.write.mint([
282
- rewardDistributor.address,
283
- mintAmount
284
- ], {});
285
- await deployL1ContractsValues.publicClient.waitForTransactionReceipt({
286
- hash: rewardDistributorMintTxHash
287
- });
288
- logger.info(`Funding rewardDistributor in ${rewardDistributorMintTxHash}`);
289
- }
290
- if (opts.l2StartTime) {
291
- // This should only be used in synching test or when you need to have a stable
292
- // timestamp for the first l2 block.
293
- await ethCheatCodes.warp(opts.l2StartTime);
294
- }
295
- const dateProvider = new TestDateProvider();
296
- const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(config.l1RpcUrls), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.publicClient, dateProvider);
297
- await watcher.start();
298
- const telemetry = getTelemetryClient(opts.telemetryConfig);
299
- // Blob sink service - blobs get posted here and served from here
300
- const blobSinkPort = await getPort();
301
- const blobSink = await createBlobSinkServer({
302
- l1ChainId: config.l1ChainId,
303
- l1RpcUrls: config.l1RpcUrls,
304
- rollupAddress: config.l1Contracts.rollupAddress,
305
- port: blobSinkPort,
306
- dataDirectory: config.dataDirectory,
307
- dataStoreMapSizeKB: config.dataStoreMapSizeKB
308
- }, telemetry);
309
- await blobSink.start();
310
- config.blobSinkUrl = `http://localhost:${blobSinkPort}`;
311
- logger.verbose('Creating and synching an aztec node...');
312
- const acvmConfig = await getACVMConfig(logger);
313
- if (acvmConfig) {
314
- config.acvmWorkingDirectory = acvmConfig.acvmWorkingDirectory;
315
- config.acvmBinaryPath = acvmConfig.acvmBinaryPath;
316
- }
317
- const bbConfig = await getBBConfig(logger);
318
- if (bbConfig) {
319
- config.bbBinaryPath = bbConfig.bbBinaryPath;
320
- config.bbWorkingDirectory = bbConfig.bbWorkingDirectory;
321
- }
322
- config.l1PublishRetryIntervalMS = 100;
323
- const blobSinkClient = createBlobSinkClient(config);
324
- const aztecNode = await AztecNodeService.createAndSync(config, {
325
- dateProvider,
326
- blobSinkClient,
327
- telemetry
328
- }, {
329
- prefilledPublicData
330
- });
331
- const sequencer = aztecNode.getSequencer();
332
- if (sequencer) {
333
- const publisher = sequencer.sequencer.publisher;
334
- publisher.l1TxUtils = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, config.ethereumSlotDuration);
335
- }
336
- let proverNode = undefined;
337
- if (opts.startProverNode) {
338
- logger.verbose('Creating and syncing a simulated prover node...');
339
- const proverNodePrivateKey = getPrivateKeyFromIndex(2);
340
- const proverNodePrivateKeyHex = `0x${proverNodePrivateKey.toString('hex')}`;
341
- proverNode = await createAndSyncProverNode(proverNodePrivateKeyHex, config, aztecNode, path.join(directoryToCleanup, randomBytes(8).toString('hex')));
342
- }
343
- logger.verbose('Creating a pxe...');
344
- const { pxe, teardown: pxeTeardown } = await setupPXEService(aztecNode, pxeOpts, logger);
345
- if (!config.skipProtocolContracts) {
346
- logger.verbose('Setting up Fee Juice...');
347
- await setupCanonicalFeeJuice(pxe);
348
- }
349
- const accountManagers = await deployFundedSchnorrAccounts(pxe, initialFundedAccounts.slice(0, numberOfAccounts));
350
- const wallets = await Promise.all(accountManagers.map((account)=>account.getWallet()));
351
- if (initialFundedAccounts.length < numberOfAccounts) {
352
- // TODO: Create (numberOfAccounts - initialFundedAccounts.length) wallets without funds.
353
- throw new Error(`Unable to deploy ${numberOfAccounts} accounts. Only ${initialFundedAccounts.length} accounts were funded.`);
354
- }
355
- const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxe);
356
- const teardown = async ()=>{
357
- await pxeTeardown();
358
- if (aztecNode instanceof AztecNodeService) {
359
- await aztecNode?.stop();
257
+ const initialFundedAccounts = opts.initialFundedAccounts ?? await generateSchnorrAccounts(opts.numberOfInitialFundedAccounts ?? numberOfAccounts);
258
+ const { genesisBlockHash, genesisArchiveRoot, prefilledPublicData, fundingNeeded } = await getGenesisValues(initialFundedAccounts.map((a)=>a.address), opts.initialAccountFeeJuice, opts.genesisPublicData);
259
+ const deployL1ContractsValues = opts.deployL1ContractsValues ?? await setupL1Contracts(config.l1RpcUrls, publisherHdAccount, logger, {
260
+ ...opts,
261
+ genesisArchiveRoot,
262
+ genesisBlockHash,
263
+ feeJuicePortalInitialBalance: fundingNeeded
264
+ }, chain);
265
+ config.l1Contracts = deployL1ContractsValues.l1ContractAddresses;
266
+ if (opts.fundRewardDistributor) {
267
+ // Mints block rewards for 10000 blocks to the rewardDistributor contract
268
+ const rewardDistributor = getContract({
269
+ address: deployL1ContractsValues.l1ContractAddresses.rewardDistributorAddress.toString(),
270
+ abi: l1Artifacts.rewardDistributor.contractAbi,
271
+ client: deployL1ContractsValues.publicClient
272
+ });
273
+ const blockReward = await rewardDistributor.read.BLOCK_REWARD();
274
+ const mintAmount = 10_000n * blockReward;
275
+ const feeJuice = getContract({
276
+ address: deployL1ContractsValues.l1ContractAddresses.feeJuiceAddress.toString(),
277
+ abi: l1Artifacts.feeAsset.contractAbi,
278
+ client: deployL1ContractsValues.walletClient
279
+ });
280
+ const rewardDistributorMintTxHash = await feeJuice.write.mint([
281
+ rewardDistributor.address,
282
+ mintAmount
283
+ ], {});
284
+ await deployL1ContractsValues.publicClient.waitForTransactionReceipt({
285
+ hash: rewardDistributorMintTxHash
286
+ });
287
+ logger.info(`Funding rewardDistributor in ${rewardDistributorMintTxHash}`);
360
288
  }
361
- if (proverNode) {
362
- await proverNode.stop();
289
+ if (opts.l2StartTime) {
290
+ // This should only be used in synching test or when you need to have a stable
291
+ // timestamp for the first l2 block.
292
+ await ethCheatCodes.warp(opts.l2StartTime);
363
293
  }
364
- if (acvmConfig?.cleanup) {
365
- // remove the temp directory created for the acvm
366
- logger.verbose(`Cleaning up ACVM state`);
367
- await acvmConfig.cleanup();
294
+ const dateProvider = new TestDateProvider();
295
+ const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(config.l1RpcUrls), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.publicClient, dateProvider);
296
+ await watcher.start();
297
+ const telemetry = getTelemetryClient(opts.telemetryConfig);
298
+ // Blob sink service - blobs get posted here and served from here
299
+ const blobSinkPort = await getPort();
300
+ const blobSink = await createBlobSinkServer({
301
+ l1ChainId: config.l1ChainId,
302
+ l1RpcUrls: config.l1RpcUrls,
303
+ rollupAddress: config.l1Contracts.rollupAddress,
304
+ port: blobSinkPort,
305
+ dataDirectory: config.dataDirectory,
306
+ dataStoreMapSizeKB: config.dataStoreMapSizeKB
307
+ }, telemetry);
308
+ await blobSink.start();
309
+ config.blobSinkUrl = `http://localhost:${blobSinkPort}`;
310
+ logger.verbose('Creating and synching an aztec node...');
311
+ const acvmConfig = await getACVMConfig(logger);
312
+ if (acvmConfig) {
313
+ config.acvmWorkingDirectory = acvmConfig.acvmWorkingDirectory;
314
+ config.acvmBinaryPath = acvmConfig.acvmBinaryPath;
368
315
  }
369
- if (bbConfig?.cleanup) {
370
- // remove the temp directory created for the acvm
371
- logger.verbose(`Cleaning up BB state`);
372
- await bbConfig.cleanup();
316
+ const bbConfig = await getBBConfig(logger);
317
+ if (bbConfig) {
318
+ config.bbBinaryPath = bbConfig.bbBinaryPath;
319
+ config.bbWorkingDirectory = bbConfig.bbWorkingDirectory;
373
320
  }
374
- await anvil?.stop().catch((err)=>getLogger().error(err));
375
- await watcher.stop();
376
- await blobSink?.stop();
377
- if (directoryToCleanup) {
378
- try {
379
- logger.verbose(`Cleaning up data directory at ${directoryToCleanup}`);
380
- await fs.rm(directoryToCleanup, {
381
- recursive: true,
382
- force: true,
383
- maxRetries: 3
384
- });
385
- } catch (err) {
386
- logger.warn(`Failed to delete data directory at ${directoryToCleanup}: ${err}`);
387
- }
321
+ config.l1PublishRetryIntervalMS = 100;
322
+ const blobSinkClient = createBlobSinkClient(config);
323
+ const aztecNode = await AztecNodeService.createAndSync(config, {
324
+ dateProvider,
325
+ blobSinkClient,
326
+ telemetry
327
+ }, {
328
+ prefilledPublicData
329
+ });
330
+ const sequencer = aztecNode.getSequencer();
331
+ if (sequencer) {
332
+ const publisher = sequencer.sequencer.publisher;
333
+ publisher.l1TxUtils = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, config.ethereumSlotDuration);
388
334
  }
389
- };
390
- return {
391
- aztecNode,
392
- aztecNodeAdmin: aztecNode,
393
- blobSink,
394
- cheatCodes,
395
- config,
396
- dateProvider,
397
- deployL1ContractsValues,
398
- initialFundedAccounts,
399
- logger,
400
- proverNode,
401
- pxe,
402
- sequencer,
403
- teardown,
404
- telemetryClient: telemetry,
405
- wallet: wallets[0],
406
- wallets,
407
- watcher
408
- };
335
+ let proverNode = undefined;
336
+ if (opts.startProverNode) {
337
+ logger.verbose('Creating and syncing a simulated prover node...');
338
+ const proverNodePrivateKey = getPrivateKeyFromIndex(2);
339
+ const proverNodePrivateKeyHex = `0x${proverNodePrivateKey.toString('hex')}`;
340
+ proverNode = await createAndSyncProverNode(proverNodePrivateKeyHex, config, aztecNode, path.join(directoryToCleanup, randomBytes(8).toString('hex')));
341
+ }
342
+ logger.verbose('Creating a pxe...');
343
+ const { pxe, teardown: pxeTeardown } = await setupPXEService(aztecNode, pxeOpts, logger);
344
+ const accountManagers = await deployFundedSchnorrAccounts(pxe, initialFundedAccounts.slice(0, numberOfAccounts));
345
+ const wallets = await Promise.all(accountManagers.map((account)=>account.getWallet()));
346
+ if (initialFundedAccounts.length < numberOfAccounts) {
347
+ // TODO: Create (numberOfAccounts - initialFundedAccounts.length) wallets without funds.
348
+ throw new Error(`Unable to deploy ${numberOfAccounts} accounts. Only ${initialFundedAccounts.length} accounts were funded.`);
349
+ }
350
+ const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxe);
351
+ const teardown = async ()=>{
352
+ await pxeTeardown();
353
+ if (aztecNode instanceof AztecNodeService) {
354
+ await aztecNode?.stop();
355
+ }
356
+ if (proverNode) {
357
+ await proverNode.stop();
358
+ }
359
+ if (acvmConfig?.cleanup) {
360
+ // remove the temp directory created for the acvm
361
+ logger.verbose(`Cleaning up ACVM state`);
362
+ await acvmConfig.cleanup();
363
+ }
364
+ if (bbConfig?.cleanup) {
365
+ // remove the temp directory created for the acvm
366
+ logger.verbose(`Cleaning up BB state`);
367
+ await bbConfig.cleanup();
368
+ }
369
+ await anvil?.stop().catch((err)=>getLogger().error(err));
370
+ await watcher.stop();
371
+ await blobSink?.stop();
372
+ if (directoryToCleanup) {
373
+ try {
374
+ logger.verbose(`Cleaning up data directory at ${directoryToCleanup}`);
375
+ await fs.rm(directoryToCleanup, {
376
+ recursive: true,
377
+ force: true,
378
+ maxRetries: 3
379
+ });
380
+ } catch (err) {
381
+ logger.warn(`Failed to delete data directory at ${directoryToCleanup}: ${err}`);
382
+ }
383
+ }
384
+ };
385
+ return {
386
+ aztecNode,
387
+ aztecNodeAdmin: aztecNode,
388
+ blobSink,
389
+ cheatCodes,
390
+ config,
391
+ dateProvider,
392
+ deployL1ContractsValues,
393
+ initialFundedAccounts,
394
+ logger,
395
+ proverNode,
396
+ pxe,
397
+ sequencer,
398
+ teardown,
399
+ telemetryClient: telemetry,
400
+ wallet: wallets[0],
401
+ wallets,
402
+ watcher
403
+ };
404
+ } catch (err) {
405
+ // TODO: Just hoisted anvil for now to ensure cleanup. Prob need to hoist the rest.
406
+ await anvil?.stop();
407
+ throw err;
408
+ }
409
409
  }
410
410
  /**
411
411
  * Registers the contract class used for test accounts and publicly deploys the instances requested.
@@ -482,28 +482,6 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
482
482
  const diffs = outputs.map((output, i)=>output - initialValues[i]);
483
483
  expect(diffs).toEqual(expectedDiffs);
484
484
  }
485
- /**
486
- * Deploy the canonical Fee Juice contract to a running instance.
487
- */ export async function setupCanonicalFeeJuice(pxe) {
488
- // "deploy" the Fee Juice as it contains public functions
489
- const feeJuicePortalAddress = (await pxe.getNodeInfo()).l1ContractAddresses.feeJuicePortalAddress;
490
- const wallet = new SignerlessWallet(pxe);
491
- const feeJuice = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, wallet);
492
- try {
493
- const paymentMethod = new FeeJuicePaymentMethod(ProtocolContractAddress.FeeJuice);
494
- await feeJuice.methods.initialize(feeJuicePortalAddress, FEE_JUICE_INITIAL_MINT).send({
495
- fee: {
496
- paymentMethod,
497
- gasSettings: {
498
- teardownGasLimits: Gas.empty()
499
- }
500
- }
501
- }).wait();
502
- getLogger().info(`Fee Juice successfully setup. Portal address: ${feeJuicePortalAddress}`);
503
- } catch (error) {
504
- getLogger().warn(`Fee Juice might have already been setup. Got error: ${inspect(error)}.`);
505
- }
506
- }
507
485
  /**
508
486
  * Computes the address of the "canonical" SponosoredFPCContract. This is not a protocol contract
509
487
  * but by conventions its address is computed with a salt of 0.
@@ -517,8 +495,8 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
517
495
  /**
518
496
  * Deploy a sponsored FPC contract to a running instance.
519
497
  */ export async function setupSponsoredFPC(pxe) {
520
- const { l1ChainId: chainId, protocolVersion } = await pxe.getNodeInfo();
521
- const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, protocolVersion));
498
+ const { l1ChainId: chainId, rollupVersion } = await pxe.getNodeInfo();
499
+ const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, rollupVersion));
522
500
  // Make the contract pay for the deployment fee itself
523
501
  const paymentMethod = new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
524
502
  const deployed = await SponsoredFPCContract.deploy(deployer).send({
@@ -118,7 +118,7 @@ export declare class CrossChainTestHarness {
118
118
  expectPrivateBalanceOnL2(owner: AztecAddress, expectedBalance: bigint): Promise<void>;
119
119
  getL2PublicBalanceOf(owner: AztecAddress): Promise<any>;
120
120
  expectPublicBalanceOnL2(owner: AztecAddress, expectedBalance: bigint): Promise<void>;
121
- getL2ToL1MessageLeaf(withdrawAmount: bigint, callerOnL1?: EthAddress): Fr;
121
+ getL2ToL1MessageLeaf(withdrawAmount: bigint, callerOnL1?: EthAddress): Promise<Fr>;
122
122
  withdrawFundsFromBridgeOnL1(amount: bigint, blockNumber: number | bigint, messageIndex: bigint, siblingPath: SiblingPath<number>): Promise<void>;
123
123
  transferToPrivateOnL2(shieldAmount: bigint): Promise<void>;
124
124
  transferToPublicOnL2(amount: bigint, nonce?: Fr): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"cross_chain_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/cross_chain_test_harness.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,S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MAAM,EAC5B,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC;IAW5B,qBAAqB,CAAC,YAAY,EAAE,MAAM;IAK1C,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,KAAU;IAK1D;;;;;;OAMG;IACG,qBAAqB,CAAC,OAAO,EAAE,EAAE,GAAG,GAAG;IAS7C,mBAAmB,IAAI,iBAAiB;CAYzC"}
1
+ {"version":3,"file":"cross_chain_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/cross_chain_test_harness.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,UAAU,EACV,KAAK,QAAQ,EACb,EAAE,EAGF,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAEtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,OAAO,EAAE,KAAK,GAAG,EAAe,MAAM,MAAM,CAAC;AAK7C;;;;;;;;;GASG;AACH,wBAAsB,0CAA0C,CAC9D,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,qBAAqB,EAAE,UAAU,EACjC,KAAK,EAAE,YAAY,EACnB,sBAAsB,EAAE,UAAU,GACjC,OAAO,CAAC;IACT;;OAEG;IACH,KAAK,EAAE,aAAa,CAAC;IACrB;;OAEG;IACH,MAAM,EAAE,mBAAmB,CAAC;IAC5B;;OAEG;IACH,kBAAkB,E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Ac,EAAE,MAAM,EAAE,KAAK,GAAE,EAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAStG,qBAAqB,CAAC,KAAK,EAAE,YAAY;IAIzC,wBAAwB,CAAC,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM;IAMrE,oBAAoB,CAAC,KAAK,EAAE,YAAY;IAIxC,uBAAuB,CAAC,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM;IAKpE,oBAAoB,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,GAAE,UAA4B,GAAG,OAAO,CAAC,EAAE,CAAC;IASzG,2BAA2B,CACzB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,EAC5B,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC;IAW5B,qBAAqB,CAAC,YAAY,EAAE,MAAM;IAK1C,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,KAAU;IAK1D;;;;;;OAMG;IACG,qBAAqB,CAAC,OAAO,EAAE,EAAE,GAAG,GAAG;IAS7C,mBAAmB,IAAI,iBAAiB;CAYzC"}
@@ -174,8 +174,8 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
174
174
  const balance = await this.getL2PublicBalanceOf(owner);
175
175
  expect(balance).toBe(expectedBalance);
176
176
  }
177
- getL2ToL1MessageLeaf(withdrawAmount, callerOnL1 = EthAddress.ZERO) {
178
- return this.l1TokenPortalManager.getL2ToL1MessageLeaf(withdrawAmount, this.ethAccount, this.l2Bridge.address, callerOnL1);
177
+ async getL2ToL1MessageLeaf(withdrawAmount, callerOnL1 = EthAddress.ZERO) {
178
+ return await this.l1TokenPortalManager.getL2ToL1MessageLeaf(withdrawAmount, this.ethAccount, this.l2Bridge.address, callerOnL1);
179
179
  }
180
180
  withdrawFundsFromBridgeOnL1(amount, blockNumber, messageIndex, siblingPath) {
181
181
  return this.l1TokenPortalManager.withdrawFunds(amount, this.ethAccount, BigInt(blockNumber), messageIndex, siblingPath);
@@ -44,12 +44,14 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
44
44
  const uniswapFeeTier = 3000n;
45
45
  const minimumOutputAmount = 0n;
46
46
  let cheatCodes;
47
+ let version;
47
48
  beforeAll(async ()=>{
48
49
  ({ aztecNode, pxe, logger, publicClient, walletClient, ownerWallet, sponsorWallet, deployL1ContractsValues, cheatCodes } = await setup());
49
50
  if (Number(await publicClient.getBlockNumber()) < expectedForkBlockNumber) {
50
51
  throw new Error('This test must be run on a fork of mainnet with the expected fork block');
51
52
  }
52
53
  rollup = new RollupContract(deployL1ContractsValues.publicClient, deployL1ContractsValues.l1ContractAddresses.rollupAddress);
54
+ version = Number(await rollup.getVersion());
53
55
  ownerAddress = ownerWallet.getAddress();
54
56
  // sponsorAddress = sponsorWallet.getAddress();
55
57
  ownerEthAddress = EthAddress.fromString((await walletClient.getAddresses())[0]);
@@ -135,7 +137,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
135
137
  ]);
136
138
  const swapPrivateLeaf = sha256ToField([
137
139
  uniswapL2Contract.address,
138
- new Fr(1),
140
+ new Fr(version),
139
141
  EthAddress.fromString(uniswapPortal.address).toBuffer32(),
140
142
  new Fr(publicClient.chain.id),
141
143
  swapPrivateContent
@@ -148,7 +150,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
148
150
  ]);
149
151
  const withdrawLeaf = sha256ToField([
150
152
  wethCrossChainHarness.l2Bridge.address,
151
- new Fr(1),
153
+ new Fr(version),
152
154
  wethCrossChainHarness.tokenPortalAddress.toBuffer32(),
153
155
  new Fr(publicClient.chain.id),
154
156
  withdrawContent
@@ -532,7 +534,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
532
534
  ]);
533
535
  const swapPrivateLeaf = sha256ToField([
534
536
  uniswapL2Contract.address,
535
- new Fr(1),
537
+ new Fr(version),
536
538
  EthAddress.fromString(uniswapPortal.address).toBuffer32(),
537
539
  new Fr(publicClient.chain.id),
538
540
  swapPrivateContent
@@ -545,7 +547,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
545
547
  ]);
546
548
  const withdrawLeaf = sha256ToField([
547
549
  wethCrossChainHarness.l2Bridge.address,
548
- new Fr(1),
550
+ new Fr(version),
549
551
  wethCrossChainHarness.tokenPortalAddress.toBuffer32(),
550
552
  new Fr(publicClient.chain.id),
551
553
  withdrawContent
@@ -612,7 +614,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
612
614
  ]);
613
615
  const swapPublicLeaf = sha256ToField([
614
616
  uniswapL2Contract.address,
615
- new Fr(1),
617
+ new Fr(version),
616
618
  EthAddress.fromString(uniswapPortal.address).toBuffer32(),
617
619
  new Fr(publicClient.chain.id),
618
620
  swapPublicContent
@@ -625,7 +627,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
625
627
  ]);
626
628
  const withdrawLeaf = sha256ToField([
627
629
  wethCrossChainHarness.l2Bridge.address,
628
- new Fr(1),
630
+ new Fr(version),
629
631
  wethCrossChainHarness.tokenPortalAddress.toBuffer32(),
630
632
  new Fr(publicClient.chain.id),
631
633
  withdrawContent