@aztec/end-to-end 0.78.1 → 0.80.0

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 (60) hide show
  1. package/dest/bench/utils.d.ts +1 -13
  2. package/dest/bench/utils.d.ts.map +1 -1
  3. package/dest/bench/utils.js +6 -6
  4. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +2 -1
  5. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  6. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +2 -1
  7. package/dest/e2e_epochs/epochs_test.d.ts +1 -1
  8. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  9. package/dest/e2e_epochs/epochs_test.js +1 -1
  10. package/dest/e2e_fees/fees_test.d.ts +3 -1
  11. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  12. package/dest/e2e_fees/fees_test.js +3 -1
  13. package/dest/e2e_p2p/p2p_network.d.ts +1 -1
  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_prover/e2e_prover_test.d.ts +3 -1
  17. package/dest/e2e_prover/e2e_prover_test.d.ts.map +1 -1
  18. package/dest/e2e_prover/e2e_prover_test.js +2 -1
  19. package/dest/fixtures/setup_l1_contracts.d.ts +3 -3
  20. package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
  21. package/dest/fixtures/setup_l1_contracts.js +1 -1
  22. package/dest/fixtures/snapshot_manager.d.ts +3 -2
  23. package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
  24. package/dest/fixtures/snapshot_manager.js +27 -23
  25. package/dest/fixtures/utils.d.ts +3 -2
  26. package/dest/fixtures/utils.d.ts.map +1 -1
  27. package/dest/fixtures/utils.js +16 -14
  28. package/dest/sample-dapp/deploy.js +1 -0
  29. package/dest/shared/cross_chain_test_harness.d.ts +1 -1
  30. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  31. package/dest/shared/cross_chain_test_harness.js +2 -1
  32. package/dest/shared/uniswap_l1_l2.d.ts +2 -1
  33. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  34. package/dest/simulators/lending_simulator.d.ts +2 -1
  35. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  36. package/dest/simulators/token_simulator.d.ts.map +1 -1
  37. package/dest/simulators/token_simulator.js +3 -8
  38. package/dest/spartan/setup_test_wallets.d.ts +1 -1
  39. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  40. package/dest/spartan/setup_test_wallets.js +4 -6
  41. package/dest/spartan/utils.d.ts +15 -1
  42. package/dest/spartan/utils.d.ts.map +1 -1
  43. package/dest/spartan/utils.js +75 -12
  44. package/package.json +32 -32
  45. package/src/bench/utils.ts +6 -8
  46. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +1 -1
  47. package/src/e2e_epochs/epochs_test.ts +1 -1
  48. package/src/e2e_fees/fees_test.ts +2 -2
  49. package/src/e2e_p2p/p2p_network.ts +1 -2
  50. package/src/e2e_prover/e2e_prover_test.ts +2 -3
  51. package/src/fixtures/setup_l1_contracts.ts +2 -2
  52. package/src/fixtures/snapshot_manager.ts +42 -30
  53. package/src/fixtures/utils.ts +21 -16
  54. package/src/sample-dapp/deploy.mjs +2 -0
  55. package/src/shared/cross_chain_test_harness.ts +6 -2
  56. package/src/shared/uniswap_l1_l2.ts +1 -1
  57. package/src/simulators/lending_simulator.ts +2 -1
  58. package/src/simulators/token_simulator.ts +5 -8
  59. package/src/spartan/setup_test_wallets.ts +4 -4
  60. package/src/spartan/utils.ts +60 -2
@@ -1 +1 @@
1
- {"version":3,"file":"token_simulator.d.ts","sourceRoot":"","sources":["../../src/simulators/token_simulator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAa,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzF,OAAO,KAA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AAM;IAQrE,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM;IAQ9C,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM;IAQ7C,eAAe,CAAC,OAAO,EAAE,YAAY;IAIrC,gBAAgB,CAAC,OAAO,EAAE,YAAY;IAIvC,WAAW;IAkBX,YAAY;IAgCL,KAAK;CAInB"}
@@ -83,11 +83,9 @@ export class TokenSimulator {
83
83
  async checkPublic() {
84
84
  // public calls
85
85
  const calls = [
86
- await this.token.methods.total_supply().request()
86
+ this.token.methods.total_supply(),
87
+ ...this.accounts.map((address)=>this.token.methods.balance_of_public(address))
87
88
  ];
88
- for (const address of this.accounts){
89
- calls.push(await this.token.methods.balance_of_public(address).request());
90
- }
91
89
  const results = (await Promise.all(chunk(calls, 4).map((batch)=>new BatchCall(this.defaultWallet, batch).simulate()))).flat();
92
90
  expect(results[0]).toEqual(this.totalSupply);
93
91
  // Check that all our balances match
@@ -106,10 +104,7 @@ export class TokenSimulator {
106
104
  defaultLookups.push(address);
107
105
  }
108
106
  }
109
- const defaultCalls = [];
110
- for (const address of defaultLookups){
111
- defaultCalls.push(await this.token.methods.balance_of_private(address).request());
112
- }
107
+ const defaultCalls = defaultLookups.map((address)=>this.token.methods.balance_of_private(address));
113
108
  const results = (await Promise.all(chunk(defaultCalls, 4).map((batch)=>new BatchCall(this.defaultWallet, batch).simulate()))).flat();
114
109
  for(let i = 0; i < defaultLookups.length; i++){
115
110
  expect(results[i]).toEqual(this.balanceOfPrivate(defaultLookups[i]));
@@ -10,7 +10,7 @@ export interface TestWallets {
10
10
  tokenAddress: AztecAddress;
11
11
  }
12
12
  export declare function setupTestWalletsWithTokens(pxeUrl: string, mintAmount: bigint, logger: Logger): Promise<TestWallets>;
13
- export declare function deployTestWalletWithTokens(pxeUrl: string, nodeUrl: string, l1RpcUrl: string, mnemonicOrPrivateKey: string, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number, initialFeeJuice?: bigint): Promise<TestWallets>;
13
+ export declare function deployTestWalletWithTokens(pxeUrl: string, nodeUrl: string, l1RpcUrls: string[], mnemonicOrPrivateKey: string, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number, initialFeeJuice?: bigint): Promise<TestWallets>;
14
14
  export declare function performTransfers({ testWallets, rounds, transferAmount, logger, }: {
15
15
  testWallets: TestWallets;
16
16
  rounds: number;
@@ -1 +1 @@
1
- {"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EAKjB,KAAK,GAAG,EAIT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,GAAG,CAAC;IACT,OAAO,EAAE,0BAA0B,EAAE,CAAC;IACtC,gBAAgB,EAAE,aAAa,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,0BAA0B,CAAC;IAC5C,YAAY,EAAE,YAAY,CAAC;CAC5B;AAMD,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,CAAC,CAYtB;AAED,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,oBAAoB,EAAE,MAAM,EAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,qBAAqB,SAAI,EACzB,eAAe,SAAa,GAC3B,OAAO,CAAC,WAAW,CAAC,CAsCtB;AA2DD,wBAAsB,gBAAgB,CAAC,EACrC,WAAW,EACX,MAAM,EACN,cAAc,EACd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B,MAAM,EAAE,MAAM,CAAC;CAChB,iBAkBA"}
@@ -22,13 +22,13 @@ export async function setupTestWalletsWithTokens(pxeUrl, mintAmount, logger) {
22
22
  recipientWallet
23
23
  };
24
24
  }
25
- export async function deployTestWalletWithTokens(pxeUrl, nodeUrl, l1RpcUrl, mnemonicOrPrivateKey, mintAmount, logger, numberOfFundedWallets = 1, initialFeeJuice = 10n ** 22n) {
25
+ export async function deployTestWalletWithTokens(pxeUrl, nodeUrl, l1RpcUrls, mnemonicOrPrivateKey, mintAmount, logger, numberOfFundedWallets = 1, initialFeeJuice = 10n ** 22n) {
26
26
  const pxe = await createCompatibleClient(pxeUrl, logger);
27
27
  const node = createAztecNodeClient(nodeUrl);
28
28
  const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
29
29
  const recipientWallet = await getSchnorrWalletWithSecretKey(pxe, recipient.secret, recipient.signingKey, recipient.salt);
30
30
  const fundedAccounts = await Promise.all(funded.map((a)=>getSchnorrAccount(pxe, a.secret, a.signingKey, a.salt)));
31
- const claims = await Promise.all(fundedAccounts.map((a)=>bridgeL1FeeJuice(l1RpcUrl, mnemonicOrPrivateKey, pxe, a.getAddress(), initialFeeJuice, logger)));
31
+ const claims = await Promise.all(fundedAccounts.map((a)=>bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, a.getAddress(), initialFeeJuice, logger)));
32
32
  // Progress by 2 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
33
33
  await advanceL2Block(node);
34
34
  await advanceL2Block(node);
@@ -55,11 +55,9 @@ export async function deployTestWalletWithTokens(pxeUrl, nodeUrl, l1RpcUrl, mnem
55
55
  recipientWallet
56
56
  };
57
57
  }
58
- async function bridgeL1FeeJuice(l1RpcUrl, mnemonicOrPrivateKey, pxe, recipient, amount, log) {
58
+ async function bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, recipient, amount, log) {
59
59
  const { l1ChainId } = await pxe.getNodeInfo();
60
- const chain = createEthereumChain([
61
- l1RpcUrl
62
- ], l1ChainId);
60
+ const chain = createEthereumChain(l1RpcUrls, l1ChainId);
63
61
  const { publicClient, walletClient } = createL1Clients(chain.rpcUrls, mnemonicOrPrivateKey, chain.chainInfo);
64
62
  const portal = await L1FeeJuicePortalManager.new(pxe, publicClient, walletClient, log);
65
63
  const claim = await portal.bridgeTokensPublic(recipient, amount, true);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" resolution-mode="require"/>
2
- import type { RollupCheatCodes } from '@aztec/aztec.js/ethereum';
2
+ import type { RollupCheatCodes } from '@aztec/aztec.js/testing';
3
3
  import type { Logger } from '@aztec/foundation/log';
4
4
  import type { SequencerConfig } from '@aztec/sequencer-client';
5
5
  import { ChildProcess } from 'child_process';
@@ -302,6 +302,16 @@ export type EnvConfig = z.infer<typeof envSchema>;
302
302
  export declare function isK8sConfig(config: EnvConfig): config is K8sLocalConfig | K8sGCloudConfig;
303
303
  export declare function isGCloudConfig(config: EnvConfig): config is K8sGCloudConfig;
304
304
  export declare function setupEnvironment(env: unknown): EnvConfig;
305
+ export declare function getAztecBin(): string;
306
+ /**
307
+ * Runs the Aztec binary
308
+ * @param args - The arguments to pass to the Aztec binary
309
+ * @param logger - The logger to use
310
+ * @param env - Optional environment variables to set for the process
311
+ * @returns The exit code of the Aztec binary
312
+ */
313
+ export declare function runAztecBin(args: string[], logger: Logger, env?: Record<string, string>): Promise<number>;
314
+ export declare function runProjectScript(script: string, args: string[], logger: Logger, env?: Record<string, string>): Promise<number>;
305
315
  export declare function startPortForward({ resource, namespace, containerPort, hostPort, }: {
306
316
  resource: string;
307
317
  namespace: string;
@@ -411,5 +421,9 @@ export declare function updateSequencersConfig(env: EnvConfig, config: Partial<S
411
421
  * This is useful for testing, but you should be aware of the implications.
412
422
  */
413
423
  export declare function rollAztecPods(namespace: string): Promise<void>;
424
+ /**
425
+ * Returns the absolute path to the git repository root
426
+ */
427
+ export declare function getGitProjectRoot(): string;
414
428
  export {};
415
429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AAM,iBAef;AAED,wBAAsB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAMjE;AAED,wBAAsB,8BAA8B,CAClD,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,iBAgBf;AAED,wBAAsB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,MAAM,iBAgB3F;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,iBAGxF;AAED,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,qBAIpD;AAED,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAClC,iBAcA;AAED,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,iBAU5F;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,iBAcpD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAW1C"}
@@ -65,10 +65,57 @@ export function setupEnvironment(env) {
65
65
  }
66
66
  return config;
67
67
  }
68
+ /**
69
+ * @param path - The path to the script, relative to the project root
70
+ * @param args - The arguments to pass to the script
71
+ * @param logger - The logger to use
72
+ * @returns The exit code of the script
73
+ */ function runScript(path, args, logger, env) {
74
+ const childProcess = spawn(path, args, {
75
+ stdio: [
76
+ 'ignore',
77
+ 'pipe',
78
+ 'pipe'
79
+ ],
80
+ env: env ? {
81
+ ...process.env,
82
+ ...env
83
+ } : process.env
84
+ });
85
+ return new Promise((resolve, reject)=>{
86
+ childProcess.on('close', (code)=>resolve(code ?? 0));
87
+ childProcess.on('error', reject);
88
+ childProcess.stdout?.on('data', (data)=>{
89
+ logger.info(data.toString());
90
+ });
91
+ childProcess.stderr?.on('data', (data)=>{
92
+ logger.error(data.toString());
93
+ });
94
+ });
95
+ }
96
+ export function getAztecBin() {
97
+ return path.join(getGitProjectRoot(), 'yarn-project/aztec/dest/bin/index.js');
98
+ }
99
+ /**
100
+ * Runs the Aztec binary
101
+ * @param args - The arguments to pass to the Aztec binary
102
+ * @param logger - The logger to use
103
+ * @param env - Optional environment variables to set for the process
104
+ * @returns The exit code of the Aztec binary
105
+ */ export function runAztecBin(args, logger, env) {
106
+ return runScript('node', [
107
+ getAztecBin(),
108
+ ...args
109
+ ], logger, env);
110
+ }
111
+ export function runProjectScript(script, args, logger, env) {
112
+ const scriptPath = script.startsWith('/') ? script : path.join(getGitProjectRoot(), script);
113
+ return runScript(scriptPath, args, logger, env);
114
+ }
68
115
  export async function startPortForward({ resource, namespace, containerPort, hostPort }) {
69
116
  const hostPortAsString = hostPort ? hostPort.toString() : '';
70
117
  logger.info(`kubectl port-forward -n ${namespace} ${resource} ${hostPortAsString}:${containerPort}`);
71
- const process = spawn('kubectl', [
118
+ const process1 = spawn('kubectl', [
72
119
  'port-forward',
73
120
  '-n',
74
121
  namespace,
@@ -85,7 +132,7 @@ export async function startPortForward({ resource, namespace, containerPort, hos
85
132
  });
86
133
  let isResolved = false;
87
134
  const connected = new Promise((resolve)=>{
88
- process.stdout?.on('data', (data)=>{
135
+ process1.stdout?.on('data', (data)=>{
89
136
  const str = data.toString();
90
137
  if (!isResolved && str.includes('Forwarding from')) {
91
138
  isResolved = true;
@@ -96,13 +143,12 @@ export async function startPortForward({ resource, namespace, containerPort, hos
96
143
  }
97
144
  const portNumber = parseInt(str.slice(port + 1));
98
145
  logger.info(`Port forward connected: ${portNumber}`);
99
- logger.info(`Port forward connected: ${portNumber}`);
100
146
  resolve(portNumber);
101
147
  } else {
102
148
  logger.silent(str);
103
149
  }
104
150
  });
105
- process.stderr?.on('data', (data)=>{
151
+ process1.stderr?.on('data', (data)=>{
106
152
  logger.info(data.toString());
107
153
  // It's a strange thing:
108
154
  // If we don't pipe stderr, then the port forwarding does not work.
@@ -110,25 +156,25 @@ export async function startPortForward({ resource, namespace, containerPort, hos
110
156
  // just extremely verbose debug logs.
111
157
  logger.silent(data.toString());
112
158
  });
113
- process.on('close', ()=>{
159
+ process1.on('close', ()=>{
114
160
  if (!isResolved) {
115
161
  isResolved = true;
116
162
  logger.warn('Port forward closed before connection established');
117
163
  resolve(0);
118
164
  }
119
165
  });
120
- process.on('error', (error)=>{
166
+ process1.on('error', (error)=>{
121
167
  logger.error(`Port forward error: ${error}`);
122
168
  resolve(0);
123
169
  });
124
- process.on('exit', (code)=>{
170
+ process1.on('exit', (code)=>{
125
171
  logger.info(`Port forward exited with code ${code}`);
126
172
  resolve(0);
127
173
  });
128
174
  });
129
175
  const port = await connected;
130
176
  return {
131
- process,
177
+ process: process1,
132
178
  port
133
179
  };
134
180
  }
@@ -325,7 +371,7 @@ export async function enableValidatorDynamicBootNode(instanceName, namespace, sp
325
371
  }
326
372
  export async function runAlertCheck(config, alerts, logger) {
327
373
  if (isK8sConfig(config)) {
328
- const { process, port } = await startPortForward({
374
+ const { process: process1, port } = await startPortForward({
329
375
  resource: `svc/metrics-grafana`,
330
376
  namespace: 'metrics',
331
377
  containerPort: config.CONTAINER_METRICS_PORT
@@ -335,7 +381,7 @@ export async function runAlertCheck(config, alerts, logger) {
335
381
  grafanaCredentials: `admin:${config.GRAFANA_PASSWORD}`
336
382
  });
337
383
  await alertChecker.runAlertCheck(alerts);
338
- process.kill();
384
+ process1.kill();
339
385
  } else {
340
386
  logger.info('Not running alert check in non-k8s environment');
341
387
  }
@@ -353,14 +399,14 @@ export async function updateK8sSequencersConfig(args) {
353
399
  const { containerPort, namespace, config } = args;
354
400
  const sequencers = await getSequencers(namespace);
355
401
  for (const sequencer of sequencers){
356
- const { process, port } = await startPortForward({
402
+ const { process: process1, port } = await startPortForward({
357
403
  resource: `pod/${sequencer}`,
358
404
  namespace,
359
405
  containerPort
360
406
  });
361
407
  const url = `http://localhost:${port}`;
362
408
  await updateSequencerConfig(url, config);
363
- process.kill();
409
+ process1.kill();
364
410
  }
365
411
  }
366
412
  export async function updateSequencersConfig(env, config) {
@@ -443,3 +489,20 @@ export async function updateSequencersConfig(env, config) {
443
489
  label: 'app=pxe'
444
490
  });
445
491
  }
492
+ /**
493
+ * Returns the absolute path to the git repository root
494
+ */ export function getGitProjectRoot() {
495
+ try {
496
+ const rootDir = execSync('git rev-parse --show-toplevel', {
497
+ encoding: 'utf-8',
498
+ stdio: [
499
+ 'ignore',
500
+ 'pipe',
501
+ 'ignore'
502
+ ]
503
+ }).trim();
504
+ return rootDir;
505
+ } catch (error) {
506
+ throw new Error(`Failed to determine git project root: ${error}`);
507
+ }
508
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/end-to-end",
3
- "version": "0.78.1",
3
+ "version": "0.80.0",
4
4
  "type": "module",
5
5
  "exports": "./dest/index.js",
6
6
  "inherits": [
@@ -26,36 +26,36 @@
26
26
  "formatting": "run -T prettier --check ./src && run -T eslint ./src"
27
27
  },
28
28
  "dependencies": {
29
- "@aztec/accounts": "0.78.1",
30
- "@aztec/archiver": "0.78.1",
31
- "@aztec/aztec": "0.78.1",
32
- "@aztec/aztec-node": "0.78.1",
33
- "@aztec/aztec.js": "0.78.1",
34
- "@aztec/bb-prover": "0.78.1",
35
- "@aztec/blob-lib": "0.78.1",
36
- "@aztec/blob-sink": "0.78.1",
37
- "@aztec/bot": "0.78.1",
38
- "@aztec/constants": "0.78.1",
39
- "@aztec/entrypoints": "0.78.1",
40
- "@aztec/epoch-cache": "0.78.1",
41
- "@aztec/ethereum": "0.78.1",
42
- "@aztec/foundation": "0.78.1",
43
- "@aztec/kv-store": "0.78.1",
44
- "@aztec/l1-artifacts": "0.78.1",
45
- "@aztec/merkle-tree": "0.78.1",
46
- "@aztec/noir-contracts.js": "0.78.1",
47
- "@aztec/noir-protocol-circuits-types": "0.78.1",
48
- "@aztec/p2p": "0.78.1",
49
- "@aztec/protocol-contracts": "0.78.1",
50
- "@aztec/prover-client": "0.78.1",
51
- "@aztec/prover-node": "0.78.1",
52
- "@aztec/pxe": "0.78.1",
53
- "@aztec/sequencer-client": "0.78.1",
54
- "@aztec/simulator": "0.78.1",
55
- "@aztec/stdlib": "0.78.1",
56
- "@aztec/telemetry-client": "0.78.1",
57
- "@aztec/validator-client": "0.78.1",
58
- "@aztec/world-state": "0.78.1",
29
+ "@aztec/accounts": "0.80.0",
30
+ "@aztec/archiver": "0.80.0",
31
+ "@aztec/aztec": "0.80.0",
32
+ "@aztec/aztec-node": "0.80.0",
33
+ "@aztec/aztec.js": "0.80.0",
34
+ "@aztec/bb-prover": "0.80.0",
35
+ "@aztec/blob-lib": "0.80.0",
36
+ "@aztec/blob-sink": "0.80.0",
37
+ "@aztec/bot": "0.80.0",
38
+ "@aztec/constants": "0.80.0",
39
+ "@aztec/entrypoints": "0.80.0",
40
+ "@aztec/epoch-cache": "0.80.0",
41
+ "@aztec/ethereum": "0.80.0",
42
+ "@aztec/foundation": "0.80.0",
43
+ "@aztec/kv-store": "0.80.0",
44
+ "@aztec/l1-artifacts": "0.80.0",
45
+ "@aztec/merkle-tree": "0.80.0",
46
+ "@aztec/noir-contracts.js": "0.80.0",
47
+ "@aztec/noir-protocol-circuits-types": "0.80.0",
48
+ "@aztec/p2p": "0.80.0",
49
+ "@aztec/protocol-contracts": "0.80.0",
50
+ "@aztec/prover-client": "0.80.0",
51
+ "@aztec/prover-node": "0.80.0",
52
+ "@aztec/pxe": "0.80.0",
53
+ "@aztec/sequencer-client": "0.80.0",
54
+ "@aztec/simulator": "0.80.0",
55
+ "@aztec/stdlib": "0.80.0",
56
+ "@aztec/telemetry-client": "0.80.0",
57
+ "@aztec/validator-client": "0.80.0",
58
+ "@aztec/world-state": "0.80.0",
59
59
  "@iarna/toml": "^2.2.5",
60
60
  "@jest/globals": "^29.5.0",
61
61
  "@noble/curves": "^1.0.0",
@@ -94,7 +94,7 @@
94
94
  "tslib": "^2.4.0",
95
95
  "typescript": "^5.0.4",
96
96
  "util": "^0.12.5",
97
- "viem": "2.22.8",
97
+ "viem": "2.23.7",
98
98
  "zod": "^3.23.8"
99
99
  },
100
100
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  import type { AztecNodeService } from '@aztec/aztec-node';
2
2
  import { type AztecNode, BatchCall, INITIAL_L2_BLOCK_NUM, type SentTx, type WaitOpts } from '@aztec/aztec.js';
3
- import { mean, stdDev, timesParallel } from '@aztec/foundation/collection';
3
+ import { mean, stdDev, times } from '@aztec/foundation/collection';
4
4
  import { randomInt } from '@aztec/foundation/crypto';
5
5
  import { BenchmarkingContract } from '@aztec/noir-contracts.js/Benchmarking';
6
6
  import { type PXEService, type PXEServiceConfig, createPXEService } from '@aztec/pxe/server';
@@ -126,7 +126,7 @@ export function getFolderSize(path: string): number {
126
126
  * @param heavyPublicCompute - Whether the transactions include heavy public compute (like a big sha256).
127
127
  * @returns A BatchCall instance.
128
128
  */
129
- export async function makeCall(
129
+ function makeCall(
130
130
  index: number,
131
131
  context: EndToEndContext,
132
132
  contract: BenchmarkingContract,
@@ -135,13 +135,11 @@ export async function makeCall(
135
135
  const owner = context.wallet.getAddress();
136
136
  const sender = owner;
137
137
  if (heavyPublicCompute) {
138
- return new BatchCall(context.wallet, [
139
- await contract.methods.sha256_hash_2048(randomBytesAsBigInts(2048)).request(),
140
- ]);
138
+ return new BatchCall(context.wallet, [contract.methods.sha256_hash_2048(randomBytesAsBigInts(2048))]);
141
139
  } else {
142
140
  return new BatchCall(context.wallet, [
143
- await contract.methods.create_note(owner, sender, index + 1).request(),
144
- await contract.methods.increment_balance(owner, index + 1).request(),
141
+ contract.methods.create_note(owner, sender, index + 1),
142
+ contract.methods.increment_balance(owner, index + 1),
145
143
  ]);
146
144
  }
147
145
  }
@@ -161,7 +159,7 @@ export async function sendTxs(
161
159
  contract: BenchmarkingContract,
162
160
  heavyPublicCompute: boolean = false,
163
161
  ): Promise<SentTx[]> {
164
- const calls = await timesParallel(txCount, index => makeCall(index, context, contract, heavyPublicCompute));
162
+ const calls = times(txCount, index => makeCall(index, context, contract, heavyPublicCompute));
165
163
  context.logger.info(`Creating ${txCount} txs`);
166
164
  const provenTxs = await Promise.all(calls.map(call => call.prove({ skipPublicSimulation: true })));
167
165
  context.logger.info(`Sending ${txCount} txs`);
@@ -4,13 +4,13 @@ import {
4
4
  type AccountWallet,
5
5
  AztecAddress,
6
6
  type AztecNode,
7
- CheatCodes,
8
7
  type CompleteAddress,
9
8
  EthAddress,
10
9
  type Logger,
11
10
  type PXE,
12
11
  createLogger,
13
12
  } from '@aztec/aztec.js';
13
+ import { CheatCodes } from '@aztec/aztec.js/testing';
14
14
  import { type ViemPublicClient, createL1Clients, deployL1Contract } from '@aztec/ethereum';
15
15
  import { InboxAbi, OutboxAbi, RollupAbi, TestERC20Abi, TestERC20Bytecode } from '@aztec/l1-artifacts';
16
16
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
@@ -1,7 +1,7 @@
1
1
  import { AztecNodeService } from '@aztec/aztec-node';
2
2
  import { Fr, type Logger, getTimestampRangeForEpoch, retryUntil, sleep } from '@aztec/aztec.js';
3
- import { ChainMonitor } from '@aztec/aztec.js/ethereum';
4
3
  import { RollupContract } from '@aztec/ethereum/contracts';
4
+ import { ChainMonitor } from '@aztec/ethereum/test';
5
5
  import { DelayedTxUtils, type Delayer, waitUntilL1Timestamp } from '@aztec/ethereum/test';
6
6
  import { randomBytes } from '@aztec/foundation/crypto';
7
7
  import { withLogNameSuffix } from '@aztec/foundation/log';
@@ -3,15 +3,15 @@ import {
3
3
  type AccountWallet,
4
4
  type AztecAddress,
5
5
  type AztecNode,
6
- ChainMonitor,
7
- CheatCodes,
8
6
  type Logger,
9
7
  type PXE,
10
8
  createLogger,
11
9
  sleep,
12
10
  } from '@aztec/aztec.js';
11
+ import { CheatCodes } from '@aztec/aztec.js/testing';
13
12
  import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
14
13
  import { type DeployL1ContractsArgs, RollupContract, createL1Clients } from '@aztec/ethereum';
14
+ import { ChainMonitor } from '@aztec/ethereum/test';
15
15
  import { EthAddress } from '@aztec/foundation/eth-address';
16
16
  import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
17
17
  import { AppSubscriptionContract } from '@aztec/noir-contracts.js/AppSubscription';
@@ -2,10 +2,9 @@ import { getSchnorrWalletWithSecretKey } from '@aztec/accounts/schnorr';
2
2
  import type { InitialAccountData } from '@aztec/accounts/testing';
3
3
  import type { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
4
4
  import type { AccountWalletWithSecretKey } from '@aztec/aztec.js';
5
- import { ChainMonitor } from '@aztec/aztec.js/ethereum';
6
5
  import { RollupContract, getExpectedAddress, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
7
6
  import { L1TxUtilsWithBlobs } from '@aztec/ethereum/l1-tx-utils-with-blobs';
8
- import { EthCheatCodesWithState } from '@aztec/ethereum/test';
7
+ import { ChainMonitor, EthCheatCodesWithState } from '@aztec/ethereum/test';
9
8
  import { type Logger, createLogger } from '@aztec/foundation/log';
10
9
  import { ForwarderAbi, ForwarderBytecode, RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
11
10
  import { SpamContract } from '@aztec/noir-contracts.js/Spam';
@@ -8,18 +8,17 @@ import { type Archiver, createArchiver } from '@aztec/archiver';
8
8
  import {
9
9
  type AccountWalletWithSecretKey,
10
10
  type AztecNode,
11
- type CheatCodes,
12
11
  type CompleteAddress,
13
- type DeployL1ContractsReturnType,
14
12
  EthAddress,
15
13
  type Logger,
16
14
  type PXE,
17
15
  createLogger,
18
- deployL1Contract,
19
16
  } from '@aztec/aztec.js';
17
+ import { CheatCodes } from '@aztec/aztec.js/testing';
20
18
  import { BBCircuitVerifier, type ClientProtocolCircuitVerifier, TestCircuitVerifier } from '@aztec/bb-prover';
21
19
  import { createBlobSinkClient } from '@aztec/blob-sink/client';
22
20
  import type { BlobSinkServer } from '@aztec/blob-sink/server';
21
+ import { type DeployL1ContractsReturnType, deployL1Contract } from '@aztec/ethereum';
23
22
  import { Buffer32 } from '@aztec/foundation/buffer';
24
23
  import { HonkVerifierAbi, HonkVerifierBytecode, RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
25
24
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
@@ -1,5 +1,5 @@
1
- import { type Logger, deployL1Contracts } from '@aztec/aztec.js';
2
- import type { DeployL1ContractsArgs, L1ContractsConfig } from '@aztec/ethereum';
1
+ import type { Logger } from '@aztec/aztec.js';
2
+ import { type DeployL1ContractsArgs, type L1ContractsConfig, deployL1Contracts } from '@aztec/ethereum';
3
3
  import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
4
4
  import { ProtocolContractAddress, protocolContractTreeRoot } from '@aztec/protocol-contracts';
5
5