@aztec/end-to-end 0.0.1-commit.b655e406 → 0.0.1-commit.b8a057fa

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 (410) hide show
  1. package/README.md +217 -14
  2. package/dest/automine/automine_test_context.d.ts +85 -0
  3. package/dest/automine/automine_test_context.d.ts.map +1 -0
  4. package/dest/automine/automine_test_context.js +98 -0
  5. package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts +2 -0
  6. package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts.map +1 -0
  7. package/dest/automine/contracts/fixtures/storage_proof_fetcher.js +184 -0
  8. package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts +18 -0
  9. package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts.map +1 -0
  10. package/dest/automine/contracts/fixtures/storage_proof_fixture.js +120 -0
  11. package/dest/automine/delivery/onchain_delivery_harness.d.ts +17 -0
  12. package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -0
  13. package/dest/automine/delivery/onchain_delivery_harness.js +123 -0
  14. package/dest/automine/token/blacklist_token_contract_test.d.ts +49 -0
  15. package/dest/automine/token/blacklist_token_contract_test.d.ts.map +1 -0
  16. package/dest/automine/token/blacklist_token_contract_test.js +166 -0
  17. package/dest/automine/token/token_contract_test.d.ts +40 -0
  18. package/dest/automine/token/token_contract_test.d.ts.map +1 -0
  19. package/dest/automine/token/token_contract_test.js +119 -0
  20. package/dest/automine/token/token_test_helpers.d.ts +73 -0
  21. package/dest/automine/token/token_test_helpers.d.ts.map +1 -0
  22. package/dest/automine/token/token_test_helpers.js +97 -0
  23. package/dest/bench/client_flows/benchmark.d.ts +17 -2
  24. package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
  25. package/dest/bench/client_flows/benchmark.js +40 -1
  26. package/dest/bench/client_flows/client_flows_benchmark.d.ts +26 -20
  27. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  28. package/dest/bench/client_flows/client_flows_benchmark.js +159 -140
  29. package/dest/bench/client_flows/config.d.ts +2 -2
  30. package/dest/bench/client_flows/config.d.ts.map +1 -1
  31. package/dest/bench/client_flows/config.js +18 -0
  32. package/dest/bench/client_flows/data_extractor.d.ts +1 -1
  33. package/dest/bench/client_flows/data_extractor.js +8 -27
  34. package/dest/bench/utils.d.ts +10 -9
  35. package/dest/bench/utils.d.ts.map +1 -1
  36. package/dest/bench/utils.js +126 -23
  37. package/dest/composed/ha/ha_full_setup.d.ts +77 -0
  38. package/dest/composed/ha/ha_full_setup.d.ts.map +1 -0
  39. package/dest/composed/ha/ha_full_setup.js +383 -0
  40. package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts +12 -0
  41. package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts.map +1 -0
  42. package/dest/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js} +1 -1
  43. package/dest/fixtures/authwit_proxy.d.ts +15 -0
  44. package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
  45. package/dest/fixtures/authwit_proxy.js +34 -0
  46. package/dest/fixtures/e2e_prover_test.d.ts +27 -29
  47. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  48. package/dest/fixtures/e2e_prover_test.js +156 -156
  49. package/dest/fixtures/elu_monitor.d.ts +21 -0
  50. package/dest/fixtures/elu_monitor.d.ts.map +1 -0
  51. package/dest/fixtures/elu_monitor.js +102 -0
  52. package/dest/fixtures/fixtures.d.ts +83 -3
  53. package/dest/fixtures/fixtures.d.ts.map +1 -1
  54. package/dest/fixtures/fixtures.js +86 -3
  55. package/dest/fixtures/get_acvm_config.d.ts +1 -1
  56. package/dest/fixtures/get_acvm_config.js +1 -1
  57. package/dest/fixtures/get_bb_config.d.ts +1 -1
  58. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  59. package/dest/fixtures/get_bb_config.js +5 -5
  60. package/dest/fixtures/ha_setup.d.ts +71 -0
  61. package/dest/fixtures/ha_setup.d.ts.map +1 -0
  62. package/dest/fixtures/ha_setup.js +119 -0
  63. package/dest/fixtures/index.d.ts +3 -1
  64. package/dest/fixtures/index.d.ts.map +1 -1
  65. package/dest/fixtures/index.js +2 -0
  66. package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
  67. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  68. package/dest/fixtures/l1_to_l2_messaging.js +2 -2
  69. package/dest/fixtures/logging.d.ts +1 -1
  70. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
  71. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
  72. package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
  73. package/dest/fixtures/setup.d.ts +269 -0
  74. package/dest/fixtures/setup.d.ts.map +1 -0
  75. package/dest/fixtures/setup.js +688 -0
  76. package/dest/fixtures/setup_p2p_test.d.ts +22 -11
  77. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  78. package/dest/fixtures/setup_p2p_test.js +60 -41
  79. package/dest/fixtures/timing.d.ts +42 -0
  80. package/dest/fixtures/timing.d.ts.map +1 -0
  81. package/dest/fixtures/timing.js +72 -0
  82. package/dest/fixtures/token_utils.d.ts +26 -5
  83. package/dest/fixtures/token_utils.d.ts.map +1 -1
  84. package/dest/fixtures/token_utils.js +33 -9
  85. package/dest/fixtures/utils.d.ts +5 -192
  86. package/dest/fixtures/utils.d.ts.map +1 -1
  87. package/dest/fixtures/utils.js +4 -648
  88. package/dest/fixtures/wait_helpers.d.ts +135 -0
  89. package/dest/fixtures/wait_helpers.d.ts.map +1 -0
  90. package/dest/fixtures/wait_helpers.js +154 -0
  91. package/dest/fixtures/web3signer.d.ts +1 -1
  92. package/dest/fixtures/web3signer.js +1 -1
  93. package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
  94. package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
  95. package/dest/fixtures/with_telemetry_utils.js +2 -2
  96. package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
  97. package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
  98. package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
  99. package/dest/forward-compatibility/wallet_service.d.ts +3 -0
  100. package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
  101. package/dest/forward-compatibility/wallet_service.js +109 -0
  102. package/dest/index.d.ts +1 -1
  103. package/dest/install_legacy_contracts.d.cts +10 -0
  104. package/dest/install_legacy_contracts.d.cts.map +1 -0
  105. package/dest/legacy-jest-resolver.d.cts +3 -0
  106. package/dest/legacy-jest-resolver.d.cts.map +1 -0
  107. package/dest/multi-node/block-production/setup.d.ts +97 -0
  108. package/dest/multi-node/block-production/setup.d.ts.map +1 -0
  109. package/dest/multi-node/block-production/setup.js +158 -0
  110. package/dest/multi-node/governance/setup.d.ts +67 -0
  111. package/dest/multi-node/governance/setup.d.ts.map +1 -0
  112. package/dest/multi-node/governance/setup.js +126 -0
  113. package/dest/multi-node/multi_node_test_context.d.ts +212 -0
  114. package/dest/multi-node/multi_node_test_context.d.ts.map +1 -0
  115. package/dest/multi-node/multi_node_test_context.js +347 -0
  116. package/dest/multi-node/slashing/inactivity_setup.d.ts +27 -0
  117. package/dest/multi-node/slashing/inactivity_setup.d.ts.map +1 -0
  118. package/dest/multi-node/slashing/inactivity_setup.js +111 -0
  119. package/dest/multi-node/slashing/setup.d.ts +167 -0
  120. package/dest/multi-node/slashing/setup.d.ts.map +1 -0
  121. package/dest/multi-node/slashing/setup.js +275 -0
  122. package/dest/p2p/p2p_network.d.ts +325 -0
  123. package/dest/p2p/p2p_network.d.ts.map +1 -0
  124. package/dest/p2p/p2p_network.js +389 -0
  125. package/dest/p2p/reqresp/utils.d.ts +19 -0
  126. package/dest/p2p/reqresp/utils.d.ts.map +1 -0
  127. package/dest/p2p/reqresp/utils.js +193 -0
  128. package/dest/p2p/shared.d.ts +72 -0
  129. package/dest/p2p/shared.d.ts.map +1 -0
  130. package/dest/p2p/shared.js +212 -0
  131. package/dest/quality_of_service/grafana_client.d.ts +41 -0
  132. package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
  133. package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
  134. package/dest/quality_of_service/prometheus_client.d.ts +38 -0
  135. package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
  136. package/dest/quality_of_service/prometheus_client.js +67 -0
  137. package/dest/shared/cross_chain_test_harness.d.ts +11 -8
  138. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  139. package/dest/shared/cross_chain_test_harness.js +45 -40
  140. package/dest/shared/gas_portal_test_harness.d.ts +9 -6
  141. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  142. package/dest/shared/gas_portal_test_harness.js +28 -16
  143. package/dest/shared/index.d.ts +3 -2
  144. package/dest/shared/index.d.ts.map +1 -1
  145. package/dest/shared/index.js +1 -0
  146. package/dest/shared/jest_setup.d.ts +1 -1
  147. package/dest/shared/jest_setup.js +41 -1
  148. package/dest/shared/mock_state_view.d.ts +86 -0
  149. package/dest/shared/mock_state_view.d.ts.map +1 -0
  150. package/dest/shared/mock_state_view.js +186 -0
  151. package/dest/shared/submit-transactions.d.ts +4 -4
  152. package/dest/shared/submit-transactions.d.ts.map +1 -1
  153. package/dest/shared/submit-transactions.js +19 -14
  154. package/dest/shared/timing_env.d.js +5 -0
  155. package/dest/shared/timing_env.js +365 -0
  156. package/dest/shared/uniswap_l1_l2.d.ts +3 -27
  157. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  158. package/dest/shared/uniswap_l1_l2.js +86 -54
  159. package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
  160. package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
  161. package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
  162. package/dest/simulators/index.d.ts +1 -1
  163. package/dest/simulators/lending_simulator.d.ts +11 -4
  164. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  165. package/dest/simulators/lending_simulator.js +33 -19
  166. package/dest/simulators/token_simulator.d.ts +1 -1
  167. package/dest/simulators/token_simulator.d.ts.map +1 -1
  168. package/dest/simulators/token_simulator.js +3 -24
  169. package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts +75 -0
  170. package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts.map +1 -0
  171. package/dest/single-node/cross-chain/cross_chain_messaging_test.js +209 -0
  172. package/dest/single-node/cross-chain/message_test_helpers.d.ts +38 -0
  173. package/dest/single-node/cross-chain/message_test_helpers.d.ts.map +1 -0
  174. package/dest/single-node/cross-chain/message_test_helpers.js +70 -0
  175. package/dest/single-node/fees/bridging_race.notest.d.ts +2 -0
  176. package/dest/single-node/fees/bridging_race.notest.d.ts.map +1 -0
  177. package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.js +21 -10
  178. package/dest/single-node/fees/fees_test.d.ts +93 -0
  179. package/dest/single-node/fees/fees_test.d.ts.map +1 -0
  180. package/dest/single-node/fees/fees_test.js +274 -0
  181. package/dest/single-node/l1-reorgs/setup.d.ts +42 -0
  182. package/dest/single-node/l1-reorgs/setup.d.ts.map +1 -0
  183. package/dest/single-node/l1-reorgs/setup.js +57 -0
  184. package/dest/single-node/partial-proofs/setup.d.ts +5 -0
  185. package/dest/single-node/partial-proofs/setup.d.ts.map +1 -0
  186. package/dest/single-node/partial-proofs/setup.js +5 -0
  187. package/dest/single-node/proving/setup.d.ts +5 -0
  188. package/dest/single-node/proving/setup.d.ts.map +1 -0
  189. package/dest/single-node/proving/setup.js +5 -0
  190. package/dest/single-node/recovery/setup.d.ts +5 -0
  191. package/dest/single-node/recovery/setup.d.ts.map +1 -0
  192. package/dest/single-node/recovery/setup.js +5 -0
  193. package/dest/single-node/setup.d.ts +49 -0
  194. package/dest/single-node/setup.d.ts.map +1 -0
  195. package/dest/single-node/setup.js +56 -0
  196. package/dest/single-node/single_node_test_context.d.ts +360 -0
  197. package/dest/single-node/single_node_test_context.d.ts.map +1 -0
  198. package/dest/single-node/single_node_test_context.js +833 -0
  199. package/dest/spartan/setup_test_wallets.d.ts +18 -6
  200. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  201. package/dest/spartan/setup_test_wallets.js +169 -30
  202. package/dest/spartan/tx_metrics.d.ts +111 -0
  203. package/dest/spartan/tx_metrics.d.ts.map +1 -0
  204. package/dest/spartan/tx_metrics.js +507 -0
  205. package/dest/spartan/utils/bot.d.ts +28 -0
  206. package/dest/spartan/utils/bot.d.ts.map +1 -0
  207. package/dest/spartan/utils/bot.js +142 -0
  208. package/dest/spartan/utils/chaos.d.ts +79 -0
  209. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  210. package/dest/spartan/utils/chaos.js +142 -0
  211. package/dest/spartan/utils/clients.d.ts +39 -0
  212. package/dest/spartan/utils/clients.d.ts.map +1 -0
  213. package/dest/spartan/utils/clients.js +90 -0
  214. package/dest/spartan/utils/config.d.ts +19 -0
  215. package/dest/spartan/utils/config.d.ts.map +1 -0
  216. package/dest/spartan/utils/config.js +23 -0
  217. package/dest/spartan/utils/health.d.ts +63 -0
  218. package/dest/spartan/utils/health.d.ts.map +1 -0
  219. package/dest/spartan/utils/health.js +202 -0
  220. package/dest/spartan/utils/helm.d.ts +15 -0
  221. package/dest/spartan/utils/helm.d.ts.map +1 -0
  222. package/dest/spartan/utils/helm.js +47 -0
  223. package/dest/spartan/utils/index.d.ts +11 -0
  224. package/dest/spartan/utils/index.d.ts.map +1 -0
  225. package/dest/spartan/utils/index.js +22 -0
  226. package/dest/spartan/utils/k8s.d.ts +128 -0
  227. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  228. package/dest/spartan/utils/k8s.js +381 -0
  229. package/dest/spartan/utils/nodes.d.ts +40 -0
  230. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  231. package/dest/spartan/utils/nodes.js +461 -0
  232. package/dest/spartan/utils/pod_logs.d.ts +25 -0
  233. package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
  234. package/dest/spartan/utils/pod_logs.js +74 -0
  235. package/dest/spartan/utils/scripts.d.ts +30 -0
  236. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  237. package/dest/spartan/utils/scripts.js +81 -0
  238. package/dest/spartan/utils.d.ts +2 -218
  239. package/dest/spartan/utils.d.ts.map +1 -1
  240. package/dest/spartan/utils.js +1 -749
  241. package/dest/test-wallet/test_wallet.d.ts +105 -0
  242. package/dest/test-wallet/test_wallet.d.ts.map +1 -0
  243. package/dest/test-wallet/test_wallet.js +323 -0
  244. package/dest/test-wallet/utils.d.ts +76 -0
  245. package/dest/test-wallet/utils.d.ts.map +1 -0
  246. package/dest/test-wallet/utils.js +126 -0
  247. package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
  248. package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
  249. package/dest/test-wallet/wallet_worker_script.js +56 -0
  250. package/dest/test-wallet/worker_wallet.d.ts +53 -0
  251. package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
  252. package/dest/test-wallet/worker_wallet.js +155 -0
  253. package/dest/test-wallet/worker_wallet_schema.d.ts +4 -0
  254. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
  255. package/dest/test-wallet/worker_wallet_schema.js +22 -0
  256. package/package.json +57 -47
  257. package/src/automine/README.md +60 -0
  258. package/src/automine/automine_test_context.ts +153 -0
  259. package/src/automine/contracts/fixtures/storage_proof.json +915 -0
  260. package/src/automine/contracts/fixtures/storage_proof_fetcher.ts +190 -0
  261. package/src/automine/contracts/fixtures/storage_proof_fixture.ts +173 -0
  262. package/src/automine/delivery/onchain_delivery_harness.ts +177 -0
  263. package/src/automine/token/blacklist_token_contract_test.ts +208 -0
  264. package/src/automine/token/token_contract_test.ts +146 -0
  265. package/src/automine/token/token_test_helpers.ts +138 -0
  266. package/src/bench/client_flows/benchmark.ts +45 -2
  267. package/src/bench/client_flows/client_flows_benchmark.ts +227 -211
  268. package/src/bench/client_flows/config.ts +9 -1
  269. package/src/bench/client_flows/data_extractor.ts +7 -28
  270. package/src/bench/utils.ts +144 -25
  271. package/src/composed/ha/ha_full_setup.ts +466 -0
  272. package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts} +1 -1
  273. package/src/fixtures/authwit_proxy.ts +54 -0
  274. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  275. package/src/fixtures/e2e_prover_test.ts +175 -214
  276. package/src/fixtures/elu_monitor.ts +126 -0
  277. package/src/fixtures/fixtures.ts +110 -5
  278. package/src/fixtures/get_acvm_config.ts +1 -1
  279. package/src/fixtures/get_bb_config.ts +7 -6
  280. package/src/fixtures/ha_setup.ts +192 -0
  281. package/src/fixtures/index.ts +2 -0
  282. package/src/fixtures/l1_to_l2_messaging.ts +4 -2
  283. package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
  284. package/src/fixtures/setup.ts +987 -0
  285. package/src/fixtures/setup_p2p_test.ts +72 -58
  286. package/src/fixtures/timing.ts +97 -0
  287. package/src/fixtures/token_utils.ts +47 -11
  288. package/src/fixtures/utils.ts +26 -947
  289. package/src/fixtures/wait_helpers.ts +333 -0
  290. package/src/fixtures/web3signer.ts +1 -1
  291. package/src/fixtures/with_telemetry_utils.ts +2 -2
  292. package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
  293. package/src/forward-compatibility/wallet_service.ts +106 -0
  294. package/src/guides/up_quick_start.sh +8 -5
  295. package/src/infra/README.md +12 -0
  296. package/src/install_legacy_contracts.cjs +75 -0
  297. package/src/legacy-jest-resolver.cjs +112 -0
  298. package/src/multi-node/README.md +95 -0
  299. package/src/multi-node/block-production/setup.ts +272 -0
  300. package/src/multi-node/governance/setup.ts +172 -0
  301. package/src/multi-node/multi_node_test_context.ts +447 -0
  302. package/src/multi-node/slashing/inactivity_setup.ts +139 -0
  303. package/src/multi-node/slashing/setup.ts +433 -0
  304. package/src/p2p/README.md +78 -0
  305. package/src/p2p/p2p_network.ts +542 -0
  306. package/src/p2p/reqresp/utils.ts +263 -0
  307. package/src/p2p/shared.ts +329 -0
  308. package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
  309. package/src/quality_of_service/prometheus_client.ts +113 -0
  310. package/src/shared/cross_chain_test_harness.ts +51 -43
  311. package/src/shared/gas_portal_test_harness.ts +36 -18
  312. package/src/shared/index.ts +2 -1
  313. package/src/shared/jest_setup.ts +51 -1
  314. package/src/shared/mock_state_view.ts +188 -0
  315. package/src/shared/submit-transactions.ts +22 -19
  316. package/src/shared/timing_env.d.mts +39 -0
  317. package/src/shared/timing_env.mjs +363 -0
  318. package/src/shared/uniswap_l1_l2.ts +136 -115
  319. package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
  320. package/src/simulators/lending_simulator.ts +40 -20
  321. package/src/simulators/token_simulator.ts +6 -30
  322. package/src/single-node/README.md +60 -0
  323. package/src/single-node/cross-chain/cross_chain_messaging_test.ts +302 -0
  324. package/src/single-node/cross-chain/message_test_helpers.ts +125 -0
  325. package/src/{e2e_fees → single-node/fees}/bridging_race.notest.ts +23 -15
  326. package/src/single-node/fees/fees_test.ts +368 -0
  327. package/src/single-node/l1-reorgs/setup.ts +93 -0
  328. package/src/single-node/partial-proofs/setup.ts +8 -0
  329. package/src/single-node/proving/setup.ts +15 -0
  330. package/src/single-node/recovery/setup.ts +8 -0
  331. package/src/single-node/setup.ts +63 -0
  332. package/src/single-node/single_node_test_context.ts +1041 -0
  333. package/src/spartan/DEVELOP.md +7 -0
  334. package/src/spartan/setup_test_wallets.ts +243 -32
  335. package/src/spartan/tx_metrics.ts +460 -0
  336. package/src/spartan/utils/bot.ts +188 -0
  337. package/src/spartan/utils/chaos.ts +253 -0
  338. package/src/spartan/utils/clients.ts +100 -0
  339. package/src/spartan/utils/config.ts +29 -0
  340. package/src/spartan/utils/health.ts +255 -0
  341. package/src/spartan/utils/helm.ts +84 -0
  342. package/src/spartan/utils/index.ts +71 -0
  343. package/src/spartan/utils/k8s.ts +535 -0
  344. package/src/spartan/utils/nodes.ts +543 -0
  345. package/src/spartan/utils/pod_logs.ts +99 -0
  346. package/src/spartan/utils/scripts.ts +99 -0
  347. package/src/spartan/utils.ts +1 -942
  348. package/src/test-wallet/test_wallet.ts +429 -0
  349. package/src/test-wallet/utils.ts +205 -0
  350. package/src/test-wallet/wallet_worker_script.ts +66 -0
  351. package/src/test-wallet/worker_wallet.ts +214 -0
  352. package/src/test-wallet/worker_wallet_schema.ts +14 -0
  353. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +0 -54
  354. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +0 -1
  355. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +0 -185
  356. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -41
  357. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +0 -1
  358. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +0 -107
  359. package/dest/e2e_deploy_contract/deploy_test.d.ts +0 -36
  360. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +0 -1
  361. package/dest/e2e_deploy_contract/deploy_test.js +0 -45
  362. package/dest/e2e_epochs/epochs_test.d.ts +0 -92
  363. package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
  364. package/dest/e2e_epochs/epochs_test.js +0 -336
  365. package/dest/e2e_fees/bridging_race.notest.d.ts +0 -2
  366. package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
  367. package/dest/e2e_fees/fees_test.d.ts +0 -84
  368. package/dest/e2e_fees/fees_test.d.ts.map +0 -1
  369. package/dest/e2e_fees/fees_test.js +0 -260
  370. package/dest/e2e_l1_publisher/write_json.d.ts +0 -10
  371. package/dest/e2e_l1_publisher/write_json.d.ts.map +0 -1
  372. package/dest/e2e_l1_publisher/write_json.js +0 -57
  373. package/dest/e2e_multi_validator/utils.d.ts +0 -12
  374. package/dest/e2e_multi_validator/utils.d.ts.map +0 -1
  375. package/dest/e2e_nested_contract/nested_contract_test.d.ts +0 -29
  376. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +0 -1
  377. package/dest/e2e_nested_contract/nested_contract_test.js +0 -63
  378. package/dest/e2e_p2p/inactivity_slash_test.d.ts +0 -31
  379. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +0 -1
  380. package/dest/e2e_p2p/inactivity_slash_test.js +0 -135
  381. package/dest/e2e_p2p/p2p_network.d.ts +0 -108
  382. package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
  383. package/dest/e2e_p2p/p2p_network.js +0 -318
  384. package/dest/e2e_p2p/shared.d.ts +0 -46
  385. package/dest/e2e_p2p/shared.d.ts.map +0 -1
  386. package/dest/e2e_p2p/shared.js +0 -183
  387. package/dest/e2e_token_contract/token_contract_test.d.ts +0 -35
  388. package/dest/e2e_token_contract/token_contract_test.d.ts.map +0 -1
  389. package/dest/e2e_token_contract/token_contract_test.js +0 -126
  390. package/dest/fixtures/setup_l1_contracts.d.ts +0 -6
  391. package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
  392. package/dest/fixtures/setup_l1_contracts.js +0 -17
  393. package/dest/fixtures/snapshot_manager.d.ts +0 -95
  394. package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
  395. package/dest/fixtures/snapshot_manager.js +0 -505
  396. package/dest/quality_of_service/alert_checker.d.ts +0 -41
  397. package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
  398. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +0 -256
  399. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +0 -178
  400. package/src/e2e_deploy_contract/deploy_test.ts +0 -78
  401. package/src/e2e_epochs/epochs_test.ts +0 -437
  402. package/src/e2e_fees/fees_test.ts +0 -378
  403. package/src/e2e_l1_publisher/write_json.ts +0 -76
  404. package/src/e2e_nested_contract/nested_contract_test.ts +0 -95
  405. package/src/e2e_p2p/inactivity_slash_test.ts +0 -178
  406. package/src/e2e_p2p/p2p_network.ts +0 -472
  407. package/src/e2e_p2p/shared.ts +0 -282
  408. package/src/e2e_token_contract/token_contract_test.ts +0 -167
  409. package/src/fixtures/setup_l1_contracts.ts +0 -26
  410. package/src/fixtures/snapshot_manager.ts +0 -665
@@ -1,43 +1,29 @@
1
- import type { InitialAccountData } from '@aztec/accounts/testing';
2
- import { type Archiver, createArchiver } from '@aztec/archiver';
1
+ import { type InitialAccountData, generateSchnorrAccounts } from '@aztec/accounts/testing';
2
+ import { AztecNodeService, createAztecNodeService } from '@aztec/aztec-node';
3
3
  import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
4
- import { type Logger, createLogger } from '@aztec/aztec.js/log';
4
+ import { createLogger } from '@aztec/aztec.js/log';
5
5
  import type { AztecNode } from '@aztec/aztec.js/node';
6
6
  import { CheatCodes } from '@aztec/aztec/testing';
7
- import {
8
- BBCircuitVerifier,
9
- type ClientProtocolCircuitVerifier,
10
- QueuedIVCVerifier,
11
- TestCircuitVerifier,
12
- } from '@aztec/bb-prover';
13
- import { createBlobSinkClient } from '@aztec/blob-sink/client';
14
- import type { BlobSinkServer } from '@aztec/blob-sink/server';
15
- import type { DeployL1ContractsReturnType } from '@aztec/ethereum';
7
+ import type { ClientProtocolCircuitVerifier } from '@aztec/bb-prover';
8
+ import { BackendType, Barretenberg } from '@aztec/bb.js';
9
+ import type { DeployAztecL1ContractsReturnType } from '@aztec/ethereum/deploy-aztec-l1-contracts';
16
10
  import { Buffer32 } from '@aztec/foundation/buffer';
17
11
  import { SecretValue } from '@aztec/foundation/config';
18
12
  import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
19
13
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
20
- import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
14
+ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
21
15
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
22
- import { TestWallet } from '@aztec/test-wallet/server';
23
16
  import { getGenesisValues } from '@aztec/world-state/testing';
24
17
 
25
18
  import { type Hex, getContract } from 'viem';
26
19
  import { privateKeyToAddress } from 'viem/accounts';
27
20
 
28
21
  import { TokenSimulator } from '../simulators/token_simulator.js';
22
+ import { SingleNodeTestContext, type SingleNodeTestOpts } from '../single-node/single_node_test_context.js';
23
+ import { TestWallet } from '../test-wallet/test_wallet.js';
29
24
  import { getACVMConfig } from './get_acvm_config.js';
30
25
  import { getBBConfig } from './get_bb_config.js';
31
- import {
32
- type ISnapshotManager,
33
- type SubsystemsContext,
34
- createSnapshotManager,
35
- deployAccounts,
36
- publicDeployAccounts,
37
- } from './snapshot_manager.js';
38
- import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEAndGetWallet } from './utils.js';
39
-
40
- const { E2E_DATA_PATH: dataPath } = process.env;
26
+ import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setup, setupPXEAndGetWallet } from './setup.js';
41
27
 
42
28
  type ProvenSetup = {
43
29
  wallet: TestWallet;
@@ -49,127 +35,117 @@ type ProvenSetup = {
49
35
  * However, we then setup a second PXE with a full prover instance.
50
36
  * We configure this instance with all of the accounts and contracts.
51
37
  * We then prove and verify transactions created via this full prover PXE.
38
+ *
39
+ * The real-prover sub-base of the single-node topology: extends {@link SingleNodeTestContext} so it
40
+ * reuses the base node tracking / chain monitor / teardown machinery, but builds its environment with
41
+ * the bespoke prover opts below (real BB, `realVerifier` L1, the snapshot/account + TokenSimulator
42
+ * harness, and a hand-built prover node) rather than the base's default fake-prover config.
52
43
  */
53
44
 
54
- export class FullProverTest {
45
+ export class FullProverTest extends SingleNodeTestContext {
55
46
  static TOKEN_NAME = 'USDC';
56
47
  static TOKEN_SYMBOL = 'USD';
57
48
  static TOKEN_DECIMALS = 18n;
58
- private snapshotManager: ISnapshotManager;
59
- logger: Logger;
60
49
  wallet!: TestWallet;
61
50
  provenWallet!: TestWallet;
62
51
  accounts: AztecAddress[] = [];
63
- deployedAccounts!: InitialAccountData[];
52
+ fundedAccounts!: InitialAccountData[];
64
53
  fakeProofsAsset!: TokenContract;
54
+ fakeProofsAssetInstance!: ContractInstanceWithAddress;
65
55
  tokenSim!: TokenSimulator;
66
56
  aztecNode!: AztecNode;
67
57
  aztecNodeAdmin!: AztecNodeAdmin;
68
58
  cheatCodes!: CheatCodes;
69
- blobSink!: BlobSinkServer;
70
59
  private provenComponents: ProvenSetup[] = [];
71
60
  private bbConfigCleanup?: () => Promise<void>;
72
61
  private acvmConfigCleanup?: () => Promise<void>;
73
- circuitProofVerifier?: ClientProtocolCircuitVerifier;
62
+ /** Returns the proof verifier from the prover node (for test assertions). */
63
+ get circuitProofVerifier(): ClientProtocolCircuitVerifier | undefined {
64
+ return this.proverAztecNode?.getProofVerifier();
65
+ }
74
66
  provenAsset!: TokenContract;
75
- private context!: SubsystemsContext;
76
- private proverNode!: ProverNode;
77
- private simulatedProverNode!: ProverNode;
78
- public l1Contracts!: DeployL1ContractsReturnType;
67
+ private proverAztecNode!: AztecNodeService;
68
+ private simulatedProverAztecNode!: AztecNodeService;
69
+ public l1Contracts!: DeployAztecL1ContractsReturnType;
79
70
  public proverAddress!: EthAddress;
80
-
81
- constructor(
82
- testName: string,
83
- private minNumberOfTxsPerBlock: number,
84
- coinbase: EthAddress,
85
- private realProofs = true,
86
- ) {
71
+ private testName: string;
72
+ private minNumberOfTxsPerBlock: number;
73
+ private coinbase: EthAddress;
74
+ private realProofs: boolean;
75
+
76
+ constructor(testName: string, minNumberOfTxsPerBlock: number, coinbase: EthAddress, realProofs = true) {
77
+ super();
78
+ this.testName = testName;
87
79
  this.logger = createLogger(`e2e:full_prover_test:${testName}`);
88
- this.snapshotManager = createSnapshotManager(
89
- `full_prover_integration/${testName}`,
90
- dataPath,
91
- { startProverNode: true, fundRewardDistributor: true, coinbase },
92
- {
93
- realVerifier: realProofs,
94
- },
95
- );
80
+ this.minNumberOfTxsPerBlock = minNumberOfTxsPerBlock;
81
+ this.coinbase = coinbase;
82
+ this.realProofs = realProofs;
96
83
  }
97
84
 
98
85
  /**
99
- * Adds two state shifts to snapshot manager.
100
- * 1. Add 2 accounts.
101
- * 2. Publicly deploy accounts, deploy token contract
86
+ * Applies base setup: deploys 2 accounts and token contract.
102
87
  */
103
- async applyBaseSnapshots() {
104
- await this.snapshotManager.snapshot(
105
- '2_accounts',
106
- deployAccounts(2, this.logger),
107
- ({ deployedAccounts }, { wallet }) => {
108
- this.deployedAccounts = deployedAccounts;
109
- this.accounts = deployedAccounts.map(a => a.address);
110
- this.wallet = wallet;
111
- return Promise.resolve();
112
- },
113
- );
88
+ private async applyBaseSetup() {
89
+ this.logger.info('Applying base setup: registering funded accounts');
90
+ this.fundedAccounts = this.context.additionallyFundedAccounts;
91
+ this.accounts = this.fundedAccounts.map(a => a.address);
92
+ this.wallet = this.context.wallet;
93
+ for (const { secret, salt, signingKey } of this.fundedAccounts) {
94
+ await this.wallet.createSchnorrInitializerlessAccount(secret, salt, signingKey);
95
+ }
96
+
97
+ this.logger.info('Applying base setup: deploying token contract');
98
+ const { contract: asset, instance } = await TokenContract.deploy(
99
+ this.wallet,
100
+ this.accounts[0],
101
+ FullProverTest.TOKEN_NAME,
102
+ FullProverTest.TOKEN_SYMBOL,
103
+ FullProverTest.TOKEN_DECIMALS,
104
+ ).send({ from: this.accounts[0] });
105
+ this.logger.verbose(`Token deployed to ${asset.address}`);
106
+
107
+ this.fakeProofsAsset = asset;
108
+ this.fakeProofsAssetInstance = instance;
109
+ this.logger.verbose(`Token contract address: ${this.fakeProofsAsset.address}`);
114
110
 
115
- await this.snapshotManager.snapshot(
116
- 'client_prover_integration',
117
- async () => {
118
- // Create the token contract state.
119
- // Move this account thing to addAccounts above?
120
- this.logger.verbose(`Public deploy accounts...`);
121
- await publicDeployAccounts(this.wallet, this.accounts.slice(0, 2));
122
-
123
- this.logger.verbose(`Deploying TokenContract...`);
124
- const asset = await TokenContract.deploy(
125
- this.wallet,
126
- this.accounts[0],
127
- FullProverTest.TOKEN_NAME,
128
- FullProverTest.TOKEN_SYMBOL,
129
- FullProverTest.TOKEN_DECIMALS,
130
- )
131
- .send({ from: this.accounts[0] })
132
- .deployed();
133
- this.logger.verbose(`Token deployed to ${asset.address}`);
134
-
135
- return { tokenContractAddress: asset.address };
136
- },
137
- async ({ tokenContractAddress }) => {
138
- // Restore the token contract state.
139
- this.fakeProofsAsset = await TokenContract.at(tokenContractAddress, this.wallet);
140
- this.logger.verbose(`Token contract address: ${this.fakeProofsAsset.address}`);
141
-
142
- this.tokenSim = new TokenSimulator(
143
- this.fakeProofsAsset,
144
- this.wallet,
145
- this.accounts[0],
146
- this.logger,
147
- this.accounts,
148
- );
149
-
150
- expect(await this.fakeProofsAsset.methods.get_admin().simulate({ from: this.accounts[0] })).toBe(
151
- this.accounts[0].toBigInt(),
152
- );
153
- },
111
+ this.tokenSim = new TokenSimulator(this.fakeProofsAsset, this.wallet, this.accounts[0], this.logger, this.accounts);
112
+
113
+ expect((await this.fakeProofsAsset.methods.get_admin().simulate({ from: this.accounts[0] })).result).toBe(
114
+ this.accounts[0].toBigInt(),
154
115
  );
155
116
  }
156
117
 
157
- async setup() {
158
- this.context = await this.snapshotManager.setup();
118
+ override async setup(opts: SingleNodeTestOpts = {}) {
119
+ this.logger.info('Setting up subsystems from fresh');
120
+ const context = await setup(0, {
121
+ ...opts,
122
+ startProverNode: true,
123
+ coinbase: this.coinbase,
124
+ fundSponsoredFPC: true,
125
+ additionallyFundedAccounts: await generateSchnorrAccounts(2),
126
+ l1ContractsArgs: { realVerifier: this.realProofs },
127
+ });
128
+
129
+ // Reuse the base context machinery (rollup, epoch cache, chain monitor, node tracking, teardown)
130
+ // over the environment built above. Restore the FullProverTest-named logger afterwards, since
131
+ // hydrateFromContext repoints `this.logger` at the context logger.
132
+ await this.hydrateFromContext(context);
133
+ this.logger = createLogger(`e2e:full_prover_test:${this.testName}`);
134
+
135
+ await this.applyBaseSetup();
136
+ await this.applyMint();
159
137
 
160
- // We don't wish to mark as proven automatically, so we set the flag to false
161
- this.context.watcher.setIsMarkingAsProven(false);
138
+ this.logger.info(`Enabling proving`, { realProofs: this.realProofs });
162
139
 
163
- this.simulatedProverNode = this.context.proverNode!;
140
+ this.simulatedProverAztecNode = this.context.proverNode!;
164
141
  ({
165
142
  aztecNode: this.aztecNode,
166
143
  deployL1ContractsValues: this.l1Contracts,
167
144
  cheatCodes: this.cheatCodes,
168
- blobSink: this.blobSink,
169
145
  } = this.context);
170
- this.aztecNodeAdmin = this.context.aztecNode;
146
+ this.aztecNodeAdmin = this.context.aztecNodeService;
171
147
 
172
- const blobSinkClient = createBlobSinkClient({ blobSinkUrl: `http://localhost:${this.blobSink.port}` });
148
+ const config = this.context.aztecNodeConfig;
173
149
 
174
150
  // Configure a full prover PXE
175
151
  let acvmConfig: Awaited<ReturnType<typeof getACVMConfig>> | undefined;
@@ -183,12 +159,7 @@ export class FullProverTest {
183
159
  this.acvmConfigCleanup = acvmConfig.cleanup;
184
160
  this.bbConfigCleanup = bbConfig.cleanup;
185
161
 
186
- if (!bbConfig?.bbWorkingDirectory || !bbConfig?.bbBinaryPath) {
187
- throw new Error(`Test must be run with BB native configuration`);
188
- }
189
-
190
- const verifier = await BBCircuitVerifier.new(bbConfig);
191
- this.circuitProofVerifier = new QueuedIVCVerifier(bbConfig, verifier);
162
+ await Barretenberg.initSingleton({ backend: BackendType.NativeUnixSocket });
192
163
 
193
164
  this.logger.debug(`Configuring the node for real proofs...`);
194
165
  await this.aztecNodeAdmin.setConfig({
@@ -197,7 +168,6 @@ export class FullProverTest {
197
168
  });
198
169
  } else {
199
170
  this.logger.debug(`Configuring the node min txs per block ${this.minNumberOfTxsPerBlock}...`);
200
- this.circuitProofVerifier = new TestCircuitVerifier();
201
171
  await this.aztecNodeAdmin.setConfig({
202
172
  minTxsPerBlock: this.minNumberOfTxsPerBlock,
203
173
  });
@@ -212,23 +182,25 @@ export class FullProverTest {
212
182
  this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
213
183
  const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEAndGetWallet(
214
184
  this.aztecNode,
215
- {
216
- proverEnabled: this.realProofs,
217
- bbBinaryPath: bbConfig?.bbBinaryPath,
218
- bbWorkingDirectory: bbConfig?.bbWorkingDirectory,
219
- },
185
+ this.context.aztecNode,
186
+ { proverEnabled: this.realProofs },
220
187
  undefined,
221
- true,
188
+ 'pxe-proven',
222
189
  );
223
190
  this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
224
- await provenWallet.registerContract(this.fakeProofsAsset);
191
+ await provenWallet.registerContract(this.fakeProofsAssetInstance, TokenContract.artifact);
225
192
 
226
193
  for (let i = 0; i < 2; i++) {
227
- await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
228
- await this.wallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
194
+ // Mirror the initializerless funded accounts (created via createFundedAccounts) in both wallets so
195
+ // their addresses match the genesis-funded ones.
196
+ await provenWallet.createSchnorrInitializerlessAccount(
197
+ this.fundedAccounts[i].secret,
198
+ this.fundedAccounts[i].salt,
199
+ );
200
+ await this.wallet.createSchnorrInitializerlessAccount(this.fundedAccounts[i].secret, this.fundedAccounts[i].salt);
229
201
  }
230
202
 
231
- const asset = await TokenContract.at(this.fakeProofsAsset.address, provenWallet);
203
+ const asset = TokenContract.at(this.fakeProofsAsset.address, provenWallet);
232
204
  this.provenComponents.push({
233
205
  wallet: provenWallet,
234
206
  teardown: provenTeardown,
@@ -237,20 +209,13 @@ export class FullProverTest {
237
209
  this.provenWallet = provenWallet;
238
210
  this.logger.info(`Full prover PXE started`);
239
211
 
240
- // Shutdown the current, simulated prover node
212
+ // Shutdown the current, simulated prover node (by stopping its hosting aztec node)
241
213
  this.logger.verbose('Shutting down simulated prover node');
242
- await this.simulatedProverNode.stop();
243
-
244
- // Creating temp store and archiver for fully proven prover node
245
- this.logger.verbose('Starting archiver for new prover node');
246
- const archiver = await createArchiver(
247
- { ...this.context.aztecNodeConfig, dataDirectory: undefined },
248
- { blobSinkClient },
249
- { blockUntilSync: true },
250
- );
214
+ await this.simulatedProverAztecNode.stop();
251
215
 
252
216
  // The simulated prover node (now shutdown) used private key index 2
253
217
  const proverNodePrivateKey = getPrivateKeyFromIndex(2);
218
+ const proverNodePrivateKeyHex = `0x${proverNodePrivateKey!.toString('hex')}` as const;
254
219
  const proverNodeSenderAddress = privateKeyToAddress(new Buffer32(proverNodePrivateKey!).toString());
255
220
  this.proverAddress = EthAddress.fromString(proverNodeSenderAddress);
256
221
 
@@ -258,41 +223,48 @@ export class FullProverTest {
258
223
  await this.mintFeeJuice(proverNodeSenderAddress);
259
224
 
260
225
  this.logger.verbose('Starting prover node');
261
- const proverConfig: ProverNodeConfig = {
262
- ...this.context.aztecNodeConfig,
263
- txCollectionNodeRpcUrls: [],
226
+ const sponsoredFPCAddress = await getSponsoredFPCAddress();
227
+ const { genesis } = await getGenesisValues(
228
+ this.context.additionallyFundedAccounts.map(a => a.address).concat(sponsoredFPCAddress),
229
+ undefined,
230
+ undefined,
231
+ this.context.genesis!.genesisTimestamp,
232
+ );
233
+
234
+ const proverNodeConfig: Parameters<typeof createAztecNodeService>[0] = {
235
+ ...config,
236
+ enableProverNode: true,
237
+ disableValidator: true,
264
238
  dataDirectory: undefined,
239
+ txCollectionNodeRpcUrls: [],
265
240
  proverId: this.proverAddress,
266
241
  realProofs: this.realProofs,
267
242
  proverAgentCount: 2,
268
- publisherPrivateKeys: [new SecretValue(`0x${proverNodePrivateKey!.toString('hex')}` as const)],
243
+ proverPublisherPrivateKeys: [new SecretValue(proverNodePrivateKeyHex)],
269
244
  proverNodeMaxPendingJobs: 100,
270
245
  proverNodeMaxParallelBlocksPerEpoch: 32,
271
246
  proverNodePollingIntervalMs: 100,
272
247
  txGatheringIntervalMs: 1000,
273
248
  txGatheringBatchSize: 10,
274
249
  txGatheringMaxParallelRequestsPerNode: 100,
275
- txGatheringTimeoutMs: 24_000,
250
+ // The test warps the L1 clock forward a full epoch via cheatcodes; the prover-node
251
+ // tracks L1 time, so an in-flight tx-gather would see its deadline jump into the
252
+ // past. Use a generous window so the deadline survives the warp.
253
+ txGatheringTimeoutMs: 10 * 60 * 1000,
276
254
  proverNodeFailedEpochStore: undefined,
277
255
  proverNodeEpochProvingDelayMs: undefined,
256
+ validatorPrivateKeys: new SecretValue([]),
278
257
  };
279
- const sponsoredFPCAddress = await getSponsoredFPCAddress();
280
- const { prefilledPublicData } = await getGenesisValues(
281
- this.context.initialFundedAccounts.map(a => a.address).concat(sponsoredFPCAddress),
282
- );
283
- this.proverNode = await createProverNode(
284
- proverConfig,
285
- {
286
- aztecNodeTxProvider: this.aztecNode,
287
- archiver: archiver as Archiver,
288
- blobSinkClient,
289
- },
290
- { prefilledPublicData },
291
- );
292
- await this.proverNode.start();
293
258
 
294
- this.logger.warn(`Proofs are now enabled`);
295
- return this;
259
+ this.proverAztecNode = await createAztecNodeService(
260
+ proverNodeConfig,
261
+ { dateProvider: this.context.dateProvider, p2pClientDeps: { rpcTxProviders: [this.aztecNode] } },
262
+ { genesis },
263
+ );
264
+ // Track the real prover node so the base teardown stops it (the simulated one created by `setup`
265
+ // was already stopped above).
266
+ this.proverNodes = [this.proverAztecNode];
267
+ this.logger.warn(`Proofs are now enabled`, { realProofs: this.realProofs });
296
268
  }
297
269
 
298
270
  private async mintFeeJuice(recipient: Hex) {
@@ -304,71 +276,60 @@ export class FullProverTest {
304
276
  await this.context.deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash });
305
277
  }
306
278
 
307
- snapshot = <T>(
308
- name: string,
309
- apply: (context: SubsystemsContext) => Promise<T>,
310
- restore: (snapshotData: T, context: SubsystemsContext) => Promise<void> = () => Promise.resolve(),
311
- ): Promise<void> => this.snapshotManager.snapshot(name, apply, restore);
312
-
313
- async teardown() {
314
- await this.snapshotManager.teardown();
315
-
279
+ override async teardown() {
316
280
  // Cleanup related to the full prover PXEs
317
281
  for (let i = 0; i < this.provenComponents.length; i++) {
318
282
  await this.provenComponents[i].teardown();
319
283
  }
320
284
 
321
- // clean up the full prover node
322
- await this.proverNode.stop();
285
+ // Stop the prover node before destroying the BB singleton it proves with.
286
+ await this.proverAztecNode.stop();
323
287
 
288
+ await Barretenberg.destroySingleton();
324
289
  await this.bbConfigCleanup?.();
325
290
  await this.acvmConfigCleanup?.();
291
+
292
+ // Stops the chain monitor, the tracked nodes (main node + the already-stopped prover node, a
293
+ // safe no-op), and the context.
294
+ await super.teardown();
326
295
  }
327
296
 
328
- async applyMintSnapshot() {
329
- await this.snapshotManager.snapshot(
330
- 'mint',
331
- async () => {
332
- const { fakeProofsAsset: asset, accounts } = this;
333
- const privateAmount = 10000n;
334
- const publicAmount = 10000n;
335
-
336
- this.logger.verbose(`Minting ${privateAmount + publicAmount} publicly...`);
337
- await asset.methods
338
- .mint_to_public(accounts[0], privateAmount + publicAmount)
339
- .send({ from: accounts[0] })
340
- .wait();
341
-
342
- this.logger.verbose(`Transferring ${privateAmount} to private...`);
343
- await asset.methods.transfer_to_private(accounts[0], privateAmount).send({ from: accounts[0] }).wait();
344
-
345
- this.logger.verbose(`Minting complete.`);
346
-
347
- return { amount: publicAmount };
348
- },
349
- async ({ amount }) => {
350
- const {
351
- fakeProofsAsset: asset,
352
- accounts: [address],
353
- tokenSim,
354
- } = this;
355
- tokenSim.mintPublic(address, amount);
356
-
357
- const publicBalance = await asset.methods.balance_of_public(address).simulate({ from: address });
358
- this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
359
- expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(address));
360
-
361
- tokenSim.mintPrivate(address, amount);
362
- const privateBalance = await asset.methods.balance_of_private(address).simulate({ from: address });
363
- this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
364
- expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(address));
365
-
366
- const totalSupply = await asset.methods.total_supply().simulate({ from: address });
367
- this.logger.verbose(`Total supply: ${totalSupply}`);
368
- expect(totalSupply).toEqual(tokenSim.totalSupply);
369
-
370
- return Promise.resolve();
371
- },
372
- );
297
+ private async applyMint() {
298
+ this.logger.info('Applying mint setup');
299
+ const { fakeProofsAsset: asset, accounts } = this;
300
+ const privateAmount = 10000n;
301
+ const publicAmount = 10000n;
302
+
303
+ this.logger.verbose(`Minting ${privateAmount + publicAmount} publicly...`);
304
+ await asset.methods.mint_to_public(accounts[0], privateAmount + publicAmount).send({ from: accounts[0] });
305
+
306
+ this.logger.verbose(`Transferring ${privateAmount} to private...`);
307
+ await asset.methods.transfer_to_private(accounts[0], privateAmount).send({ from: accounts[0] });
308
+
309
+ this.logger.info(`Minting complete`);
310
+
311
+ const {
312
+ fakeProofsAsset,
313
+ accounts: [address],
314
+ tokenSim,
315
+ } = this;
316
+ tokenSim.mintPublic(address, publicAmount);
317
+
318
+ const { result: publicBalance } = await fakeProofsAsset.methods
319
+ .balance_of_public(address)
320
+ .simulate({ from: address });
321
+ this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
322
+ expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(address));
323
+
324
+ tokenSim.mintPrivate(address, publicAmount);
325
+ const { result: privateBalance } = await fakeProofsAsset.methods
326
+ .balance_of_private(address)
327
+ .simulate({ from: address });
328
+ this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
329
+ expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(address));
330
+
331
+ const { result: totalSupply } = await fakeProofsAsset.methods.total_supply().simulate({ from: address });
332
+ this.logger.verbose(`Total supply: ${totalSupply}`);
333
+ expect(totalSupply).toEqual(tokenSim.totalSupply);
373
334
  }
374
335
  }
@@ -0,0 +1,126 @@
1
+ import { appendFileSync } from 'node:fs';
2
+ import { type EventLoopUtilization, type IntervalHistogram, monitorEventLoopDelay, performance } from 'node:perf_hooks';
3
+
4
+ const NANOS_PER_MS = 1_000_000;
5
+
6
+ /** Samples event-loop utilization, delay histogram, and heap usage per test, writing columnar text to a file. */
7
+ export class EluMonitor {
8
+ private filePath: string;
9
+ private intervalMs: number;
10
+ private timer: ReturnType<typeof setInterval> | undefined;
11
+ private lastELU: EventLoopUtilization | undefined;
12
+ private histogram: IntervalHistogram;
13
+ private testName: string | undefined;
14
+ private testStart: number | undefined;
15
+ private eluSamples: number[] = [];
16
+
17
+ constructor(filePath: string, intervalMs?: number) {
18
+ this.filePath = filePath;
19
+ this.intervalMs = intervalMs ?? 2000;
20
+ this.histogram = monitorEventLoopDelay({ resolution: 20 });
21
+ }
22
+
23
+ /** Begin sampling for a test. Writes a header line and starts the periodic sampler. */
24
+ startTest(testName: string): void {
25
+ this.stopTest();
26
+
27
+ this.testName = testName;
28
+ this.testStart = performance.now();
29
+ this.eluSamples = [];
30
+
31
+ appendFileSync(this.filePath, `\n=== Test: ${testName} ===\n`);
32
+ appendFileSync(
33
+ this.filePath,
34
+ padColumns('TIME', 'ELU', 'EL_DLY_P50', 'EL_DLY_P99', 'EL_DLY_MAX', 'HEAP_MB') + '\n',
35
+ );
36
+
37
+ this.lastELU = performance.eventLoopUtilization();
38
+ this.histogram.enable();
39
+
40
+ this.timer = setInterval(() => this.sample(), this.intervalMs);
41
+ // Allow the process to exit even if the timer is still running.
42
+ this.timer.unref();
43
+ }
44
+
45
+ /** Stop sampling and write a summary line. */
46
+ stopTest(): void {
47
+ if (!this.timer) {
48
+ return;
49
+ }
50
+
51
+ // Take a final sample before stopping.
52
+ this.sample();
53
+
54
+ clearInterval(this.timer);
55
+ this.timer = undefined;
56
+ this.histogram.disable();
57
+ this.histogram.reset();
58
+
59
+ this.writeSummary();
60
+
61
+ this.lastELU = undefined;
62
+ this.testName = undefined;
63
+ this.testStart = undefined;
64
+ this.eluSamples = [];
65
+ }
66
+
67
+ /** Alias for stopTest — call on process exit to flush any remaining data. */
68
+ stop(): void {
69
+ this.stopTest();
70
+ }
71
+
72
+ private sample(): void {
73
+ const newELU = performance.eventLoopUtilization();
74
+ const delta = performance.eventLoopUtilization(newELU, this.lastELU);
75
+ this.lastELU = newELU;
76
+
77
+ const elu = delta.utilization;
78
+ this.eluSamples.push(elu);
79
+
80
+ const p50 = this.histogram.percentile(50) / NANOS_PER_MS;
81
+ const p99 = this.histogram.percentile(99) / NANOS_PER_MS;
82
+ const max = this.histogram.max / NANOS_PER_MS;
83
+ const heapMb = Math.round(process.memoryUsage().heapUsed / (1024 * 1024));
84
+
85
+ const now = new Date();
86
+ const time = [now.getHours(), now.getMinutes(), now.getSeconds()].map(n => String(n).padStart(2, '0')).join(':');
87
+
88
+ const line = padColumns(
89
+ time,
90
+ elu.toFixed(2),
91
+ `${p50.toFixed(1)}ms`,
92
+ `${p99.toFixed(1)}ms`,
93
+ `${max.toFixed(1)}ms`,
94
+ String(heapMb),
95
+ );
96
+ appendFileSync(this.filePath, line + '\n');
97
+
98
+ // Reset histogram so next sample only reflects the new interval.
99
+ this.histogram.reset();
100
+ }
101
+
102
+ private writeSummary(): void {
103
+ if (this.eluSamples.length === 0 || this.testStart === undefined) {
104
+ return;
105
+ }
106
+
107
+ const mean = this.eluSamples.reduce((a, b) => a + b, 0) / this.eluSamples.length;
108
+ const maxElu = Math.max(...this.eluSamples);
109
+ const sorted = [...this.eluSamples].sort((a, b) => a - b);
110
+ const p90Elu = sorted[Math.floor(sorted.length * 0.9)] ?? maxElu;
111
+ const durationS = ((performance.now() - this.testStart) / 1000).toFixed(1);
112
+
113
+ let summary = `--- Summary: mean_elu=${mean.toFixed(2)} max_elu=${maxElu.toFixed(2)} p90_elu=${p90Elu.toFixed(2)} duration=${durationS}s`;
114
+ if (maxElu > 0.85) {
115
+ summary += ' WARNING:ELU>0.85';
116
+ }
117
+ summary += ' ---\n';
118
+
119
+ appendFileSync(this.filePath, summary);
120
+ }
121
+ }
122
+
123
+ function padColumns(...cols: string[]): string {
124
+ const widths = [11, 7, 12, 12, 12, 8];
125
+ return cols.map((col, i) => col.padEnd(widths[i] ?? 10)).join('');
126
+ }