@aztec/end-to-end 0.0.1-commit.1142ef1 → 0.0.1-commit.11bf3dd6e

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 (252) hide show
  1. package/README.md +27 -0
  2. package/dest/bench/client_flows/benchmark.d.ts +3 -2
  3. package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
  4. package/dest/bench/client_flows/benchmark.js +21 -1
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts +13 -14
  6. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  7. package/dest/bench/client_flows/client_flows_benchmark.js +118 -140
  8. package/dest/bench/client_flows/config.d.ts +2 -2
  9. package/dest/bench/client_flows/config.d.ts.map +1 -1
  10. package/dest/bench/client_flows/config.js +18 -0
  11. package/dest/bench/utils.d.ts +6 -5
  12. package/dest/bench/utils.d.ts.map +1 -1
  13. package/dest/bench/utils.js +13 -8
  14. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +11 -9
  15. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  16. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +108 -114
  17. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +7 -8
  18. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  19. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +68 -64
  20. package/dest/e2e_deploy_contract/deploy_test.d.ts +5 -4
  21. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  22. package/dest/e2e_deploy_contract/deploy_test.js +18 -13
  23. package/dest/e2e_epochs/epochs_test.d.ts +17 -7
  24. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  25. package/dest/e2e_epochs/epochs_test.js +92 -42
  26. package/dest/e2e_fees/bridging_race.notest.js +3 -5
  27. package/dest/e2e_fees/fees_test.d.ts +14 -14
  28. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  29. package/dest/e2e_fees/fees_test.js +133 -144
  30. package/dest/e2e_l1_publisher/write_json.d.ts +4 -3
  31. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
  32. package/dest/e2e_l1_publisher/write_json.js +14 -13
  33. package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -9
  34. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  35. package/dest/e2e_nested_contract/nested_contract_test.js +30 -40
  36. package/dest/e2e_p2p/inactivity_slash_test.d.ts +3 -3
  37. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
  38. package/dest/e2e_p2p/inactivity_slash_test.js +6 -6
  39. package/dest/e2e_p2p/p2p_network.d.ts +15 -15
  40. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  41. package/dest/e2e_p2p/p2p_network.js +144 -119
  42. package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
  43. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
  44. package/dest/e2e_p2p/reqresp/utils.js +190 -0
  45. package/dest/e2e_p2p/shared.d.ts +30 -12
  46. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  47. package/dest/e2e_p2p/shared.js +62 -60
  48. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
  49. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
  50. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
  51. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
  52. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
  53. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
  54. package/dest/e2e_token_contract/token_contract_test.d.ts +19 -10
  55. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  56. package/dest/e2e_token_contract/token_contract_test.js +100 -92
  57. package/dest/fixtures/authwit_proxy.d.ts +15 -0
  58. package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
  59. package/dest/fixtures/authwit_proxy.js +34 -0
  60. package/dest/fixtures/e2e_prover_test.d.ts +14 -19
  61. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  62. package/dest/fixtures/e2e_prover_test.js +113 -133
  63. package/dest/fixtures/elu_monitor.d.ts +21 -0
  64. package/dest/fixtures/elu_monitor.d.ts.map +1 -0
  65. package/dest/fixtures/elu_monitor.js +102 -0
  66. package/dest/fixtures/fixtures.d.ts +5 -1
  67. package/dest/fixtures/fixtures.d.ts.map +1 -1
  68. package/dest/fixtures/fixtures.js +6 -0
  69. package/dest/fixtures/get_bb_config.d.ts +1 -1
  70. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  71. package/dest/fixtures/get_bb_config.js +5 -5
  72. package/dest/fixtures/ha_setup.d.ts +71 -0
  73. package/dest/fixtures/ha_setup.d.ts.map +1 -0
  74. package/dest/fixtures/ha_setup.js +116 -0
  75. package/dest/fixtures/index.d.ts +2 -1
  76. package/dest/fixtures/index.d.ts.map +1 -1
  77. package/dest/fixtures/index.js +1 -0
  78. package/dest/fixtures/setup.d.ts +242 -0
  79. package/dest/fixtures/setup.d.ts.map +1 -0
  80. package/dest/fixtures/setup.js +611 -0
  81. package/dest/fixtures/setup_p2p_test.d.ts +18 -11
  82. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  83. package/dest/fixtures/setup_p2p_test.js +43 -32
  84. package/dest/fixtures/token_utils.d.ts +2 -2
  85. package/dest/fixtures/token_utils.d.ts.map +1 -1
  86. package/dest/fixtures/token_utils.js +7 -6
  87. package/dest/fixtures/utils.d.ts +5 -191
  88. package/dest/fixtures/utils.d.ts.map +1 -1
  89. package/dest/fixtures/utils.js +4 -615
  90. package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
  91. package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
  92. package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
  93. package/dest/forward-compatibility/wallet_service.d.ts +3 -0
  94. package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
  95. package/dest/forward-compatibility/wallet_service.js +109 -0
  96. package/dest/legacy-jest-resolver.d.cts +3 -0
  97. package/dest/legacy-jest-resolver.d.cts.map +1 -0
  98. package/dest/quality_of_service/prometheus_client.d.ts +38 -0
  99. package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
  100. package/dest/quality_of_service/prometheus_client.js +67 -0
  101. package/dest/shared/cross_chain_test_harness.d.ts +14 -4
  102. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  103. package/dest/shared/cross_chain_test_harness.js +24 -24
  104. package/dest/shared/gas_portal_test_harness.d.ts +11 -1
  105. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  106. package/dest/shared/gas_portal_test_harness.js +3 -3
  107. package/dest/shared/index.d.ts +2 -1
  108. package/dest/shared/index.d.ts.map +1 -1
  109. package/dest/shared/index.js +1 -0
  110. package/dest/shared/jest_setup.js +41 -1
  111. package/dest/shared/mock_state_view.d.ts +86 -0
  112. package/dest/shared/mock_state_view.d.ts.map +1 -0
  113. package/dest/shared/mock_state_view.js +186 -0
  114. package/dest/shared/submit-transactions.d.ts +4 -4
  115. package/dest/shared/submit-transactions.d.ts.map +1 -1
  116. package/dest/shared/submit-transactions.js +9 -11
  117. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  118. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  119. package/dest/shared/uniswap_l1_l2.js +27 -28
  120. package/dest/simulators/lending_simulator.d.ts +5 -1
  121. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  122. package/dest/simulators/lending_simulator.js +6 -6
  123. package/dest/simulators/token_simulator.d.ts +1 -1
  124. package/dest/simulators/token_simulator.d.ts.map +1 -1
  125. package/dest/simulators/token_simulator.js +3 -24
  126. package/dest/spartan/setup_test_wallets.d.ts +12 -3
  127. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  128. package/dest/spartan/setup_test_wallets.js +130 -42
  129. package/dest/spartan/tx_metrics.d.ts +51 -2
  130. package/dest/spartan/tx_metrics.d.ts.map +1 -1
  131. package/dest/spartan/tx_metrics.js +334 -7
  132. package/dest/spartan/utils/bot.d.ts +28 -0
  133. package/dest/spartan/utils/bot.d.ts.map +1 -0
  134. package/dest/spartan/utils/bot.js +142 -0
  135. package/dest/spartan/utils/chaos.d.ts +79 -0
  136. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  137. package/dest/spartan/utils/chaos.js +142 -0
  138. package/dest/spartan/utils/clients.d.ts +39 -0
  139. package/dest/spartan/utils/clients.d.ts.map +1 -0
  140. package/dest/spartan/utils/clients.js +90 -0
  141. package/dest/spartan/utils/config.d.ts +45 -0
  142. package/dest/spartan/utils/config.d.ts.map +1 -0
  143. package/dest/spartan/utils/config.js +23 -0
  144. package/dest/spartan/utils/health.d.ts +63 -0
  145. package/dest/spartan/utils/health.d.ts.map +1 -0
  146. package/dest/spartan/utils/health.js +202 -0
  147. package/dest/spartan/utils/helm.d.ts +15 -0
  148. package/dest/spartan/utils/helm.d.ts.map +1 -0
  149. package/dest/spartan/utils/helm.js +47 -0
  150. package/dest/spartan/utils/index.d.ts +11 -0
  151. package/dest/spartan/utils/index.d.ts.map +1 -0
  152. package/dest/spartan/utils/index.js +22 -0
  153. package/dest/spartan/utils/k8s.d.ts +128 -0
  154. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  155. package/dest/spartan/utils/k8s.js +381 -0
  156. package/dest/spartan/utils/nodes.d.ts +40 -0
  157. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  158. package/dest/spartan/utils/nodes.js +461 -0
  159. package/dest/spartan/utils/pod_logs.d.ts +25 -0
  160. package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
  161. package/dest/spartan/utils/pod_logs.js +74 -0
  162. package/dest/spartan/utils/scripts.d.ts +30 -0
  163. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  164. package/dest/spartan/utils/scripts.js +81 -0
  165. package/dest/spartan/utils.d.ts +2 -253
  166. package/dest/spartan/utils.d.ts.map +1 -1
  167. package/dest/spartan/utils.js +1 -892
  168. package/dest/test-wallet/test_wallet.d.ts +84 -0
  169. package/dest/test-wallet/test_wallet.d.ts.map +1 -0
  170. package/dest/test-wallet/test_wallet.js +249 -0
  171. package/dest/test-wallet/utils.d.ts +41 -0
  172. package/dest/test-wallet/utils.d.ts.map +1 -0
  173. package/dest/test-wallet/utils.js +71 -0
  174. package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
  175. package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
  176. package/dest/test-wallet/wallet_worker_script.js +48 -0
  177. package/dest/test-wallet/worker_wallet.d.ts +52 -0
  178. package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
  179. package/dest/test-wallet/worker_wallet.js +151 -0
  180. package/dest/test-wallet/worker_wallet_schema.d.ts +279 -0
  181. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
  182. package/dest/test-wallet/worker_wallet_schema.js +10 -0
  183. package/package.json +47 -43
  184. package/src/bench/client_flows/benchmark.ts +24 -2
  185. package/src/bench/client_flows/client_flows_benchmark.ts +157 -210
  186. package/src/bench/client_flows/config.ts +9 -1
  187. package/src/bench/utils.ts +15 -8
  188. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +123 -151
  189. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +103 -111
  190. package/src/e2e_deploy_contract/deploy_test.ts +22 -15
  191. package/src/e2e_epochs/epochs_test.ts +140 -92
  192. package/src/e2e_fees/bridging_race.notest.ts +4 -10
  193. package/src/e2e_fees/fees_test.ts +170 -224
  194. package/src/e2e_l1_publisher/write_json.ts +16 -13
  195. package/src/e2e_nested_contract/nested_contract_test.ts +35 -56
  196. package/src/e2e_p2p/inactivity_slash_test.ts +6 -6
  197. package/src/e2e_p2p/p2p_network.ts +210 -185
  198. package/src/e2e_p2p/reqresp/utils.ts +256 -0
  199. package/src/e2e_p2p/shared.ts +92 -80
  200. package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
  201. package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
  202. package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
  203. package/src/e2e_token_contract/token_contract_test.ts +121 -119
  204. package/src/fixtures/authwit_proxy.ts +54 -0
  205. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  206. package/src/fixtures/e2e_prover_test.ts +140 -183
  207. package/src/fixtures/elu_monitor.ts +126 -0
  208. package/src/fixtures/fixtures.ts +10 -0
  209. package/src/fixtures/get_bb_config.ts +7 -6
  210. package/src/fixtures/ha_setup.ts +186 -0
  211. package/src/fixtures/index.ts +1 -0
  212. package/src/fixtures/setup.ts +910 -0
  213. package/src/fixtures/setup_p2p_test.ts +48 -52
  214. package/src/fixtures/token_utils.ts +7 -6
  215. package/src/fixtures/utils.ts +27 -901
  216. package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
  217. package/src/forward-compatibility/wallet_service.ts +104 -0
  218. package/src/guides/up_quick_start.sh +3 -3
  219. package/src/legacy-jest-resolver.cjs +135 -0
  220. package/src/quality_of_service/prometheus_client.ts +113 -0
  221. package/src/shared/cross_chain_test_harness.ts +24 -34
  222. package/src/shared/gas_portal_test_harness.ts +2 -2
  223. package/src/shared/index.ts +1 -0
  224. package/src/shared/jest_setup.ts +51 -1
  225. package/src/shared/mock_state_view.ts +188 -0
  226. package/src/shared/submit-transactions.ts +11 -16
  227. package/src/shared/uniswap_l1_l2.ts +49 -51
  228. package/src/simulators/lending_simulator.ts +10 -6
  229. package/src/simulators/token_simulator.ts +6 -30
  230. package/src/spartan/setup_test_wallets.ts +183 -26
  231. package/src/spartan/tx_metrics.ts +256 -10
  232. package/src/spartan/utils/bot.ts +188 -0
  233. package/src/spartan/utils/chaos.ts +253 -0
  234. package/src/spartan/utils/clients.ts +100 -0
  235. package/src/spartan/utils/config.ts +29 -0
  236. package/src/spartan/utils/health.ts +255 -0
  237. package/src/spartan/utils/helm.ts +84 -0
  238. package/src/spartan/utils/index.ts +71 -0
  239. package/src/spartan/utils/k8s.ts +535 -0
  240. package/src/spartan/utils/nodes.ts +543 -0
  241. package/src/spartan/utils/pod_logs.ts +99 -0
  242. package/src/spartan/utils/scripts.ts +99 -0
  243. package/src/spartan/utils.ts +1 -1158
  244. package/src/test-wallet/test_wallet.ts +351 -0
  245. package/src/test-wallet/utils.ts +112 -0
  246. package/src/test-wallet/wallet_worker_script.ts +60 -0
  247. package/src/test-wallet/worker_wallet.ts +214 -0
  248. package/src/test-wallet/worker_wallet_schema.ts +13 -0
  249. package/dest/fixtures/snapshot_manager.d.ts +0 -93
  250. package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
  251. package/dest/fixtures/snapshot_manager.js +0 -488
  252. package/src/fixtures/snapshot_manager.ts +0 -646
@@ -7,7 +7,13 @@ import {
7
7
  import type { Logger } from '@aztec/aztec.js/log';
8
8
  import { createLogger } from '@aztec/foundation/log';
9
9
  import { type PrivateExecutionStep, serializePrivateExecutionSteps } from '@aztec/stdlib/kernel';
10
- import type { ProvingStats, ProvingTimings, SimulationStats, SimulationTimings } from '@aztec/stdlib/tx';
10
+ import type {
11
+ ProvingStats,
12
+ ProvingTimings,
13
+ RoundTripStats,
14
+ SimulationStats,
15
+ SimulationTimings,
16
+ } from '@aztec/stdlib/tx';
11
17
 
12
18
  import assert from 'node:assert';
13
19
  import { mkdir, writeFile } from 'node:fs/promises';
@@ -119,6 +125,7 @@ type ClientFlowBenchmark = {
119
125
  timings: Omit<ProvingTimings & SimulationTimings, 'perFunction'> & { witgen: number };
120
126
  maxMemory: number;
121
127
  rpc: Record<string, CallRecording>;
128
+ roundTrips: RoundTripStats;
122
129
  proverType: ProverType;
123
130
  minimumTrace: StructuredTrace;
124
131
  totalGateCount: number;
@@ -212,6 +219,10 @@ export function generateBenchmark(
212
219
  }, []);
213
220
  const timings = stats.timings;
214
221
  const totalGateCount = steps[steps.length - 1].accGateCount;
222
+ const nodeRPCCalls = stats.nodeRPCCalls ?? {
223
+ perMethod: {},
224
+ roundTrips: { roundTrips: 0, totalBlockingTime: 0, roundTripDurations: [], roundTripMethods: [] },
225
+ };
215
226
  return {
216
227
  name: flow,
217
228
  timings: {
@@ -221,7 +232,7 @@ export function generateBenchmark(
221
232
  unaccounted: timings.unaccounted,
222
233
  witgen: timings.perFunction.reduce((acc, fn) => acc + fn.time, 0),
223
234
  },
224
- rpc: Object.entries(stats.nodeRPCCalls ?? {}).reduce(
235
+ rpc: Object.entries(nodeRPCCalls.perMethod).reduce(
225
236
  (acc, [RPCName, RPCCalls]) => {
226
237
  const total = RPCCalls.times.reduce((sum, time) => sum + time, 0);
227
238
  const calls = RPCCalls.times.length;
@@ -236,6 +247,7 @@ export function generateBenchmark(
236
247
  },
237
248
  {} as Record<string, CallRecording>,
238
249
  ),
250
+ roundTrips: nodeRPCCalls.roundTrips,
239
251
  maxMemory,
240
252
  proverType,
241
253
  minimumTrace: minimumTrace!,
@@ -280,6 +292,16 @@ export function convertProfileToGHBenchmark(benchmark: ClientFlowBenchmark): Git
280
292
  value: totalRPCCalls,
281
293
  unit: 'calls',
282
294
  },
295
+ {
296
+ name: `${benchmark.name}/round_trips`,
297
+ value: benchmark.roundTrips.roundTrips,
298
+ unit: 'round_trips',
299
+ },
300
+ {
301
+ name: `${benchmark.name}/round_trips_blocking_time`,
302
+ value: benchmark.roundTrips.totalBlockingTime,
303
+ unit: 'ms',
304
+ },
283
305
  ];
284
306
  if (benchmark.timings.proving) {
285
307
  benches.push({
@@ -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,38 +27,31 @@ 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
- import {
33
- type ISnapshotManager,
34
- type SubsystemsContext,
35
- createSnapshotManager,
36
- deployAccounts,
37
- } from '../../fixtures/snapshot_manager.js';
32
+ import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../../fixtures/setup.js';
38
33
  import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
39
- import { type SetupOptions, setupSponsoredFPC } from '../../fixtures/utils.js';
34
+ import { setupSponsoredFPC } from '../../fixtures/utils.js';
40
35
  import { CrossChainTestHarness } from '../../shared/cross_chain_test_harness.js';
41
36
  import {
42
37
  FeeJuicePortalTestingHarnessFactory,
43
38
  type GasBridgingTestHarness,
44
39
  } from '../../shared/gas_portal_test_harness.js';
40
+ import { TestWallet } from '../../test-wallet/test_wallet.js';
45
41
  import { ProxyLogger } from './benchmark.js';
46
42
  import { type ClientFlowsConfig, FULL_FLOWS_CONFIG, KEY_FLOWS_CONFIG } from './config.js';
47
43
 
48
- const { E2E_DATA_PATH: dataPath, BENCHMARK_CONFIG } = process.env;
44
+ const { BENCHMARK_CONFIG } = process.env;
49
45
 
50
46
  export type AccountType = 'ecdsar1' | 'schnorr';
51
47
  export type FeePaymentMethodGetter = (wallet: Wallet, sender: AztecAddress) => Promise<FeePaymentMethod | undefined>;
52
48
  export type BenchmarkingFeePaymentMethod = 'bridged_fee_juice' | 'private_fpc' | 'sponsored_fpc' | 'fee_juice';
53
49
 
54
50
  export class ClientFlowsBenchmark {
55
- private snapshotManager: ISnapshotManager;
56
-
57
51
  public logger: Logger;
58
52
  public aztecNode!: AztecNode;
59
53
  public cheatCodes!: CheatCodes;
60
- public context!: SubsystemsContext;
54
+ public context!: EndToEndContext;
61
55
  public chainMonitor!: ChainMonitor;
62
56
  public feeJuiceBridgeTestHarness!: GasBridgingTestHarness;
63
57
  public adminWallet!: TestWallet;
@@ -125,33 +119,41 @@ export class ClientFlowsBenchmark {
125
119
  public config: ClientFlowsConfig;
126
120
 
127
121
  private proxyLogger: ProxyLogger;
122
+ private setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs>;
128
123
 
129
124
  constructor(testName?: string, setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs> = {}) {
130
125
  this.logger = createLogger(`bench:client_flows${testName ? `:${testName}` : ''}`);
131
- this.snapshotManager = createSnapshotManager(
132
- `bench_client_flows${testName ? `/${testName}` : ''}`,
133
- dataPath,
134
- { startProverNode: true, ...setupOptions },
135
- { ...setupOptions },
136
- );
126
+ this.setupOptions = { startProverNode: true, ...setupOptions };
137
127
  this.config = BENCHMARK_CONFIG === 'key_flows' ? KEY_FLOWS_CONFIG : FULL_FLOWS_CONFIG;
138
128
  ProxyLogger.create();
139
129
  this.proxyLogger = ProxyLogger.getInstance();
140
130
  }
141
131
 
142
132
  async setup() {
143
- const context = await this.snapshotManager.setup();
144
- await context.aztecNode.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
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();
136
+ this.context = await setup(0, {
137
+ ...this.setupOptions,
138
+ fundSponsoredFPC: true,
139
+ skipAccountDeployment: true,
140
+ l1ContractsArgs: this.setupOptions,
141
+ txPublicSetupAllowListExtend: [...(this.setupOptions.txPublicSetupAllowListExtend ?? []), ...tokenAllowList],
142
+ });
143
+ await this.applyBaseSetup();
144
+
145
+ await this.context.aztecNodeService.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
145
146
 
146
- const rollupContract = RollupContract.getFromConfig(context.aztecNodeConfig);
147
- this.chainMonitor = new ChainMonitor(rollupContract, context.dateProvider, this.logger, 200).start();
147
+ const rollupContract = RollupContract.getFromConfig(this.context.config);
148
+ this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider, this.logger, 200).start();
148
149
 
149
150
  return this;
150
151
  }
151
152
 
152
153
  async teardown() {
153
154
  await this.chainMonitor.stop();
154
- await this.snapshotManager.teardown();
155
+ await this.userWallet?.stop();
156
+ await teardown(this.context);
155
157
  }
156
158
 
157
159
  async mintAndBridgeFeeJuice(address: AztecAddress) {
@@ -159,21 +161,20 @@ export class ClientFlowsBenchmark {
159
161
  const { claimSecret: secret, messageLeafIndex: index } = claim;
160
162
  await this.feeJuiceContract.methods
161
163
  .claim(address, claim.claimAmount, secret, index)
162
- .send({ from: this.adminAddress })
163
- .wait();
164
+ .send({ from: this.adminAddress });
164
165
  }
165
166
 
166
167
  /** Admin mints bananaCoin tokens privately to the target address and redeems them. */
167
168
  async mintPrivateBananas(amount: bigint, address: AztecAddress) {
168
- const balanceBefore = await this.bananaCoin.methods
169
+ const { result: balanceBefore } = await this.bananaCoin.methods
169
170
  .balance_of_private(address)
170
- .simulate({ from: this.adminAddress });
171
+ .simulate({ from: address });
171
172
 
172
173
  await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
173
174
 
174
- const balanceAfter = await this.bananaCoin.methods
175
+ const { result: balanceAfter } = await this.bananaCoin.methods
175
176
  .balance_of_private(address)
176
- .simulate({ from: this.adminAddress });
177
+ .simulate({ from: address });
177
178
  expect(balanceAfter).toEqual(balanceBefore + amount);
178
179
  }
179
180
 
@@ -193,161 +194,124 @@ export class ClientFlowsBenchmark {
193
194
  }
194
195
  }
195
196
 
196
- public async applyBaseSnapshots() {
197
- await this.applyInitialAccountsSnapshot();
198
- await this.applySetupFeeJuiceSnapshot();
197
+ public async applyBaseSetup() {
198
+ await this.applyInitialAccounts();
199
+ await this.applySetupFeeJuice();
199
200
  }
200
201
 
201
- async applyInitialAccountsSnapshot() {
202
- await this.snapshotManager.snapshot(
203
- 'initial_accounts',
204
- deployAccounts(2, this.logger),
205
- async (
206
- { deployedAccounts: [{ address: adminAddress }, { address: sequencerAddress }] },
207
- { wallet, aztecNode, cheatCodes },
208
- ) => {
209
- this.adminWallet = wallet;
210
- this.aztecNode = aztecNode;
211
- this.cheatCodes = cheatCodes;
212
-
213
- this.adminAddress = adminAddress;
214
- this.sequencerAddress = sequencerAddress;
215
-
216
- const canonicalFeeJuice = await getCanonicalFeeJuice();
217
- this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
218
- this.coinbase = EthAddress.random();
219
-
220
- const userPXEConfig = getPXEConfig();
221
- const userPXEConfigWithContracts = {
222
- ...userPXEConfig,
223
- proverEnabled: this.realProofs,
224
- } as PXEConfig;
225
-
226
- this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
227
- loggers: {
228
- prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied'),
229
- },
230
- });
202
+ async applyInitialAccounts() {
203
+ this.logger.info('Applying initial accounts setup');
204
+ const { deployedAccounts } = await deployAccounts(
205
+ 2,
206
+ this.logger,
207
+ )({
208
+ wallet: this.context.wallet,
209
+ initialFundedAccounts: this.context.initialFundedAccounts,
210
+ });
211
+
212
+ const [{ address: adminAddress }, { address: sequencerAddress }] = deployedAccounts;
213
+
214
+ this.adminWallet = this.context.wallet;
215
+ this.aztecNode = this.context.aztecNodeService;
216
+ this.cheatCodes = this.context.cheatCodes;
217
+
218
+ this.adminAddress = adminAddress;
219
+ this.sequencerAddress = sequencerAddress;
220
+
221
+ const canonicalFeeJuice = await getCanonicalFeeJuice();
222
+ this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
223
+ this.coinbase = EthAddress.random();
224
+
225
+ const userPXEConfig = getPXEConfig();
226
+ const userPXEConfigWithContracts = {
227
+ ...userPXEConfig,
228
+ proverEnabled: this.realProofs,
229
+ } as PXEConfig;
230
+
231
+ this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
232
+ loggers: {
233
+ prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied'),
231
234
  },
232
- );
235
+ });
233
236
  }
234
237
 
235
- async applySetupFeeJuiceSnapshot() {
236
- await this.snapshotManager.snapshot(
237
- 'setup_fee_juice',
238
- async () => {},
239
- async (_data, context) => {
240
- this.context = context;
241
-
242
- this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
243
-
244
- this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
245
- aztecNode: context.aztecNode,
246
- aztecNodeAdmin: context.aztecNode,
247
- l1Client: context.deployL1ContractsValues.l1Client,
248
- wallet: this.adminWallet,
249
- logger: this.logger,
250
- });
251
- },
252
- );
238
+ async applySetupFeeJuice() {
239
+ this.logger.info('Applying fee juice setup');
240
+ this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
241
+
242
+ this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
243
+ aztecNode: this.context.aztecNodeService,
244
+ aztecNodeAdmin: this.context.aztecNodeService,
245
+ l1Client: this.context.deployL1ContractsValues.l1Client,
246
+ wallet: this.adminWallet,
247
+ logger: this.logger,
248
+ });
253
249
  }
254
250
 
255
- async applyDeployBananaTokenSnapshot() {
256
- await this.snapshotManager.snapshot(
257
- 'deploy_banana_token',
258
- async () => {
259
- const { contract: bananaCoin, instance: bananaCoinInstance } = await BananaCoin.deploy(
260
- this.adminWallet,
261
- this.adminAddress,
262
- 'BC',
263
- 'BC',
264
- 18n,
265
- )
266
- .send({ from: this.adminAddress })
267
- .wait();
268
- this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
269
- return { bananaCoinAddress: bananaCoin.address, bananaCoinInstance };
270
- },
271
- ({ bananaCoinAddress, bananaCoinInstance }) => {
272
- this.bananaCoin = BananaCoin.at(bananaCoinAddress, this.adminWallet);
273
- this.bananaCoinInstance = bananaCoinInstance;
274
- return Promise.resolve();
275
- },
276
- );
251
+ async applyDeployBananaToken() {
252
+ this.logger.info('Applying banana token deployment');
253
+ const { contract: bananaCoin, instance: bananaCoinInstance } = await BananaCoin.deploy(
254
+ this.adminWallet,
255
+ this.adminAddress,
256
+ 'BC',
257
+ 'BC',
258
+ 18n,
259
+ ).send({
260
+ from: this.adminAddress,
261
+ });
262
+ this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
263
+ this.bananaCoin = bananaCoin;
264
+ this.bananaCoinInstance = bananaCoinInstance;
277
265
  }
278
266
 
279
- async applyDeployCandyBarTokenSnapshot() {
280
- await this.snapshotManager.snapshot(
281
- 'deploy_candy_bar_token',
282
- async () => {
283
- const { contract: candyBarCoin, instance: candyBarCoinInstance } = await TokenContract.deploy(
284
- this.adminWallet,
285
- this.adminAddress,
286
- 'CBC',
287
- 'CBC',
288
- 18n,
289
- )
290
- .send({ from: this.adminAddress })
291
- .wait();
292
- this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
293
- return { candyBarCoinAddress: candyBarCoin.address, candyBarCoinInstance };
294
- },
295
- ({ candyBarCoinAddress, candyBarCoinInstance }) => {
296
- this.candyBarCoin = TokenContract.at(candyBarCoinAddress, this.adminWallet);
297
- this.candyBarCoinInstance = candyBarCoinInstance;
298
- return Promise.resolve();
299
- },
300
- );
267
+ async applyDeployCandyBarToken() {
268
+ this.logger.info('Applying candy bar token deployment');
269
+ const { contract: candyBarCoin, instance: candyBarCoinInstance } = await TokenContract.deploy(
270
+ this.adminWallet,
271
+ this.adminAddress,
272
+ 'CBC',
273
+ 'CBC',
274
+ 18n,
275
+ ).send({
276
+ from: this.adminAddress,
277
+ });
278
+ this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
279
+ this.candyBarCoin = candyBarCoin;
280
+ this.candyBarCoinInstance = candyBarCoinInstance;
301
281
  }
302
282
 
303
- public async applyFPCSetupSnapshot() {
304
- await this.snapshotManager.snapshot(
305
- 'fpc_setup',
306
- async context => {
307
- const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
308
- expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
283
+ public async applyFPCSetup() {
284
+ this.logger.info('Applying FPC setup');
285
+ const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
286
+ expect((await this.context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
309
287
 
310
- const bananaCoin = this.bananaCoin;
311
- const { contract: bananaFPC, instance: bananaFPCInstance } = await FPCContract.deploy(
312
- this.adminWallet,
313
- bananaCoin.address,
314
- this.adminAddress,
315
- )
316
- .send({ from: this.adminAddress })
317
- .wait();
288
+ const bananaCoin = this.bananaCoin;
289
+ const { contract: bananaFPC, instance: bananaFPCInstance } = await FPCContract.deploy(
290
+ this.adminWallet,
291
+ bananaCoin.address,
292
+ this.adminAddress,
293
+ ).send({
294
+ from: this.adminAddress,
295
+ });
318
296
 
319
- this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
297
+ this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
320
298
 
321
- await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
299
+ await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
322
300
 
323
- return { bananaFPCAddress: bananaFPC.address, bananaFPCInstance };
324
- },
325
- data => {
326
- this.bananaFPC = FPCContract.at(data.bananaFPCAddress, this.adminWallet);
327
- this.bananaFPCInstance = data.bananaFPCInstance;
328
- return Promise.resolve();
329
- },
330
- );
301
+ this.bananaFPC = bananaFPC;
302
+ this.bananaFPCInstance = bananaFPCInstance;
331
303
  }
332
304
 
333
- async applyDeploySponsoredFPCSnapshot() {
334
- await this.snapshotManager.snapshot(
335
- 'deploy_sponsored_fpc',
336
- async () => {
337
- const sponsoredFPCInstance = await setupSponsoredFPC(this.adminWallet);
338
- this.logger.info(`SponsoredFPC at ${sponsoredFPCInstance.address}`);
339
- return { sponsoredFPCAddress: sponsoredFPCInstance.address, sponsoredFPCInstance };
340
- },
341
- ({ sponsoredFPCAddress, sponsoredFPCInstance }) => {
342
- this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCAddress, this.adminWallet);
343
- this.sponsoredFPCInstance = sponsoredFPCInstance;
344
- return Promise.resolve();
345
- },
346
- );
305
+ async applyDeploySponsoredFPC() {
306
+ this.logger.info('Applying sponsored FPC deployment');
307
+ const sponsoredFPCInstance = await setupSponsoredFPC(this.adminWallet);
308
+ this.logger.info(`SponsoredFPC at ${sponsoredFPCInstance.address}`);
309
+ this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCInstance.address, this.adminWallet);
310
+ this.sponsoredFPCInstance = sponsoredFPCInstance;
347
311
  }
348
312
 
349
313
  public async createCrossChainTestHarness(owner: AztecAddress) {
350
- const l1Client = createExtendedL1Client(this.context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
314
+ const l1Client = createExtendedL1Client(this.context.config.l1RpcUrls, MNEMONIC);
351
315
 
352
316
  const underlyingERC20Address = await deployL1Contract(l1Client, TestERC20Abi, TestERC20Bytecode, [
353
317
  'Underlying',
@@ -376,12 +340,10 @@ export class ClientFlowsBenchmark {
376
340
  const benchysAddress = benchysAccountManager.address;
377
341
  const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
378
342
  const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
379
- await behchysDeployMethod
380
- .send({
381
- from: AztecAddress.ZERO,
382
- fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
383
- })
384
- .wait();
343
+ await behchysDeployMethod.send({
344
+ from: NO_FROM,
345
+ fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
346
+ });
385
347
  // Register benchy on the user's Wallet, where we're going to be interacting from
386
348
  const accountManager = await this.userWallet.createAccount({
387
349
  secret: benchysAccount.getSecretKey(),
@@ -391,44 +353,29 @@ export class ClientFlowsBenchmark {
391
353
  return accountManager.address;
392
354
  }
393
355
 
394
- public async applyDeployAmmSnapshot() {
395
- await this.snapshotManager.snapshot(
396
- 'deploy_amm',
397
- async () => {
398
- const { contract: liquidityToken, instance: liquidityTokenInstance } = await TokenContract.deploy(
399
- this.adminWallet,
400
- this.adminAddress,
401
- 'LPT',
402
- 'LPT',
403
- 18n,
404
- )
405
- .send({ from: this.adminAddress })
406
- .wait();
407
- const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
408
- this.adminWallet,
409
- this.bananaCoin.address,
410
- this.candyBarCoin.address,
411
- liquidityToken.address,
412
- )
413
- .send({ from: this.adminAddress })
414
- .wait();
415
- this.logger.info(`AMM deployed at ${amm.address}`);
416
- await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress }).wait();
417
- return {
418
- ammAddress: amm.address,
419
- ammInstance,
420
- liquidityTokenAddress: liquidityToken.address,
421
- liquidityTokenInstance,
422
- };
423
- },
424
- ({ ammAddress, ammInstance, liquidityTokenAddress, liquidityTokenInstance }) => {
425
- this.liquidityToken = TokenContract.at(liquidityTokenAddress, this.adminWallet);
426
- this.liquidityTokenInstance = liquidityTokenInstance;
427
- this.amm = AMMContract.at(ammAddress, this.adminWallet);
428
- this.ammInstance = ammInstance;
429
- return Promise.resolve();
430
- },
431
- );
356
+ public async applyDeployAmm() {
357
+ this.logger.info('Applying AMM deployment');
358
+ const { contract: liquidityToken, instance: liquidityTokenInstance } = await TokenContract.deploy(
359
+ this.adminWallet,
360
+ this.adminAddress,
361
+ 'LPT',
362
+ 'LPT',
363
+ 18n,
364
+ ).send({
365
+ from: this.adminAddress,
366
+ });
367
+ const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
368
+ this.adminWallet,
369
+ this.bananaCoin.address,
370
+ this.candyBarCoin.address,
371
+ liquidityToken.address,
372
+ ).send({ from: this.adminAddress });
373
+ this.logger.info(`AMM deployed at ${amm.address}`);
374
+ await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress });
375
+ this.liquidityToken = liquidityToken;
376
+ this.liquidityTokenInstance = liquidityTokenInstance;
377
+ this.amm = amm;
378
+ this.ammInstance = ammInstance;
432
379
  }
433
380
 
434
381
  public async getBridgedFeeJuicePaymentMethodForWallet(_wallet: Wallet, sender: AztecAddress) {
@@ -440,7 +387,7 @@ export class ClientFlowsBenchmark {
440
387
  // The private fee paying method assembled on the app side requires knowledge of the maximum
441
388
  // fee the user is willing to pay
442
389
  const maxFeesPerGas = (await this.aztecNode.getCurrentMinFees()).mul(1.5);
443
- const gasSettings = GasSettings.default({ maxFeesPerGas });
390
+ const gasSettings = GasSettings.fallback({ maxFeesPerGas });
444
391
  return new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet, gasSettings);
445
392
  }
446
393
 
@@ -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[] {