@aztec/end-to-end 0.0.1-commit.24de95ac → 0.0.1-commit.2606882

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 (299) hide show
  1. package/README.md +27 -0
  2. package/dest/bench/client_flows/benchmark.d.ts +17 -2
  3. package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
  4. package/dest/bench/client_flows/benchmark.js +38 -1
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts +23 -17
  6. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  7. package/dest/bench/client_flows/client_flows_benchmark.js +143 -136
  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/client_flows/data_extractor.d.ts +1 -1
  12. package/dest/bench/client_flows/data_extractor.js +7 -27
  13. package/dest/bench/utils.d.ts +8 -7
  14. package/dest/bench/utils.d.ts.map +1 -1
  15. package/dest/bench/utils.js +33 -19
  16. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +12 -10
  17. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  18. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +120 -117
  19. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +33 -16
  20. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  21. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +124 -70
  22. package/dest/e2e_deploy_contract/deploy_test.d.ts +7 -6
  23. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  24. package/dest/e2e_deploy_contract/deploy_test.js +20 -14
  25. package/dest/e2e_epochs/epochs_test.d.ts +49 -16
  26. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  27. package/dest/e2e_epochs/epochs_test.js +188 -64
  28. package/dest/e2e_fees/bridging_race.notest.d.ts +1 -1
  29. package/dest/e2e_fees/bridging_race.notest.js +5 -7
  30. package/dest/e2e_fees/fees_test.d.ts +25 -18
  31. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  32. package/dest/e2e_fees/fees_test.js +162 -141
  33. package/dest/e2e_l1_publisher/write_json.d.ts +4 -3
  34. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
  35. package/dest/e2e_l1_publisher/write_json.js +18 -19
  36. package/dest/e2e_multi_validator/utils.d.ts +1 -1
  37. package/dest/e2e_multi_validator/utils.js +1 -1
  38. package/dest/e2e_nested_contract/nested_contract_test.d.ts +7 -10
  39. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  40. package/dest/e2e_nested_contract/nested_contract_test.js +32 -40
  41. package/dest/e2e_p2p/inactivity_slash_test.d.ts +3 -3
  42. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
  43. package/dest/e2e_p2p/inactivity_slash_test.js +11 -9
  44. package/dest/e2e_p2p/p2p_network.d.ts +237 -28
  45. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  46. package/dest/e2e_p2p/p2p_network.js +176 -129
  47. package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
  48. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
  49. package/dest/e2e_p2p/reqresp/utils.js +206 -0
  50. package/dest/e2e_p2p/shared.d.ts +44 -15
  51. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  52. package/dest/e2e_p2p/shared.js +102 -68
  53. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
  54. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
  55. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
  56. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
  57. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
  58. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
  59. package/dest/e2e_token_contract/token_contract_test.d.ts +20 -11
  60. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  61. package/dest/e2e_token_contract/token_contract_test.js +103 -93
  62. package/dest/fixtures/authwit_proxy.d.ts +15 -0
  63. package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
  64. package/dest/fixtures/authwit_proxy.js +34 -0
  65. package/dest/fixtures/e2e_prover_test.d.ts +19 -24
  66. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  67. package/dest/fixtures/e2e_prover_test.js +126 -145
  68. package/dest/fixtures/elu_monitor.d.ts +21 -0
  69. package/dest/fixtures/elu_monitor.d.ts.map +1 -0
  70. package/dest/fixtures/elu_monitor.js +102 -0
  71. package/dest/fixtures/fixtures.d.ts +75 -3
  72. package/dest/fixtures/fixtures.d.ts.map +1 -1
  73. package/dest/fixtures/fixtures.js +73 -3
  74. package/dest/fixtures/get_acvm_config.d.ts +1 -1
  75. package/dest/fixtures/get_acvm_config.js +1 -1
  76. package/dest/fixtures/get_bb_config.d.ts +1 -1
  77. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  78. package/dest/fixtures/get_bb_config.js +5 -5
  79. package/dest/fixtures/ha_setup.d.ts +71 -0
  80. package/dest/fixtures/ha_setup.d.ts.map +1 -0
  81. package/dest/fixtures/ha_setup.js +116 -0
  82. package/dest/fixtures/index.d.ts +2 -1
  83. package/dest/fixtures/index.d.ts.map +1 -1
  84. package/dest/fixtures/index.js +1 -0
  85. package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
  86. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  87. package/dest/fixtures/l1_to_l2_messaging.js +2 -2
  88. package/dest/fixtures/logging.d.ts +1 -1
  89. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
  90. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
  91. package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
  92. package/dest/fixtures/setup.d.ts +272 -0
  93. package/dest/fixtures/setup.d.ts.map +1 -0
  94. package/dest/fixtures/setup.js +735 -0
  95. package/dest/fixtures/setup_p2p_test.d.ts +22 -11
  96. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  97. package/dest/fixtures/setup_p2p_test.js +57 -38
  98. package/dest/fixtures/token_utils.d.ts +6 -3
  99. package/dest/fixtures/token_utils.d.ts.map +1 -1
  100. package/dest/fixtures/token_utils.js +13 -9
  101. package/dest/fixtures/utils.d.ts +5 -192
  102. package/dest/fixtures/utils.d.ts.map +1 -1
  103. package/dest/fixtures/utils.js +4 -648
  104. package/dest/fixtures/web3signer.d.ts +1 -1
  105. package/dest/fixtures/web3signer.js +1 -1
  106. package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
  107. package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
  108. package/dest/fixtures/with_telemetry_utils.js +2 -2
  109. package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
  110. package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
  111. package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
  112. package/dest/forward-compatibility/wallet_service.d.ts +3 -0
  113. package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
  114. package/dest/forward-compatibility/wallet_service.js +109 -0
  115. package/dest/index.d.ts +1 -1
  116. package/dest/install_legacy_contracts.d.cts +10 -0
  117. package/dest/install_legacy_contracts.d.cts.map +1 -0
  118. package/dest/legacy-jest-resolver.d.cts +3 -0
  119. package/dest/legacy-jest-resolver.d.cts.map +1 -0
  120. package/dest/quality_of_service/grafana_client.d.ts +41 -0
  121. package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
  122. package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
  123. package/dest/quality_of_service/prometheus_client.d.ts +38 -0
  124. package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
  125. package/dest/quality_of_service/prometheus_client.js +67 -0
  126. package/dest/shared/cross_chain_test_harness.d.ts +9 -6
  127. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  128. package/dest/shared/cross_chain_test_harness.js +34 -30
  129. package/dest/shared/gas_portal_test_harness.d.ts +9 -6
  130. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  131. package/dest/shared/gas_portal_test_harness.js +21 -12
  132. package/dest/shared/index.d.ts +3 -2
  133. package/dest/shared/index.d.ts.map +1 -1
  134. package/dest/shared/index.js +1 -0
  135. package/dest/shared/jest_setup.d.ts +1 -1
  136. package/dest/shared/jest_setup.js +41 -1
  137. package/dest/shared/mock_state_view.d.ts +86 -0
  138. package/dest/shared/mock_state_view.d.ts.map +1 -0
  139. package/dest/shared/mock_state_view.js +186 -0
  140. package/dest/shared/submit-transactions.d.ts +4 -4
  141. package/dest/shared/submit-transactions.d.ts.map +1 -1
  142. package/dest/shared/submit-transactions.js +9 -11
  143. package/dest/shared/uniswap_l1_l2.d.ts +3 -27
  144. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  145. package/dest/shared/uniswap_l1_l2.js +87 -50
  146. package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
  147. package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
  148. package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
  149. package/dest/simulators/index.d.ts +1 -1
  150. package/dest/simulators/lending_simulator.d.ts +11 -4
  151. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  152. package/dest/simulators/lending_simulator.js +32 -18
  153. package/dest/simulators/token_simulator.d.ts +1 -1
  154. package/dest/simulators/token_simulator.d.ts.map +1 -1
  155. package/dest/simulators/token_simulator.js +3 -24
  156. package/dest/spartan/setup_test_wallets.d.ts +18 -6
  157. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  158. package/dest/spartan/setup_test_wallets.js +159 -30
  159. package/dest/spartan/tx_metrics.d.ts +102 -0
  160. package/dest/spartan/tx_metrics.d.ts.map +1 -0
  161. package/dest/spartan/tx_metrics.js +475 -0
  162. package/dest/spartan/utils/bot.d.ts +28 -0
  163. package/dest/spartan/utils/bot.d.ts.map +1 -0
  164. package/dest/spartan/utils/bot.js +142 -0
  165. package/dest/spartan/utils/chaos.d.ts +79 -0
  166. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  167. package/dest/spartan/utils/chaos.js +142 -0
  168. package/dest/spartan/utils/clients.d.ts +39 -0
  169. package/dest/spartan/utils/clients.d.ts.map +1 -0
  170. package/dest/spartan/utils/clients.js +90 -0
  171. package/dest/spartan/utils/config.d.ts +19 -0
  172. package/dest/spartan/utils/config.d.ts.map +1 -0
  173. package/dest/spartan/utils/config.js +23 -0
  174. package/dest/spartan/utils/health.d.ts +63 -0
  175. package/dest/spartan/utils/health.d.ts.map +1 -0
  176. package/dest/spartan/utils/health.js +202 -0
  177. package/dest/spartan/utils/helm.d.ts +15 -0
  178. package/dest/spartan/utils/helm.d.ts.map +1 -0
  179. package/dest/spartan/utils/helm.js +47 -0
  180. package/dest/spartan/utils/index.d.ts +11 -0
  181. package/dest/spartan/utils/index.d.ts.map +1 -0
  182. package/dest/spartan/utils/index.js +22 -0
  183. package/dest/spartan/utils/k8s.d.ts +128 -0
  184. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  185. package/dest/spartan/utils/k8s.js +381 -0
  186. package/dest/spartan/utils/nodes.d.ts +40 -0
  187. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  188. package/dest/spartan/utils/nodes.js +461 -0
  189. package/dest/spartan/utils/pod_logs.d.ts +25 -0
  190. package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
  191. package/dest/spartan/utils/pod_logs.js +74 -0
  192. package/dest/spartan/utils/scripts.d.ts +30 -0
  193. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  194. package/dest/spartan/utils/scripts.js +81 -0
  195. package/dest/spartan/utils.d.ts +2 -218
  196. package/dest/spartan/utils.d.ts.map +1 -1
  197. package/dest/spartan/utils.js +1 -749
  198. package/dest/test-wallet/test_wallet.d.ts +85 -0
  199. package/dest/test-wallet/test_wallet.d.ts.map +1 -0
  200. package/dest/test-wallet/test_wallet.js +273 -0
  201. package/dest/test-wallet/utils.d.ts +41 -0
  202. package/dest/test-wallet/utils.d.ts.map +1 -0
  203. package/dest/test-wallet/utils.js +66 -0
  204. package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
  205. package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
  206. package/dest/test-wallet/wallet_worker_script.js +53 -0
  207. package/dest/test-wallet/worker_wallet.d.ts +53 -0
  208. package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
  209. package/dest/test-wallet/worker_wallet.js +155 -0
  210. package/dest/test-wallet/worker_wallet_schema.d.ts +160 -0
  211. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
  212. package/dest/test-wallet/worker_wallet_schema.js +22 -0
  213. package/package.json +56 -46
  214. package/src/bench/client_flows/benchmark.ts +43 -2
  215. package/src/bench/client_flows/client_flows_benchmark.ts +203 -206
  216. package/src/bench/client_flows/config.ts +9 -1
  217. package/src/bench/client_flows/data_extractor.ts +6 -28
  218. package/src/bench/utils.ts +38 -22
  219. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +141 -152
  220. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +180 -127
  221. package/src/e2e_deploy_contract/deploy_test.ts +25 -17
  222. package/src/e2e_epochs/epochs_test.ts +254 -116
  223. package/src/e2e_fees/bridging_race.notest.ts +6 -12
  224. package/src/e2e_fees/fees_test.ts +215 -229
  225. package/src/e2e_l1_publisher/write_json.ts +20 -19
  226. package/src/e2e_multi_validator/utils.ts +1 -1
  227. package/src/e2e_nested_contract/nested_contract_test.ts +38 -56
  228. package/src/e2e_p2p/inactivity_slash_test.ts +12 -10
  229. package/src/e2e_p2p/p2p_network.ts +246 -201
  230. package/src/e2e_p2p/reqresp/utils.ts +274 -0
  231. package/src/e2e_p2p/shared.ts +132 -82
  232. package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
  233. package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
  234. package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
  235. package/src/e2e_token_contract/token_contract_test.ts +129 -117
  236. package/src/fixtures/authwit_proxy.ts +54 -0
  237. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  238. package/src/fixtures/e2e_prover_test.ts +154 -199
  239. package/src/fixtures/elu_monitor.ts +126 -0
  240. package/src/fixtures/fixtures.ts +95 -5
  241. package/src/fixtures/get_acvm_config.ts +1 -1
  242. package/src/fixtures/get_bb_config.ts +7 -6
  243. package/src/fixtures/ha_setup.ts +188 -0
  244. package/src/fixtures/index.ts +1 -0
  245. package/src/fixtures/l1_to_l2_messaging.ts +4 -2
  246. package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
  247. package/src/fixtures/setup.ts +1056 -0
  248. package/src/fixtures/setup_p2p_test.ts +70 -56
  249. package/src/fixtures/token_utils.ts +9 -8
  250. package/src/fixtures/utils.ts +29 -947
  251. package/src/fixtures/web3signer.ts +1 -1
  252. package/src/fixtures/with_telemetry_utils.ts +2 -2
  253. package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
  254. package/src/forward-compatibility/wallet_service.ts +104 -0
  255. package/src/guides/up_quick_start.sh +4 -6
  256. package/src/install_legacy_contracts.cjs +75 -0
  257. package/src/legacy-jest-resolver.cjs +112 -0
  258. package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
  259. package/src/quality_of_service/prometheus_client.ts +113 -0
  260. package/src/shared/cross_chain_test_harness.ts +37 -40
  261. package/src/shared/gas_portal_test_harness.ts +24 -14
  262. package/src/shared/index.ts +2 -1
  263. package/src/shared/jest_setup.ts +51 -1
  264. package/src/shared/mock_state_view.ts +188 -0
  265. package/src/shared/submit-transactions.ts +11 -16
  266. package/src/shared/uniswap_l1_l2.ts +142 -114
  267. package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
  268. package/src/simulators/lending_simulator.ts +39 -19
  269. package/src/simulators/token_simulator.ts +6 -30
  270. package/src/spartan/DEVELOP.md +7 -0
  271. package/src/spartan/setup_test_wallets.ts +234 -32
  272. package/src/spartan/tx_metrics.ts +434 -0
  273. package/src/spartan/utils/bot.ts +188 -0
  274. package/src/spartan/utils/chaos.ts +253 -0
  275. package/src/spartan/utils/clients.ts +100 -0
  276. package/src/spartan/utils/config.ts +29 -0
  277. package/src/spartan/utils/health.ts +255 -0
  278. package/src/spartan/utils/helm.ts +84 -0
  279. package/src/spartan/utils/index.ts +71 -0
  280. package/src/spartan/utils/k8s.ts +535 -0
  281. package/src/spartan/utils/nodes.ts +543 -0
  282. package/src/spartan/utils/pod_logs.ts +99 -0
  283. package/src/spartan/utils/scripts.ts +99 -0
  284. package/src/spartan/utils.ts +1 -942
  285. package/src/test-wallet/test_wallet.ts +376 -0
  286. package/src/test-wallet/utils.ts +108 -0
  287. package/src/test-wallet/wallet_worker_script.ts +63 -0
  288. package/src/test-wallet/worker_wallet.ts +218 -0
  289. package/src/test-wallet/worker_wallet_schema.ts +13 -0
  290. package/dest/fixtures/setup_l1_contracts.d.ts +0 -6
  291. package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
  292. package/dest/fixtures/setup_l1_contracts.js +0 -17
  293. package/dest/fixtures/snapshot_manager.d.ts +0 -95
  294. package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
  295. package/dest/fixtures/snapshot_manager.js +0 -505
  296. package/dest/quality_of_service/alert_checker.d.ts +0 -41
  297. package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
  298. package/src/fixtures/setup_l1_contracts.ts +0 -26
  299. package/src/fixtures/snapshot_manager.ts +0 -665
@@ -1,15 +1,19 @@
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 { type DeployL1ContractsArgs, RollupContract, createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
8
+ import { CheatCodes, getTokenAllowedSetupFunctions } from '@aztec/aztec/testing';
9
+ import { createExtendedL1Client } from '@aztec/ethereum/client';
10
+ import { RollupContract } from '@aztec/ethereum/contracts';
11
+ import type { DeployAztecL1ContractsArgs } from '@aztec/ethereum/deploy-aztec-l1-contracts';
12
+ import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
9
13
  import { ChainMonitor } from '@aztec/ethereum/test';
10
- import { randomBytes } from '@aztec/foundation/crypto';
14
+ import { randomBytes } from '@aztec/foundation/crypto/random';
15
+ import { Fr } from '@aztec/foundation/curves/bn254';
11
16
  import { EthAddress } from '@aztec/foundation/eth-address';
12
- import { Fr } from '@aztec/foundation/fields';
13
17
  import { TestERC20Abi } from '@aztec/l1-artifacts/TestERC20Abi';
14
18
  import { TestERC20Bytecode } from '@aztec/l1-artifacts/TestERC20Bytecode';
15
19
  import { AMMContract } from '@aztec/noir-contracts.js/AMM';
@@ -20,40 +24,34 @@ import { TokenContract as BananaCoin, TokenContract } from '@aztec/noir-contract
20
24
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
21
25
  import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
22
26
  import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
27
+ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
23
28
  import { GasSettings } from '@aztec/stdlib/gas';
24
29
  import { deriveSigningKey } from '@aztec/stdlib/keys';
25
- import { TestWallet } from '@aztec/test-wallet/server';
26
30
 
27
- import { MNEMONIC } from '../../fixtures/fixtures.js';
28
- import {
29
- type ISnapshotManager,
30
- type SubsystemsContext,
31
- createSnapshotManager,
32
- deployAccounts,
33
- } from '../../fixtures/snapshot_manager.js';
31
+ import { AUTOMINE_E2E_OPTS, MNEMONIC, getPaddedMaxFeesPerGas } from '../../fixtures/fixtures.js';
32
+ import { type EndToEndContext, type SetupOptions, deployAccounts, setup, teardown } from '../../fixtures/setup.js';
34
33
  import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
35
- import { type SetupOptions, setupSponsoredFPC } from '../../fixtures/utils.js';
34
+ import { setupSponsoredFPC } from '../../fixtures/utils.js';
36
35
  import { CrossChainTestHarness } from '../../shared/cross_chain_test_harness.js';
37
36
  import {
38
37
  FeeJuicePortalTestingHarnessFactory,
39
38
  type GasBridgingTestHarness,
40
39
  } from '../../shared/gas_portal_test_harness.js';
40
+ import { TestWallet } from '../../test-wallet/test_wallet.js';
41
41
  import { ProxyLogger } from './benchmark.js';
42
42
  import { type ClientFlowsConfig, FULL_FLOWS_CONFIG, KEY_FLOWS_CONFIG } from './config.js';
43
43
 
44
- const { E2E_DATA_PATH: dataPath, BENCHMARK_CONFIG } = process.env;
44
+ const { BENCHMARK_CONFIG } = process.env;
45
45
 
46
46
  export type AccountType = 'ecdsar1' | 'schnorr';
47
47
  export type FeePaymentMethodGetter = (wallet: Wallet, sender: AztecAddress) => Promise<FeePaymentMethod | undefined>;
48
48
  export type BenchmarkingFeePaymentMethod = 'bridged_fee_juice' | 'private_fpc' | 'sponsored_fpc' | 'fee_juice';
49
49
 
50
50
  export class ClientFlowsBenchmark {
51
- private snapshotManager: ISnapshotManager;
52
-
53
51
  public logger: Logger;
54
52
  public aztecNode!: AztecNode;
55
53
  public cheatCodes!: CheatCodes;
56
- public context!: SubsystemsContext;
54
+ public context!: EndToEndContext;
57
55
  public chainMonitor!: ChainMonitor;
58
56
  public feeJuiceBridgeTestHarness!: GasBridgingTestHarness;
59
57
  public adminWallet!: TestWallet;
@@ -69,79 +67,95 @@ export class ClientFlowsBenchmark {
69
67
  public feeJuiceContract!: FeeJuiceContract;
70
68
  // Asset in which fees are paid via FPC
71
69
  public bananaCoin!: BananaCoin;
70
+ public bananaCoinInstance!: ContractInstanceWithAddress;
72
71
  public bananaFPC!: FPCContract;
72
+ public bananaFPCInstance!: ContractInstanceWithAddress;
73
73
  // Random asset we want to trade
74
74
  public candyBarCoin!: TokenContract;
75
+ public candyBarCoinInstance!: ContractInstanceWithAddress;
75
76
  // AMM contract
76
77
  public amm!: AMMContract;
78
+ public ammInstance!: ContractInstanceWithAddress;
77
79
  // Liquidity token for AMM
78
80
  public liquidityToken!: TokenContract;
81
+ public liquidityTokenInstance!: ContractInstanceWithAddress;
79
82
  // Sponsored FPC contract
80
83
  public sponsoredFPC!: SponsoredFPCContract;
84
+ public sponsoredFPCInstance!: ContractInstanceWithAddress;
81
85
 
82
86
  // PXE and Wallet used by the benchmarking user. It can be set up with client-side proving enabled
83
87
  public userWallet!: TestWallet;
84
88
 
85
89
  public realProofs = ['true', '1'].includes(process.env.REAL_PROOFS ?? '');
86
90
 
87
- public paymentMethods: Record<BenchmarkingFeePaymentMethod, { forWallet: FeePaymentMethodGetter; circuits: number }> =
88
- {
89
- // eslint-disable-next-line camelcase
90
- bridged_fee_juice: {
91
- forWallet: this.getBridgedFeeJuicePaymentMethodForWallet.bind(this),
92
- circuits: 2, // FeeJuice claim + kernel inner
93
- },
94
- // eslint-disable-next-line camelcase
95
- private_fpc: {
96
- forWallet: this.getPrivateFPCPaymentMethodForWallet.bind(this),
97
- circuits:
98
- 2 + // FPC entrypoint + kernel inner
99
- 2 + // BananaCoin transfer_to_public + kernel inner
100
- 2 + // Account verify_private_authwit + kernel inner
101
- 2, // BananaCoin prepare_private_balance_increase + kernel inner
102
- },
103
- // eslint-disable-next-line camelcase
104
- sponsored_fpc: {
105
- forWallet: this.getSponsoredFPCPaymentMethodForWallet.bind(this),
106
- circuits: 2, // Sponsored FPC sponsor_unconditionally + kernel inner
107
- },
108
- // eslint-disable-next-line camelcase
109
- fee_juice: {
110
- forWallet: () => Promise.resolve(undefined),
111
- circuits: 0,
112
- },
113
- };
91
+ // `apps` is the number of private function calls contributed by this payment method.
92
+ // Each app produces one execution step at proving time; the orchestrator additionally produces
93
+ // one kernel step per batch of N apps (see `expectedExecutionSteps` in `benchmark.ts`).
94
+ public paymentMethods: Record<BenchmarkingFeePaymentMethod, { forWallet: FeePaymentMethodGetter; apps: number }> = {
95
+ // eslint-disable-next-line camelcase
96
+ bridged_fee_juice: {
97
+ forWallet: this.getBridgedFeeJuicePaymentMethodForWallet.bind(this),
98
+ apps: 1, // FeeJuice claim
99
+ },
100
+ // eslint-disable-next-line camelcase
101
+ private_fpc: {
102
+ forWallet: this.getPrivateFPCPaymentMethodForWallet.bind(this),
103
+ apps:
104
+ 1 + // FPC entrypoint
105
+ 1 + // BananaCoin transfer_to_public
106
+ 1 + // Account verify_private_authwit
107
+ 1, // BananaCoin prepare_private_balance_increase
108
+ },
109
+ // eslint-disable-next-line camelcase
110
+ sponsored_fpc: {
111
+ forWallet: this.getSponsoredFPCPaymentMethodForWallet.bind(this),
112
+ apps: 1, // Sponsored FPC sponsor_unconditionally
113
+ },
114
+ // eslint-disable-next-line camelcase
115
+ fee_juice: {
116
+ forWallet: () => Promise.resolve(undefined),
117
+ apps: 0,
118
+ },
119
+ };
114
120
 
115
121
  public config: ClientFlowsConfig;
116
122
 
117
123
  private proxyLogger: ProxyLogger;
124
+ private setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs>;
118
125
 
119
- constructor(testName?: string, setupOptions: Partial<SetupOptions & DeployL1ContractsArgs> = {}) {
126
+ constructor(testName?: string, setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs> = {}) {
120
127
  this.logger = createLogger(`bench:client_flows${testName ? `:${testName}` : ''}`);
121
- this.snapshotManager = createSnapshotManager(
122
- `bench_client_flows${testName ? `/${testName}` : ''}`,
123
- dataPath,
124
- { startProverNode: true, ...setupOptions },
125
- { ...setupOptions },
126
- );
128
+ this.setupOptions = { ...AUTOMINE_E2E_OPTS, startProverNode: true, ...setupOptions };
127
129
  this.config = BENCHMARK_CONFIG === 'key_flows' ? KEY_FLOWS_CONFIG : FULL_FLOWS_CONFIG;
128
130
  ProxyLogger.create();
129
131
  this.proxyLogger = ProxyLogger.getInstance();
130
132
  }
131
133
 
132
134
  async setup() {
133
- const context = await this.snapshotManager.setup();
134
- await context.aztecNode.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
135
+ this.logger.info('Setting up subsystems from fresh');
136
+ // Token allowlist entries are test-only: FPC-based fee payment with custom tokens won't work on mainnet alpha.
137
+ const tokenAllowList = await getTokenAllowedSetupFunctions();
138
+ this.context = await setup(0, {
139
+ ...this.setupOptions,
140
+ fundSponsoredFPC: true,
141
+ skipAccountDeployment: true,
142
+ l1ContractsArgs: this.setupOptions,
143
+ txPublicSetupAllowListExtend: [...(this.setupOptions.txPublicSetupAllowListExtend ?? []), ...tokenAllowList],
144
+ });
145
+ await this.applyBaseSetup();
146
+
147
+ await this.context.aztecNodeService.setConfig({ feeRecipient: this.sequencerAddress, coinbase: this.coinbase });
135
148
 
136
- const rollupContract = RollupContract.getFromConfig(context.aztecNodeConfig);
137
- this.chainMonitor = new ChainMonitor(rollupContract, context.dateProvider, this.logger, 200).start();
149
+ const rollupContract = RollupContract.getFromConfig(this.context.config);
150
+ this.chainMonitor = new ChainMonitor(rollupContract, this.context.dateProvider, this.logger, 200).start();
138
151
 
139
152
  return this;
140
153
  }
141
154
 
142
155
  async teardown() {
143
156
  await this.chainMonitor.stop();
144
- await this.snapshotManager.teardown();
157
+ await this.userWallet?.stop();
158
+ await teardown(this.context);
145
159
  }
146
160
 
147
161
  async mintAndBridgeFeeJuice(address: AztecAddress) {
@@ -149,21 +163,20 @@ export class ClientFlowsBenchmark {
149
163
  const { claimSecret: secret, messageLeafIndex: index } = claim;
150
164
  await this.feeJuiceContract.methods
151
165
  .claim(address, claim.claimAmount, secret, index)
152
- .send({ from: this.adminAddress })
153
- .wait();
166
+ .send({ from: this.adminAddress });
154
167
  }
155
168
 
156
169
  /** Admin mints bananaCoin tokens privately to the target address and redeems them. */
157
170
  async mintPrivateBananas(amount: bigint, address: AztecAddress) {
158
- const balanceBefore = await this.bananaCoin.methods
171
+ const { result: balanceBefore } = await this.bananaCoin.methods
159
172
  .balance_of_private(address)
160
- .simulate({ from: this.adminAddress });
173
+ .simulate({ from: address });
161
174
 
162
175
  await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
163
176
 
164
- const balanceAfter = await this.bananaCoin.methods
177
+ const { result: balanceAfter } = await this.bananaCoin.methods
165
178
  .balance_of_private(address)
166
- .simulate({ from: this.adminAddress });
179
+ .simulate({ from: address });
167
180
  expect(balanceAfter).toEqual(balanceBefore + amount);
168
181
  }
169
182
 
@@ -183,137 +196,124 @@ export class ClientFlowsBenchmark {
183
196
  }
184
197
  }
185
198
 
186
- public async applyBaseSnapshots() {
187
- await this.applyInitialAccountsSnapshot();
188
- await this.applySetupFeeJuiceSnapshot();
199
+ public async applyBaseSetup() {
200
+ await this.applyInitialAccounts();
201
+ await this.applySetupFeeJuice();
189
202
  }
190
203
 
191
- async applyInitialAccountsSnapshot() {
192
- await this.snapshotManager.snapshot(
193
- 'initial_accounts',
194
- deployAccounts(2, this.logger),
195
- async (
196
- { deployedAccounts: [{ address: adminAddress }, { address: sequencerAddress }] },
197
- { wallet, aztecNode, cheatCodes },
198
- ) => {
199
- this.adminWallet = wallet;
200
- this.aztecNode = aztecNode;
201
- this.cheatCodes = cheatCodes;
202
-
203
- this.adminAddress = adminAddress;
204
- this.sequencerAddress = sequencerAddress;
205
-
206
- const canonicalFeeJuice = await getCanonicalFeeJuice();
207
- this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
208
- this.coinbase = EthAddress.random();
209
-
210
- const userPXEConfig = getPXEConfig();
211
- const userPXEConfigWithContracts = {
212
- ...userPXEConfig,
213
- proverEnabled: this.realProofs,
214
- } as PXEConfig;
215
-
216
- this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
217
- loggers: {
218
- prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied'),
219
- },
220
- });
204
+ async applyInitialAccounts() {
205
+ this.logger.info('Applying initial accounts setup');
206
+ const { deployedAccounts } = await deployAccounts(
207
+ 2,
208
+ this.logger,
209
+ )({
210
+ wallet: this.context.wallet,
211
+ initialFundedAccounts: this.context.initialFundedAccounts,
212
+ });
213
+
214
+ const [{ address: adminAddress }, { address: sequencerAddress }] = deployedAccounts;
215
+
216
+ this.adminWallet = this.context.wallet;
217
+ this.aztecNode = this.context.aztecNodeService;
218
+ this.cheatCodes = this.context.cheatCodes;
219
+
220
+ this.adminAddress = adminAddress;
221
+ this.sequencerAddress = sequencerAddress;
222
+
223
+ const canonicalFeeJuice = await getCanonicalFeeJuice();
224
+ this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
225
+ this.coinbase = EthAddress.random();
226
+
227
+ const userPXEConfig = getPXEConfig();
228
+ const userPXEConfigWithContracts = {
229
+ ...userPXEConfig,
230
+ proverEnabled: this.realProofs,
231
+ } as PXEConfig;
232
+
233
+ this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
234
+ loggers: {
235
+ prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied'),
221
236
  },
222
- );
237
+ });
223
238
  }
224
239
 
225
- async applySetupFeeJuiceSnapshot() {
226
- await this.snapshotManager.snapshot(
227
- 'setup_fee_juice',
228
- async () => {},
229
- async (_data, context) => {
230
- this.context = context;
231
-
232
- this.feeJuiceContract = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
233
-
234
- this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
235
- aztecNode: context.aztecNode,
236
- aztecNodeAdmin: context.aztecNode,
237
- l1Client: context.deployL1ContractsValues.l1Client,
238
- wallet: this.adminWallet,
239
- logger: this.logger,
240
- });
241
- },
242
- );
240
+ async applySetupFeeJuice() {
241
+ this.logger.info('Applying fee juice setup');
242
+ this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.adminWallet);
243
+
244
+ this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
245
+ aztecNode: this.context.aztecNodeService,
246
+ aztecNodeAdmin: this.context.aztecNodeService,
247
+ l1Client: this.context.deployL1ContractsValues.l1Client,
248
+ wallet: this.adminWallet,
249
+ logger: this.logger,
250
+ });
243
251
  }
244
252
 
245
- async applyDeployBananaTokenSnapshot() {
246
- await this.snapshotManager.snapshot(
247
- 'deploy_banana_token',
248
- async () => {
249
- const bananaCoin = await BananaCoin.deploy(this.adminWallet, this.adminAddress, 'BC', 'BC', 18n)
250
- .send({ from: this.adminAddress })
251
- .deployed();
252
- this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
253
- return { bananaCoinAddress: bananaCoin.address };
254
- },
255
- async ({ bananaCoinAddress }) => {
256
- this.bananaCoin = await BananaCoin.at(bananaCoinAddress, this.adminWallet);
257
- },
258
- );
253
+ async applyDeployBananaToken() {
254
+ this.logger.info('Applying banana token deployment');
255
+ const { contract: bananaCoin, instance: bananaCoinInstance } = await BananaCoin.deploy(
256
+ this.adminWallet,
257
+ this.adminAddress,
258
+ 'BC',
259
+ 'BC',
260
+ 18n,
261
+ ).send({
262
+ from: this.adminAddress,
263
+ });
264
+ this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
265
+ this.bananaCoin = bananaCoin;
266
+ this.bananaCoinInstance = bananaCoinInstance;
259
267
  }
260
268
 
261
- async applyDeployCandyBarTokenSnapshot() {
262
- await this.snapshotManager.snapshot(
263
- 'deploy_candy_bar_token',
264
- async () => {
265
- const candyBarCoin = await TokenContract.deploy(this.adminWallet, this.adminAddress, 'CBC', 'CBC', 18n)
266
- .send({ from: this.adminAddress })
267
- .deployed();
268
- this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
269
- return { candyBarCoinAddress: candyBarCoin.address };
270
- },
271
- async ({ candyBarCoinAddress }) => {
272
- this.candyBarCoin = await TokenContract.at(candyBarCoinAddress, this.adminWallet);
273
- },
274
- );
269
+ async applyDeployCandyBarToken() {
270
+ this.logger.info('Applying candy bar token deployment');
271
+ const { contract: candyBarCoin, instance: candyBarCoinInstance } = await TokenContract.deploy(
272
+ this.adminWallet,
273
+ this.adminAddress,
274
+ 'CBC',
275
+ 'CBC',
276
+ 18n,
277
+ ).send({
278
+ from: this.adminAddress,
279
+ });
280
+ this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
281
+ this.candyBarCoin = candyBarCoin;
282
+ this.candyBarCoinInstance = candyBarCoinInstance;
275
283
  }
276
284
 
277
- public async applyFPCSetupSnapshot() {
278
- await this.snapshotManager.snapshot(
279
- 'fpc_setup',
280
- async context => {
281
- const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
282
- expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
285
+ public async applyFPCSetup() {
286
+ this.logger.info('Applying FPC setup');
287
+ const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
288
+ expect((await this.context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
283
289
 
284
- const bananaCoin = this.bananaCoin;
285
- const bananaFPC = await FPCContract.deploy(this.adminWallet, bananaCoin.address, this.adminAddress)
286
- .send({ from: this.adminAddress })
287
- .deployed();
290
+ const bananaCoin = this.bananaCoin;
291
+ const { contract: bananaFPC, instance: bananaFPCInstance } = await FPCContract.deploy(
292
+ this.adminWallet,
293
+ bananaCoin.address,
294
+ this.adminAddress,
295
+ ).send({
296
+ from: this.adminAddress,
297
+ });
288
298
 
289
- this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
299
+ this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
290
300
 
291
- await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
301
+ await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.adminAddress);
292
302
 
293
- return { bananaFPCAddress: bananaFPC.address };
294
- },
295
- async data => {
296
- this.bananaFPC = await FPCContract.at(data.bananaFPCAddress, this.adminWallet);
297
- },
298
- );
303
+ this.bananaFPC = bananaFPC;
304
+ this.bananaFPCInstance = bananaFPCInstance;
299
305
  }
300
306
 
301
- async applyDeploySponsoredFPCSnapshot() {
302
- await this.snapshotManager.snapshot(
303
- 'deploy_sponsored_fpc',
304
- async () => {
305
- const sponsoredFPC = await setupSponsoredFPC(this.adminWallet);
306
- this.logger.info(`SponsoredFPC at ${sponsoredFPC.address}`);
307
- return { sponsoredFPCAddress: sponsoredFPC.address };
308
- },
309
- async ({ sponsoredFPCAddress }) => {
310
- this.sponsoredFPC = await SponsoredFPCContract.at(sponsoredFPCAddress, this.adminWallet);
311
- },
312
- );
307
+ async applyDeploySponsoredFPC() {
308
+ this.logger.info('Applying sponsored FPC deployment');
309
+ const sponsoredFPCInstance = await setupSponsoredFPC(this.adminWallet);
310
+ this.logger.info(`SponsoredFPC at ${sponsoredFPCInstance.address}`);
311
+ this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCInstance.address, this.adminWallet);
312
+ this.sponsoredFPCInstance = sponsoredFPCInstance;
313
313
  }
314
314
 
315
315
  public async createCrossChainTestHarness(owner: AztecAddress) {
316
- const l1Client = createExtendedL1Client(this.context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
316
+ const l1Client = createExtendedL1Client(this.context.config.l1RpcUrls, MNEMONIC);
317
317
 
318
318
  const underlyingERC20Address = await deployL1Contract(l1Client, TestERC20Abi, TestERC20Bytecode, [
319
319
  'Underlying',
@@ -342,45 +342,42 @@ export class ClientFlowsBenchmark {
342
342
  const benchysAddress = benchysAccountManager.address;
343
343
  const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
344
344
  const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
345
- await behchysDeployMethod
346
- .send({
347
- from: AztecAddress.ZERO,
348
- fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
349
- })
350
- .wait();
345
+ await behchysDeployMethod.send({
346
+ from: NO_FROM,
347
+ fee: { paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim) },
348
+ });
351
349
  // Register benchy on the user's Wallet, where we're going to be interacting from
352
350
  const accountManager = await this.userWallet.createAccount({
353
351
  secret: benchysAccount.getSecretKey(),
354
- salt: new Fr(benchysAccount.salt),
352
+ salt: new Fr(benchysAccountManager.getInstance().salt),
355
353
  contract: benchysAccountManager.getAccountContract(),
356
354
  });
357
355
  return accountManager.address;
358
356
  }
359
357
 
360
- public async applyDeployAmmSnapshot() {
361
- await this.snapshotManager.snapshot(
362
- 'deploy_amm',
363
- async () => {
364
- const liquidityToken = await TokenContract.deploy(this.adminWallet, this.adminAddress, 'LPT', 'LPT', 18n)
365
- .send({ from: this.adminAddress })
366
- .deployed();
367
- const amm = await AMMContract.deploy(
368
- this.adminWallet,
369
- this.bananaCoin.address,
370
- this.candyBarCoin.address,
371
- liquidityToken.address,
372
- )
373
- .send({ from: this.adminAddress })
374
- .deployed();
375
- this.logger.info(`AMM deployed at ${amm.address}`);
376
- await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress }).wait();
377
- return { ammAddress: amm.address, liquidityTokenAddress: liquidityToken.address };
378
- },
379
- async ({ ammAddress, liquidityTokenAddress }) => {
380
- this.liquidityToken = await TokenContract.at(liquidityTokenAddress, this.adminWallet);
381
- this.amm = await AMMContract.at(ammAddress, this.adminWallet);
382
- },
383
- );
358
+ public async applyDeployAmm() {
359
+ this.logger.info('Applying AMM deployment');
360
+ const { contract: liquidityToken, instance: liquidityTokenInstance } = await TokenContract.deploy(
361
+ this.adminWallet,
362
+ this.adminAddress,
363
+ 'LPT',
364
+ 'LPT',
365
+ 18n,
366
+ ).send({
367
+ from: this.adminAddress,
368
+ });
369
+ const { contract: amm, instance: ammInstance } = await AMMContract.deploy(
370
+ this.adminWallet,
371
+ this.bananaCoin.address,
372
+ this.candyBarCoin.address,
373
+ liquidityToken.address,
374
+ ).send({ from: this.adminAddress });
375
+ this.logger.info(`AMM deployed at ${amm.address}`);
376
+ await liquidityToken.methods.set_minter(amm.address, true).send({ from: this.adminAddress });
377
+ this.liquidityToken = liquidityToken;
378
+ this.liquidityTokenInstance = liquidityTokenInstance;
379
+ this.amm = amm;
380
+ this.ammInstance = ammInstance;
384
381
  }
385
382
 
386
383
  public async getBridgedFeeJuicePaymentMethodForWallet(_wallet: Wallet, sender: AztecAddress) {
@@ -391,8 +388,8 @@ export class ClientFlowsBenchmark {
391
388
  public async getPrivateFPCPaymentMethodForWallet(wallet: Wallet, sender: AztecAddress) {
392
389
  // The private fee paying method assembled on the app side requires knowledge of the maximum
393
390
  // fee the user is willing to pay
394
- const maxFeesPerGas = (await this.aztecNode.getCurrentBaseFees()).mul(1.5);
395
- const gasSettings = GasSettings.default({ maxFeesPerGas });
391
+ const maxFeesPerGas = await getPaddedMaxFeesPerGas(this.aztecNode);
392
+ const gasSettings = GasSettings.fallback({ maxFeesPerGas });
396
393
  return new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet, gasSettings);
397
394
  }
398
395
 
@@ -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,6 +1,4 @@
1
- import type { Logger } from '@aztec/aztec.js/log';
2
- import { BBNativePrivateKernelProver } from '@aztec/bb-prover/client/native';
3
- import { BBWASMBundlePrivateKernelProver } from '@aztec/bb-prover/client/wasm/bundle';
1
+ import { BBBundlePrivateKernelProver } from '@aztec/bb-prover/client/bundle';
4
2
  import { createLogger, logger } from '@aztec/foundation/log';
5
3
  import { Timer } from '@aztec/foundation/timer';
6
4
  import { WASMSimulator } from '@aztec/simulator/client';
@@ -11,26 +9,7 @@ import { Decoder } from 'msgpackr';
11
9
  import { readFile, readdir, writeFile } from 'node:fs/promises';
12
10
  import { join } from 'node:path';
13
11
 
14
- import { type Log, type ProverType, ProxyLogger, generateBenchmark } from './benchmark.js';
15
-
16
- type NativeProverConfig = { bbBinaryPath?: string; bbWorkingDirectory?: string };
17
-
18
- async function createProver(config: NativeProverConfig = {}, log: Logger) {
19
- const simulator = new WASMSimulator();
20
- if (!config.bbBinaryPath || !config.bbWorkingDirectory) {
21
- return { prover: new BBWASMBundlePrivateKernelProver(simulator, 16, log), type: 'wasm' as ProverType };
22
- } else {
23
- const bbConfig = config as Required<NativeProverConfig>;
24
- return {
25
- prover: await BBNativePrivateKernelProver.new(
26
- { bbSkipCleanup: false, numConcurrentIVCVerifiers: 1, bbIVCConcurrency: 1, ...bbConfig },
27
- simulator,
28
- log,
29
- ),
30
- type: 'native' as ProverType,
31
- };
32
- }
33
- }
12
+ import { type Log, ProxyLogger, generateBenchmark } from './benchmark.js';
34
13
 
35
14
  async function main() {
36
15
  ProxyLogger.create();
@@ -41,10 +20,9 @@ async function main() {
41
20
  }
42
21
  const flows = await readdir(ivcFolder);
43
22
  logger.info(`Flows in ${ivcFolder}: \n${flows.map(flowName => `\t- ${flowName}`).join('\n')}`);
44
- const { prover, type: proverType } = await createProver(
45
- { bbBinaryPath: process.env.BB_BINARY_PATH, bbWorkingDirectory: process.env.BB_WORKING_DIRECTORY },
46
- proxyLogger.createLogger('bb:prover'),
47
- );
23
+ const simulator = new WASMSimulator();
24
+ const log = proxyLogger.createLogger('bb:prover');
25
+ const prover = new BBBundlePrivateKernelProver(simulator, { logger: log });
48
26
 
49
27
  const userLog = createLogger('chonk_flows:data_processor');
50
28
 
@@ -96,7 +74,7 @@ async function main() {
96
74
  if (!(profile.stats.timings as ProvingTimings).proving) {
97
75
  (profile.stats.timings as ProvingTimings).proving = provingTime;
98
76
  }
99
- const benchmark = generateBenchmark(flow, currentLogs, profile.stats, privateExecutionSteps, proverType, error);
77
+ const benchmark = generateBenchmark(flow, currentLogs, profile.stats, privateExecutionSteps, 'native', error);
100
78
  await writeFile(join(ivcFolder, flow, 'benchmark.json'), JSON.stringify(benchmark, null, 2));
101
79
  proxyLogger.flushLogs();
102
80
  }