@aztec/end-to-end 0.0.1-commit.3469e52 → 0.0.1-commit.35158ae7e

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 (216) 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 +49 -26
  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 +17 -7
  19. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  20. package/dest/e2e_epochs/epochs_test.js +90 -40
  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 +24 -17
  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 +5 -4
  30. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  31. package/dest/e2e_p2p/p2p_network.js +29 -8
  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 +190 -0
  35. package/dest/e2e_p2p/shared.d.ts +26 -6
  36. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  37. package/dest/e2e_p2p/shared.js +46 -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 +7 -6
  51. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  52. package/dest/fixtures/e2e_prover_test.js +44 -50
  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/get_bb_config.d.ts +1 -1
  60. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  61. package/dest/fixtures/get_bb_config.js +5 -5
  62. package/dest/fixtures/ha_setup.d.ts +71 -0
  63. package/dest/fixtures/ha_setup.d.ts.map +1 -0
  64. package/dest/fixtures/ha_setup.js +116 -0
  65. package/dest/fixtures/index.d.ts +2 -1
  66. package/dest/fixtures/index.d.ts.map +1 -1
  67. package/dest/fixtures/index.js +1 -0
  68. package/dest/fixtures/setup.d.ts +48 -25
  69. package/dest/fixtures/setup.d.ts.map +1 -1
  70. package/dest/fixtures/setup.js +97 -172
  71. package/dest/fixtures/setup_p2p_test.d.ts +16 -9
  72. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  73. package/dest/fixtures/setup_p2p_test.js +40 -29
  74. package/dest/fixtures/token_utils.d.ts +2 -2
  75. package/dest/fixtures/token_utils.d.ts.map +1 -1
  76. package/dest/fixtures/token_utils.js +12 -8
  77. package/dest/shared/cross_chain_test_harness.d.ts +3 -4
  78. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  79. package/dest/shared/cross_chain_test_harness.js +24 -24
  80. package/dest/shared/gas_portal_test_harness.js +3 -3
  81. package/dest/shared/index.d.ts +2 -1
  82. package/dest/shared/index.d.ts.map +1 -1
  83. package/dest/shared/index.js +1 -0
  84. package/dest/shared/jest_setup.js +41 -1
  85. package/dest/shared/mock_state_view.d.ts +86 -0
  86. package/dest/shared/mock_state_view.d.ts.map +1 -0
  87. package/dest/shared/mock_state_view.js +186 -0
  88. package/dest/shared/submit-transactions.d.ts +4 -4
  89. package/dest/shared/submit-transactions.d.ts.map +1 -1
  90. package/dest/shared/submit-transactions.js +9 -11
  91. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  92. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  93. package/dest/shared/uniswap_l1_l2.js +27 -28
  94. package/dest/simulators/lending_simulator.d.ts +1 -1
  95. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  96. package/dest/simulators/lending_simulator.js +6 -6
  97. package/dest/simulators/token_simulator.d.ts +1 -1
  98. package/dest/simulators/token_simulator.d.ts.map +1 -1
  99. package/dest/simulators/token_simulator.js +3 -24
  100. package/dest/spartan/setup_test_wallets.d.ts +12 -3
  101. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  102. package/dest/spartan/setup_test_wallets.js +162 -41
  103. package/dest/spartan/tx_metrics.d.ts +38 -2
  104. package/dest/spartan/tx_metrics.d.ts.map +1 -1
  105. package/dest/spartan/tx_metrics.js +179 -5
  106. package/dest/spartan/utils/bot.d.ts +28 -0
  107. package/dest/spartan/utils/bot.d.ts.map +1 -0
  108. package/dest/spartan/utils/bot.js +142 -0
  109. package/dest/spartan/utils/chaos.d.ts +79 -0
  110. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  111. package/dest/spartan/utils/chaos.js +142 -0
  112. package/dest/spartan/utils/clients.d.ts +39 -0
  113. package/dest/spartan/utils/clients.d.ts.map +1 -0
  114. package/dest/spartan/utils/clients.js +90 -0
  115. package/dest/spartan/utils/config.d.ts +45 -0
  116. package/dest/spartan/utils/config.d.ts.map +1 -0
  117. package/dest/spartan/utils/config.js +23 -0
  118. package/dest/spartan/utils/health.d.ts +63 -0
  119. package/dest/spartan/utils/health.d.ts.map +1 -0
  120. package/dest/spartan/utils/health.js +202 -0
  121. package/dest/spartan/utils/helm.d.ts +15 -0
  122. package/dest/spartan/utils/helm.d.ts.map +1 -0
  123. package/dest/spartan/utils/helm.js +47 -0
  124. package/dest/spartan/utils/index.d.ts +11 -0
  125. package/dest/spartan/utils/index.d.ts.map +1 -0
  126. package/dest/spartan/utils/index.js +22 -0
  127. package/dest/spartan/utils/k8s.d.ts +128 -0
  128. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  129. package/dest/spartan/utils/k8s.js +381 -0
  130. package/dest/spartan/utils/nodes.d.ts +40 -0
  131. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  132. package/dest/spartan/utils/nodes.js +461 -0
  133. package/dest/spartan/utils/pod_logs.d.ts +25 -0
  134. package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
  135. package/dest/spartan/utils/pod_logs.js +74 -0
  136. package/dest/spartan/utils/scripts.d.ts +30 -0
  137. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  138. package/dest/spartan/utils/scripts.js +81 -0
  139. package/dest/spartan/utils.d.ts +2 -260
  140. package/dest/spartan/utils.d.ts.map +1 -1
  141. package/dest/spartan/utils.js +1 -942
  142. package/dest/test-wallet/test_wallet.d.ts +76 -0
  143. package/dest/test-wallet/test_wallet.d.ts.map +1 -0
  144. package/dest/test-wallet/test_wallet.js +213 -0
  145. package/dest/test-wallet/utils.d.ts +41 -0
  146. package/dest/test-wallet/utils.d.ts.map +1 -0
  147. package/dest/test-wallet/utils.js +71 -0
  148. package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
  149. package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
  150. package/dest/test-wallet/wallet_worker_script.js +48 -0
  151. package/dest/test-wallet/worker_wallet.d.ts +52 -0
  152. package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
  153. package/dest/test-wallet/worker_wallet.js +151 -0
  154. package/dest/test-wallet/worker_wallet_schema.d.ts +274 -0
  155. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
  156. package/dest/test-wallet/worker_wallet_schema.js +10 -0
  157. package/package.json +45 -43
  158. package/src/bench/client_flows/client_flows_benchmark.ts +50 -58
  159. package/src/bench/client_flows/config.ts +9 -1
  160. package/src/bench/utils.ts +15 -8
  161. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +33 -23
  162. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +7 -8
  163. package/src/e2e_deploy_contract/deploy_test.ts +3 -3
  164. package/src/e2e_epochs/epochs_test.ts +139 -91
  165. package/src/e2e_fees/bridging_race.notest.ts +2 -5
  166. package/src/e2e_fees/fees_test.ts +28 -40
  167. package/src/e2e_l1_publisher/write_json.ts +3 -8
  168. package/src/e2e_nested_contract/nested_contract_test.ts +7 -7
  169. package/src/e2e_p2p/inactivity_slash_test.ts +4 -4
  170. package/src/e2e_p2p/p2p_network.ts +50 -18
  171. package/src/e2e_p2p/reqresp/utils.ts +256 -0
  172. package/src/e2e_p2p/shared.ts +76 -23
  173. package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
  174. package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
  175. package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
  176. package/src/e2e_token_contract/token_contract_test.ts +27 -12
  177. package/src/fixtures/authwit_proxy.ts +50 -0
  178. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  179. package/src/fixtures/e2e_prover_test.ts +48 -63
  180. package/src/fixtures/elu_monitor.ts +126 -0
  181. package/src/fixtures/fixtures.ts +10 -0
  182. package/src/fixtures/get_bb_config.ts +7 -6
  183. package/src/fixtures/ha_setup.ts +186 -0
  184. package/src/fixtures/index.ts +1 -0
  185. package/src/fixtures/setup.ts +131 -235
  186. package/src/fixtures/setup_p2p_test.ts +40 -44
  187. package/src/fixtures/token_utils.ts +10 -6
  188. package/src/guides/up_quick_start.sh +3 -3
  189. package/src/shared/cross_chain_test_harness.ts +24 -34
  190. package/src/shared/gas_portal_test_harness.ts +2 -2
  191. package/src/shared/index.ts +1 -0
  192. package/src/shared/jest_setup.ts +51 -1
  193. package/src/shared/mock_state_view.ts +188 -0
  194. package/src/shared/submit-transactions.ts +11 -16
  195. package/src/shared/uniswap_l1_l2.ts +49 -51
  196. package/src/simulators/lending_simulator.ts +10 -6
  197. package/src/simulators/token_simulator.ts +6 -30
  198. package/src/spartan/setup_test_wallets.ts +205 -26
  199. package/src/spartan/tx_metrics.ts +153 -8
  200. package/src/spartan/utils/bot.ts +188 -0
  201. package/src/spartan/utils/chaos.ts +253 -0
  202. package/src/spartan/utils/clients.ts +100 -0
  203. package/src/spartan/utils/config.ts +29 -0
  204. package/src/spartan/utils/health.ts +255 -0
  205. package/src/spartan/utils/helm.ts +84 -0
  206. package/src/spartan/utils/index.ts +71 -0
  207. package/src/spartan/utils/k8s.ts +535 -0
  208. package/src/spartan/utils/nodes.ts +543 -0
  209. package/src/spartan/utils/pod_logs.ts +99 -0
  210. package/src/spartan/utils/scripts.ts +99 -0
  211. package/src/spartan/utils.ts +1 -1246
  212. package/src/test-wallet/test_wallet.ts +301 -0
  213. package/src/test-wallet/utils.ts +112 -0
  214. package/src/test-wallet/wallet_worker_script.ts +60 -0
  215. package/src/test-wallet/worker_wallet.ts +213 -0
  216. package/src/test-wallet/worker_wallet_schema.ts +13 -0
@@ -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';
@@ -26,7 +27,6 @@ import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
26
27
  import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
27
28
  import { GasSettings } from '@aztec/stdlib/gas';
28
29
  import { deriveSigningKey } from '@aztec/stdlib/keys';
29
- import { TestWallet } from '@aztec/test-wallet/server';
30
30
 
31
31
  import { MNEMONIC } from '../../fixtures/fixtures.js';
32
32
  import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../../fixtures/setup.js';
@@ -37,6 +37,7 @@ import {
37
37
  FeeJuicePortalTestingHarnessFactory,
38
38
  type GasBridgingTestHarness,
39
39
  } from '../../shared/gas_portal_test_harness.js';
40
+ import { TestWallet } from '../../test-wallet/test_wallet.js';
40
41
  import { ProxyLogger } from './benchmark.js';
41
42
  import { type ClientFlowsConfig, FULL_FLOWS_CONFIG, KEY_FLOWS_CONFIG } from './config.js';
42
43
 
@@ -130,24 +131,28 @@ export class ClientFlowsBenchmark {
130
131
 
131
132
  async setup() {
132
133
  this.logger.info('Setting up subsystems from fresh');
134
+ // Token allowlist entries are test-only: FPC-based fee payment with custom tokens won't work on mainnet alpha.
135
+ const tokenAllowList = await getTokenAllowedSetupFunctions();
133
136
  this.context = await setup(0, {
134
137
  ...this.setupOptions,
135
138
  fundSponsoredFPC: true,
136
139
  skipAccountDeployment: true,
137
140
  l1ContractsArgs: this.setupOptions,
141
+ txPublicSetupAllowListExtend: [...(this.setupOptions.txPublicSetupAllowListExtend ?? []), ...tokenAllowList],
138
142
  });
139
143
  await this.applyBaseSetup();
140
144
 
141
- await this.context.aztecNodeService!.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
145
+ await this.context.aztecNodeService.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
142
146
 
143
147
  const rollupContract = RollupContract.getFromConfig(this.context.config);
144
- this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider!, this.logger, 200).start();
148
+ this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider, this.logger, 200).start();
145
149
 
146
150
  return this;
147
151
  }
148
152
 
149
153
  async teardown() {
150
154
  await this.chainMonitor.stop();
155
+ await this.userWallet?.stop();
151
156
  await teardown(this.context);
152
157
  }
153
158
 
@@ -156,21 +161,20 @@ export class ClientFlowsBenchmark {
156
161
  const { claimSecret: secret, messageLeafIndex: index } = claim;
157
162
  await this.feeJuiceContract.methods
158
163
  .claim(address, claim.claimAmount, secret, index)
159
- .send({ from: this.adminAddress })
160
- .wait();
164
+ .send({ from: this.adminAddress });
161
165
  }
162
166
 
163
167
  /** Admin mints bananaCoin tokens privately to the target address and redeems them. */
164
168
  async mintPrivateBananas(amount: bigint, address: AztecAddress) {
165
- const balanceBefore = await this.bananaCoin.methods
169
+ const { result: balanceBefore } = await this.bananaCoin.methods
166
170
  .balance_of_private(address)
167
- .simulate({ from: this.adminAddress });
171
+ .simulate({ from: address });
168
172
 
169
173
  await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
170
174
 
171
- const balanceAfter = await this.bananaCoin.methods
175
+ const { result: balanceAfter } = await this.bananaCoin.methods
172
176
  .balance_of_private(address)
173
- .simulate({ from: this.adminAddress });
177
+ .simulate({ from: address });
174
178
  expect(balanceAfter).toEqual(balanceBefore + amount);
175
179
  }
176
180
 
@@ -208,7 +212,7 @@ export class ClientFlowsBenchmark {
208
212
  const [{ address: adminAddress }, { address: sequencerAddress }] = deployedAccounts;
209
213
 
210
214
  this.adminWallet = this.context.wallet;
211
- this.aztecNode = this.context.aztecNodeService!;
215
+ this.aztecNode = this.context.aztecNodeService;
212
216
  this.cheatCodes = this.context.cheatCodes;
213
217
 
214
218
  this.adminAddress = adminAddress;
@@ -236,8 +240,8 @@ export class ClientFlowsBenchmark {
236
240
  this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
237
241
 
238
242
  this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
239
- aztecNode: this.context.aztecNodeService!,
240
- aztecNodeAdmin: this.context.aztecNodeService!,
243
+ aztecNode: this.context.aztecNodeService,
244
+ aztecNodeAdmin: this.context.aztecNodeService,
241
245
  l1Client: this.context.deployL1ContractsValues.l1Client,
242
246
  wallet: this.adminWallet,
243
247
  logger: this.logger,
@@ -246,15 +250,12 @@ export class ClientFlowsBenchmark {
246
250
 
247
251
  async applyDeployBananaToken() {
248
252
  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();
253
+ const {
254
+ receipt: { contract: bananaCoin, instance: bananaCoinInstance },
255
+ } = await BananaCoin.deploy(this.adminWallet, this.adminAddress, 'BC', 'BC', 18n).send({
256
+ from: this.adminAddress,
257
+ wait: { returnReceipt: true },
258
+ });
258
259
  this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
259
260
  this.bananaCoin = bananaCoin;
260
261
  this.bananaCoinInstance = bananaCoinInstance;
@@ -262,15 +263,12 @@ export class ClientFlowsBenchmark {
262
263
 
263
264
  async applyDeployCandyBarToken() {
264
265
  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();
266
+ const {
267
+ receipt: { contract: candyBarCoin, instance: candyBarCoinInstance },
268
+ } = await TokenContract.deploy(this.adminWallet, this.adminAddress, 'CBC', 'CBC', 18n).send({
269
+ from: this.adminAddress,
270
+ wait: { returnReceipt: true },
271
+ });
274
272
  this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
275
273
  this.candyBarCoin = candyBarCoin;
276
274
  this.candyBarCoinInstance = candyBarCoinInstance;
@@ -282,13 +280,12 @@ export class ClientFlowsBenchmark {
282
280
  expect((await this.context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
283
281
 
284
282
  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();
283
+ const {
284
+ receipt: { contract: bananaFPC, instance: bananaFPCInstance },
285
+ } = await FPCContract.deploy(this.adminWallet, bananaCoin.address, this.adminAddress).send({
286
+ from: this.adminAddress,
287
+ wait: { returnReceipt: true },
288
+ });
292
289
 
293
290
  this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
294
291
 
@@ -336,12 +333,10 @@ export class ClientFlowsBenchmark {
336
333
  const benchysAddress = benchysAccountManager.address;
337
334
  const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
338
335
  const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
339
- await behchysDeployMethod
340
- .send({
341
- from: AztecAddress.ZERO,
342
- fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
343
- })
344
- .wait();
336
+ await behchysDeployMethod.send({
337
+ from: NO_FROM,
338
+ fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
339
+ });
345
340
  // Register benchy on the user's Wallet, where we're going to be interacting from
346
341
  const accountManager = await this.userWallet.createAccount({
347
342
  secret: benchysAccount.getSecretKey(),
@@ -353,25 +348,22 @@ export class ClientFlowsBenchmark {
353
348
 
354
349
  public async applyDeployAmm() {
355
350
  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(
351
+ const {
352
+ receipt: { contract: liquidityToken, instance: liquidityTokenInstance },
353
+ } = await TokenContract.deploy(this.adminWallet, this.adminAddress, 'LPT', 'LPT', 18n).send({
354
+ from: this.adminAddress,
355
+ wait: { returnReceipt: true },
356
+ });
357
+ const {
358
+ receipt: { contract: amm, instance: ammInstance },
359
+ } = await AMMContract.deploy(
366
360
  this.adminWallet,
367
361
  this.bananaCoin.address,
368
362
  this.candyBarCoin.address,
369
363
  liquidityToken.address,
370
- )
371
- .send({ from: this.adminAddress })
372
- .wait();
364
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
373
365
  this.logger.info(`AMM deployed at ${amm.address}`);
374
- await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress }).wait();
366
+ await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress });
375
367
  this.liquidityToken = liquidityToken;
376
368
  this.liquidityTokenInstance = liquidityTokenInstance;
377
369
  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
  }