@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,9 +1,12 @@
1
1
  import type { AztecAddress } from '@aztec/aztec.js/addresses';
2
2
  import { type Logger, createLogger } from '@aztec/aztec.js/log';
3
3
  import type { AztecNode } from '@aztec/aztec.js/node';
4
- import { CheatCodes } from '@aztec/aztec/testing';
5
- import { type DeployL1ContractsArgs, RollupContract, createExtendedL1Client } from '@aztec/ethereum';
4
+ import { CheatCodes, getTokenAllowedSetupFunctions } from '@aztec/aztec/testing';
5
+ import { createExtendedL1Client } from '@aztec/ethereum/client';
6
+ import { RollupContract } from '@aztec/ethereum/contracts';
7
+ import type { DeployAztecL1ContractsArgs } from '@aztec/ethereum/deploy-aztec-l1-contracts';
6
8
  import { ChainMonitor } from '@aztec/ethereum/test';
9
+ import { BlockNumber } from '@aztec/foundation/branded-types';
7
10
  import { EthAddress } from '@aztec/foundation/eth-address';
8
11
  import { sleep } from '@aztec/foundation/sleep';
9
12
  import { TestERC20Abi } from '@aztec/l1-artifacts';
@@ -16,31 +19,27 @@ import { CounterContract } from '@aztec/noir-test-contracts.js/Counter';
16
19
  import { ProtocolContractAddress } from '@aztec/protocol-contracts';
17
20
  import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
18
21
  import { GasSettings } from '@aztec/stdlib/gas';
19
- import { TestWallet } from '@aztec/test-wallet/server';
22
+ import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
20
23
 
21
24
  import { getContract } from 'viem';
22
25
 
23
- import { MNEMONIC } from '../fixtures/fixtures.js';
26
+ import { MNEMONIC, getPaddedMaxFeesPerGas } from '../fixtures/fixtures.js';
24
27
  import {
25
- type ISnapshotManager,
26
- type SubsystemsContext,
27
- createSnapshotManager,
28
+ type EndToEndContext,
29
+ type SetupOptions,
28
30
  deployAccounts,
29
- } from '../fixtures/snapshot_manager.js';
31
+ ensureAuthRegistryPublished,
32
+ publicDeployAccounts,
33
+ setup,
34
+ teardown,
35
+ } from '../fixtures/setup.js';
30
36
  import { mintTokensToPrivate } from '../fixtures/token_utils.js';
31
- import {
32
- type BalancesFn,
33
- type SetupOptions,
34
- ensureAccountContractsPublished,
35
- getBalancesFn,
36
- setupSponsoredFPC,
37
- } from '../fixtures/utils.js';
37
+ import { type BalancesFn, getBalancesFn, setupSponsoredFPC } from '../fixtures/utils.js';
38
38
  import { FeeJuicePortalTestingHarnessFactory, type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.js';
39
-
40
- const { E2E_DATA_PATH: dataPath } = process.env;
39
+ import { TestWallet } from '../test-wallet/test_wallet.js';
41
40
 
42
41
  /**
43
- * Test fixture for testing fees. Provides the following snapshots:
42
+ * Test fixture for testing fees. Provides the following setup steps:
44
43
  * InitialAccounts: Initializes 3 Schnorr account contracts.
45
44
  * PublicDeployAccounts: Deploys the accounts publicly.
46
45
  * DeployFeeJuice: Deploys the Fee Juice contract.
@@ -50,11 +49,12 @@ const { E2E_DATA_PATH: dataPath } = process.env;
50
49
  * SetupSubscription: Deploys a counter contract and a subscription contract, and mints Fee Juice to the subscription contract.
51
50
  */
52
51
  export class FeesTest {
53
- private snapshotManager: ISnapshotManager;
54
52
  private accounts: AztecAddress[] = [];
53
+ public context!: EndToEndContext;
55
54
 
56
55
  public logger: Logger;
57
56
  public aztecNode!: AztecNode;
57
+ public aztecNodeAdmin!: AztecNodeAdmin;
58
58
  public cheatCodes!: CheatCodes;
59
59
 
60
60
  public wallet!: TestWallet;
@@ -77,7 +77,6 @@ export class FeesTest {
77
77
  public subscriptionContract!: AppSubscriptionContract;
78
78
  public feeJuiceBridgeTestHarness!: GasBridgingTestHarness;
79
79
 
80
- public context!: SubsystemsContext;
81
80
  public chainMonitor!: ChainMonitor;
82
81
 
83
82
  public getCoinbaseBalance!: () => Promise<bigint>;
@@ -85,7 +84,9 @@ export class FeesTest {
85
84
  public getGasBalanceFn!: BalancesFn;
86
85
  public getBananaPublicBalanceFn!: BalancesFn;
87
86
  public getBananaPrivateBalanceFn!: BalancesFn;
88
- public getProverFee!: (blockNumber: number) => Promise<bigint>;
87
+ public getProverFee!: (blockNumber: BlockNumber) => Promise<bigint>;
88
+ public getCommittedProverFee!: (blockNumber: BlockNumber) => Promise<bigint>;
89
+ public getCommittedBurn!: (blockNumber: BlockNumber) => Promise<bigint>;
89
90
 
90
91
  public readonly ALICE_INITIAL_BANANAS = BigInt(1e22);
91
92
  public readonly SUBSCRIPTION_AMOUNT = BigInt(1e19);
@@ -94,7 +95,7 @@ export class FeesTest {
94
95
  constructor(
95
96
  testName: string,
96
97
  private numberOfAccounts = 3,
97
- setupOptions: Partial<SetupOptions & DeployL1ContractsArgs> = {},
98
+ private setupOptions: Partial<SetupOptions & DeployAztecL1ContractsArgs> = {},
98
99
  ) {
99
100
  if (!numberOfAccounts) {
100
101
  throw new Error('There must be at least 1 initial account.');
@@ -102,26 +103,33 @@ export class FeesTest {
102
103
  setupOptions.coinbase ??= EthAddress.random();
103
104
  this.coinbase = setupOptions.coinbase!;
104
105
  this.logger = createLogger(`e2e:e2e_fees:${testName}`);
105
- this.snapshotManager = createSnapshotManager(
106
- `e2e_fees/${testName}-${numberOfAccounts}`,
107
- dataPath,
108
- { startProverNode: true, ...setupOptions },
109
- { ...setupOptions },
110
- );
111
106
  }
112
107
 
113
- async setup() {
114
- const context = await this.snapshotManager.setup();
115
-
116
- this.rollupContract = RollupContract.getFromConfig(context.aztecNodeConfig);
117
- this.chainMonitor = new ChainMonitor(this.rollupContract, context.dateProvider, this.logger, 200).start();
108
+ async setup(opts: Partial<SetupOptions> = {}) {
109
+ this.logger.verbose('Setting up fresh context...');
110
+ // Token allowlist entries are test-only: FPC-based fee payment with custom tokens won't work on mainnet alpha.
111
+ const tokenAllowList = await getTokenAllowedSetupFunctions();
112
+ this.context = await setup(0, {
113
+ startProverNode: true,
114
+ ...this.setupOptions,
115
+ ...opts,
116
+ fundSponsoredFPC: true,
117
+ skipAccountDeployment: true,
118
+ l1ContractsArgs: { ...this.setupOptions },
119
+ txPublicSetupAllowListExtend: [...(this.setupOptions.txPublicSetupAllowListExtend ?? []), ...tokenAllowList],
120
+ });
121
+
122
+ this.rollupContract = RollupContract.getFromConfig(this.context.config);
123
+ this.chainMonitor = new ChainMonitor(this.rollupContract, this.context.dateProvider, this.logger, 200).start();
124
+
125
+ await this.applyBaseSetup();
118
126
 
119
127
  return this;
120
128
  }
121
129
 
122
130
  async teardown() {
123
131
  await this.chainMonitor.stop();
124
- await this.snapshotManager.teardown();
132
+ await teardown(this.context);
125
133
  }
126
134
 
127
135
  setIsMarkingAsProven(b: boolean) {
@@ -130,18 +138,16 @@ export class FeesTest {
130
138
 
131
139
  async catchUpProvenChain() {
132
140
  const bn = await this.aztecNode.getBlockNumber();
133
- while ((await this.aztecNode.getProvenBlockNumber()) < bn) {
141
+ while ((await this.aztecNode.getBlockNumber('proven')) < bn) {
134
142
  await sleep(1000);
135
143
  }
136
144
  }
137
145
 
138
146
  async getBlockRewards() {
139
- const blockReward = await this.rollupContract.getBlockReward();
147
+ const blockReward = await this.rollupContract.getCheckpointReward();
140
148
  const rewardConfig = await this.rollupContract.getRewardConfig();
141
149
 
142
- const balance = await this.feeJuiceBridgeTestHarness.getL1FeeJuiceBalance(
143
- EthAddress.fromString(rewardConfig.rewardDistributor),
144
- );
150
+ const balance = await this.feeJuiceBridgeTestHarness.getL1FeeJuiceBalance(rewardConfig.rewardDistributor);
145
151
 
146
152
  const toDistribute = balance > blockReward ? blockReward : balance;
147
153
  const sequencerBlockRewards = (toDistribute * BigInt(rewardConfig.sequencerBps)) / 10000n;
@@ -153,226 +159,206 @@ export class FeesTest {
153
159
  async mintAndBridgeFeeJuice(minter: AztecAddress, recipient: AztecAddress) {
154
160
  const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(recipient);
155
161
  const { claimSecret: secret, messageLeafIndex: index } = claim;
156
- await this.feeJuiceContract.methods
157
- .claim(recipient, claim.claimAmount, secret, index)
158
- .send({ from: minter })
159
- .wait();
162
+ await this.feeJuiceContract.methods.claim(recipient, claim.claimAmount, secret, index).send({ from: minter });
160
163
  }
161
164
 
162
165
  /** Alice mints bananaCoin tokens privately to the target address and redeems them. */
163
166
  async mintPrivateBananas(amount: bigint, address: AztecAddress) {
164
- const balanceBefore = await this.bananaCoin.methods
167
+ const { result: balanceBefore } = await this.bananaCoin.methods
165
168
  .balance_of_private(address)
166
- .simulate({ from: this.aliceAddress });
169
+ .simulate({ from: address });
167
170
 
168
171
  await mintTokensToPrivate(this.bananaCoin, this.aliceAddress, address, amount);
169
172
 
170
- const balanceAfter = await this.bananaCoin.methods
173
+ const { result: balanceAfter } = await this.bananaCoin.methods
171
174
  .balance_of_private(address)
172
- .simulate({ from: this.aliceAddress });
175
+ .simulate({ from: address });
173
176
  expect(balanceAfter).toEqual(balanceBefore + amount);
174
177
  }
175
178
 
176
- public async applyBaseSnapshots() {
177
- await this.applyInitialAccountsSnapshot();
178
- await this.applyPublicDeployAccountsSnapshot();
179
- await this.applySetupFeeJuiceSnapshot();
180
- await this.applyDeployBananaTokenSnapshot();
179
+ public async applyBaseSetup() {
180
+ await this.applyInitialAccounts();
181
+ await this.applyEnsureAuthRegistryPublished();
182
+ await this.applyPublicDeployAccounts();
183
+ await this.applySetupFeeJuice();
184
+ await this.applyDeployBananaToken();
181
185
  }
182
186
 
183
- async applyInitialAccountsSnapshot() {
184
- await this.snapshotManager.snapshot(
185
- 'initial_accounts',
186
- deployAccounts(this.numberOfAccounts, this.logger),
187
- async ({ deployedAccounts }, { wallet, aztecNode, cheatCodes }) => {
188
- this.wallet = wallet;
189
- this.aztecNode = aztecNode;
190
- this.gasSettings = GasSettings.default({ maxFeesPerGas: (await this.aztecNode.getCurrentBaseFees()).mul(2) });
191
- this.cheatCodes = cheatCodes;
192
- this.accounts = deployedAccounts.map(a => a.address);
193
- this.accounts.forEach((a, i) => this.logger.verbose(`Account ${i} address: ${a}`));
194
- [this.aliceAddress, this.bobAddress, this.sequencerAddress] = this.accounts.slice(0, 3);
195
-
196
- // We set Alice as the FPC admin to avoid the need for deployment of another account.
197
- this.fpcAdmin = this.aliceAddress;
198
-
199
- const canonicalFeeJuice = await getCanonicalFeeJuice();
200
- this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.wallet);
201
- },
202
- );
187
+ async applyEnsureAuthRegistryPublished() {
188
+ this.logger.info('Ensuring AuthRegistry published');
189
+ await ensureAuthRegistryPublished(this.wallet, this.aliceAddress);
203
190
  }
204
191
 
205
- async applyPublicDeployAccountsSnapshot() {
206
- await this.snapshotManager.snapshot('public_deploy_accounts', () =>
207
- ensureAccountContractsPublished(this.wallet, this.accounts),
208
- );
192
+ async applyInitialAccounts() {
193
+ this.logger.info('Applying initial accounts setup');
194
+
195
+ const { deployedAccounts } = await deployAccounts(
196
+ this.numberOfAccounts,
197
+ this.logger,
198
+ )({
199
+ wallet: this.context.wallet,
200
+ initialFundedAccounts: this.context.initialFundedAccounts,
201
+ });
202
+
203
+ this.wallet = this.context.wallet;
204
+ this.aztecNode = this.context.aztecNodeService;
205
+ this.aztecNodeAdmin = this.context.aztecNodeService;
206
+ this.gasSettings = GasSettings.fallback({
207
+ maxFeesPerGas: await getPaddedMaxFeesPerGas(this.aztecNode),
208
+ });
209
+ this.cheatCodes = this.context.cheatCodes;
210
+ this.accounts = deployedAccounts.map(a => a.address);
211
+ this.accounts.forEach((a, i) => this.logger.verbose(`Account ${i} address: ${a}`));
212
+ [this.aliceAddress, this.bobAddress, this.sequencerAddress] = this.accounts.slice(0, 3);
213
+
214
+ // We set Alice as the FPC admin to avoid the need for deployment of another account.
215
+ this.fpcAdmin = this.aliceAddress;
216
+
217
+ const canonicalFeeJuice = await getCanonicalFeeJuice();
218
+ this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.wallet);
209
219
  }
210
220
 
211
- async applySetupFeeJuiceSnapshot() {
212
- await this.snapshotManager.snapshot(
213
- 'setup_fee_juice',
214
- async () => {},
215
- async (_data, context) => {
216
- this.context = context;
217
-
218
- this.feeJuiceContract = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.wallet);
219
-
220
- this.getGasBalanceFn = getBalancesFn(
221
- '⛽',
222
- this.feeJuiceContract.methods.balance_of_public,
223
- this.aliceAddress,
224
- this.logger,
225
- );
226
-
227
- this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
228
- aztecNode: context.aztecNode,
229
- aztecNodeAdmin: context.aztecNode,
230
- l1Client: context.deployL1ContractsValues.l1Client,
231
- wallet: this.wallet,
232
- logger: this.logger,
233
- });
234
- },
235
- );
221
+ async applyPublicDeployAccounts() {
222
+ this.logger.info('Applying public deploy accounts setup');
223
+ await publicDeployAccounts(this.wallet, this.accounts);
236
224
  }
237
225
 
238
- async applyDeployBananaTokenSnapshot() {
239
- await this.snapshotManager.snapshot(
240
- 'deploy_banana_token',
241
- async () => {
242
- const bananaCoin = await BananaCoin.deploy(this.wallet, this.aliceAddress, 'BC', 'BC', 18n)
243
- .send({ from: this.aliceAddress })
244
- .deployed();
245
- this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
246
- return { bananaCoinAddress: bananaCoin.address };
247
- },
248
- async ({ bananaCoinAddress }) => {
249
- this.bananaCoin = await BananaCoin.at(bananaCoinAddress, this.wallet);
250
- const logger = this.logger;
251
- this.getBananaPublicBalanceFn = getBalancesFn(
252
- '🍌.public',
253
- this.bananaCoin.methods.balance_of_public,
254
- this.aliceAddress,
255
- logger,
256
- );
257
- this.getBananaPrivateBalanceFn = getBalancesFn(
258
- '🍌.private',
259
- this.bananaCoin.methods.balance_of_private,
260
- this.aliceAddress,
261
- logger,
262
- );
263
- },
264
- );
226
+ async applySetupFeeJuice() {
227
+ this.logger.info('Applying fee juice setup');
228
+
229
+ this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.wallet);
230
+
231
+ this.getGasBalanceFn = getBalancesFn('⛽', this.feeJuiceContract.methods.balance_of_public, this.logger);
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.wallet,
238
+ logger: this.logger,
239
+ });
265
240
  }
266
241
 
267
- public async applyFPCSetupSnapshot() {
268
- await this.snapshotManager.snapshot(
269
- 'fpc_setup',
270
- async context => {
271
- const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
272
- expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
273
-
274
- const bananaCoin = this.bananaCoin;
275
- const bananaFPC = await FPCContract.deploy(this.wallet, bananaCoin.address, this.fpcAdmin)
276
- .send({ from: this.aliceAddress })
277
- .deployed();
278
-
279
- this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
280
-
281
- await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.aliceAddress);
282
-
283
- return {
284
- bananaFPCAddress: bananaFPC.address,
285
- feeJuiceAddress: feeJuiceContract.address,
286
- l1FeeJuiceAddress: this.feeJuiceBridgeTestHarness.l1FeeJuiceAddress,
287
- rollupAddress: context.deployL1ContractsValues.l1ContractAddresses.rollupAddress,
288
- };
289
- },
290
- async (data, context) => {
291
- const bananaFPC = await FPCContract.at(data.bananaFPCAddress, this.wallet);
292
- this.bananaFPC = bananaFPC;
293
-
294
- this.getCoinbaseBalance = async () => {
295
- const l1Client = createExtendedL1Client(context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
296
- const gasL1 = getContract({
297
- address: data.l1FeeJuiceAddress.toString(),
298
- abi: TestERC20Abi,
299
- client: l1Client,
300
- });
301
- return await gasL1.read.balanceOf([this.coinbase.toString()]);
302
- };
303
-
304
- this.getCoinbaseSequencerRewards = async () => {
305
- return await this.rollupContract.getSequencerRewards(this.coinbase);
306
- };
307
-
308
- this.getProverFee = async (blockNumber: number) => {
309
- const block = await this.aztecNode.getBlock(blockNumber);
310
-
311
- // @todo @lherskind As we deal with #13601
312
- // Right now the value is from `FeeLib.sol`
313
- const L1_GAS_PER_EPOCH_VERIFIED = 1000000n;
314
-
315
- // We round up
316
- const mulDiv = (a: bigint, b: bigint, c: bigint) => (a * b) / c + ((a * b) % c > 0n ? 1n : 0n);
317
-
318
- const { baseFee } = await this.rollupContract.getL1FeesAt(block!.header.globalVariables.timestamp);
319
- const proverCost =
320
- mulDiv(
321
- mulDiv(L1_GAS_PER_EPOCH_VERIFIED, baseFee, await this.rollupContract.getEpochDuration()),
322
- 1n,
323
- await this.rollupContract.getManaTarget(),
324
- ) + (await this.rollupContract.getProvingCostPerMana());
325
-
326
- const price = await this.rollupContract.getFeeAssetPerEth();
327
-
328
- const mana = block!.header.totalManaUsed.toBigInt();
329
- return mulDiv(mana * proverCost, price, 10n ** 9n);
330
- };
331
- },
242
+ async applyDeployBananaToken() {
243
+ this.logger.info('Applying deploy banana token setup');
244
+
245
+ const { contract: bananaCoin } = await BananaCoin.deploy(this.wallet, this.aliceAddress, 'BC', 'BC', 18n).send({
246
+ from: this.aliceAddress,
247
+ });
248
+ this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
249
+
250
+ this.bananaCoin = bananaCoin;
251
+ this.getBananaPublicBalanceFn = getBalancesFn('🍌.public', this.bananaCoin.methods.balance_of_public, this.logger);
252
+ this.getBananaPrivateBalanceFn = getBalancesFn(
253
+ '🍌.private',
254
+ this.bananaCoin.methods.balance_of_private,
255
+ this.logger,
332
256
  );
333
257
  }
334
258
 
335
- public async applySponsoredFPCSetupSnapshot() {
336
- await this.snapshotManager.snapshot(
337
- 'sponsored_fpc_setup',
338
- async context => {
339
- const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
340
- expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
341
-
342
- const sponsoredFPC = await setupSponsoredFPC(this.wallet);
343
- this.logger.info(`SponsoredFPC at ${sponsoredFPC.address}`);
344
-
345
- return {
346
- sponsoredFPCAddress: sponsoredFPC.address,
347
- };
348
- },
349
- async data => {
350
- this.sponsoredFPC = await SponsoredFPCContract.at(data.sponsoredFPCAddress, this.wallet);
351
- },
352
- );
259
+ public async applyFPCSetup() {
260
+ this.logger.info('Applying FPC setup');
261
+
262
+ const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
263
+ expect((await this.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
264
+
265
+ const bananaCoin = this.bananaCoin;
266
+ const { contract: bananaFPC } = await FPCContract.deploy(this.wallet, bananaCoin.address, this.fpcAdmin).send({
267
+ from: this.aliceAddress,
268
+ });
269
+
270
+ this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
271
+
272
+ await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.aliceAddress);
273
+
274
+ this.bananaFPC = bananaFPC;
275
+
276
+ const l1FeeJuiceAddress = this.feeJuiceBridgeTestHarness.l1FeeJuiceAddress;
277
+
278
+ this.getCoinbaseBalance = async () => {
279
+ const l1Client = createExtendedL1Client(this.context.config.l1RpcUrls, MNEMONIC);
280
+ const gasL1 = getContract({
281
+ address: l1FeeJuiceAddress.toString(),
282
+ abi: TestERC20Abi,
283
+ client: l1Client,
284
+ });
285
+ return await gasL1.read.balanceOf([this.coinbase.toString()]);
286
+ };
287
+
288
+ this.getCoinbaseSequencerRewards = async () => {
289
+ return await this.rollupContract.getSequencerRewards(this.coinbase);
290
+ };
291
+
292
+ this.getProverFee = async (blockNumber: BlockNumber) => {
293
+ const block = await this.aztecNode.getBlock(blockNumber);
294
+
295
+ // @todo @lherskind As we deal with #13601
296
+ // Right now the value is from `FeeLib.sol`
297
+ const L1_GAS_PER_EPOCH_VERIFIED = 3600000n;
298
+
299
+ // We round up
300
+ const mulDiv = (a: bigint, b: bigint, c: bigint) => (a * b) / c + ((a * b) % c > 0n ? 1n : 0n);
301
+
302
+ const { baseFee } = await this.rollupContract.getL1FeesAt(block!.header.globalVariables.timestamp);
303
+ const proverCost =
304
+ mulDiv(
305
+ mulDiv(L1_GAS_PER_EPOCH_VERIFIED, baseFee, BigInt(await this.rollupContract.getEpochDuration())),
306
+ 1n,
307
+ await this.rollupContract.getManaTarget(),
308
+ ) + (await this.rollupContract.getProvingCostPerMana());
309
+
310
+ const price = await this.rollupContract.getEthPerFeeAsset();
311
+
312
+ const mana = block!.header.totalManaUsed.toBigInt();
313
+ return mulDiv(mana * proverCost, 10n ** 12n, price);
314
+ };
315
+
316
+ /**
317
+ * Reads the prover fee that the rollup actually committed for the block's checkpoint, which is what
318
+ * RewardLib uses to pay prover rewards. Unlike `getProverFee`, this does not re-derive the value
319
+ * from current L1 fees or current eth-per-fee-asset price, so it is robust to pipelined fee-asset-price
320
+ * drift between propose-time and reward-payout-time.
321
+ */
322
+ this.getCommittedProverFee = async (blockNumber: BlockNumber) => {
323
+ const block = await this.aztecNode.getBlock(blockNumber);
324
+ const feeHeader = await this.rollupContract.getFeeHeader(BigInt(block!.checkpointNumber));
325
+ return feeHeader.manaUsed * feeHeader.proverCost;
326
+ };
327
+
328
+ // RewardLib computes sequencerFee = checkpointFee - burn - proverFee where burn = manaUsed * congestionCost.
329
+ // The fixture's typical case keeps congestionCost at zero, but reading it explicitly avoids latent bugs
330
+ // when test load changes excess mana.
331
+ this.getCommittedBurn = async (blockNumber: BlockNumber) => {
332
+ const block = await this.aztecNode.getBlock(blockNumber);
333
+ const feeHeader = await this.rollupContract.getFeeHeader(BigInt(block!.checkpointNumber));
334
+ return feeHeader.manaUsed * feeHeader.congestionCost;
335
+ };
336
+ }
337
+
338
+ public async applySponsoredFPCSetup() {
339
+ this.logger.info('Applying sponsored FPC setup');
340
+
341
+ const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
342
+ expect((await this.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
343
+
344
+ const sponsoredFPCInstance = await setupSponsoredFPC(this.wallet);
345
+ this.logger.info(`SponsoredFPC at ${sponsoredFPCInstance.address}`);
346
+
347
+ this.sponsoredFPC = SponsoredFPCContract.at(sponsoredFPCInstance.address, this.wallet);
353
348
  }
354
349
 
355
350
  public async applyFundAliceWithBananas() {
356
- await this.snapshotManager.snapshot(
357
- 'fund_alice',
358
- async () => {
359
- await this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress);
360
- await this.bananaCoin.methods
361
- .mint_to_public(this.aliceAddress, this.ALICE_INITIAL_BANANAS)
362
- .send({ from: this.aliceAddress })
363
- .wait();
364
- },
365
- () => Promise.resolve(),
366
- );
351
+ this.logger.info('Applying fund Alice with bananas setup');
352
+
353
+ await this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress);
354
+ await this.bananaCoin.methods
355
+ .mint_to_public(this.aliceAddress, this.ALICE_INITIAL_BANANAS)
356
+ .send({ from: this.aliceAddress });
367
357
  }
368
358
 
369
359
  public async applyFundAliceWithPrivateBananas() {
370
- await this.snapshotManager.snapshot(
371
- 'fund_alice_with_private_bananas',
372
- async () => {
373
- await this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress);
374
- },
375
- () => Promise.resolve(),
376
- );
360
+ this.logger.info('Applying fund Alice with private bananas setup');
361
+
362
+ await this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress);
377
363
  }
378
364
  }
@@ -1,8 +1,9 @@
1
1
  import { AztecAddress } from '@aztec/aztec.js/addresses';
2
- import type { L2Block } from '@aztec/aztec.js/block';
3
2
  import { Fr } from '@aztec/aztec.js/fields';
4
- import { BatchedBlob, Blob, getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
3
+ import { BatchedBlob, Blob, getEthBlobEvaluationInputs, getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
5
4
  import { EthAddress } from '@aztec/foundation/eth-address';
5
+ import { L2Block } from '@aztec/stdlib/block';
6
+ import { CheckpointHeader } from '@aztec/stdlib/rollup';
6
7
 
7
8
  import { writeFile } from 'fs/promises';
8
9
 
@@ -14,6 +15,7 @@ const AZTEC_GENERATE_TEST_DATA = !!process.env.AZTEC_GENERATE_TEST_DATA;
14
15
  */
15
16
  export async function writeJson(
16
17
  fileName: string,
18
+ checkpointHeader: CheckpointHeader,
17
19
  block: L2Block,
18
20
  l1ToL2Content: Fr[],
19
21
  blobs: Blob[],
@@ -41,32 +43,31 @@ export async function writeJson(
41
43
  messages: {
42
44
  l2ToL1Messages: block.body.txEffects.flatMap(txEffect => txEffect.l2ToL1Msgs).map(value => asHex(value)),
43
45
  },
44
- block: {
46
+ checkpoint: {
45
47
  // The json formatting in forge is a bit brittle, so we convert Fr to a number in the few values below.
46
48
  // This should not be a problem for testing as long as the values are not larger than u32.
47
49
  archive: asHex(block.archive.root),
48
50
  blobCommitments: getPrefixedEthBlobCommitments(blobs),
49
- batchedBlobInputs: batchedBlob.getEthBlobEvaluationInputs(),
50
- blockNumber: block.number,
51
+ batchedBlobInputs: getEthBlobEvaluationInputs(batchedBlob),
52
+ checkpointNumber: block.number,
51
53
  body: `0x${block.body.toBuffer().toString('hex')}`,
52
54
  header: {
53
- lastArchiveRoot: asHex(block.header.lastArchive.root),
54
- contentCommitment: {
55
- blobsHash: asHex(block.header.contentCommitment.blobsHash),
56
- inHash: asHex(block.header.contentCommitment.inHash),
57
- outHash: asHex(block.header.contentCommitment.outHash),
58
- },
59
- slotNumber: Number(block.header.globalVariables.slotNumber),
60
- timestamp: Number(block.header.globalVariables.timestamp),
61
- coinbase: asHex(block.header.globalVariables.coinbase, 40),
62
- feeRecipient: asHex(block.header.globalVariables.feeRecipient),
55
+ lastArchiveRoot: asHex(checkpointHeader.lastArchiveRoot),
56
+ blockHeadersHash: asHex(checkpointHeader.blockHeadersHash),
57
+ blobsHash: asHex(checkpointHeader.blobsHash),
58
+ inHash: asHex(checkpointHeader.inHash),
59
+ outHash: asHex(checkpointHeader.epochOutHash),
60
+ slotNumber: Number(checkpointHeader.slotNumber),
61
+ timestamp: Number(checkpointHeader.timestamp),
62
+ coinbase: asHex(checkpointHeader.coinbase, 40),
63
+ feeRecipient: asHex(checkpointHeader.feeRecipient),
63
64
  gasFees: {
64
- feePerDaGas: Number(block.header.globalVariables.gasFees.feePerDaGas),
65
- feePerL2Gas: Number(block.header.globalVariables.gasFees.feePerL2Gas),
65
+ feePerDaGas: Number(checkpointHeader.gasFees.feePerDaGas),
66
+ feePerL2Gas: Number(checkpointHeader.gasFees.feePerL2Gas),
66
67
  },
67
- totalManaUsed: block.header.totalManaUsed.toNumber(),
68
+ totalManaUsed: checkpointHeader.totalManaUsed.toNumber(),
68
69
  },
69
- headerHash: asHex(block.getCheckpointHeader().hash()),
70
+ headerHash: asHex(checkpointHeader.hash()),
70
71
  numTxs: block.body.txEffects.length,
71
72
  },
72
73
  };
@@ -1,5 +1,5 @@
1
1
  import { AztecAddress } from '@aztec/aztec.js/addresses';
2
- import { getAddressFromPrivateKey } from '@aztec/ethereum';
2
+ import { getAddressFromPrivateKey } from '@aztec/ethereum/account';
3
3
  import { EthAddress } from '@aztec/foundation/eth-address';
4
4
  import type { EthPrivateKey } from '@aztec/node-keystore';
5
5