@aztec/end-to-end 0.0.1-commit.72dcdcda8 → 0.0.1-commit.7689c7f

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 (181) hide show
  1. package/README.md +27 -0
  2. package/dest/bench/client_flows/benchmark.d.ts +15 -1
  3. package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
  4. package/dest/bench/client_flows/benchmark.js +17 -0
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts +2 -2
  6. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  7. package/dest/bench/client_flows/client_flows_benchmark.js +32 -36
  8. package/dest/bench/utils.d.ts +1 -1
  9. package/dest/bench/utils.d.ts.map +1 -1
  10. package/dest/bench/utils.js +8 -3
  11. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +5 -4
  12. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  13. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +28 -19
  14. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +15 -4
  15. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  16. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +39 -7
  17. package/dest/e2e_deploy_contract/deploy_test.d.ts +3 -3
  18. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  19. package/dest/e2e_deploy_contract/deploy_test.js +2 -1
  20. package/dest/e2e_epochs/epochs_test.d.ts +25 -2
  21. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  22. package/dest/e2e_epochs/epochs_test.js +88 -14
  23. package/dest/e2e_fees/fees_test.d.ts +5 -2
  24. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  25. package/dest/e2e_fees/fees_test.js +44 -11
  26. package/dest/e2e_nested_contract/nested_contract_test.d.ts +3 -3
  27. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  28. package/dest/e2e_nested_contract/nested_contract_test.js +6 -7
  29. package/dest/e2e_p2p/inactivity_slash_test.d.ts +1 -1
  30. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
  31. package/dest/e2e_p2p/inactivity_slash_test.js +5 -3
  32. package/dest/e2e_p2p/p2p_network.d.ts +13 -11
  33. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  34. package/dest/e2e_p2p/p2p_network.js +65 -43
  35. package/dest/e2e_p2p/reqresp/utils.d.ts +1 -1
  36. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -1
  37. package/dest/e2e_p2p/reqresp/utils.js +42 -13
  38. package/dest/e2e_p2p/shared.d.ts +25 -7
  39. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  40. package/dest/e2e_p2p/shared.js +73 -50
  41. package/dest/e2e_token_contract/token_contract_test.d.ts +3 -3
  42. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  43. package/dest/e2e_token_contract/token_contract_test.js +15 -13
  44. package/dest/fixtures/authwit_proxy.d.ts +3 -3
  45. package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
  46. package/dest/fixtures/authwit_proxy.js +4 -0
  47. package/dest/fixtures/e2e_prover_test.d.ts +6 -5
  48. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  49. package/dest/fixtures/e2e_prover_test.js +13 -17
  50. package/dest/fixtures/fixtures.d.ts +73 -1
  51. package/dest/fixtures/fixtures.d.ts.map +1 -1
  52. package/dest/fixtures/fixtures.js +68 -0
  53. package/dest/fixtures/get_bb_config.d.ts +1 -1
  54. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  55. package/dest/fixtures/get_bb_config.js +5 -5
  56. package/dest/fixtures/ha_setup.d.ts +2 -2
  57. package/dest/fixtures/ha_setup.d.ts.map +1 -1
  58. package/dest/fixtures/ha_setup.js +1 -1
  59. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
  60. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
  61. package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
  62. package/dest/fixtures/setup.d.ts +43 -11
  63. package/dest/fixtures/setup.d.ts.map +1 -1
  64. package/dest/fixtures/setup.js +138 -29
  65. package/dest/fixtures/setup_p2p_test.d.ts +10 -6
  66. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  67. package/dest/fixtures/setup_p2p_test.js +8 -8
  68. package/dest/fixtures/token_utils.d.ts +1 -1
  69. package/dest/fixtures/token_utils.d.ts.map +1 -1
  70. package/dest/fixtures/token_utils.js +2 -5
  71. package/dest/fixtures/utils.d.ts +2 -2
  72. package/dest/fixtures/utils.d.ts.map +1 -1
  73. package/dest/fixtures/utils.js +1 -1
  74. package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
  75. package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
  76. package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
  77. package/dest/forward-compatibility/wallet_service.d.ts +3 -0
  78. package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
  79. package/dest/forward-compatibility/wallet_service.js +109 -0
  80. package/dest/install_legacy_contracts.d.cts +10 -0
  81. package/dest/install_legacy_contracts.d.cts.map +1 -0
  82. package/dest/legacy-jest-resolver.d.cts +3 -0
  83. package/dest/legacy-jest-resolver.d.cts.map +1 -0
  84. package/dest/shared/cross_chain_test_harness.d.ts +4 -2
  85. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  86. package/dest/shared/cross_chain_test_harness.js +22 -18
  87. package/dest/shared/gas_portal_test_harness.d.ts +8 -5
  88. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  89. package/dest/shared/gas_portal_test_harness.js +19 -10
  90. package/dest/shared/submit-transactions.d.ts +1 -1
  91. package/dest/shared/submit-transactions.d.ts.map +1 -1
  92. package/dest/shared/submit-transactions.js +1 -1
  93. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  94. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  95. package/dest/shared/uniswap_l1_l2.js +60 -39
  96. package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
  97. package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
  98. package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
  99. package/dest/simulators/lending_simulator.d.ts +10 -3
  100. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  101. package/dest/simulators/lending_simulator.js +26 -14
  102. package/dest/simulators/token_simulator.d.ts +1 -1
  103. package/dest/simulators/token_simulator.d.ts.map +1 -1
  104. package/dest/simulators/token_simulator.js +2 -2
  105. package/dest/spartan/setup_test_wallets.d.ts +4 -2
  106. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  107. package/dest/spartan/setup_test_wallets.js +72 -39
  108. package/dest/spartan/tx_metrics.d.ts +18 -4
  109. package/dest/spartan/tx_metrics.d.ts.map +1 -1
  110. package/dest/spartan/tx_metrics.js +74 -21
  111. package/dest/spartan/utils/config.d.ts +9 -32
  112. package/dest/spartan/utils/config.d.ts.map +1 -1
  113. package/dest/spartan/utils/config.js +1 -0
  114. package/dest/spartan/utils/index.d.ts +2 -1
  115. package/dest/spartan/utils/index.d.ts.map +1 -1
  116. package/dest/spartan/utils/index.js +2 -0
  117. package/dest/spartan/utils/nodes.js +2 -2
  118. package/dest/spartan/utils/pod_logs.d.ts +25 -0
  119. package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
  120. package/dest/spartan/utils/pod_logs.js +74 -0
  121. package/dest/test-wallet/test_wallet.d.ts +25 -23
  122. package/dest/test-wallet/test_wallet.d.ts.map +1 -1
  123. package/dest/test-wallet/test_wallet.js +146 -87
  124. package/dest/test-wallet/utils.d.ts +3 -3
  125. package/dest/test-wallet/utils.d.ts.map +1 -1
  126. package/dest/test-wallet/utils.js +2 -7
  127. package/dest/test-wallet/wallet_worker_script.js +2 -2
  128. package/dest/test-wallet/worker_wallet.d.ts +5 -4
  129. package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
  130. package/dest/test-wallet/worker_wallet.js +5 -1
  131. package/dest/test-wallet/worker_wallet_schema.d.ts +110 -224
  132. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
  133. package/dest/test-wallet/worker_wallet_schema.js +14 -2
  134. package/package.json +46 -42
  135. package/src/bench/client_flows/benchmark.ts +19 -0
  136. package/src/bench/client_flows/client_flows_benchmark.ts +59 -41
  137. package/src/bench/utils.ts +9 -3
  138. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +42 -24
  139. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +49 -11
  140. package/src/e2e_deploy_contract/deploy_test.ts +3 -2
  141. package/src/e2e_epochs/epochs_test.ts +99 -11
  142. package/src/e2e_fees/fees_test.ts +49 -9
  143. package/src/e2e_nested_contract/nested_contract_test.ts +9 -5
  144. package/src/e2e_p2p/inactivity_slash_test.ts +5 -3
  145. package/src/e2e_p2p/p2p_network.ts +82 -60
  146. package/src/e2e_p2p/reqresp/utils.ts +51 -12
  147. package/src/e2e_p2p/shared.ts +92 -64
  148. package/src/e2e_token_contract/token_contract_test.ts +28 -10
  149. package/src/fixtures/authwit_proxy.ts +4 -0
  150. package/src/fixtures/e2e_prover_test.ts +22 -19
  151. package/src/fixtures/fixtures.ts +86 -0
  152. package/src/fixtures/get_bb_config.ts +7 -6
  153. package/src/fixtures/ha_setup.ts +4 -2
  154. package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
  155. package/src/fixtures/setup.ts +175 -33
  156. package/src/fixtures/setup_p2p_test.ts +13 -9
  157. package/src/fixtures/token_utils.ts +1 -2
  158. package/src/fixtures/utils.ts +2 -0
  159. package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
  160. package/src/forward-compatibility/wallet_service.ts +104 -0
  161. package/src/guides/up_quick_start.sh +0 -2
  162. package/src/install_legacy_contracts.cjs +75 -0
  163. package/src/legacy-jest-resolver.cjs +112 -0
  164. package/src/shared/cross_chain_test_harness.ts +27 -13
  165. package/src/shared/gas_portal_test_harness.ts +21 -11
  166. package/src/shared/submit-transactions.ts +1 -4
  167. package/src/shared/uniswap_l1_l2.ts +77 -50
  168. package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
  169. package/src/simulators/lending_simulator.ts +32 -14
  170. package/src/simulators/token_simulator.ts +6 -2
  171. package/src/spartan/setup_test_wallets.ts +91 -37
  172. package/src/spartan/tx_metrics.ts +82 -24
  173. package/src/spartan/utils/config.ts +1 -0
  174. package/src/spartan/utils/index.ts +3 -0
  175. package/src/spartan/utils/nodes.ts +2 -2
  176. package/src/spartan/utils/pod_logs.ts +99 -0
  177. package/src/test-wallet/test_wallet.ts +174 -104
  178. package/src/test-wallet/utils.ts +3 -7
  179. package/src/test-wallet/wallet_worker_script.ts +2 -2
  180. package/src/test-wallet/worker_wallet.ts +9 -4
  181. package/src/test-wallet/worker_wallet_schema.ts +2 -2
@@ -1,10 +1,11 @@
1
+ import { NO_FROM } from '@aztec/aztec.js/account';
1
2
  import { AztecAddress } from '@aztec/aztec.js/addresses';
2
3
  import { FeeJuicePaymentMethodWithClaim } from '@aztec/aztec.js/fee';
3
4
  import { type FeePaymentMethod, PrivateFeePaymentMethod, SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee';
4
5
  import { type Logger, createLogger } from '@aztec/aztec.js/log';
5
6
  import type { AztecNode } from '@aztec/aztec.js/node';
6
7
  import type { Wallet } from '@aztec/aztec.js/wallet';
7
- import { CheatCodes } from '@aztec/aztec/testing';
8
+ import { CheatCodes, getTokenAllowedSetupFunctions } from '@aztec/aztec/testing';
8
9
  import { createExtendedL1Client } from '@aztec/ethereum/client';
9
10
  import { RollupContract } from '@aztec/ethereum/contracts';
10
11
  import type { DeployAztecL1ContractsArgs } from '@aztec/ethereum/deploy-aztec-l1-contracts';
@@ -27,7 +28,7 @@ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
27
28
  import { GasSettings } from '@aztec/stdlib/gas';
28
29
  import { deriveSigningKey } from '@aztec/stdlib/keys';
29
30
 
30
- import { MNEMONIC } from '../../fixtures/fixtures.js';
31
+ import { AUTOMINE_E2E_OPTS, MNEMONIC, getPaddedMaxFeesPerGas } from '../../fixtures/fixtures.js';
31
32
  import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../../fixtures/setup.js';
32
33
  import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
33
34
  import { setupSponsoredFPC } from '../../fixtures/utils.js';
@@ -87,33 +88,35 @@ export class ClientFlowsBenchmark {
87
88
 
88
89
  public realProofs = ['true', '1'].includes(process.env.REAL_PROOFS ?? '');
89
90
 
90
- public paymentMethods: Record<BenchmarkingFeePaymentMethod, { forWallet: FeePaymentMethodGetter; circuits: number }> =
91
- {
92
- // eslint-disable-next-line camelcase
93
- bridged_fee_juice: {
94
- forWallet: this.getBridgedFeeJuicePaymentMethodForWallet.bind(this),
95
- circuits: 2, // FeeJuice claim + kernel inner
96
- },
97
- // eslint-disable-next-line camelcase
98
- private_fpc: {
99
- forWallet: this.getPrivateFPCPaymentMethodForWallet.bind(this),
100
- circuits:
101
- 2 + // FPC entrypoint + kernel inner
102
- 2 + // BananaCoin transfer_to_public + kernel inner
103
- 2 + // Account verify_private_authwit + kernel inner
104
- 2, // BananaCoin prepare_private_balance_increase + kernel inner
105
- },
106
- // eslint-disable-next-line camelcase
107
- sponsored_fpc: {
108
- forWallet: this.getSponsoredFPCPaymentMethodForWallet.bind(this),
109
- circuits: 2, // Sponsored FPC sponsor_unconditionally + kernel inner
110
- },
111
- // eslint-disable-next-line camelcase
112
- fee_juice: {
113
- forWallet: () => Promise.resolve(undefined),
114
- circuits: 0,
115
- },
116
- };
91
+ // `apps` is the number of private function calls contributed by this payment method.
92
+ // Each app produces one execution step at proving time; the orchestrator additionally produces
93
+ // one kernel step per batch of N apps (see `expectedExecutionSteps` in `benchmark.ts`).
94
+ public paymentMethods: Record<BenchmarkingFeePaymentMethod, { forWallet: FeePaymentMethodGetter; apps: number }> = {
95
+ // eslint-disable-next-line camelcase
96
+ bridged_fee_juice: {
97
+ forWallet: this.getBridgedFeeJuicePaymentMethodForWallet.bind(this),
98
+ apps: 1, // FeeJuice claim
99
+ },
100
+ // eslint-disable-next-line camelcase
101
+ private_fpc: {
102
+ forWallet: this.getPrivateFPCPaymentMethodForWallet.bind(this),
103
+ apps:
104
+ 1 + // FPC entrypoint
105
+ 1 + // BananaCoin transfer_to_public
106
+ 1 + // Account verify_private_authwit
107
+ 1, // BananaCoin prepare_private_balance_increase
108
+ },
109
+ // eslint-disable-next-line camelcase
110
+ sponsored_fpc: {
111
+ forWallet: this.getSponsoredFPCPaymentMethodForWallet.bind(this),
112
+ apps: 1, // Sponsored FPC sponsor_unconditionally
113
+ },
114
+ // eslint-disable-next-line camelcase
115
+ fee_juice: {
116
+ forWallet: () => Promise.resolve(undefined),
117
+ apps: 0,
118
+ },
119
+ };
117
120
 
118
121
  public config: ClientFlowsConfig;
119
122
 
@@ -122,7 +125,7 @@ export class ClientFlowsBenchmark {
122
125
 
123
126
  constructor(testName?: string, setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs> = {}) {
124
127
  this.logger = createLogger(`bench:client_flows${testName ? `:${testName}` : ''}`);
125
- this.setupOptions = { startProverNode: true, ...setupOptions };
128
+ this.setupOptions = { ...AUTOMINE_E2E_OPTS, startProverNode: true, ...setupOptions };
126
129
  this.config = BENCHMARK_CONFIG === 'key_flows' ? KEY_FLOWS_CONFIG : FULL_FLOWS_CONFIG;
127
130
  ProxyLogger.create();
128
131
  this.proxyLogger = ProxyLogger.getInstance();
@@ -130,11 +133,14 @@ export class ClientFlowsBenchmark {
130
133
 
131
134
  async setup() {
132
135
  this.logger.info('Setting up subsystems from fresh');
136
+ // Token allowlist entries are test-only: FPC-based fee payment with custom tokens won't work on mainnet alpha.
137
+ const tokenAllowList = await getTokenAllowedSetupFunctions();
133
138
  this.context = await setup(0, {
134
139
  ...this.setupOptions,
135
140
  fundSponsoredFPC: true,
136
141
  skipAccountDeployment: true,
137
142
  l1ContractsArgs: this.setupOptions,
143
+ txPublicSetupAllowListExtend: [...(this.setupOptions.txPublicSetupAllowListExtend ?? []), ...tokenAllowList],
138
144
  });
139
145
  await this.applyBaseSetup();
140
146
 
@@ -162,11 +168,15 @@ export class ClientFlowsBenchmark {
162
168
 
163
169
  /** Admin mints bananaCoin tokens privately to the target address and redeems them. */
164
170
  async mintPrivateBananas(amount: bigint, address: AztecAddress) {
165
- const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({ from: address });
171
+ const { result: balanceBefore } = await this.bananaCoin.methods
172
+ .balance_of_private(address)
173
+ .simulate({ from: address });
166
174
 
167
175
  await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
168
176
 
169
- const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({ from: address });
177
+ const { result: balanceAfter } = await this.bananaCoin.methods
178
+ .balance_of_private(address)
179
+ .simulate({ from: address });
170
180
  expect(balanceAfter).toEqual(balanceBefore + amount);
171
181
  }
172
182
 
@@ -248,7 +258,9 @@ export class ClientFlowsBenchmark {
248
258
  'BC',
249
259
  'BC',
250
260
  18n,
251
- ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
261
+ ).send({
262
+ from: this.adminAddress,
263
+ });
252
264
  this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
253
265
  this.bananaCoin = bananaCoin;
254
266
  this.bananaCoinInstance = bananaCoinInstance;
@@ -262,7 +274,9 @@ export class ClientFlowsBenchmark {
262
274
  'CBC',
263
275
  'CBC',
264
276
  18n,
265
- ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
277
+ ).send({
278
+ from: this.adminAddress,
279
+ });
266
280
  this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
267
281
  this.candyBarCoin = candyBarCoin;
268
282
  this.candyBarCoinInstance = candyBarCoinInstance;
@@ -278,7 +292,9 @@ export class ClientFlowsBenchmark {
278
292
  this.adminWallet,
279
293
  bananaCoin.address,
280
294
  this.adminAddress,
281
- ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
295
+ ).send({
296
+ from: this.adminAddress,
297
+ });
282
298
 
283
299
  this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
284
300
 
@@ -327,13 +343,13 @@ export class ClientFlowsBenchmark {
327
343
  const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
328
344
  const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
329
345
  await behchysDeployMethod.send({
330
- from: AztecAddress.ZERO,
346
+ from: NO_FROM,
331
347
  fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
332
348
  });
333
349
  // Register benchy on the user's Wallet, where we're going to be interacting from
334
350
  const accountManager = await this.userWallet.createAccount({
335
351
  secret: benchysAccount.getSecretKey(),
336
- salt: new Fr(benchysAccount.salt),
352
+ salt: new Fr(benchysAccountManager.getInstance().salt),
337
353
  contract: benchysAccountManager.getAccountContract(),
338
354
  });
339
355
  return accountManager.address;
@@ -347,13 +363,15 @@ export class ClientFlowsBenchmark {
347
363
  'LPT',
348
364
  'LPT',
349
365
  18n,
350
- ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
366
+ ).send({
367
+ from: this.adminAddress,
368
+ });
351
369
  const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
352
370
  this.adminWallet,
353
371
  this.bananaCoin.address,
354
372
  this.candyBarCoin.address,
355
373
  liquidityToken.address,
356
- ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
374
+ ).send({ from: this.adminAddress });
357
375
  this.logger.info(`AMM deployed at ${amm.address}`);
358
376
  await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress });
359
377
  this.liquidityToken = liquidityToken;
@@ -370,8 +388,8 @@ export class ClientFlowsBenchmark {
370
388
  public async getPrivateFPCPaymentMethodForWallet(wallet: Wallet, sender: AztecAddress) {
371
389
  // The private fee paying method assembled on the app side requires knowledge of the maximum
372
390
  // fee the user is willing to pay
373
- const maxFeesPerGas = (await this.aztecNode.getCurrentMinFees()).mul(1.5);
374
- const gasSettings = GasSettings.default({ maxFeesPerGas });
391
+ const maxFeesPerGas = await getPaddedMaxFeesPerGas(this.aztecNode);
392
+ const gasSettings = GasSettings.fallback({ maxFeesPerGas });
375
393
  return new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet, gasSettings);
376
394
  }
377
395
 
@@ -11,6 +11,7 @@ import type { BenchmarkDataPoint, BenchmarkMetricsType, BenchmarkTelemetryClient
11
11
  import { mkdirSync, writeFileSync } from 'fs';
12
12
  import path from 'path';
13
13
 
14
+ import { PIPELINING_SETUP_OPTS } from '../fixtures/fixtures.js';
14
15
  import { type EndToEndContext, type SetupOptions, setup } from '../fixtures/utils.js';
15
16
 
16
17
  /**
@@ -23,9 +24,9 @@ export async function benchmarkSetup(
23
24
  benchOutput?: string;
24
25
  },
25
26
  ) {
26
- const context = await setup(1, { ...opts, telemetryConfig: { benchmark: true } });
27
+ const context = await setup(1, { ...PIPELINING_SETUP_OPTS, ...opts, telemetryConfig: { benchmark: true } });
27
28
  const defaultAccountAddress = context.accounts[0];
28
- const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress });
29
+ const { contract } = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress });
29
30
  context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
30
31
  const sequencer = (context.aztecNode as AztecNodeService).getSequencer()!;
31
32
  const telemetry = context.telemetryClient as BenchmarkTelemetryClient;
@@ -149,7 +150,12 @@ export async function sendTxs(
149
150
  context.logger.info(`Creating ${txCount} txs`);
150
151
  const [from] = context.accounts;
151
152
  context.logger.info(`Sending ${txCount} txs`);
152
- return Promise.all(calls.map(call => call.send({ from, wait: NO_WAIT })));
153
+ return Promise.all(
154
+ calls.map(async call => {
155
+ const { txHash } = await call.send({ from, wait: NO_WAIT });
156
+ return txHash;
157
+ }),
158
+ );
153
159
  }
154
160
 
155
161
  export async function waitTxs(txs: TxHash[], context: EndToEndContext, txWaitOpts?: WaitOpts) {
@@ -10,10 +10,19 @@ import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist'
10
10
  import { GenericProxyContract } from '@aztec/noir-test-contracts.js/GenericProxy';
11
11
  import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
12
12
  import type { SequencerClient } from '@aztec/sequencer-client';
13
+ import type { AztecNodeDebug } from '@aztec/stdlib/interfaces/client';
13
14
 
14
15
  import { jest } from '@jest/globals';
15
16
 
16
- import { type EndToEndContext, deployAccounts, publicDeployAccounts, setup, teardown } from '../fixtures/setup.js';
17
+ import {
18
+ type EndToEndContext,
19
+ type SetupOptions,
20
+ deployAccounts,
21
+ ensureAuthRegistryPublished,
22
+ publicDeployAccounts,
23
+ setup,
24
+ teardown,
25
+ } from '../fixtures/setup.js';
17
26
  import { TokenSimulator } from '../simulators/token_simulator.js';
18
27
  import type { TestWallet } from '../test-wallet/test_wallet.js';
19
28
 
@@ -57,7 +66,7 @@ export class BlacklistTokenContractTest {
57
66
  authwitProxy!: GenericProxyContract;
58
67
  cheatCodes!: CheatCodes;
59
68
  sequencer!: SequencerClient;
60
- aztecNode!: AztecNode;
69
+ aztecNode!: AztecNode & AztecNodeDebug;
61
70
 
62
71
  adminAddress!: AztecAddress;
63
72
  otherAddress!: AztecAddress;
@@ -68,11 +77,13 @@ export class BlacklistTokenContractTest {
68
77
  }
69
78
 
70
79
  async crossTimestampOfChange() {
71
- await this.cheatCodes.warpL2TimeAtLeastBy(
72
- this.sequencer,
73
- this.aztecNode,
74
- BlacklistTokenContractTest.CHANGE_ROLES_DELAY,
75
- );
80
+ // Under AUTOMINE_E2E_OPTS, the 86400s warp crosses many epochs without any proofs being
81
+ // submitted. Mark current pending checkpoints as proven first so the rollup contract's
82
+ // pruning window doesn't reset the chain tip to genesis (which would make the warp's
83
+ // own empty-checkpoint propose fail with Rollup__InvalidArchive). See the AutomineSequencer
84
+ // README "Epoch proving caveat" and the equivalent pattern in lending_simulator.progressSlots.
85
+ await this.cheatCodes.rollup.markAsProven();
86
+ await this.cheatCodes.warpL2TimeAtLeastBy(this.aztecNode, BlacklistTokenContractTest.CHANGE_ROLES_DELAY);
76
87
  }
77
88
 
78
89
  /**
@@ -81,8 +92,9 @@ export class BlacklistTokenContractTest {
81
92
  * 2. Publicly deploy accounts, deploy token contract and a "bad account".
82
93
  */
83
94
  async applyBaseSetup() {
84
- // Adding a timeout of 2 minutes in here such that it is propagated to the underlying tests
85
- jest.setTimeout(120_000);
95
+ // Bumped from 2 min: pipelined cadence (~24s/dependent-tx) makes the 3-account deploy plus token/bad-account/
96
+ // proxy deploys exceed the original window.
97
+ jest.setTimeout(600_000);
86
98
 
87
99
  this.logger.info('Deploying 3 accounts');
88
100
  const { deployedAccounts } = await deployAccounts(
@@ -102,25 +114,30 @@ export class BlacklistTokenContractTest {
102
114
  this.blacklistedAddress = deployedAccounts[2].address;
103
115
 
104
116
  this.logger.info('Setting up blacklist token contract');
117
+ await ensureAuthRegistryPublished(this.wallet, this.adminAddress);
105
118
  // Create the token contract state.
106
119
  this.logger.verbose(`Public deploy accounts...`);
107
120
  await publicDeployAccounts(this.wallet, [this.adminAddress, this.otherAddress, this.blacklistedAddress]);
108
121
 
109
122
  this.logger.verbose(`Deploying TokenContract...`);
110
- this.asset = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress).send({
123
+ ({ contract: this.asset } = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress).send({
111
124
  from: this.adminAddress,
112
- });
125
+ }));
113
126
  this.logger.verbose(`Token deployed to ${this.asset.address}`);
114
127
 
115
128
  this.logger.verbose(`Deploying bad account...`);
116
- this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress });
129
+ ({ contract: this.badAccount } = await InvalidAccountContract.deploy(this.wallet).send({
130
+ from: this.adminAddress,
131
+ }));
117
132
  this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
118
133
 
119
134
  // Deploy a proxy contract for "on behalf of other" tests. The note owner must be the tx sender
120
135
  // (so their notes are in scope), but msg_sender in the target must differ from the note owner
121
136
  // to trigger authwit validation. The proxy forwards calls so that msg_sender != tx sender.
122
137
  this.logger.verbose(`Deploying generic proxy...`);
123
- this.authwitProxy = await GenericProxyContract.deploy(this.wallet).send({ from: this.adminAddress });
138
+ ({ contract: this.authwitProxy } = await GenericProxyContract.deploy(this.wallet).send({
139
+ from: this.adminAddress,
140
+ }));
124
141
  this.logger.verbose(`Deployed to ${this.authwitProxy.address}.`);
125
142
 
126
143
  await this.crossTimestampOfChange();
@@ -133,14 +150,15 @@ export class BlacklistTokenContractTest {
133
150
  [this.adminAddress, this.otherAddress, this.blacklistedAddress],
134
151
  );
135
152
 
136
- expect(await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).toEqual(
137
- new Role().withAdmin().toNoirStruct(),
138
- );
153
+ expect(
154
+ (await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).result,
155
+ ).toEqual(new Role().withAdmin().toNoirStruct());
139
156
  }
140
157
 
141
- async setup() {
158
+ async setup(opts: Partial<SetupOptions> = {}) {
142
159
  this.logger.info('Setting up fresh context');
143
160
  this.context = await setup(0, {
161
+ ...opts,
144
162
  fundSponsoredFPC: true,
145
163
  skipAccountDeployment: true,
146
164
  });
@@ -189,9 +207,9 @@ export class BlacklistTokenContractTest {
189
207
 
190
208
  await this.crossTimestampOfChange();
191
209
 
192
- expect(await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).toEqual(
193
- adminMinterRole.toNoirStruct(),
194
- );
210
+ expect(
211
+ (await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).result,
212
+ ).toEqual(adminMinterRole.toNoirStruct());
195
213
 
196
214
  this.logger.verbose(`Minting ${amount} publicly...`);
197
215
  await asset.methods.mint_public(this.adminAddress, amount).send({ from: this.adminAddress });
@@ -199,7 +217,7 @@ export class BlacklistTokenContractTest {
199
217
  this.logger.verbose(`Minting ${amount} privately...`);
200
218
  const secret = Fr.random();
201
219
  const secretHash = await computeSecretHash(secret);
202
- const receipt = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress });
220
+ const { receipt } = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress });
203
221
 
204
222
  await this.addPendingShieldNoteToPXE(asset, this.adminAddress, amount, secretHash, receipt.txHash);
205
223
  await asset.methods.redeem_shield(this.adminAddress, amount, secret).send({ from: this.adminAddress });
@@ -207,20 +225,20 @@ export class BlacklistTokenContractTest {
207
225
 
208
226
  tokenSim.mintPublic(this.adminAddress, amount);
209
227
 
210
- const publicBalance = await asset.methods
228
+ const { result: publicBalance } = await asset.methods
211
229
  .balance_of_public(this.adminAddress)
212
230
  .simulate({ from: this.adminAddress });
213
231
  this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
214
232
  expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(this.adminAddress));
215
233
 
216
234
  tokenSim.mintPrivate(this.adminAddress, amount);
217
- const privateBalance = await asset.methods
235
+ const { result: privateBalance } = await asset.methods
218
236
  .balance_of_private(this.adminAddress)
219
237
  .simulate({ from: this.adminAddress });
220
238
  this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
221
239
  expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(this.adminAddress));
222
240
 
223
- const totalSupply = await asset.methods.total_supply().simulate({ from: this.adminAddress });
241
+ const { result: totalSupply } = await asset.methods.total_supply().simulate({ from: this.adminAddress });
224
242
  this.logger.verbose(`Total supply: ${totalSupply}`);
225
243
  expect(totalSupply).toEqual(tokenSim.totalSupply);
226
244
  }
@@ -4,7 +4,7 @@ import { waitForProven } from '@aztec/aztec.js/contracts';
4
4
  import { type Logger, createLogger } from '@aztec/aztec.js/log';
5
5
  import type { AztecNode } from '@aztec/aztec.js/node';
6
6
  import type { TxReceipt } from '@aztec/aztec.js/tx';
7
- import { CheatCodes } from '@aztec/aztec/testing';
7
+ import { CheatCodes, EpochTestSettler } from '@aztec/aztec/testing';
8
8
  import { createExtendedL1Client } from '@aztec/ethereum/client';
9
9
  import { InboxContract, OutboxContract, RollupContract } from '@aztec/ethereum/contracts';
10
10
  import type {
@@ -12,12 +12,14 @@ import type {
12
12
  DeployAztecL1ContractsReturnType,
13
13
  } from '@aztec/ethereum/deploy-aztec-l1-contracts';
14
14
  import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
15
+ import { pickL1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
15
16
  import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
16
17
  import { EpochNumber } from '@aztec/foundation/branded-types';
17
18
  import { sleep } from '@aztec/foundation/sleep';
18
19
  import { TestERC20Abi, TestERC20Bytecode } from '@aztec/l1-artifacts';
19
20
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
20
21
  import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
22
+ import type { PXEConfig } from '@aztec/pxe/server';
21
23
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
22
24
 
23
25
  import { MNEMONIC } from '../fixtures/fixtures.js';
@@ -25,6 +27,7 @@ import {
25
27
  type EndToEndContext,
26
28
  type SetupOptions,
27
29
  deployAccounts,
30
+ ensureAuthRegistryPublished,
28
31
  publicDeployAccounts,
29
32
  setup,
30
33
  teardown,
@@ -36,6 +39,7 @@ export class CrossChainMessagingTest {
36
39
  private requireEpochProven: boolean;
37
40
  private setupOptions: SetupOptions;
38
41
  private deployL1ContractsArgs: Partial<DeployAztecL1ContractsArgs>;
42
+ private pxeOpts: Partial<PXEConfig>;
39
43
  logger: Logger;
40
44
  context!: EndToEndContext;
41
45
  aztecNode!: AztecNode;
@@ -58,12 +62,23 @@ export class CrossChainMessagingTest {
58
62
  outbox!: OutboxContract;
59
63
  cheatCodes!: CheatCodes;
60
64
 
65
+ /**
66
+ * Background loop that marks each completed epoch as proven on L1. Started in `applyBaseSetup`
67
+ * when the test runs without a real prover node, because the e2e fixture uses L1 interval mining
68
+ * and the AnvilTestWatcher's auto-prove loop only runs under L1 automine. Without this, L1's
69
+ * `aztecProofSubmissionEpochs` window expires mid-test and triggers a chain prune that drops
70
+ * in-flight wallet txs. Tests that intentionally pause proving (e.g. inbox drift tests) can
71
+ * stop it via `await t.epochTestSettler?.stop()`.
72
+ */
73
+ epochTestSettler?: EpochTestSettler;
74
+
61
75
  deployL1ContractsValues!: DeployAztecL1ContractsReturnType;
62
76
 
63
77
  constructor(
64
78
  testName: string,
65
79
  opts: SetupOptions = {},
66
80
  deployL1ContractsArgs: Partial<DeployAztecL1ContractsArgs> = {},
81
+ pxeOpts: Partial<PXEConfig> = {},
67
82
  ) {
68
83
  this.logger = createLogger(`e2e:e2e_cross_chain_messaging:${testName}`);
69
84
  this.setupOptions = opts;
@@ -71,17 +86,25 @@ export class CrossChainMessagingTest {
71
86
  initialValidators: [],
72
87
  ...deployL1ContractsArgs,
73
88
  };
89
+ this.pxeOpts = pxeOpts;
74
90
  this.requireEpochProven = opts.startProverNode ?? false;
75
91
  }
76
92
 
77
- async setup() {
93
+ async setup(opts: Partial<SetupOptions> = {}, pxeOpts: Partial<PXEConfig> = {}) {
78
94
  this.logger.info('Setting up cross chain messaging test');
79
- this.context = await setup(0, {
80
- ...this.setupOptions,
81
- fundSponsoredFPC: true,
82
- skipAccountDeployment: true,
83
- l1ContractsArgs: this.deployL1ContractsArgs,
84
- });
95
+ // Recompute requireEpochProven from the merged options so per-call startProverNode is honored.
96
+ this.requireEpochProven = opts.startProverNode ?? this.setupOptions.startProverNode ?? false;
97
+ this.context = await setup(
98
+ 0,
99
+ {
100
+ ...this.setupOptions,
101
+ ...opts,
102
+ fundSponsoredFPC: true,
103
+ skipAccountDeployment: true,
104
+ l1ContractsArgs: { ...this.deployL1ContractsArgs, ...opts.l1ContractsArgs },
105
+ },
106
+ { ...this.pxeOpts, ...pxeOpts },
107
+ );
85
108
  await this.applyBaseSetup();
86
109
  }
87
110
 
@@ -98,12 +121,13 @@ export class CrossChainMessagingTest {
98
121
 
99
122
  async catchUpProvenChain() {
100
123
  const bn = await this.aztecNode.getBlockNumber();
101
- while ((await this.aztecNode.getProvenBlockNumber()) < bn) {
124
+ while ((await this.aztecNode.getBlockNumber('proven')) < bn) {
102
125
  await sleep(1000);
103
126
  }
104
127
  }
105
128
 
106
129
  async teardown() {
130
+ await this.epochTestSettler?.stop();
107
131
  await teardown(this.context);
108
132
  }
109
133
 
@@ -119,6 +143,19 @@ export class CrossChainMessagingTest {
119
143
  if (this.requireEpochProven) {
120
144
  // Turn off the watcher to prevent it from keep marking blocks as proven.
121
145
  this.context.watcher.setIsMarkingAsProven(false);
146
+ } else {
147
+ // When no real prover is running, the L1 proof window (aztecProofSubmissionEpochs) would
148
+ // otherwise expire mid-test and trigger a chain prune. The AnvilTestWatcher's auto-prove
149
+ // loop is dormant under L1 interval mining (it gates on `isAutoMining`), so start an
150
+ // EpochTestSettler to mark each completed epoch as proven on L1.
151
+ this.epochTestSettler = new EpochTestSettler(
152
+ this.context.ethCheatCodes,
153
+ this.context.deployL1ContractsValues.l1ContractAddresses.rollupAddress,
154
+ this.context.aztecNodeService.getBlockSource(),
155
+ this.logger.createChild('epoch-settler'),
156
+ { pollingIntervalMs: 500 },
157
+ );
158
+ await this.epochTestSettler.start();
122
159
  }
123
160
 
124
161
  // Deploy 3 accounts
@@ -135,6 +172,7 @@ export class CrossChainMessagingTest {
135
172
  // Set up cross chain messaging
136
173
  this.logger.info('Applying e2e_cross_chain_messaging setup');
137
174
 
175
+ await ensureAuthRegistryPublished(this.wallet, this.ownerAddress);
138
176
  // Create the token contract state.
139
177
  this.logger.verbose(`Public deploy accounts...`);
140
178
  await publicDeployAccounts(this.wallet, [this.ownerAddress, this.user1Address, this.user2Address]);
@@ -171,7 +209,7 @@ export class CrossChainMessagingTest {
171
209
  const l1Client = createExtendedL1Client(this.aztecNodeConfig.l1RpcUrls, MNEMONIC);
172
210
  this.l1Client = l1Client;
173
211
 
174
- const l1Contracts = this.aztecNodeConfig.l1Contracts;
212
+ const l1Contracts = pickL1ContractAddresses(this.aztecNodeConfig);
175
213
  this.rollup = new RollupContract(l1Client, l1Contracts.rollupAddress.toString());
176
214
  this.inbox = new InboxContract(l1Client, l1Contracts.inboxAddress.toString());
177
215
  this.outbox = new OutboxContract(l1Client, l1Contracts.outboxAddress.toString());
@@ -185,7 +223,7 @@ export class CrossChainMessagingTest {
185
223
  tokenPortalAddress,
186
224
  crossChainContext.underlying,
187
225
  l1Client,
188
- this.aztecNodeConfig.l1Contracts,
226
+ pickL1ContractAddresses(this.aztecNodeConfig),
189
227
  this.wallet,
190
228
  this.ownerAddress,
191
229
  );
@@ -9,7 +9,7 @@ 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
11
 
12
- import { type EndToEndContext, deployAccounts, setup, teardown } from '../fixtures/setup.js';
12
+ import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../fixtures/setup.js';
13
13
  import type { TestWallet } from '../test-wallet/test_wallet.js';
14
14
 
15
15
  export class DeployTest {
@@ -24,9 +24,10 @@ export class DeployTest {
24
24
  this.logger = createLogger(`e2e:e2e_deploy_contract:${testName}`);
25
25
  }
26
26
 
27
- async setup() {
27
+ async setup(opts: Partial<SetupOptions> = {}) {
28
28
  this.logger.info('Setting up test environment');
29
29
  this.context = await setup(0, {
30
+ ...opts,
30
31
  fundSponsoredFPC: true,
31
32
  skipAccountDeployment: true,
32
33
  });