@aztec/end-to-end 0.0.1-commit.d431d1c → 0.0.1-commit.e2b2873ed

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 (174) hide show
  1. package/dest/bench/client_flows/client_flows_benchmark.d.ts +2 -2
  2. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  3. package/dest/bench/client_flows/client_flows_benchmark.js +31 -16
  4. package/dest/bench/client_flows/config.d.ts +2 -2
  5. package/dest/bench/client_flows/config.d.ts.map +1 -1
  6. package/dest/bench/client_flows/config.js +18 -0
  7. package/dest/bench/utils.d.ts +5 -4
  8. package/dest/bench/utils.d.ts.map +1 -1
  9. package/dest/bench/utils.js +9 -7
  10. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +4 -2
  11. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  12. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +17 -8
  13. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +2 -2
  14. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  15. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +3 -2
  16. package/dest/e2e_deploy_contract/deploy_test.d.ts +2 -2
  17. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  18. package/dest/e2e_epochs/epochs_test.d.ts +7 -1
  19. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  20. package/dest/e2e_epochs/epochs_test.js +38 -10
  21. package/dest/e2e_fees/bridging_race.notest.js +1 -1
  22. package/dest/e2e_fees/fees_test.d.ts +2 -2
  23. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  24. package/dest/e2e_fees/fees_test.js +11 -11
  25. package/dest/e2e_l1_publisher/write_json.d.ts +4 -3
  26. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
  27. package/dest/e2e_l1_publisher/write_json.js +1 -7
  28. package/dest/e2e_nested_contract/nested_contract_test.d.ts +1 -1
  29. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  30. package/dest/e2e_nested_contract/nested_contract_test.js +2 -2
  31. package/dest/e2e_p2p/p2p_network.d.ts +2 -2
  32. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  33. package/dest/e2e_p2p/p2p_network.js +6 -2
  34. package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
  35. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
  36. package/dest/e2e_p2p/reqresp/utils.js +153 -0
  37. package/dest/e2e_p2p/shared.d.ts +6 -6
  38. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  39. package/dest/e2e_p2p/shared.js +14 -17
  40. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
  41. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
  42. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
  43. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
  44. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
  45. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
  46. package/dest/e2e_token_contract/token_contract_test.d.ts +4 -2
  47. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  48. package/dest/e2e_token_contract/token_contract_test.js +13 -3
  49. package/dest/fixtures/e2e_prover_test.d.ts +2 -2
  50. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  51. package/dest/fixtures/e2e_prover_test.js +8 -5
  52. package/dest/fixtures/ha_setup.d.ts +71 -0
  53. package/dest/fixtures/ha_setup.d.ts.map +1 -0
  54. package/dest/fixtures/ha_setup.js +114 -0
  55. package/dest/fixtures/index.d.ts +2 -1
  56. package/dest/fixtures/index.d.ts.map +1 -1
  57. package/dest/fixtures/index.js +1 -0
  58. package/dest/fixtures/setup.d.ts +19 -17
  59. package/dest/fixtures/setup.d.ts.map +1 -1
  60. package/dest/fixtures/setup.js +42 -95
  61. package/dest/fixtures/setup_p2p_test.d.ts +12 -8
  62. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  63. package/dest/fixtures/setup_p2p_test.js +29 -21
  64. package/dest/fixtures/token_utils.d.ts +1 -1
  65. package/dest/fixtures/token_utils.d.ts.map +1 -1
  66. package/dest/fixtures/token_utils.js +7 -4
  67. package/dest/shared/cross_chain_test_harness.d.ts +3 -4
  68. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  69. package/dest/shared/cross_chain_test_harness.js +11 -11
  70. package/dest/shared/gas_portal_test_harness.js +1 -1
  71. package/dest/shared/submit-transactions.d.ts +4 -4
  72. package/dest/shared/submit-transactions.d.ts.map +1 -1
  73. package/dest/shared/submit-transactions.js +9 -11
  74. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  75. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  76. package/dest/shared/uniswap_l1_l2.js +20 -18
  77. package/dest/simulators/lending_simulator.js +2 -2
  78. package/dest/simulators/token_simulator.d.ts +1 -1
  79. package/dest/simulators/token_simulator.d.ts.map +1 -1
  80. package/dest/simulators/token_simulator.js +2 -23
  81. package/dest/spartan/setup_test_wallets.d.ts +2 -2
  82. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  83. package/dest/spartan/setup_test_wallets.js +64 -35
  84. package/dest/spartan/tx_metrics.d.ts +38 -2
  85. package/dest/spartan/tx_metrics.d.ts.map +1 -1
  86. package/dest/spartan/tx_metrics.js +178 -4
  87. package/dest/spartan/utils/bot.d.ts +27 -0
  88. package/dest/spartan/utils/bot.d.ts.map +1 -0
  89. package/dest/spartan/utils/bot.js +141 -0
  90. package/dest/spartan/utils/chaos.d.ts +79 -0
  91. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  92. package/dest/spartan/utils/chaos.js +142 -0
  93. package/dest/spartan/utils/clients.d.ts +39 -0
  94. package/dest/spartan/utils/clients.d.ts.map +1 -0
  95. package/dest/spartan/utils/clients.js +90 -0
  96. package/dest/spartan/utils/config.d.ts +39 -0
  97. package/dest/spartan/utils/config.d.ts.map +1 -0
  98. package/dest/spartan/utils/config.js +21 -0
  99. package/dest/spartan/utils/health.d.ts +63 -0
  100. package/dest/spartan/utils/health.d.ts.map +1 -0
  101. package/dest/spartan/utils/health.js +202 -0
  102. package/dest/spartan/utils/helm.d.ts +15 -0
  103. package/dest/spartan/utils/helm.d.ts.map +1 -0
  104. package/dest/spartan/utils/helm.js +47 -0
  105. package/dest/spartan/utils/index.d.ts +9 -0
  106. package/dest/spartan/utils/index.d.ts.map +1 -0
  107. package/dest/spartan/utils/index.js +18 -0
  108. package/dest/spartan/utils/k8s.d.ts +126 -0
  109. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  110. package/dest/spartan/utils/k8s.js +375 -0
  111. package/dest/spartan/utils/nodes.d.ts +41 -0
  112. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  113. package/dest/spartan/utils/nodes.js +461 -0
  114. package/dest/spartan/utils/scripts.d.ts +30 -0
  115. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  116. package/dest/spartan/utils/scripts.js +81 -0
  117. package/dest/spartan/utils.d.ts +2 -260
  118. package/dest/spartan/utils.d.ts.map +1 -1
  119. package/dest/spartan/utils.js +1 -942
  120. package/dest/test-wallet/test_wallet.d.ts +82 -0
  121. package/dest/test-wallet/test_wallet.d.ts.map +1 -0
  122. package/dest/test-wallet/test_wallet.js +214 -0
  123. package/dest/test-wallet/utils.d.ts +41 -0
  124. package/dest/test-wallet/utils.d.ts.map +1 -0
  125. package/dest/test-wallet/utils.js +71 -0
  126. package/package.json +43 -39
  127. package/src/bench/client_flows/client_flows_benchmark.ts +19 -36
  128. package/src/bench/client_flows/config.ts +9 -1
  129. package/src/bench/utils.ts +10 -8
  130. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +20 -14
  131. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +7 -8
  132. package/src/e2e_deploy_contract/deploy_test.ts +3 -3
  133. package/src/e2e_epochs/epochs_test.ts +71 -35
  134. package/src/e2e_fees/bridging_race.notest.ts +2 -5
  135. package/src/e2e_fees/fees_test.ts +21 -40
  136. package/src/e2e_l1_publisher/write_json.ts +3 -8
  137. package/src/e2e_nested_contract/nested_contract_test.ts +3 -5
  138. package/src/e2e_p2p/inactivity_slash_test.ts +4 -4
  139. package/src/e2e_p2p/p2p_network.ts +20 -14
  140. package/src/e2e_p2p/reqresp/utils.ts +207 -0
  141. package/src/e2e_p2p/shared.ts +22 -22
  142. package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
  143. package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
  144. package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
  145. package/src/e2e_token_contract/token_contract_test.ts +14 -7
  146. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  147. package/src/fixtures/e2e_prover_test.ts +8 -13
  148. package/src/fixtures/ha_setup.ts +184 -0
  149. package/src/fixtures/index.ts +1 -0
  150. package/src/fixtures/setup.ts +50 -128
  151. package/src/fixtures/setup_p2p_test.ts +31 -27
  152. package/src/fixtures/token_utils.ts +6 -5
  153. package/src/guides/up_quick_start.sh +3 -3
  154. package/src/shared/cross_chain_test_harness.ts +13 -27
  155. package/src/shared/gas_portal_test_harness.ts +1 -1
  156. package/src/shared/submit-transactions.ts +11 -16
  157. package/src/shared/uniswap_l1_l2.ts +21 -30
  158. package/src/simulators/lending_simulator.ts +2 -2
  159. package/src/simulators/token_simulator.ts +1 -29
  160. package/src/spartan/setup_test_wallets.ts +75 -25
  161. package/src/spartan/tx_metrics.ts +152 -7
  162. package/src/spartan/utils/bot.ts +185 -0
  163. package/src/spartan/utils/chaos.ts +253 -0
  164. package/src/spartan/utils/clients.ts +100 -0
  165. package/src/spartan/utils/config.ts +27 -0
  166. package/src/spartan/utils/health.ts +255 -0
  167. package/src/spartan/utils/helm.ts +84 -0
  168. package/src/spartan/utils/index.ts +64 -0
  169. package/src/spartan/utils/k8s.ts +527 -0
  170. package/src/spartan/utils/nodes.ts +538 -0
  171. package/src/spartan/utils/scripts.ts +99 -0
  172. package/src/spartan/utils.ts +1 -1246
  173. package/src/test-wallet/test_wallet.ts +305 -0
  174. package/src/test-wallet/utils.ts +112 -0
@@ -26,7 +26,6 @@ import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
26
26
  import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
27
27
  import { GasSettings } from '@aztec/stdlib/gas';
28
28
  import { deriveSigningKey } from '@aztec/stdlib/keys';
29
- import { TestWallet } from '@aztec/test-wallet/server';
30
29
 
31
30
  import { MNEMONIC } from '../../fixtures/fixtures.js';
32
31
  import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../../fixtures/setup.js';
@@ -37,6 +36,7 @@ import {
37
36
  FeeJuicePortalTestingHarnessFactory,
38
37
  type GasBridgingTestHarness,
39
38
  } from '../../shared/gas_portal_test_harness.js';
39
+ import { TestWallet } from '../../test-wallet/test_wallet.js';
40
40
  import { ProxyLogger } from './benchmark.js';
41
41
  import { type ClientFlowsConfig, FULL_FLOWS_CONFIG, KEY_FLOWS_CONFIG } from './config.js';
42
42
 
@@ -138,10 +138,10 @@ export class ClientFlowsBenchmark {
138
138
  });
139
139
  await this.applyBaseSetup();
140
140
 
141
- await this.context.aztecNodeService!.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
141
+ await this.context.aztecNodeService.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
142
142
 
143
143
  const rollupContract = RollupContract.getFromConfig(this.context.config);
144
- this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider!, this.logger, 200).start();
144
+ this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider, this.logger, 200).start();
145
145
 
146
146
  return this;
147
147
  }
@@ -156,21 +156,16 @@ export class ClientFlowsBenchmark {
156
156
  const { claimSecret: secret, messageLeafIndex: index } = claim;
157
157
  await this.feeJuiceContract.methods
158
158
  .claim(address, claim.claimAmount, secret, index)
159
- .send({ from: this.adminAddress })
160
- .wait();
159
+ .send({ from: this.adminAddress });
161
160
  }
162
161
 
163
162
  /** Admin mints bananaCoin tokens privately to the target address and redeems them. */
164
163
  async mintPrivateBananas(amount: bigint, address: AztecAddress) {
165
- const balanceBefore = await this.bananaCoin.methods
166
- .balance_of_private(address)
167
- .simulate({ from: this.adminAddress });
164
+ const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({ from: address });
168
165
 
169
166
  await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
170
167
 
171
- const balanceAfter = await this.bananaCoin.methods
172
- .balance_of_private(address)
173
- .simulate({ from: this.adminAddress });
168
+ const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({ from: address });
174
169
  expect(balanceAfter).toEqual(balanceBefore + amount);
175
170
  }
176
171
 
@@ -208,7 +203,7 @@ export class ClientFlowsBenchmark {
208
203
  const [{ address: adminAddress }, { address: sequencerAddress }] = deployedAccounts;
209
204
 
210
205
  this.adminWallet = this.context.wallet;
211
- this.aztecNode = this.context.aztecNodeService!;
206
+ this.aztecNode = this.context.aztecNodeService;
212
207
  this.cheatCodes = this.context.cheatCodes;
213
208
 
214
209
  this.adminAddress = adminAddress;
@@ -236,8 +231,8 @@ export class ClientFlowsBenchmark {
236
231
  this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
237
232
 
238
233
  this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
239
- aztecNode: this.context.aztecNodeService!,
240
- aztecNodeAdmin: this.context.aztecNodeService!,
234
+ aztecNode: this.context.aztecNodeService,
235
+ aztecNodeAdmin: this.context.aztecNodeService,
241
236
  l1Client: this.context.deployL1ContractsValues.l1Client,
242
237
  wallet: this.adminWallet,
243
238
  logger: this.logger,
@@ -252,9 +247,7 @@ export class ClientFlowsBenchmark {
252
247
  'BC',
253
248
  'BC',
254
249
  18n,
255
- )
256
- .send({ from: this.adminAddress })
257
- .wait();
250
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
258
251
  this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
259
252
  this.bananaCoin = bananaCoin;
260
253
  this.bananaCoinInstance = bananaCoinInstance;
@@ -268,9 +261,7 @@ export class ClientFlowsBenchmark {
268
261
  'CBC',
269
262
  'CBC',
270
263
  18n,
271
- )
272
- .send({ from: this.adminAddress })
273
- .wait();
264
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
274
265
  this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
275
266
  this.candyBarCoin = candyBarCoin;
276
267
  this.candyBarCoinInstance = candyBarCoinInstance;
@@ -286,9 +277,7 @@ export class ClientFlowsBenchmark {
286
277
  this.adminWallet,
287
278
  bananaCoin.address,
288
279
  this.adminAddress,
289
- )
290
- .send({ from: this.adminAddress })
291
- .wait();
280
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
292
281
 
293
282
  this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
294
283
 
@@ -336,12 +325,10 @@ export class ClientFlowsBenchmark {
336
325
  const benchysAddress = benchysAccountManager.address;
337
326
  const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
338
327
  const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
339
- await behchysDeployMethod
340
- .send({
341
- from: AztecAddress.ZERO,
342
- fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
343
- })
344
- .wait();
328
+ await behchysDeployMethod.send({
329
+ from: AztecAddress.ZERO,
330
+ fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
331
+ });
345
332
  // Register benchy on the user's Wallet, where we're going to be interacting from
346
333
  const accountManager = await this.userWallet.createAccount({
347
334
  secret: benchysAccount.getSecretKey(),
@@ -359,19 +346,15 @@ export class ClientFlowsBenchmark {
359
346
  'LPT',
360
347
  'LPT',
361
348
  18n,
362
- )
363
- .send({ from: this.adminAddress })
364
- .wait();
349
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
365
350
  const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
366
351
  this.adminWallet,
367
352
  this.bananaCoin.address,
368
353
  this.candyBarCoin.address,
369
354
  liquidityToken.address,
370
- )
371
- .send({ from: this.adminAddress })
372
- .wait();
355
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
373
356
  this.logger.info(`AMM deployed at ${amm.address}`);
374
- await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress }).wait();
357
+ await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress });
375
358
  this.liquidityToken = liquidityToken;
376
359
  this.liquidityTokenInstance = liquidityTokenInstance;
377
360
  this.amm = amm;
@@ -6,7 +6,7 @@ export type ClientFlowConfig = {
6
6
  recursions?: number[];
7
7
  };
8
8
 
9
- type ClientFlows = 'accountDeployments' | 'deployments' | 'transfers' | 'bridging' | 'amm';
9
+ type ClientFlows = 'accountDeployments' | 'deployments' | 'transfers' | 'bridging' | 'amm' | 'storageProof';
10
10
 
11
11
  export type ClientFlowsConfig = {
12
12
  [key in ClientFlows]: ClientFlowConfig;
@@ -34,6 +34,10 @@ export const KEY_FLOWS_CONFIG: ClientFlowsConfig = {
34
34
  feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
35
35
  recursions: [0, 1],
36
36
  },
37
+ storageProof: {
38
+ accounts: ['ecdsar1'],
39
+ feePaymentMethods: ['sponsored_fpc'],
40
+ },
37
41
  };
38
42
 
39
43
  export const FULL_FLOWS_CONFIG: ClientFlowsConfig = {
@@ -58,4 +62,8 @@ export const FULL_FLOWS_CONFIG: ClientFlowsConfig = {
58
62
  feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
59
63
  recursions: [0, 1, 2],
60
64
  },
65
+ storageProof: {
66
+ accounts: ['ecdsar1', 'schnorr'],
67
+ feePaymentMethods: ['sponsored_fpc', 'private_fpc'],
68
+ },
61
69
  };
@@ -1,8 +1,10 @@
1
1
  import type { AztecNodeService } from '@aztec/aztec-node';
2
2
  import { AztecAddress } from '@aztec/aztec.js/addresses';
3
- import { BatchCall, type SentTx, type WaitOpts } from '@aztec/aztec.js/contracts';
3
+ import { BatchCall, NO_WAIT, type WaitOpts } from '@aztec/aztec.js/contracts';
4
+ import { waitForTx } from '@aztec/aztec.js/node';
4
5
  import { mean, stdDev, times } from '@aztec/foundation/collection';
5
6
  import { BenchmarkingContract } from '@aztec/noir-test-contracts.js/Benchmarking';
7
+ import type { TxHash } from '@aztec/stdlib/tx';
6
8
  import type { MetricDefinition } from '@aztec/telemetry-client';
7
9
  import type { BenchmarkDataPoint, BenchmarkMetricsType, BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
8
10
 
@@ -23,10 +25,10 @@ export async function benchmarkSetup(
23
25
  ) {
24
26
  const context = await setup(1, { ...opts, telemetryConfig: { benchmark: true } });
25
27
  const defaultAccountAddress = context.accounts[0];
26
- const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress }).deployed();
28
+ const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress });
27
29
  context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
28
30
  const sequencer = (context.aztecNode as AztecNodeService).getSequencer()!;
29
- const telemetry = context.telemetryClient! as BenchmarkTelemetryClient;
31
+ const telemetry = context.telemetryClient as BenchmarkTelemetryClient;
30
32
  context.logger.warn(`Cleared benchmark data points from setup`);
31
33
  telemetry.clear();
32
34
  const origTeardown = context.teardown.bind(context);
@@ -142,18 +144,18 @@ export async function sendTxs(
142
144
  context: EndToEndContext,
143
145
  contract: BenchmarkingContract,
144
146
  heavyPublicCompute: boolean = false,
145
- ): Promise<SentTx[]> {
147
+ ): Promise<TxHash[]> {
146
148
  const calls = await Promise.all(times(txCount, index => makeCall(index, context, contract, heavyPublicCompute)));
147
149
  context.logger.info(`Creating ${txCount} txs`);
148
150
  const [from] = context.accounts;
149
151
  context.logger.info(`Sending ${txCount} txs`);
150
- return calls.map(call => call.send({ from }));
152
+ return Promise.all(calls.map(call => call.send({ from, wait: NO_WAIT })));
151
153
  }
152
154
 
153
- export async function waitTxs(txs: SentTx[], context: EndToEndContext, txWaitOpts?: WaitOpts) {
155
+ export async function waitTxs(txs: TxHash[], context: EndToEndContext, txWaitOpts?: WaitOpts) {
154
156
  context.logger.info(`Awaiting ${txs.length} txs to be mined`);
155
- await Promise.all(txs.map(tx => tx.wait(txWaitOpts)));
156
- context.logger.info(`All ${txs.length} txs have been mined`);
157
+ await Promise.all(txs.map(txHash => waitForTx(context.aztecNode, txHash, txWaitOpts)));
158
+ context.logger.info(`${txs.length} txs have been mined`);
157
159
  }
158
160
 
159
161
  function randomBytesAsBigInts(length: number): bigint[] {
@@ -7,14 +7,15 @@ import type { TxHash } from '@aztec/aztec.js/tx';
7
7
  import type { CheatCodes } from '@aztec/aztec/testing';
8
8
  import type { TokenContract } from '@aztec/noir-contracts.js/Token';
9
9
  import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
10
+ import { GenericProxyContract } from '@aztec/noir-test-contracts.js/GenericProxy';
10
11
  import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
11
12
  import type { SequencerClient } from '@aztec/sequencer-client';
12
- import type { TestWallet } from '@aztec/test-wallet/server';
13
13
 
14
14
  import { jest } from '@jest/globals';
15
15
 
16
16
  import { type EndToEndContext, deployAccounts, publicDeployAccounts, setup, teardown } from '../fixtures/setup.js';
17
17
  import { TokenSimulator } from '../simulators/token_simulator.js';
18
+ import type { TestWallet } from '../test-wallet/test_wallet.js';
18
19
 
19
20
  export class Role {
20
21
  private isAdmin = false;
@@ -53,6 +54,7 @@ export class BlacklistTokenContractTest {
53
54
  asset!: TokenBlacklistContract;
54
55
  tokenSim!: TokenSimulator;
55
56
  badAccount!: InvalidAccountContract;
57
+ proxy!: GenericProxyContract;
56
58
  cheatCodes!: CheatCodes;
57
59
  sequencer!: SequencerClient;
58
60
  aztecNode!: AztecNode;
@@ -92,7 +94,7 @@ export class BlacklistTokenContractTest {
92
94
  });
93
95
 
94
96
  this.cheatCodes = this.context.cheatCodes;
95
- this.aztecNode = this.context.aztecNodeService!;
97
+ this.aztecNode = this.context.aztecNodeService;
96
98
  this.sequencer = this.context.sequencer!;
97
99
  this.wallet = this.context.wallet;
98
100
  this.adminAddress = deployedAccounts[0].address;
@@ -105,15 +107,22 @@ export class BlacklistTokenContractTest {
105
107
  await publicDeployAccounts(this.wallet, [this.adminAddress, this.otherAddress, this.blacklistedAddress]);
106
108
 
107
109
  this.logger.verbose(`Deploying TokenContract...`);
108
- this.asset = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress)
109
- .send({ from: this.adminAddress })
110
- .deployed();
110
+ this.asset = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress).send({
111
+ from: this.adminAddress,
112
+ });
111
113
  this.logger.verbose(`Token deployed to ${this.asset.address}`);
112
114
 
113
115
  this.logger.verbose(`Deploying bad account...`);
114
- this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress }).deployed();
116
+ this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress });
115
117
  this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
116
118
 
119
+ // Deploy a proxy contract for "on behalf of other" tests. The note owner must be the tx sender
120
+ // (so their notes are in scope), but msg_sender in the target must differ from the note owner
121
+ // to trigger authwit validation. The proxy forwards calls so that msg_sender != tx sender.
122
+ this.logger.verbose(`Deploying generic proxy...`);
123
+ this.proxy = await GenericProxyContract.deploy(this.wallet).send({ from: this.adminAddress });
124
+ this.logger.verbose(`Deployed to ${this.proxy.address}.`);
125
+
117
126
  await this.crossTimestampOfChange();
118
127
 
119
128
  this.tokenSim = new TokenSimulator(
@@ -171,14 +180,12 @@ export class BlacklistTokenContractTest {
171
180
  const adminMinterRole = new Role().withAdmin().withMinter();
172
181
  await this.asset.methods
173
182
  .update_roles(this.adminAddress, adminMinterRole.toNoirStruct())
174
- .send({ from: this.adminAddress })
175
- .wait();
183
+ .send({ from: this.adminAddress });
176
184
 
177
185
  const blacklistRole = new Role().withBlacklisted();
178
186
  await this.asset.methods
179
187
  .update_roles(this.blacklistedAddress, blacklistRole.toNoirStruct())
180
- .send({ from: this.adminAddress })
181
- .wait();
188
+ .send({ from: this.adminAddress });
182
189
 
183
190
  await this.crossTimestampOfChange();
184
191
 
@@ -187,16 +194,15 @@ export class BlacklistTokenContractTest {
187
194
  );
188
195
 
189
196
  this.logger.verbose(`Minting ${amount} publicly...`);
190
- await asset.methods.mint_public(this.adminAddress, amount).send({ from: this.adminAddress }).wait();
197
+ await asset.methods.mint_public(this.adminAddress, amount).send({ from: this.adminAddress });
191
198
 
192
199
  this.logger.verbose(`Minting ${amount} privately...`);
193
200
  const secret = Fr.random();
194
201
  const secretHash = await computeSecretHash(secret);
195
- const receipt = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress }).wait();
202
+ const receipt = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress });
196
203
 
197
204
  await this.addPendingShieldNoteToPXE(asset, this.adminAddress, amount, secretHash, receipt.txHash);
198
- const txClaim = asset.methods.redeem_shield(this.adminAddress, amount, secret).send({ from: this.adminAddress });
199
- await txClaim.wait();
205
+ await asset.methods.redeem_shield(this.adminAddress, amount, secret).send({ from: this.adminAddress });
200
206
  this.logger.verbose(`Minting complete.`);
201
207
 
202
208
  tokenSim.mintPublic(this.adminAddress, amount);
@@ -13,13 +13,12 @@ import type {
13
13
  } from '@aztec/ethereum/deploy-aztec-l1-contracts';
14
14
  import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
15
15
  import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
16
- import { CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
16
+ import { EpochNumber } from '@aztec/foundation/branded-types';
17
17
  import { sleep } from '@aztec/foundation/sleep';
18
18
  import { TestERC20Abi, TestERC20Bytecode } from '@aztec/l1-artifacts';
19
19
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
20
20
  import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
21
21
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
22
- import type { TestWallet } from '@aztec/test-wallet/server';
23
22
 
24
23
  import { MNEMONIC } from '../fixtures/fixtures.js';
25
24
  import {
@@ -31,6 +30,7 @@ import {
31
30
  teardown,
32
31
  } from '../fixtures/setup.js';
33
32
  import { CrossChainTestHarness } from '../shared/cross_chain_test_harness.js';
33
+ import type { TestWallet } from '../test-wallet/test_wallet.js';
34
34
 
35
35
  export class CrossChainMessagingTest {
36
36
  private requireEpochProven: boolean;
@@ -86,9 +86,8 @@ export class CrossChainMessagingTest {
86
86
  }
87
87
 
88
88
  async advanceToEpochProven(l2TxReceipt: TxReceipt): Promise<EpochNumber> {
89
- const epoch = await this.rollup.getEpochNumberForCheckpoint(
90
- CheckpointNumber.fromBlockNumber(l2TxReceipt.blockNumber!),
91
- );
89
+ const block = await this.aztecNode.getBlock(l2TxReceipt.blockNumber!);
90
+ const epoch = await this.rollup.getEpochNumberForCheckpoint(block!.checkpointNumber);
92
91
  // Warp to the next epoch.
93
92
  await this.cheatCodes.rollup.advanceToEpoch(EpochNumber(epoch + 1));
94
93
  // Wait for the tx to be proven.
@@ -110,16 +109,16 @@ export class CrossChainMessagingTest {
110
109
 
111
110
  async applyBaseSetup() {
112
111
  // Set up base context fields
113
- this.aztecNode = this.context.aztecNodeService!;
112
+ this.aztecNode = this.context.aztecNodeService;
114
113
  this.wallet = this.context.wallet;
115
114
  this.aztecNodeConfig = this.context.config;
116
115
  this.cheatCodes = this.context.cheatCodes;
117
116
  this.deployL1ContractsValues = this.context.deployL1ContractsValues;
118
- this.aztecNodeAdmin = this.context.aztecNodeService!;
117
+ this.aztecNodeAdmin = this.context.aztecNodeService;
119
118
 
120
119
  if (this.requireEpochProven) {
121
120
  // Turn off the watcher to prevent it from keep marking blocks as proven.
122
- this.context.watcher!.setIsMarkingAsProven(false);
121
+ this.context.watcher.setIsMarkingAsProven(false);
123
122
  }
124
123
 
125
124
  // Deploy 3 accounts
@@ -8,9 +8,9 @@ import type { AztecNode } from '@aztec/aztec.js/node';
8
8
  import type { Wallet } from '@aztec/aztec.js/wallet';
9
9
  import type { StatefulTestContract } from '@aztec/noir-test-contracts.js/StatefulTest';
10
10
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
11
- import type { TestWallet } from '@aztec/test-wallet/server';
12
11
 
13
12
  import { type EndToEndContext, deployAccounts, setup, teardown } from '../fixtures/setup.js';
13
+ import type { TestWallet } from '../test-wallet/test_wallet.js';
14
14
 
15
15
  export class DeployTest {
16
16
  public context!: EndToEndContext;
@@ -30,9 +30,9 @@ export class DeployTest {
30
30
  fundSponsoredFPC: true,
31
31
  skipAccountDeployment: true,
32
32
  });
33
- this.aztecNode = this.context.aztecNodeService!;
33
+ this.aztecNode = this.context.aztecNodeService;
34
34
  this.wallet = this.context.wallet;
35
- this.aztecNodeAdmin = this.context.aztecNodeService!;
35
+ this.aztecNodeAdmin = this.context.aztecNodeService;
36
36
  await this.applyInitialAccount();
37
37
  return this;
38
38
  }
@@ -14,13 +14,15 @@ import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
14
14
  import { BlockNumber, CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
15
15
  import { SecretValue } from '@aztec/foundation/config';
16
16
  import { randomBytes } from '@aztec/foundation/crypto/random';
17
- import { withLogNameSuffix } from '@aztec/foundation/log';
17
+ import { withLoggerBindings } from '@aztec/foundation/log/server';
18
18
  import { retryUntil } from '@aztec/foundation/retry';
19
19
  import { sleep } from '@aztec/foundation/sleep';
20
20
  import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
21
+ import { TestContract } from '@aztec/noir-test-contracts.js/Test';
21
22
  import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
22
23
  import { ProverNode, type ProverNodeConfig, ProverNodePublisher } from '@aztec/prover-node';
23
24
  import type { TestProverNode } from '@aztec/prover-node/test';
25
+ import type { PXEConfig } from '@aztec/pxe/config';
24
26
  import {
25
27
  type SequencerClient,
26
28
  type SequencerEvents,
@@ -49,7 +51,11 @@ export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
49
51
  export const ARCHIVER_POLL_INTERVAL = 50;
50
52
  export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
51
53
 
52
- export type EpochsTestOpts = Partial<SetupOptions> & { numberOfAccounts?: number };
54
+ export type EpochsTestOpts = Partial<SetupOptions> & {
55
+ numberOfAccounts?: number;
56
+ pxeOpts?: Partial<PXEConfig>;
57
+ aztecSlotDurationInL1Slots?: number;
58
+ };
53
59
 
54
60
  export type TrackedSequencerEvent = {
55
61
  [K in keyof SequencerEvents]: Parameters<SequencerEvents[K]>[0] & {
@@ -94,7 +100,7 @@ export class EpochsTestContext {
94
100
  ? parseInt(process.env.L1_BLOCK_TIME)
95
101
  : DEFAULT_L1_BLOCK_TIME;
96
102
  const ethereumSlotDuration = opts.ethereumSlotDuration ?? envEthereumSlotDuration;
97
- const aztecSlotDuration = opts.aztecSlotDuration ?? ethereumSlotDuration * 2;
103
+ const aztecSlotDuration = opts.aztecSlotDuration ?? (opts.aztecSlotDurationInL1Slots ?? 2) * ethereumSlotDuration;
98
104
  const aztecEpochDuration = opts.aztecEpochDuration ?? 6;
99
105
  const aztecProofSubmissionEpochs = opts.aztecProofSubmissionEpochs ?? 1;
100
106
  const l1PublishingTime = opts.l1PublishingTime ?? 1;
@@ -121,30 +127,36 @@ export class EpochsTestContext {
121
127
 
122
128
  // Set up system without any account nor protocol contracts
123
129
  // and with faster block times and shorter epochs.
124
- const context = await setup(opts.numberOfAccounts ?? 0, {
125
- automineL1Setup: true,
126
- checkIntervalMs: 50,
127
- archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
128
- worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
129
- aztecEpochDuration,
130
- aztecSlotDuration,
131
- ethereumSlotDuration,
132
- aztecProofSubmissionEpochs,
133
- aztecTargetCommitteeSize: opts.initialValidators?.length ?? 0,
134
- minTxsPerBlock: 0,
135
- realProofs: false,
136
- startProverNode: true,
137
- proverTestDelayMs: opts.proverTestDelayMs ?? 0,
138
- // We use numeric incremental prover ids for simplicity, but we can switch to
139
- // using the prover's eth address if the proverId is used for something in the rollup contract
140
- // Use numeric EthAddress for deterministic prover id
141
- proverId: EthAddress.fromNumber(1),
142
- worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
143
- exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
144
- slasherFlavor: 'none',
145
- l1PublishingTime,
146
- ...opts,
147
- });
130
+ const context = await setup(
131
+ opts.numberOfAccounts ?? 0,
132
+ {
133
+ automineL1Setup: true,
134
+ checkIntervalMs: 50,
135
+ archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
136
+ worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
137
+ aztecEpochDuration,
138
+ aztecSlotDuration,
139
+ ethereumSlotDuration,
140
+ aztecProofSubmissionEpochs,
141
+ aztecTargetCommitteeSize: opts.initialValidators?.length ?? 0,
142
+ minTxsPerBlock: 0,
143
+ realProofs: false,
144
+ startProverNode: true,
145
+ proverTestDelayMs: opts.proverTestDelayMs ?? 0,
146
+ // We use numeric incremental prover ids for simplicity, but we can switch to
147
+ // using the prover's eth address if the proverId is used for something in the rollup contract
148
+ // Use numeric EthAddress for deterministic prover id
149
+ proverId: EthAddress.fromNumber(1),
150
+ worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
151
+ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
152
+ slasherFlavor: 'none',
153
+ l1PublishingTime,
154
+ ...opts,
155
+ },
156
+ // Use checkpointed chain tip for PXE by default to avoid issues with blocks being dropped due to pruned anchor blocks.
157
+ // Can be overridden via opts.pxeOpts.
158
+ { syncChainTip: 'checkpointed', ...opts.pxeOpts },
159
+ );
148
160
 
149
161
  this.context = context;
150
162
  this.proverNodes = context.proverNode ? [context.proverNode] : [];
@@ -182,6 +194,7 @@ export class EpochsTestContext {
182
194
  l1GenesisTime: await this.rollup.getL1GenesisTime(),
183
195
  ethereumSlotDuration,
184
196
  proofSubmissionEpochs: Number(await this.rollup.getProofSubmissionEpochs()),
197
+ targetCommitteeSize: await this.rollup.getTargetCommitteeSize(),
185
198
  };
186
199
 
187
200
  this.logger.info(
@@ -199,20 +212,29 @@ export class EpochsTestContext {
199
212
  public async createProverNode(opts: { dontStart?: boolean } & Partial<ProverNodeConfig> = {}) {
200
213
  this.logger.warn('Creating and syncing a simulated prover node...');
201
214
  const proverNodePrivateKey = this.getNextPrivateKey();
202
- const suffix = (this.proverNodes.length + 1).toString();
203
- const proverNode = await withLogNameSuffix(suffix, () =>
215
+ const proverIndex = this.proverNodes.length + 1;
216
+ const { mockGossipSubNetwork } = this.context;
217
+ const proverNode = await withLoggerBindings({ actor: `prover-${proverIndex}` }, () =>
204
218
  createAndSyncProverNode(
205
219
  proverNodePrivateKey,
206
- { ...this.context.config },
220
+ {
221
+ ...this.context.config,
222
+ p2pEnabled: this.context.config.p2pEnabled || mockGossipSubNetwork !== undefined,
223
+ },
207
224
  {
208
225
  dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
209
- proverId: EthAddress.fromNumber(parseInt(suffix, 10)),
226
+ proverId: EthAddress.fromNumber(proverIndex),
210
227
  dontStart: opts.dontStart,
211
228
  ...opts,
212
229
  },
213
230
  this.context.aztecNode,
214
231
  this.context.prefilledPublicData ?? [],
215
- { dateProvider: this.context.dateProvider },
232
+ {
233
+ dateProvider: this.context.dateProvider,
234
+ p2pClientDeps: mockGossipSubNetwork
235
+ ? { p2pServiceFactory: getMockPubSubP2PServiceFactory(mockGossipSubNetwork) }
236
+ : undefined,
237
+ },
216
238
  ),
217
239
  );
218
240
  this.proverNodes.push(proverNode);
@@ -235,12 +257,13 @@ export class EpochsTestContext {
235
257
  private async createNode(
236
258
  opts: Partial<AztecNodeConfig> & { txDelayerMaxInclusionTimeIntoSlot?: number; dontStartSequencer?: boolean } = {},
237
259
  ) {
238
- const suffix = (this.nodes.length + 1).toString();
260
+ const nodeIndex = this.nodes.length + 1;
261
+ const actorPrefix = opts.disableValidator ? 'node' : 'validator';
239
262
  const { mockGossipSubNetwork } = this.context;
240
263
  const resolvedConfig = { ...this.context.config, ...opts };
241
264
  const p2pEnabled = resolvedConfig.p2pEnabled || mockGossipSubNetwork !== undefined;
242
265
  const p2pIp = resolvedConfig.p2pIp ?? (p2pEnabled ? '127.0.0.1' : undefined);
243
- const node = await withLogNameSuffix(suffix, () =>
266
+ const node = await withLoggerBindings({ actor: `${actorPrefix}-${nodeIndex}` }, () =>
244
267
  AztecNodeService.createAndSync(
245
268
  {
246
269
  ...resolvedConfig,
@@ -370,6 +393,19 @@ export class EpochsTestContext {
370
393
  return SpamContract.at(instance.address, wallet);
371
394
  }
372
395
 
396
+ /** Registers the TestContract on the given wallet. */
397
+ public async registerTestContract(wallet: Wallet, salt = Fr.ZERO) {
398
+ const instance = await getContractInstanceFromInstantiationParams(TestContract.artifact, {
399
+ constructorArgs: [],
400
+ constructorArtifact: undefined,
401
+ salt,
402
+ publicKeys: undefined,
403
+ deployer: undefined,
404
+ });
405
+ await wallet.registerContract(instance, TestContract.artifact);
406
+ return TestContract.at(instance.address, wallet);
407
+ }
408
+
373
409
  /** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */
374
410
  public async createL1Client() {
375
411
  const { client, delayer } = withDelayer(
@@ -378,7 +414,7 @@ export class EpochsTestContext {
378
414
  privateKeyToAccount(this.getNextPrivateKey()),
379
415
  this.l1Client.chain,
380
416
  ),
381
- this.context.dateProvider!,
417
+ this.context.dateProvider,
382
418
  { ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S },
383
419
  );
384
420
  expect(await client.getBalance({ address: client.account.address })).toBeGreaterThan(0n);
@@ -4,11 +4,11 @@ import type { Logger } from '@aztec/aztec.js/log';
4
4
  import { Fq } from '@aztec/foundation/curves/bn254';
5
5
  import { sleep } from '@aztec/foundation/sleep';
6
6
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
7
- import type { TestWallet } from '@aztec/test-wallet/server';
8
7
 
9
8
  import { jest } from '@jest/globals';
10
9
  import type { Hex } from 'viem';
11
10
 
11
+ import type { TestWallet } from '../test-wallet/test_wallet.js';
12
12
  import { FeesTest } from './fees_test.js';
13
13
 
14
14
  jest.setTimeout(300_000);
@@ -67,10 +67,7 @@ describe('e2e_fees bridging_race', () => {
67
67
  // Yes, we need to REFACTOR it at some point
68
68
  const claim = await t.feeJuiceBridgeTestHarness.prepareTokensOnL1(bobsAddress);
69
69
  const { claimSecret: secret, messageLeafIndex: index } = claim;
70
- await t.feeJuiceContract.methods
71
- .claim(bobsAddress, claim.claimAmount, secret, index)
72
- .send({ from: bobsAddress })
73
- .wait();
70
+ await t.feeJuiceContract.methods.claim(bobsAddress, claim.claimAmount, secret, index).send({ from: bobsAddress });
74
71
  const [balance] = await t.getGasBalanceFn(bobsAddress);
75
72
  expect(balance).toEqual(claim.claimAmount);
76
73
  });