@aztec/end-to-end 0.0.1-commit.fce3e4f → 0.0.1-commit.ff7989d6c

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 (253) hide show
  1. package/dest/bench/client_flows/benchmark.d.ts +3 -2
  2. package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
  3. package/dest/bench/client_flows/benchmark.js +21 -1
  4. package/dest/bench/client_flows/client_flows_benchmark.d.ts +15 -16
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  6. package/dest/bench/client_flows/client_flows_benchmark.js +126 -139
  7. package/dest/bench/client_flows/config.d.ts +2 -2
  8. package/dest/bench/client_flows/config.d.ts.map +1 -1
  9. package/dest/bench/client_flows/config.js +18 -0
  10. package/dest/bench/client_flows/data_extractor.js +3 -1
  11. package/dest/bench/utils.d.ts +9 -8
  12. package/dest/bench/utils.d.ts.map +1 -1
  13. package/dest/bench/utils.js +27 -18
  14. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +9 -8
  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 +106 -112
  17. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +20 -14
  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 +92 -71
  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 +25 -15
  24. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  25. package/dest/e2e_epochs/epochs_test.js +100 -51
  26. package/dest/e2e_fees/bridging_race.notest.js +4 -6
  27. package/dest/e2e_fees/fees_test.d.ts +21 -17
  28. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  29. package/dest/e2e_fees/fees_test.js +128 -143
  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 -16
  33. package/dest/e2e_multi_validator/utils.js +1 -1
  34. package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -9
  35. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  36. package/dest/e2e_nested_contract/nested_contract_test.js +31 -39
  37. package/dest/e2e_p2p/inactivity_slash_test.d.ts +4 -4
  38. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
  39. package/dest/e2e_p2p/inactivity_slash_test.js +6 -9
  40. package/dest/e2e_p2p/p2p_network.d.ts +14 -12
  41. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  42. package/dest/e2e_p2p/p2p_network.js +135 -112
  43. package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
  44. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
  45. package/dest/e2e_p2p/reqresp/utils.js +177 -0
  46. package/dest/e2e_p2p/shared.d.ts +7 -7
  47. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  48. package/dest/e2e_p2p/shared.js +18 -21
  49. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
  50. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
  51. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
  52. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
  53. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
  54. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
  55. package/dest/e2e_token_contract/token_contract_test.d.ts +19 -10
  56. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  57. package/dest/e2e_token_contract/token_contract_test.js +99 -91
  58. package/dest/fixtures/authwit_proxy.d.ts +15 -0
  59. package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
  60. package/dest/fixtures/authwit_proxy.js +30 -0
  61. package/dest/fixtures/e2e_prover_test.d.ts +13 -21
  62. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  63. package/dest/fixtures/e2e_prover_test.js +114 -133
  64. package/dest/fixtures/fixtures.d.ts +6 -3
  65. package/dest/fixtures/fixtures.d.ts.map +1 -1
  66. package/dest/fixtures/fixtures.js +8 -3
  67. package/dest/fixtures/get_acvm_config.js +1 -1
  68. package/dest/fixtures/ha_setup.d.ts +71 -0
  69. package/dest/fixtures/ha_setup.d.ts.map +1 -0
  70. package/dest/fixtures/ha_setup.js +116 -0
  71. package/dest/fixtures/index.d.ts +2 -1
  72. package/dest/fixtures/index.d.ts.map +1 -1
  73. package/dest/fixtures/index.js +1 -0
  74. package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
  75. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  76. package/dest/fixtures/l1_to_l2_messaging.js +2 -2
  77. package/dest/fixtures/setup.d.ts +235 -0
  78. package/dest/fixtures/setup.d.ts.map +1 -0
  79. package/dest/fixtures/setup.js +605 -0
  80. package/dest/fixtures/setup_p2p_test.d.ts +16 -9
  81. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  82. package/dest/fixtures/setup_p2p_test.js +43 -32
  83. package/dest/fixtures/token_utils.d.ts +2 -2
  84. package/dest/fixtures/token_utils.d.ts.map +1 -1
  85. package/dest/fixtures/token_utils.js +10 -6
  86. package/dest/fixtures/utils.d.ts +5 -637
  87. package/dest/fixtures/utils.d.ts.map +1 -1
  88. package/dest/fixtures/utils.js +4 -647
  89. package/dest/fixtures/web3signer.js +1 -1
  90. package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
  91. package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
  92. package/dest/fixtures/with_telemetry_utils.js +2 -2
  93. package/dest/quality_of_service/grafana_client.d.ts +41 -0
  94. package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
  95. package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
  96. package/dest/quality_of_service/prometheus_client.d.ts +38 -0
  97. package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
  98. package/dest/quality_of_service/prometheus_client.js +67 -0
  99. package/dest/shared/cross_chain_test_harness.d.ts +18 -6
  100. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  101. package/dest/shared/cross_chain_test_harness.js +14 -14
  102. package/dest/shared/gas_portal_test_harness.d.ts +12 -2
  103. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  104. package/dest/shared/gas_portal_test_harness.js +1 -1
  105. package/dest/shared/index.d.ts +3 -2
  106. package/dest/shared/index.d.ts.map +1 -1
  107. package/dest/shared/index.js +1 -0
  108. package/dest/shared/mock_state_view.d.ts +86 -0
  109. package/dest/shared/mock_state_view.d.ts.map +1 -0
  110. package/dest/shared/mock_state_view.js +186 -0
  111. package/dest/shared/submit-transactions.d.ts +4 -4
  112. package/dest/shared/submit-transactions.d.ts.map +1 -1
  113. package/dest/shared/submit-transactions.js +9 -11
  114. package/dest/shared/uniswap_l1_l2.d.ts +3 -27
  115. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  116. package/dest/shared/uniswap_l1_l2.js +57 -35
  117. package/dest/simulators/lending_simulator.d.ts +6 -2
  118. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  119. package/dest/simulators/lending_simulator.js +2 -2
  120. package/dest/simulators/token_simulator.d.ts +1 -1
  121. package/dest/simulators/token_simulator.d.ts.map +1 -1
  122. package/dest/simulators/token_simulator.js +2 -23
  123. package/dest/spartan/setup_test_wallets.d.ts +12 -4
  124. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  125. package/dest/spartan/setup_test_wallets.js +94 -36
  126. package/dest/spartan/tx_metrics.d.ts +88 -0
  127. package/dest/spartan/tx_metrics.d.ts.map +1 -0
  128. package/dest/spartan/tx_metrics.js +422 -0
  129. package/dest/spartan/utils/bot.d.ts +28 -0
  130. package/dest/spartan/utils/bot.d.ts.map +1 -0
  131. package/dest/spartan/utils/bot.js +142 -0
  132. package/dest/spartan/utils/chaos.d.ts +79 -0
  133. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  134. package/dest/spartan/utils/chaos.js +142 -0
  135. package/dest/spartan/utils/clients.d.ts +39 -0
  136. package/dest/spartan/utils/clients.d.ts.map +1 -0
  137. package/dest/spartan/utils/clients.js +90 -0
  138. package/dest/spartan/utils/config.d.ts +39 -0
  139. package/dest/spartan/utils/config.d.ts.map +1 -0
  140. package/dest/spartan/utils/config.js +21 -0
  141. package/dest/spartan/utils/health.d.ts +63 -0
  142. package/dest/spartan/utils/health.d.ts.map +1 -0
  143. package/dest/spartan/utils/health.js +202 -0
  144. package/dest/spartan/utils/helm.d.ts +15 -0
  145. package/dest/spartan/utils/helm.d.ts.map +1 -0
  146. package/dest/spartan/utils/helm.js +47 -0
  147. package/dest/spartan/utils/index.d.ts +9 -0
  148. package/dest/spartan/utils/index.d.ts.map +1 -0
  149. package/dest/spartan/utils/index.js +18 -0
  150. package/dest/spartan/utils/k8s.d.ts +128 -0
  151. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  152. package/dest/spartan/utils/k8s.js +381 -0
  153. package/dest/spartan/utils/nodes.d.ts +40 -0
  154. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  155. package/dest/spartan/utils/nodes.js +460 -0
  156. package/dest/spartan/utils/scripts.d.ts +30 -0
  157. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  158. package/dest/spartan/utils/scripts.js +81 -0
  159. package/dest/spartan/utils.d.ts +2 -218
  160. package/dest/spartan/utils.d.ts.map +1 -1
  161. package/dest/spartan/utils.js +1 -749
  162. package/dest/test-wallet/test_wallet.d.ts +83 -0
  163. package/dest/test-wallet/test_wallet.d.ts.map +1 -0
  164. package/dest/test-wallet/test_wallet.js +214 -0
  165. package/dest/test-wallet/utils.d.ts +41 -0
  166. package/dest/test-wallet/utils.d.ts.map +1 -0
  167. package/dest/test-wallet/utils.js +71 -0
  168. package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
  169. package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
  170. package/dest/test-wallet/wallet_worker_script.js +40 -0
  171. package/dest/test-wallet/worker_wallet.d.ts +52 -0
  172. package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
  173. package/dest/test-wallet/worker_wallet.js +103 -0
  174. package/dest/test-wallet/worker_wallet_schema.d.ts +274 -0
  175. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
  176. package/dest/test-wallet/worker_wallet_schema.js +10 -0
  177. package/package.json +46 -41
  178. package/src/bench/client_flows/benchmark.ts +24 -2
  179. package/src/bench/client_flows/client_flows_benchmark.ts +148 -215
  180. package/src/bench/client_flows/config.ts +9 -1
  181. package/src/bench/client_flows/data_extractor.ts +1 -1
  182. package/src/bench/utils.ts +31 -21
  183. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +114 -143
  184. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +140 -126
  185. package/src/e2e_deploy_contract/deploy_test.ts +22 -15
  186. package/src/e2e_epochs/epochs_test.ts +162 -113
  187. package/src/e2e_fees/bridging_race.notest.ts +5 -11
  188. package/src/e2e_fees/fees_test.ts +171 -228
  189. package/src/e2e_l1_publisher/write_json.ts +16 -16
  190. package/src/e2e_multi_validator/utils.ts +1 -1
  191. package/src/e2e_nested_contract/nested_contract_test.ts +33 -56
  192. package/src/e2e_p2p/inactivity_slash_test.ts +7 -10
  193. package/src/e2e_p2p/p2p_network.ts +204 -185
  194. package/src/e2e_p2p/reqresp/utils.ts +235 -0
  195. package/src/e2e_p2p/shared.ts +33 -28
  196. package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
  197. package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
  198. package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
  199. package/src/e2e_token_contract/token_contract_test.ts +113 -119
  200. package/src/fixtures/authwit_proxy.ts +50 -0
  201. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  202. package/src/fixtures/e2e_prover_test.ts +130 -177
  203. package/src/fixtures/fixtures.ts +12 -5
  204. package/src/fixtures/get_acvm_config.ts +1 -1
  205. package/src/fixtures/ha_setup.ts +186 -0
  206. package/src/fixtures/index.ts +1 -0
  207. package/src/fixtures/l1_to_l2_messaging.ts +4 -2
  208. package/src/fixtures/setup.ts +896 -0
  209. package/src/fixtures/setup_p2p_test.ts +43 -47
  210. package/src/fixtures/token_utils.ts +7 -5
  211. package/src/fixtures/utils.ts +27 -966
  212. package/src/fixtures/web3signer.ts +1 -1
  213. package/src/fixtures/with_telemetry_utils.ts +2 -2
  214. package/src/guides/up_quick_start.sh +3 -3
  215. package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
  216. package/src/quality_of_service/prometheus_client.ts +113 -0
  217. package/src/shared/cross_chain_test_harness.ts +19 -36
  218. package/src/shared/gas_portal_test_harness.ts +2 -2
  219. package/src/shared/index.ts +2 -1
  220. package/src/shared/mock_state_view.ts +188 -0
  221. package/src/shared/submit-transactions.ts +14 -16
  222. package/src/shared/uniswap_l1_l2.ts +66 -89
  223. package/src/simulators/lending_simulator.ts +3 -3
  224. package/src/simulators/token_simulator.ts +1 -29
  225. package/src/spartan/DEVELOP.md +7 -0
  226. package/src/spartan/setup_test_wallets.ts +136 -27
  227. package/src/spartan/tx_metrics.ts +376 -0
  228. package/src/spartan/utils/bot.ts +188 -0
  229. package/src/spartan/utils/chaos.ts +253 -0
  230. package/src/spartan/utils/clients.ts +100 -0
  231. package/src/spartan/utils/config.ts +27 -0
  232. package/src/spartan/utils/health.ts +255 -0
  233. package/src/spartan/utils/helm.ts +84 -0
  234. package/src/spartan/utils/index.ts +65 -0
  235. package/src/spartan/utils/k8s.ts +535 -0
  236. package/src/spartan/utils/nodes.ts +535 -0
  237. package/src/spartan/utils/scripts.ts +99 -0
  238. package/src/spartan/utils.ts +1 -942
  239. package/src/test-wallet/test_wallet.ts +306 -0
  240. package/src/test-wallet/utils.ts +112 -0
  241. package/src/test-wallet/wallet_worker_script.ts +43 -0
  242. package/src/test-wallet/worker_wallet.ts +165 -0
  243. package/src/test-wallet/worker_wallet_schema.ts +13 -0
  244. package/dest/fixtures/setup_l1_contracts.d.ts +0 -477
  245. package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
  246. package/dest/fixtures/setup_l1_contracts.js +0 -17
  247. package/dest/fixtures/snapshot_manager.d.ts +0 -95
  248. package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
  249. package/dest/fixtures/snapshot_manager.js +0 -505
  250. package/dest/quality_of_service/alert_checker.d.ts +0 -41
  251. package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
  252. package/src/fixtures/setup_l1_contracts.ts +0 -26
  253. package/src/fixtures/snapshot_manager.ts +0 -665
@@ -5,11 +5,14 @@ import { type Logger, createLogger } from '@aztec/aztec.js/log';
5
5
  import type { AztecNode } from '@aztec/aztec.js/node';
6
6
  import type { Wallet } from '@aztec/aztec.js/wallet';
7
7
  import { CheatCodes } from '@aztec/aztec/testing';
8
- import { type DeployL1ContractsArgs, RollupContract, createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
8
+ import { createExtendedL1Client } from '@aztec/ethereum/client';
9
+ import { RollupContract } from '@aztec/ethereum/contracts';
10
+ import type { DeployAztecL1ContractsArgs } from '@aztec/ethereum/deploy-aztec-l1-contracts';
11
+ import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
9
12
  import { ChainMonitor } from '@aztec/ethereum/test';
10
- import { randomBytes } from '@aztec/foundation/crypto';
13
+ import { randomBytes } from '@aztec/foundation/crypto/random';
14
+ import { Fr } from '@aztec/foundation/curves/bn254';
11
15
  import { EthAddress } from '@aztec/foundation/eth-address';
12
- import { Fr } from '@aztec/foundation/fields';
13
16
  import { TestERC20Abi } from '@aztec/l1-artifacts/TestERC20Abi';
14
17
  import { TestERC20Bytecode } from '@aztec/l1-artifacts/TestERC20Bytecode';
15
18
  import { AMMContract } from '@aztec/noir-contracts.js/AMM';
@@ -23,38 +26,31 @@ import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
23
26
  import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
24
27
  import { GasSettings } from '@aztec/stdlib/gas';
25
28
  import { deriveSigningKey } from '@aztec/stdlib/keys';
26
- import { TestWallet } from '@aztec/test-wallet/server';
27
29
 
28
30
  import { MNEMONIC } from '../../fixtures/fixtures.js';
29
- import {
30
- type ISnapshotManager,
31
- type SubsystemsContext,
32
- createSnapshotManager,
33
- deployAccounts,
34
- } from '../../fixtures/snapshot_manager.js';
31
+ import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../../fixtures/setup.js';
35
32
  import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
36
- import { type SetupOptions, setupSponsoredFPC } from '../../fixtures/utils.js';
33
+ import { setupSponsoredFPC } from '../../fixtures/utils.js';
37
34
  import { CrossChainTestHarness } from '../../shared/cross_chain_test_harness.js';
38
35
  import {
39
36
  FeeJuicePortalTestingHarnessFactory,
40
37
  type GasBridgingTestHarness,
41
38
  } from '../../shared/gas_portal_test_harness.js';
39
+ import { TestWallet } from '../../test-wallet/test_wallet.js';
42
40
  import { ProxyLogger } from './benchmark.js';
43
41
  import { type ClientFlowsConfig, FULL_FLOWS_CONFIG, KEY_FLOWS_CONFIG } from './config.js';
44
42
 
45
- const { E2E_DATA_PATH: dataPath, BENCHMARK_CONFIG } = process.env;
43
+ const { BENCHMARK_CONFIG } = process.env;
46
44
 
47
45
  export type AccountType = 'ecdsar1' | 'schnorr';
48
46
  export type FeePaymentMethodGetter = (wallet: Wallet, sender: AztecAddress) => Promise<FeePaymentMethod | undefined>;
49
47
  export type BenchmarkingFeePaymentMethod = 'bridged_fee_juice' | 'private_fpc' | 'sponsored_fpc' | 'fee_juice';
50
48
 
51
49
  export class ClientFlowsBenchmark {
52
- private snapshotManager: ISnapshotManager;
53
-
54
50
  public logger: Logger;
55
51
  public aztecNode!: AztecNode;
56
52
  public cheatCodes!: CheatCodes;
57
- public context!: SubsystemsContext;
53
+ public context!: EndToEndContext;
58
54
  public chainMonitor!: ChainMonitor;
59
55
  public feeJuiceBridgeTestHarness!: GasBridgingTestHarness;
60
56
  public adminWallet!: TestWallet;
@@ -122,33 +118,37 @@ export class ClientFlowsBenchmark {
122
118
  public config: ClientFlowsConfig;
123
119
 
124
120
  private proxyLogger: ProxyLogger;
121
+ private setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs>;
125
122
 
126
- constructor(testName?: string, setupOptions: Partial<SetupOptions & DeployL1ContractsArgs> = {}) {
123
+ constructor(testName?: string, setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs> = {}) {
127
124
  this.logger = createLogger(`bench:client_flows${testName ? `:${testName}` : ''}`);
128
- this.snapshotManager = createSnapshotManager(
129
- `bench_client_flows${testName ? `/${testName}` : ''}`,
130
- dataPath,
131
- { startProverNode: true, ...setupOptions },
132
- { ...setupOptions },
133
- );
125
+ this.setupOptions = { startProverNode: true, ...setupOptions };
134
126
  this.config = BENCHMARK_CONFIG === 'key_flows' ? KEY_FLOWS_CONFIG : FULL_FLOWS_CONFIG;
135
127
  ProxyLogger.create();
136
128
  this.proxyLogger = ProxyLogger.getInstance();
137
129
  }
138
130
 
139
131
  async setup() {
140
- const context = await this.snapshotManager.setup();
141
- await context.aztecNode.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
132
+ this.logger.info('Setting up subsystems from fresh');
133
+ this.context = await setup(0, {
134
+ ...this.setupOptions,
135
+ fundSponsoredFPC: true,
136
+ skipAccountDeployment: true,
137
+ l1ContractsArgs: this.setupOptions,
138
+ });
139
+ await this.applyBaseSetup();
140
+
141
+ await this.context.aztecNodeService.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
142
142
 
143
- const rollupContract = RollupContract.getFromConfig(context.aztecNodeConfig);
144
- this.chainMonitor = new ChainMonitor(rollupContract, context.dateProvider, this.logger, 200).start();
143
+ const rollupContract = RollupContract.getFromConfig(this.context.config);
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.snapshotManager.teardown();
151
+ await teardown(this.context);
152
152
  }
153
153
 
154
154
  async mintAndBridgeFeeJuice(address: AztecAddress) {
@@ -156,21 +156,16 @@ export class ClientFlowsBenchmark {
156
156
  const { claimSecret: secret, messageLeafIndex: index } = claim;
157
157
  await this.feeJuiceContract.methods
158
158
  .claim(address, claim.claimAmount, secret, index)
159
- .send({ from: this.adminAddress })
160
- .wait();
159
+ .send({ from: this.adminAddress });
161
160
  }
162
161
 
163
162
  /** Admin mints bananaCoin tokens privately to the target address and redeems them. */
164
163
  async mintPrivateBananas(amount: bigint, address: AztecAddress) {
165
- const balanceBefore = await this.bananaCoin.methods
166
- .balance_of_private(address)
167
- .simulate({ from: this.adminAddress });
164
+ const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({ from: address });
168
165
 
169
166
  await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
170
167
 
171
- const balanceAfter = await this.bananaCoin.methods
172
- .balance_of_private(address)
173
- .simulate({ from: this.adminAddress });
168
+ const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({ from: address });
174
169
  expect(balanceAfter).toEqual(balanceBefore + amount);
175
170
  }
176
171
 
@@ -190,161 +185,118 @@ export class ClientFlowsBenchmark {
190
185
  }
191
186
  }
192
187
 
193
- public async applyBaseSnapshots() {
194
- await this.applyInitialAccountsSnapshot();
195
- await this.applySetupFeeJuiceSnapshot();
188
+ public async applyBaseSetup() {
189
+ await this.applyInitialAccounts();
190
+ await this.applySetupFeeJuice();
196
191
  }
197
192
 
198
- async applyInitialAccountsSnapshot() {
199
- await this.snapshotManager.snapshot(
200
- 'initial_accounts',
201
- deployAccounts(2, this.logger),
202
- async (
203
- { deployedAccounts: [{ address: adminAddress }, { address: sequencerAddress }] },
204
- { wallet, aztecNode, cheatCodes },
205
- ) => {
206
- this.adminWallet = wallet;
207
- this.aztecNode = aztecNode;
208
- this.cheatCodes = cheatCodes;
209
-
210
- this.adminAddress = adminAddress;
211
- this.sequencerAddress = sequencerAddress;
212
-
213
- const canonicalFeeJuice = await getCanonicalFeeJuice();
214
- this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
215
- this.coinbase = EthAddress.random();
216
-
217
- const userPXEConfig = getPXEConfig();
218
- const userPXEConfigWithContracts = {
219
- ...userPXEConfig,
220
- proverEnabled: this.realProofs,
221
- } as PXEConfig;
222
-
223
- this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
224
- loggers: {
225
- prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied'),
226
- },
227
- });
193
+ async applyInitialAccounts() {
194
+ this.logger.info('Applying initial accounts setup');
195
+ const { deployedAccounts } = await deployAccounts(
196
+ 2,
197
+ this.logger,
198
+ )({
199
+ wallet: this.context.wallet,
200
+ initialFundedAccounts: this.context.initialFundedAccounts,
201
+ });
202
+
203
+ const [{ address: adminAddress }, { address: sequencerAddress }] = deployedAccounts;
204
+
205
+ this.adminWallet = this.context.wallet;
206
+ this.aztecNode = this.context.aztecNodeService;
207
+ this.cheatCodes = this.context.cheatCodes;
208
+
209
+ this.adminAddress = adminAddress;
210
+ this.sequencerAddress = sequencerAddress;
211
+
212
+ const canonicalFeeJuice = await getCanonicalFeeJuice();
213
+ this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
214
+ this.coinbase = EthAddress.random();
215
+
216
+ const userPXEConfig = getPXEConfig();
217
+ const userPXEConfigWithContracts = {
218
+ ...userPXEConfig,
219
+ proverEnabled: this.realProofs,
220
+ } as PXEConfig;
221
+
222
+ this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
223
+ loggers: {
224
+ prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied'),
228
225
  },
229
- );
226
+ });
230
227
  }
231
228
 
232
- async applySetupFeeJuiceSnapshot() {
233
- await this.snapshotManager.snapshot(
234
- 'setup_fee_juice',
235
- async () => {},
236
- async (_data, context) => {
237
- this.context = context;
238
-
239
- this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
240
-
241
- this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
242
- aztecNode: context.aztecNode,
243
- aztecNodeAdmin: context.aztecNode,
244
- l1Client: context.deployL1ContractsValues.l1Client,
245
- wallet: this.adminWallet,
246
- logger: this.logger,
247
- });
248
- },
249
- );
229
+ async applySetupFeeJuice() {
230
+ this.logger.info('Applying fee juice setup');
231
+ this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
232
+
233
+ this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
234
+ aztecNode: this.context.aztecNodeService,
235
+ aztecNodeAdmin: this.context.aztecNodeService,
236
+ l1Client: this.context.deployL1ContractsValues.l1Client,
237
+ wallet: this.adminWallet,
238
+ logger: this.logger,
239
+ });
250
240
  }
251
241
 
252
- async applyDeployBananaTokenSnapshot() {
253
- await this.snapshotManager.snapshot(
254
- 'deploy_banana_token',
255
- async () => {
256
- const { contract: bananaCoin, instance: bananaCoinInstance } = await BananaCoin.deploy(
257
- this.adminWallet,
258
- this.adminAddress,
259
- 'BC',
260
- 'BC',
261
- 18n,
262
- )
263
- .send({ from: this.adminAddress })
264
- .wait();
265
- this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
266
- return { bananaCoinAddress: bananaCoin.address, bananaCoinInstance };
267
- },
268
- ({ bananaCoinAddress, bananaCoinInstance }) => {
269
- this.bananaCoin = BananaCoin.at(bananaCoinAddress, this.adminWallet);
270
- this.bananaCoinInstance = bananaCoinInstance;
271
- return Promise.resolve();
272
- },
273
- );
242
+ async applyDeployBananaToken() {
243
+ this.logger.info('Applying banana token deployment');
244
+ const { contract: bananaCoin, instance: bananaCoinInstance } = await BananaCoin.deploy(
245
+ this.adminWallet,
246
+ this.adminAddress,
247
+ 'BC',
248
+ 'BC',
249
+ 18n,
250
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
251
+ this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
252
+ this.bananaCoin = bananaCoin;
253
+ this.bananaCoinInstance = bananaCoinInstance;
274
254
  }
275
255
 
276
- async applyDeployCandyBarTokenSnapshot() {
277
- await this.snapshotManager.snapshot(
278
- 'deploy_candy_bar_token',
279
- async () => {
280
- const { contract: candyBarCoin, instance: candyBarCoinInstance } = await TokenContract.deploy(
281
- this.adminWallet,
282
- this.adminAddress,
283
- 'CBC',
284
- 'CBC',
285
- 18n,
286
- )
287
- .send({ from: this.adminAddress })
288
- .wait();
289
- this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
290
- return { candyBarCoinAddress: candyBarCoin.address, candyBarCoinInstance };
291
- },
292
- ({ candyBarCoinAddress, candyBarCoinInstance }) => {
293
- this.candyBarCoin = TokenContract.at(candyBarCoinAddress, this.adminWallet);
294
- this.candyBarCoinInstance = candyBarCoinInstance;
295
- return Promise.resolve();
296
- },
297
- );
256
+ async applyDeployCandyBarToken() {
257
+ this.logger.info('Applying candy bar token deployment');
258
+ const { contract: candyBarCoin, instance: candyBarCoinInstance } = await TokenContract.deploy(
259
+ this.adminWallet,
260
+ this.adminAddress,
261
+ 'CBC',
262
+ 'CBC',
263
+ 18n,
264
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
265
+ this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
266
+ this.candyBarCoin = candyBarCoin;
267
+ this.candyBarCoinInstance = candyBarCoinInstance;
298
268
  }
299
269
 
300
- public async applyFPCSetupSnapshot() {
301
- await this.snapshotManager.snapshot(
302
- 'fpc_setup',
303
- async context => {
304
- const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
305
- expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
270
+ public async applyFPCSetup() {
271
+ this.logger.info('Applying FPC setup');
272
+ const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
273
+ expect((await this.context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
306
274
 
307
- const bananaCoin = this.bananaCoin;
308
- const { contract: bananaFPC, instance: bananaFPCInstance } = await FPCContract.deploy(
309
- this.adminWallet,
310
- bananaCoin.address,
311
- this.adminAddress,
312
- )
313
- .send({ from: this.adminAddress })
314
- .wait();
275
+ const bananaCoin = this.bananaCoin;
276
+ const { contract: bananaFPC, instance: bananaFPCInstance } = await FPCContract.deploy(
277
+ this.adminWallet,
278
+ bananaCoin.address,
279
+ this.adminAddress,
280
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
315
281
 
316
- this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
282
+ this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
317
283
 
318
- await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
284
+ await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
319
285
 
320
- return { bananaFPCAddress: bananaFPC.address, bananaFPCInstance };
321
- },
322
- data => {
323
- this.bananaFPC = FPCContract.at(data.bananaFPCAddress, this.adminWallet);
324
- this.bananaFPCInstance = data.bananaFPCInstance;
325
- return Promise.resolve();
326
- },
327
- );
286
+ this.bananaFPC = bananaFPC;
287
+ this.bananaFPCInstance = bananaFPCInstance;
328
288
  }
329
289
 
330
- async applyDeploySponsoredFPCSnapshot() {
331
- await this.snapshotManager.snapshot(
332
- 'deploy_sponsored_fpc',
333
- async () => {
334
- const sponsoredFPCInstance = await setupSponsoredFPC(this.adminWallet);
335
- this.logger.info(`SponsoredFPC at ${sponsoredFPCInstance.address}`);
336
- return { sponsoredFPCAddress: sponsoredFPCInstance.address, sponsoredFPCInstance };
337
- },
338
- ({ sponsoredFPCAddress, sponsoredFPCInstance }) => {
339
- this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCAddress, this.adminWallet);
340
- this.sponsoredFPCInstance = sponsoredFPCInstance;
341
- return Promise.resolve();
342
- },
343
- );
290
+ async applyDeploySponsoredFPC() {
291
+ this.logger.info('Applying sponsored FPC deployment');
292
+ const sponsoredFPCInstance = await setupSponsoredFPC(this.adminWallet);
293
+ this.logger.info(`SponsoredFPC at ${sponsoredFPCInstance.address}`);
294
+ this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCInstance.address, this.adminWallet);
295
+ this.sponsoredFPCInstance = sponsoredFPCInstance;
344
296
  }
345
297
 
346
298
  public async createCrossChainTestHarness(owner: AztecAddress) {
347
- const l1Client = createExtendedL1Client(this.context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
299
+ const l1Client = createExtendedL1Client(this.context.config.l1RpcUrls, MNEMONIC);
348
300
 
349
301
  const underlyingERC20Address = await deployL1Contract(l1Client, TestERC20Abi, TestERC20Bytecode, [
350
302
  'Underlying',
@@ -373,12 +325,10 @@ export class ClientFlowsBenchmark {
373
325
  const benchysAddress = benchysAccountManager.address;
374
326
  const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
375
327
  const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
376
- await behchysDeployMethod
377
- .send({
378
- from: AztecAddress.ZERO,
379
- fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
380
- })
381
- .wait();
328
+ await behchysDeployMethod.send({
329
+ from: AztecAddress.ZERO,
330
+ fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
331
+ });
382
332
  // Register benchy on the user's Wallet, where we're going to be interacting from
383
333
  const accountManager = await this.userWallet.createAccount({
384
334
  secret: benchysAccount.getSecretKey(),
@@ -388,44 +338,27 @@ export class ClientFlowsBenchmark {
388
338
  return accountManager.address;
389
339
  }
390
340
 
391
- public async applyDeployAmmSnapshot() {
392
- await this.snapshotManager.snapshot(
393
- 'deploy_amm',
394
- async () => {
395
- const { contract: liquidityToken, instance: liquidityTokenInstance } = await TokenContract.deploy(
396
- this.adminWallet,
397
- this.adminAddress,
398
- 'LPT',
399
- 'LPT',
400
- 18n,
401
- )
402
- .send({ from: this.adminAddress })
403
- .wait();
404
- const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
405
- this.adminWallet,
406
- this.bananaCoin.address,
407
- this.candyBarCoin.address,
408
- liquidityToken.address,
409
- )
410
- .send({ from: this.adminAddress })
411
- .wait();
412
- this.logger.info(`AMM deployed at ${amm.address}`);
413
- await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress }).wait();
414
- return {
415
- ammAddress: amm.address,
416
- ammInstance,
417
- liquidityTokenAddress: liquidityToken.address,
418
- liquidityTokenInstance,
419
- };
420
- },
421
- ({ ammAddress, ammInstance, liquidityTokenAddress, liquidityTokenInstance }) => {
422
- this.liquidityToken = TokenContract.at(liquidityTokenAddress, this.adminWallet);
423
- this.liquidityTokenInstance = liquidityTokenInstance;
424
- this.amm = AMMContract.at(ammAddress, this.adminWallet);
425
- this.ammInstance = ammInstance;
426
- return Promise.resolve();
427
- },
428
- );
341
+ public async applyDeployAmm() {
342
+ this.logger.info('Applying AMM deployment');
343
+ const { contract: liquidityToken, instance: liquidityTokenInstance } = await TokenContract.deploy(
344
+ this.adminWallet,
345
+ this.adminAddress,
346
+ 'LPT',
347
+ 'LPT',
348
+ 18n,
349
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
350
+ const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
351
+ this.adminWallet,
352
+ this.bananaCoin.address,
353
+ this.candyBarCoin.address,
354
+ liquidityToken.address,
355
+ ).send({ from: this.adminAddress, wait: { returnReceipt: true } });
356
+ this.logger.info(`AMM deployed at ${amm.address}`);
357
+ await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress });
358
+ this.liquidityToken = liquidityToken;
359
+ this.liquidityTokenInstance = liquidityTokenInstance;
360
+ this.amm = amm;
361
+ this.ammInstance = ammInstance;
429
362
  }
430
363
 
431
364
  public async getBridgedFeeJuicePaymentMethodForWallet(_wallet: Wallet, sender: AztecAddress) {
@@ -436,7 +369,7 @@ export class ClientFlowsBenchmark {
436
369
  public async getPrivateFPCPaymentMethodForWallet(wallet: Wallet, sender: AztecAddress) {
437
370
  // The private fee paying method assembled on the app side requires knowledge of the maximum
438
371
  // fee the user is willing to pay
439
- const maxFeesPerGas = (await this.aztecNode.getCurrentBaseFees()).mul(1.5);
372
+ const maxFeesPerGas = (await this.aztecNode.getCurrentMinFees()).mul(1.5);
440
373
  const gasSettings = GasSettings.default({ maxFeesPerGas });
441
374
  return new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet, gasSettings);
442
375
  }
@@ -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
  };
@@ -22,7 +22,7 @@ async function main() {
22
22
  logger.info(`Flows in ${ivcFolder}: \n${flows.map(flowName => `\t- ${flowName}`).join('\n')}`);
23
23
  const simulator = new WASMSimulator();
24
24
  const log = proxyLogger.createLogger('bb:prover');
25
- const prover = new BBBundlePrivateKernelProver(simulator, log);
25
+ const prover = new BBBundlePrivateKernelProver(simulator, { logger: log });
26
26
 
27
27
  const userLog = createLogger('chonk_flows:data_processor');
28
28
 
@@ -1,8 +1,11 @@
1
1
  import type { AztecNodeService } from '@aztec/aztec-node';
2
- import { BatchCall, type SentTx, type WaitOpts } from '@aztec/aztec.js/contracts';
2
+ import { AztecAddress } from '@aztec/aztec.js/addresses';
3
+ import { BatchCall, NO_WAIT, type WaitOpts } from '@aztec/aztec.js/contracts';
4
+ import { waitForTx } from '@aztec/aztec.js/node';
3
5
  import { mean, stdDev, times } from '@aztec/foundation/collection';
4
6
  import { BenchmarkingContract } from '@aztec/noir-test-contracts.js/Benchmarking';
5
- import type { MetricsType } from '@aztec/telemetry-client';
7
+ import type { TxHash } from '@aztec/stdlib/tx';
8
+ import type { MetricDefinition } from '@aztec/telemetry-client';
6
9
  import type { BenchmarkDataPoint, BenchmarkMetricsType, BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
7
10
 
8
11
  import { mkdirSync, writeFileSync } from 'fs';
@@ -15,17 +18,17 @@ import { type EndToEndContext, type SetupOptions, setup } from '../fixtures/util
15
18
  */
16
19
  export async function benchmarkSetup(
17
20
  opts: Partial<SetupOptions> & {
18
- /** What metrics to export */ metrics: (MetricsType | MetricFilter)[];
21
+ /** What metrics to export */ metrics: (MetricDefinition | MetricFilter)[];
19
22
  /** Where to output the benchmark data (defaults to BENCH_OUTPUT or bench.json) */
20
23
  benchOutput?: string;
21
24
  },
22
25
  ) {
23
26
  const context = await setup(1, { ...opts, telemetryConfig: { benchmark: true } });
24
27
  const defaultAccountAddress = context.accounts[0];
25
- const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress }).deployed();
28
+ const contract = await BenchmarkingContract.deploy(context.wallet).send({ from: defaultAccountAddress });
26
29
  context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
27
30
  const sequencer = (context.aztecNode as AztecNodeService).getSequencer()!;
28
- const telemetry = context.telemetryClient! as BenchmarkTelemetryClient;
31
+ const telemetry = context.telemetryClient as BenchmarkTelemetryClient;
29
32
  context.logger.warn(`Cleared benchmark data points from setup`);
30
33
  telemetry.clear();
31
34
  const origTeardown = context.teardown.bind(context);
@@ -46,7 +49,7 @@ export async function benchmarkSetup(
46
49
  }
47
50
 
48
51
  type MetricFilter = {
49
- source: MetricsType;
52
+ source: MetricDefinition;
50
53
  transform: (value: number) => number;
51
54
  name: string;
52
55
  unit?: string;
@@ -61,17 +64,21 @@ export type GithubActionBenchmarkResult = {
61
64
  extra?: string;
62
65
  };
63
66
 
67
+ function isMetricDefinition(f: MetricDefinition | MetricFilter): f is MetricDefinition {
68
+ return 'description' in f;
69
+ }
70
+
64
71
  function formatMetricsForGithubBenchmarkAction(
65
72
  data: BenchmarkMetricsType,
66
- filter: (MetricsType | MetricFilter)[],
73
+ filter: (MetricDefinition | MetricFilter)[],
67
74
  ): GithubActionBenchmarkResult[] {
68
75
  const allFilters: MetricFilter[] = filter.map(f =>
69
- typeof f === 'string' ? { name: f, source: f, transform: (x: number) => x, unit: undefined } : f,
76
+ isMetricDefinition(f) ? { name: f.name, source: f, transform: (x: number) => x, unit: f.unit } : f,
70
77
  );
71
78
  return data.flatMap(meter => {
72
79
  return meter.metrics
73
- .filter(metric => allFilters.map(f => f.source).includes(metric.name as MetricsType))
74
- .map(metric => [metric, allFilters.find(f => f.source === metric.name)!] as const)
80
+ .filter(metric => allFilters.map(f => f.source.name).includes(metric.name))
81
+ .map(metric => [metric, allFilters.find(f => f.source.name === metric.name)!] as const)
75
82
  .map(([metric, filter]) => ({
76
83
  name: `${meter.name}/${filter.name}`,
77
84
  unit: filter.unit ?? metric.unit ?? 'unknown',
@@ -103,19 +110,22 @@ function getMetricValues(points: BenchmarkDataPoint[]) {
103
110
  * @param heavyPublicCompute - Whether the transactions include heavy public compute (like a big sha256).
104
111
  * @returns A BatchCall instance.
105
112
  */
106
- function makeCall(
113
+ async function makeCall(
107
114
  index: number,
108
115
  context: EndToEndContext,
109
116
  contract: BenchmarkingContract,
110
117
  heavyPublicCompute: boolean,
111
118
  ) {
112
- const [owner] = context.accounts;
113
119
  if (heavyPublicCompute) {
114
120
  return new BatchCall(context.wallet, [contract.methods.sha256_hash_1024(randomBytesAsBigInts(1024))]);
115
121
  } else {
122
+ // We use random address for the new note owner because we can emit at most UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN
123
+ // logs for a given sender-recipient-contract tuple.
124
+ const ownerOfNewNote = await AztecAddress.random();
125
+ const [ownerOfBalance] = context.accounts;
116
126
  return new BatchCall(context.wallet, [
117
- contract.methods.create_note(owner, index + 1),
118
- contract.methods.increment_balance(owner, index + 1),
127
+ contract.methods.create_note(ownerOfNewNote, index + 1),
128
+ contract.methods.increment_balance(ownerOfBalance, index + 1),
119
129
  ]);
120
130
  }
121
131
  }
@@ -129,23 +139,23 @@ function makeCall(
129
139
  * @param heavyPublicCompute - Whether the transactions include heavy public compute (like a big sha256).
130
140
  * @returns Array of sent txs.
131
141
  */
132
- export function sendTxs(
142
+ export async function sendTxs(
133
143
  txCount: number,
134
144
  context: EndToEndContext,
135
145
  contract: BenchmarkingContract,
136
146
  heavyPublicCompute: boolean = false,
137
- ): SentTx[] {
138
- const calls = times(txCount, index => makeCall(index, context, contract, heavyPublicCompute));
147
+ ): Promise<TxHash[]> {
148
+ const calls = await Promise.all(times(txCount, index => makeCall(index, context, contract, heavyPublicCompute)));
139
149
  context.logger.info(`Creating ${txCount} txs`);
140
150
  const [from] = context.accounts;
141
151
  context.logger.info(`Sending ${txCount} txs`);
142
- return calls.map(call => call.send({ from }));
152
+ return Promise.all(calls.map(call => call.send({ from, wait: NO_WAIT })));
143
153
  }
144
154
 
145
- export async function waitTxs(txs: SentTx[], context: EndToEndContext, txWaitOpts?: WaitOpts) {
155
+ export async function waitTxs(txs: TxHash[], context: EndToEndContext, txWaitOpts?: WaitOpts) {
146
156
  context.logger.info(`Awaiting ${txs.length} txs to be mined`);
147
- await Promise.all(txs.map(tx => tx.wait(txWaitOpts)));
148
- context.logger.info(`All ${txs.length} txs have been mined`);
157
+ await Promise.all(txs.map(txHash => waitForTx(context.aztecNode, txHash, txWaitOpts)));
158
+ context.logger.info(`${txs.length} txs have been mined`);
149
159
  }
150
160
 
151
161
  function randomBytesAsBigInts(length: number): bigint[] {