@aztec/end-to-end 0.0.1-commit.f295ac2 → 0.0.1-commit.f504929

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 (208) 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 +39 -23
  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 +13 -8
  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 +27 -18
  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 +15 -7
  19. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  20. package/dest/e2e_epochs/epochs_test.js +86 -39
  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 +16 -16
  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.js +4 -6
  29. package/dest/e2e_p2p/p2p_network.d.ts +4 -3
  30. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  31. package/dest/e2e_p2p/p2p_network.js +28 -7
  32. package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
  33. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
  34. package/dest/e2e_p2p/reqresp/utils.js +177 -0
  35. package/dest/e2e_p2p/shared.d.ts +20 -6
  36. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  37. package/dest/e2e_p2p/shared.js +38 -18
  38. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
  39. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
  40. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
  41. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
  42. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
  43. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
  44. package/dest/e2e_token_contract/token_contract_test.d.ts +4 -2
  45. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  46. package/dest/e2e_token_contract/token_contract_test.js +20 -10
  47. package/dest/fixtures/authwit_proxy.d.ts +15 -0
  48. package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
  49. package/dest/fixtures/authwit_proxy.js +30 -0
  50. package/dest/fixtures/e2e_prover_test.d.ts +4 -4
  51. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  52. package/dest/fixtures/e2e_prover_test.js +41 -45
  53. package/dest/fixtures/elu_monitor.d.ts +21 -0
  54. package/dest/fixtures/elu_monitor.d.ts.map +1 -0
  55. package/dest/fixtures/elu_monitor.js +102 -0
  56. package/dest/fixtures/fixtures.d.ts +5 -1
  57. package/dest/fixtures/fixtures.d.ts.map +1 -1
  58. package/dest/fixtures/fixtures.js +6 -0
  59. package/dest/fixtures/ha_setup.d.ts +71 -0
  60. package/dest/fixtures/ha_setup.d.ts.map +1 -0
  61. package/dest/fixtures/ha_setup.js +116 -0
  62. package/dest/fixtures/index.d.ts +2 -1
  63. package/dest/fixtures/index.d.ts.map +1 -1
  64. package/dest/fixtures/index.js +1 -0
  65. package/dest/fixtures/setup.d.ts +43 -25
  66. package/dest/fixtures/setup.d.ts.map +1 -1
  67. package/dest/fixtures/setup.js +90 -169
  68. package/dest/fixtures/setup_p2p_test.d.ts +16 -9
  69. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  70. package/dest/fixtures/setup_p2p_test.js +40 -29
  71. package/dest/fixtures/token_utils.d.ts +2 -2
  72. package/dest/fixtures/token_utils.d.ts.map +1 -1
  73. package/dest/fixtures/token_utils.js +12 -8
  74. package/dest/shared/cross_chain_test_harness.d.ts +3 -4
  75. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  76. package/dest/shared/cross_chain_test_harness.js +24 -24
  77. package/dest/shared/gas_portal_test_harness.js +3 -3
  78. package/dest/shared/index.d.ts +2 -1
  79. package/dest/shared/index.d.ts.map +1 -1
  80. package/dest/shared/index.js +1 -0
  81. package/dest/shared/jest_setup.js +41 -1
  82. package/dest/shared/mock_state_view.d.ts +86 -0
  83. package/dest/shared/mock_state_view.d.ts.map +1 -0
  84. package/dest/shared/mock_state_view.js +186 -0
  85. package/dest/shared/submit-transactions.d.ts +4 -4
  86. package/dest/shared/submit-transactions.d.ts.map +1 -1
  87. package/dest/shared/submit-transactions.js +9 -11
  88. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  89. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  90. package/dest/shared/uniswap_l1_l2.js +24 -22
  91. package/dest/simulators/lending_simulator.d.ts +1 -1
  92. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  93. package/dest/simulators/lending_simulator.js +4 -4
  94. package/dest/simulators/token_simulator.d.ts +1 -1
  95. package/dest/simulators/token_simulator.d.ts.map +1 -1
  96. package/dest/simulators/token_simulator.js +3 -24
  97. package/dest/spartan/setup_test_wallets.d.ts +9 -2
  98. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  99. package/dest/spartan/setup_test_wallets.js +93 -35
  100. package/dest/spartan/tx_metrics.d.ts +48 -2
  101. package/dest/spartan/tx_metrics.d.ts.map +1 -1
  102. package/dest/spartan/tx_metrics.js +310 -6
  103. package/dest/spartan/utils/bot.d.ts +28 -0
  104. package/dest/spartan/utils/bot.d.ts.map +1 -0
  105. package/dest/spartan/utils/bot.js +142 -0
  106. package/dest/spartan/utils/chaos.d.ts +79 -0
  107. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  108. package/dest/spartan/utils/chaos.js +142 -0
  109. package/dest/spartan/utils/clients.d.ts +39 -0
  110. package/dest/spartan/utils/clients.d.ts.map +1 -0
  111. package/dest/spartan/utils/clients.js +90 -0
  112. package/dest/spartan/utils/config.d.ts +42 -0
  113. package/dest/spartan/utils/config.d.ts.map +1 -0
  114. package/dest/spartan/utils/config.js +22 -0
  115. package/dest/spartan/utils/health.d.ts +63 -0
  116. package/dest/spartan/utils/health.d.ts.map +1 -0
  117. package/dest/spartan/utils/health.js +202 -0
  118. package/dest/spartan/utils/helm.d.ts +15 -0
  119. package/dest/spartan/utils/helm.d.ts.map +1 -0
  120. package/dest/spartan/utils/helm.js +47 -0
  121. package/dest/spartan/utils/index.d.ts +10 -0
  122. package/dest/spartan/utils/index.d.ts.map +1 -0
  123. package/dest/spartan/utils/index.js +20 -0
  124. package/dest/spartan/utils/k8s.d.ts +128 -0
  125. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  126. package/dest/spartan/utils/k8s.js +381 -0
  127. package/dest/spartan/utils/nodes.d.ts +40 -0
  128. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  129. package/dest/spartan/utils/nodes.js +461 -0
  130. package/dest/spartan/utils/scripts.d.ts +30 -0
  131. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  132. package/dest/spartan/utils/scripts.js +81 -0
  133. package/dest/spartan/utils.d.ts +2 -260
  134. package/dest/spartan/utils.d.ts.map +1 -1
  135. package/dest/spartan/utils.js +1 -942
  136. package/dest/test-wallet/test_wallet.d.ts +83 -0
  137. package/dest/test-wallet/test_wallet.d.ts.map +1 -0
  138. package/dest/test-wallet/test_wallet.js +214 -0
  139. package/dest/test-wallet/utils.d.ts +41 -0
  140. package/dest/test-wallet/utils.d.ts.map +1 -0
  141. package/dest/test-wallet/utils.js +71 -0
  142. package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
  143. package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
  144. package/dest/test-wallet/wallet_worker_script.js +48 -0
  145. package/dest/test-wallet/worker_wallet.d.ts +52 -0
  146. package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
  147. package/dest/test-wallet/worker_wallet.js +151 -0
  148. package/dest/test-wallet/worker_wallet_schema.d.ts +274 -0
  149. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
  150. package/dest/test-wallet/worker_wallet_schema.js +10 -0
  151. package/package.json +46 -43
  152. package/src/bench/client_flows/client_flows_benchmark.ts +45 -57
  153. package/src/bench/client_flows/config.ts +9 -1
  154. package/src/bench/utils.ts +15 -8
  155. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +33 -23
  156. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +7 -8
  157. package/src/e2e_deploy_contract/deploy_test.ts +3 -3
  158. package/src/e2e_epochs/epochs_test.ts +129 -93
  159. package/src/e2e_fees/bridging_race.notest.ts +2 -5
  160. package/src/e2e_fees/fees_test.ts +24 -39
  161. package/src/e2e_l1_publisher/write_json.ts +3 -8
  162. package/src/e2e_nested_contract/nested_contract_test.ts +7 -7
  163. package/src/e2e_p2p/inactivity_slash_test.ts +4 -4
  164. package/src/e2e_p2p/p2p_network.ts +49 -17
  165. package/src/e2e_p2p/reqresp/utils.ts +235 -0
  166. package/src/e2e_p2p/shared.ts +66 -23
  167. package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
  168. package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
  169. package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
  170. package/src/e2e_token_contract/token_contract_test.ts +27 -12
  171. package/src/fixtures/authwit_proxy.ts +50 -0
  172. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  173. package/src/fixtures/e2e_prover_test.ts +43 -52
  174. package/src/fixtures/elu_monitor.ts +126 -0
  175. package/src/fixtures/fixtures.ts +10 -0
  176. package/src/fixtures/ha_setup.ts +186 -0
  177. package/src/fixtures/index.ts +1 -0
  178. package/src/fixtures/setup.ts +120 -233
  179. package/src/fixtures/setup_p2p_test.ts +40 -44
  180. package/src/fixtures/token_utils.ts +10 -6
  181. package/src/guides/up_quick_start.sh +3 -3
  182. package/src/shared/cross_chain_test_harness.ts +24 -34
  183. package/src/shared/gas_portal_test_harness.ts +2 -2
  184. package/src/shared/index.ts +1 -0
  185. package/src/shared/jest_setup.ts +51 -1
  186. package/src/shared/mock_state_view.ts +188 -0
  187. package/src/shared/submit-transactions.ts +11 -16
  188. package/src/shared/uniswap_l1_l2.ts +26 -33
  189. package/src/simulators/lending_simulator.ts +6 -4
  190. package/src/simulators/token_simulator.ts +6 -30
  191. package/src/spartan/setup_test_wallets.ts +120 -25
  192. package/src/spartan/tx_metrics.ts +232 -9
  193. package/src/spartan/utils/bot.ts +188 -0
  194. package/src/spartan/utils/chaos.ts +253 -0
  195. package/src/spartan/utils/clients.ts +100 -0
  196. package/src/spartan/utils/config.ts +28 -0
  197. package/src/spartan/utils/health.ts +255 -0
  198. package/src/spartan/utils/helm.ts +84 -0
  199. package/src/spartan/utils/index.ts +68 -0
  200. package/src/spartan/utils/k8s.ts +535 -0
  201. package/src/spartan/utils/nodes.ts +543 -0
  202. package/src/spartan/utils/scripts.ts +99 -0
  203. package/src/spartan/utils.ts +1 -1246
  204. package/src/test-wallet/test_wallet.ts +306 -0
  205. package/src/test-wallet/utils.ts +112 -0
  206. package/src/test-wallet/wallet_worker_script.ts +60 -0
  207. package/src/test-wallet/worker_wallet.ts +213 -0
  208. package/src/test-wallet/worker_wallet_schema.ts +13 -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,16 +138,17 @@ 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
  }
148
148
 
149
149
  async teardown() {
150
150
  await this.chainMonitor.stop();
151
+ await this.userWallet?.stop();
151
152
  await teardown(this.context);
152
153
  }
153
154
 
@@ -156,21 +157,20 @@ export class ClientFlowsBenchmark {
156
157
  const { claimSecret: secret, messageLeafIndex: index } = claim;
157
158
  await this.feeJuiceContract.methods
158
159
  .claim(address, claim.claimAmount, secret, index)
159
- .send({ from: this.adminAddress })
160
- .wait();
160
+ .send({ from: this.adminAddress });
161
161
  }
162
162
 
163
163
  /** Admin mints bananaCoin tokens privately to the target address and redeems them. */
164
164
  async mintPrivateBananas(amount: bigint, address: AztecAddress) {
165
- const balanceBefore = await this.bananaCoin.methods
165
+ const { result: balanceBefore } = await this.bananaCoin.methods
166
166
  .balance_of_private(address)
167
- .simulate({ from: this.adminAddress });
167
+ .simulate({ from: address });
168
168
 
169
169
  await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
170
170
 
171
- const balanceAfter = await this.bananaCoin.methods
171
+ const { result: balanceAfter } = await this.bananaCoin.methods
172
172
  .balance_of_private(address)
173
- .simulate({ from: this.adminAddress });
173
+ .simulate({ from: address });
174
174
  expect(balanceAfter).toEqual(balanceBefore + amount);
175
175
  }
176
176
 
@@ -208,7 +208,7 @@ export class ClientFlowsBenchmark {
208
208
  const [{ address: adminAddress }, { address: sequencerAddress }] = deployedAccounts;
209
209
 
210
210
  this.adminWallet = this.context.wallet;
211
- this.aztecNode = this.context.aztecNodeService!;
211
+ this.aztecNode = this.context.aztecNodeService;
212
212
  this.cheatCodes = this.context.cheatCodes;
213
213
 
214
214
  this.adminAddress = adminAddress;
@@ -236,8 +236,8 @@ export class ClientFlowsBenchmark {
236
236
  this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
237
237
 
238
238
  this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
239
- aztecNode: this.context.aztecNodeService!,
240
- aztecNodeAdmin: this.context.aztecNodeService!,
239
+ aztecNode: this.context.aztecNodeService,
240
+ aztecNodeAdmin: this.context.aztecNodeService,
241
241
  l1Client: this.context.deployL1ContractsValues.l1Client,
242
242
  wallet: this.adminWallet,
243
243
  logger: this.logger,
@@ -246,15 +246,12 @@ export class ClientFlowsBenchmark {
246
246
 
247
247
  async applyDeployBananaToken() {
248
248
  this.logger.info('Applying banana token deployment');
249
- const { contract: bananaCoin, instance: bananaCoinInstance } = await BananaCoin.deploy(
250
- this.adminWallet,
251
- this.adminAddress,
252
- 'BC',
253
- 'BC',
254
- 18n,
255
- )
256
- .send({ from: this.adminAddress })
257
- .wait();
249
+ const {
250
+ receipt: { contract: bananaCoin, instance: bananaCoinInstance },
251
+ } = await BananaCoin.deploy(this.adminWallet, this.adminAddress, 'BC', 'BC', 18n).send({
252
+ from: this.adminAddress,
253
+ wait: { returnReceipt: true },
254
+ });
258
255
  this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
259
256
  this.bananaCoin = bananaCoin;
260
257
  this.bananaCoinInstance = bananaCoinInstance;
@@ -262,15 +259,12 @@ export class ClientFlowsBenchmark {
262
259
 
263
260
  async applyDeployCandyBarToken() {
264
261
  this.logger.info('Applying candy bar token deployment');
265
- const { contract: candyBarCoin, instance: candyBarCoinInstance } = await TokenContract.deploy(
266
- this.adminWallet,
267
- this.adminAddress,
268
- 'CBC',
269
- 'CBC',
270
- 18n,
271
- )
272
- .send({ from: this.adminAddress })
273
- .wait();
262
+ const {
263
+ receipt: { contract: candyBarCoin, instance: candyBarCoinInstance },
264
+ } = await TokenContract.deploy(this.adminWallet, this.adminAddress, 'CBC', 'CBC', 18n).send({
265
+ from: this.adminAddress,
266
+ wait: { returnReceipt: true },
267
+ });
274
268
  this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
275
269
  this.candyBarCoin = candyBarCoin;
276
270
  this.candyBarCoinInstance = candyBarCoinInstance;
@@ -282,13 +276,12 @@ export class ClientFlowsBenchmark {
282
276
  expect((await this.context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
283
277
 
284
278
  const bananaCoin = this.bananaCoin;
285
- const { contract: bananaFPC, instance: bananaFPCInstance } = await FPCContract.deploy(
286
- this.adminWallet,
287
- bananaCoin.address,
288
- this.adminAddress,
289
- )
290
- .send({ from: this.adminAddress })
291
- .wait();
279
+ const {
280
+ receipt: { contract: bananaFPC, instance: bananaFPCInstance },
281
+ } = await FPCContract.deploy(this.adminWallet, bananaCoin.address, this.adminAddress).send({
282
+ from: this.adminAddress,
283
+ wait: { returnReceipt: true },
284
+ });
292
285
 
293
286
  this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
294
287
 
@@ -336,12 +329,10 @@ export class ClientFlowsBenchmark {
336
329
  const benchysAddress = benchysAccountManager.address;
337
330
  const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
338
331
  const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
339
- await behchysDeployMethod
340
- .send({
341
- from: AztecAddress.ZERO,
342
- fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
343
- })
344
- .wait();
332
+ await behchysDeployMethod.send({
333
+ from: AztecAddress.ZERO,
334
+ fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
335
+ });
345
336
  // Register benchy on the user's Wallet, where we're going to be interacting from
346
337
  const accountManager = await this.userWallet.createAccount({
347
338
  secret: benchysAccount.getSecretKey(),
@@ -353,25 +344,22 @@ export class ClientFlowsBenchmark {
353
344
 
354
345
  public async applyDeployAmm() {
355
346
  this.logger.info('Applying AMM deployment');
356
- const { contract: liquidityToken, instance: liquidityTokenInstance } = await TokenContract.deploy(
357
- this.adminWallet,
358
- this.adminAddress,
359
- 'LPT',
360
- 'LPT',
361
- 18n,
362
- )
363
- .send({ from: this.adminAddress })
364
- .wait();
365
- const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
347
+ const {
348
+ receipt: { contract: liquidityToken, instance: liquidityTokenInstance },
349
+ } = await TokenContract.deploy(this.adminWallet, this.adminAddress, 'LPT', 'LPT', 18n).send({
350
+ from: this.adminAddress,
351
+ wait: { returnReceipt: true },
352
+ });
353
+ const {
354
+ receipt: { contract: amm, instance: ammInstance },
355
+ } = await AMMContract.deploy(
366
356
  this.adminWallet,
367
357
  this.bananaCoin.address,
368
358
  this.candyBarCoin.address,
369
359
  liquidityToken.address,
370
- )
371
- .send({ from: this.adminAddress })
372
- .wait();
360
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
373
361
  this.logger.info(`AMM deployed at ${amm.address}`);
374
- await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress }).wait();
362
+ await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress });
375
363
  this.liquidityToken = liquidityToken;
376
364
  this.liquidityTokenInstance = liquidityTokenInstance;
377
365
  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,23 @@ 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(
153
+ calls.map(async call => {
154
+ const { txHash } = await call.send({ from, wait: NO_WAIT });
155
+ return txHash;
156
+ }),
157
+ );
151
158
  }
152
159
 
153
- export async function waitTxs(txs: SentTx[], context: EndToEndContext, txWaitOpts?: WaitOpts) {
160
+ export async function waitTxs(txs: TxHash[], context: EndToEndContext, txWaitOpts?: WaitOpts) {
154
161
  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`);
162
+ await Promise.all(txs.map(txHash => waitForTx(context.aztecNode, txHash, txWaitOpts)));
163
+ context.logger.info(`${txs.length} txs have been mined`);
157
164
  }
158
165
 
159
166
  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
+ authwitProxy!: 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,26 @@ 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
+ ({ contract: 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
+ ({ contract: this.badAccount } = await InvalidAccountContract.deploy(this.wallet).send({
117
+ from: this.adminAddress,
118
+ }));
115
119
  this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
116
120
 
121
+ // Deploy a proxy contract for "on behalf of other" tests. The note owner must be the tx sender
122
+ // (so their notes are in scope), but msg_sender in the target must differ from the note owner
123
+ // to trigger authwit validation. The proxy forwards calls so that msg_sender != tx sender.
124
+ this.logger.verbose(`Deploying generic proxy...`);
125
+ ({ contract: this.authwitProxy } = await GenericProxyContract.deploy(this.wallet).send({
126
+ from: this.adminAddress,
127
+ }));
128
+ this.logger.verbose(`Deployed to ${this.authwitProxy.address}.`);
129
+
117
130
  await this.crossTimestampOfChange();
118
131
 
119
132
  this.tokenSim = new TokenSimulator(
@@ -124,9 +137,9 @@ export class BlacklistTokenContractTest {
124
137
  [this.adminAddress, this.otherAddress, this.blacklistedAddress],
125
138
  );
126
139
 
127
- expect(await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).toEqual(
128
- new Role().withAdmin().toNoirStruct(),
129
- );
140
+ expect(
141
+ (await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).result,
142
+ ).toEqual(new Role().withAdmin().toNoirStruct());
130
143
  }
131
144
 
132
145
  async setup() {
@@ -171,50 +184,47 @@ export class BlacklistTokenContractTest {
171
184
  const adminMinterRole = new Role().withAdmin().withMinter();
172
185
  await this.asset.methods
173
186
  .update_roles(this.adminAddress, adminMinterRole.toNoirStruct())
174
- .send({ from: this.adminAddress })
175
- .wait();
187
+ .send({ from: this.adminAddress });
176
188
 
177
189
  const blacklistRole = new Role().withBlacklisted();
178
190
  await this.asset.methods
179
191
  .update_roles(this.blacklistedAddress, blacklistRole.toNoirStruct())
180
- .send({ from: this.adminAddress })
181
- .wait();
192
+ .send({ from: this.adminAddress });
182
193
 
183
194
  await this.crossTimestampOfChange();
184
195
 
185
- expect(await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).toEqual(
186
- adminMinterRole.toNoirStruct(),
187
- );
196
+ expect(
197
+ (await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).result,
198
+ ).toEqual(adminMinterRole.toNoirStruct());
188
199
 
189
200
  this.logger.verbose(`Minting ${amount} publicly...`);
190
- await asset.methods.mint_public(this.adminAddress, amount).send({ from: this.adminAddress }).wait();
201
+ await asset.methods.mint_public(this.adminAddress, amount).send({ from: this.adminAddress });
191
202
 
192
203
  this.logger.verbose(`Minting ${amount} privately...`);
193
204
  const secret = Fr.random();
194
205
  const secretHash = await computeSecretHash(secret);
195
- const receipt = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress }).wait();
206
+ const { receipt } = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress });
196
207
 
197
208
  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();
209
+ await asset.methods.redeem_shield(this.adminAddress, amount, secret).send({ from: this.adminAddress });
200
210
  this.logger.verbose(`Minting complete.`);
201
211
 
202
212
  tokenSim.mintPublic(this.adminAddress, amount);
203
213
 
204
- const publicBalance = await asset.methods
214
+ const { result: publicBalance } = await asset.methods
205
215
  .balance_of_public(this.adminAddress)
206
216
  .simulate({ from: this.adminAddress });
207
217
  this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
208
218
  expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(this.adminAddress));
209
219
 
210
220
  tokenSim.mintPrivate(this.adminAddress, amount);
211
- const privateBalance = await asset.methods
221
+ const { result: privateBalance } = await asset.methods
212
222
  .balance_of_private(this.adminAddress)
213
223
  .simulate({ from: this.adminAddress });
214
224
  this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
215
225
  expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(this.adminAddress));
216
226
 
217
- const totalSupply = await asset.methods.total_supply().simulate({ from: this.adminAddress });
227
+ const { result: totalSupply } = await asset.methods.total_supply().simulate({ from: this.adminAddress });
218
228
  this.logger.verbose(`Total supply: ${totalSupply}`);
219
229
  expect(totalSupply).toEqual(tokenSim.totalSupply);
220
230
  }
@@ -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
  }