@aztec/end-to-end 0.0.1-commit.d431d1c → 0.0.1-commit.d58ff9d0

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 (366) 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/interactive_handshake_responder.d.ts +48 -0
  12. package/dest/automine/delivery/interactive_handshake_responder.d.ts.map +1 -0
  13. package/dest/automine/delivery/interactive_handshake_responder.js +76 -0
  14. package/dest/automine/delivery/onchain_delivery_harness.d.ts +19 -0
  15. package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -0
  16. package/dest/automine/delivery/onchain_delivery_harness.js +141 -0
  17. package/dest/automine/token/blacklist_token_contract_test.d.ts +49 -0
  18. package/dest/automine/token/blacklist_token_contract_test.d.ts.map +1 -0
  19. package/dest/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.js +50 -54
  20. package/dest/automine/token/token_contract_test.d.ts +40 -0
  21. package/dest/automine/token/token_contract_test.d.ts.map +1 -0
  22. package/dest/{e2e_token_contract → automine/token}/token_contract_test.js +44 -49
  23. package/dest/automine/token/token_test_helpers.d.ts +73 -0
  24. package/dest/automine/token/token_test_helpers.d.ts.map +1 -0
  25. package/dest/automine/token/token_test_helpers.js +97 -0
  26. package/dest/bench/client_flows/benchmark.d.ts +15 -1
  27. package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
  28. package/dest/bench/client_flows/benchmark.js +19 -0
  29. package/dest/bench/client_flows/client_flows_benchmark.d.ts +6 -6
  30. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  31. package/dest/bench/client_flows/client_flows_benchmark.js +68 -44
  32. package/dest/bench/client_flows/config.d.ts +2 -2
  33. package/dest/bench/client_flows/config.d.ts.map +1 -1
  34. package/dest/bench/client_flows/config.js +18 -0
  35. package/dest/bench/client_flows/data_extractor.js +1 -0
  36. package/dest/bench/utils.d.ts +7 -6
  37. package/dest/bench/utils.d.ts.map +1 -1
  38. package/dest/bench/utils.js +108 -12
  39. package/dest/composed/ha/ha_full_setup.d.ts +77 -0
  40. package/dest/composed/ha/ha_full_setup.d.ts.map +1 -0
  41. package/dest/composed/ha/ha_full_setup.js +383 -0
  42. package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts +12 -0
  43. package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts.map +1 -0
  44. package/dest/fixtures/authwit_proxy.d.ts +15 -0
  45. package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
  46. package/dest/fixtures/authwit_proxy.js +34 -0
  47. package/dest/fixtures/e2e_prover_test.d.ts +18 -14
  48. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  49. package/dest/fixtures/e2e_prover_test.js +85 -74
  50. package/dest/fixtures/elu_monitor.d.ts +21 -0
  51. package/dest/fixtures/elu_monitor.d.ts.map +1 -0
  52. package/dest/fixtures/elu_monitor.js +102 -0
  53. package/dest/fixtures/fixtures.d.ts +83 -1
  54. package/dest/fixtures/fixtures.d.ts.map +1 -1
  55. package/dest/fixtures/fixtures.js +86 -0
  56. package/dest/fixtures/get_bb_config.d.ts +1 -1
  57. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  58. package/dest/fixtures/get_bb_config.js +5 -5
  59. package/dest/fixtures/ha_setup.d.ts +71 -0
  60. package/dest/fixtures/ha_setup.d.ts.map +1 -0
  61. package/dest/fixtures/ha_setup.js +119 -0
  62. package/dest/fixtures/index.d.ts +3 -1
  63. package/dest/fixtures/index.d.ts.map +1 -1
  64. package/dest/fixtures/index.js +2 -0
  65. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
  66. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
  67. package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
  68. package/dest/fixtures/setup.d.ts +113 -60
  69. package/dest/fixtures/setup.d.ts.map +1 -1
  70. package/dest/fixtures/setup.js +330 -326
  71. package/dest/fixtures/setup_p2p_test.d.ts +22 -11
  72. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  73. package/dest/fixtures/setup_p2p_test.js +46 -35
  74. package/dest/fixtures/timing.d.ts +42 -0
  75. package/dest/fixtures/timing.d.ts.map +1 -0
  76. package/dest/fixtures/timing.js +72 -0
  77. package/dest/fixtures/token_utils.d.ts +22 -4
  78. package/dest/fixtures/token_utils.d.ts.map +1 -1
  79. package/dest/fixtures/token_utils.js +28 -7
  80. package/dest/fixtures/utils.d.ts +2 -2
  81. package/dest/fixtures/utils.d.ts.map +1 -1
  82. package/dest/fixtures/utils.js +1 -1
  83. package/dest/fixtures/wait_helpers.d.ts +135 -0
  84. package/dest/fixtures/wait_helpers.d.ts.map +1 -0
  85. package/dest/fixtures/wait_helpers.js +154 -0
  86. package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
  87. package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
  88. package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
  89. package/dest/forward-compatibility/wallet_service.d.ts +3 -0
  90. package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
  91. package/dest/forward-compatibility/wallet_service.js +109 -0
  92. package/dest/install_legacy_contracts.d.cts +10 -0
  93. package/dest/install_legacy_contracts.d.cts.map +1 -0
  94. package/dest/legacy-jest-resolver.d.cts +3 -0
  95. package/dest/legacy-jest-resolver.d.cts.map +1 -0
  96. package/dest/multi-node/block-production/setup.d.ts +97 -0
  97. package/dest/multi-node/block-production/setup.d.ts.map +1 -0
  98. package/dest/multi-node/block-production/setup.js +158 -0
  99. package/dest/multi-node/governance/setup.d.ts +67 -0
  100. package/dest/multi-node/governance/setup.d.ts.map +1 -0
  101. package/dest/multi-node/governance/setup.js +126 -0
  102. package/dest/multi-node/multi_node_test_context.d.ts +212 -0
  103. package/dest/multi-node/multi_node_test_context.d.ts.map +1 -0
  104. package/dest/multi-node/multi_node_test_context.js +347 -0
  105. package/dest/multi-node/slashing/inactivity_setup.d.ts +27 -0
  106. package/dest/multi-node/slashing/inactivity_setup.d.ts.map +1 -0
  107. package/dest/multi-node/slashing/inactivity_setup.js +111 -0
  108. package/dest/multi-node/slashing/setup.d.ts +167 -0
  109. package/dest/multi-node/slashing/setup.d.ts.map +1 -0
  110. package/dest/multi-node/slashing/setup.js +275 -0
  111. package/dest/{e2e_p2p → p2p}/p2p_network.d.ts +22 -12
  112. package/dest/p2p/p2p_network.d.ts.map +1 -0
  113. package/dest/{e2e_p2p → p2p}/p2p_network.js +99 -35
  114. package/dest/p2p/reqresp/utils.d.ts +19 -0
  115. package/dest/p2p/reqresp/utils.d.ts.map +1 -0
  116. package/dest/p2p/reqresp/utils.js +193 -0
  117. package/dest/p2p/shared.d.ts +72 -0
  118. package/dest/p2p/shared.d.ts.map +1 -0
  119. package/dest/p2p/shared.js +212 -0
  120. package/dest/shared/cross_chain_test_harness.d.ts +8 -7
  121. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  122. package/dest/shared/cross_chain_test_harness.js +44 -39
  123. package/dest/shared/gas_portal_test_harness.d.ts +8 -5
  124. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  125. package/dest/shared/gas_portal_test_harness.js +27 -15
  126. package/dest/shared/index.d.ts +2 -1
  127. package/dest/shared/index.d.ts.map +1 -1
  128. package/dest/shared/index.js +1 -0
  129. package/dest/shared/jest_setup.js +41 -1
  130. package/dest/shared/mock_state_view.d.ts +86 -0
  131. package/dest/shared/mock_state_view.d.ts.map +1 -0
  132. package/dest/shared/mock_state_view.js +186 -0
  133. package/dest/shared/submit-transactions.d.ts +4 -4
  134. package/dest/shared/submit-transactions.d.ts.map +1 -1
  135. package/dest/shared/submit-transactions.js +19 -14
  136. package/dest/shared/timing_env.d.js +5 -0
  137. package/dest/shared/timing_env.js +365 -0
  138. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  139. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  140. package/dest/shared/uniswap_l1_l2.js +67 -55
  141. package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
  142. package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
  143. package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
  144. package/dest/simulators/lending_simulator.d.ts +10 -3
  145. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  146. package/dest/simulators/lending_simulator.js +29 -17
  147. package/dest/simulators/token_simulator.d.ts +1 -1
  148. package/dest/simulators/token_simulator.d.ts.map +1 -1
  149. package/dest/simulators/token_simulator.js +3 -24
  150. package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts +75 -0
  151. package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts.map +1 -0
  152. package/dest/single-node/cross-chain/cross_chain_messaging_test.js +209 -0
  153. package/dest/single-node/cross-chain/message_test_helpers.d.ts +38 -0
  154. package/dest/single-node/cross-chain/message_test_helpers.d.ts.map +1 -0
  155. package/dest/single-node/cross-chain/message_test_helpers.js +70 -0
  156. package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.d.ts +1 -1
  157. package/dest/single-node/fees/bridging_race.notest.d.ts.map +1 -0
  158. package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.js +18 -5
  159. package/dest/single-node/fees/fees_test.d.ts +93 -0
  160. package/dest/single-node/fees/fees_test.d.ts.map +1 -0
  161. package/dest/{e2e_fees → single-node/fees}/fees_test.js +96 -70
  162. package/dest/single-node/l1-reorgs/setup.d.ts +42 -0
  163. package/dest/single-node/l1-reorgs/setup.d.ts.map +1 -0
  164. package/dest/single-node/l1-reorgs/setup.js +57 -0
  165. package/dest/single-node/partial-proofs/setup.d.ts +5 -0
  166. package/dest/single-node/partial-proofs/setup.d.ts.map +1 -0
  167. package/dest/single-node/partial-proofs/setup.js +5 -0
  168. package/dest/single-node/proving/setup.d.ts +5 -0
  169. package/dest/single-node/proving/setup.d.ts.map +1 -0
  170. package/dest/single-node/proving/setup.js +5 -0
  171. package/dest/single-node/recovery/setup.d.ts +5 -0
  172. package/dest/single-node/recovery/setup.d.ts.map +1 -0
  173. package/dest/single-node/recovery/setup.js +5 -0
  174. package/dest/single-node/setup.d.ts +49 -0
  175. package/dest/single-node/setup.d.ts.map +1 -0
  176. package/dest/single-node/setup.js +56 -0
  177. package/dest/single-node/single_node_test_context.d.ts +360 -0
  178. package/dest/single-node/single_node_test_context.d.ts.map +1 -0
  179. package/dest/single-node/single_node_test_context.js +833 -0
  180. package/dest/spartan/setup_test_wallets.d.ts +12 -3
  181. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  182. package/dest/spartan/setup_test_wallets.js +153 -49
  183. package/dest/spartan/tx_metrics.d.ts +64 -5
  184. package/dest/spartan/tx_metrics.d.ts.map +1 -1
  185. package/dest/spartan/tx_metrics.js +280 -21
  186. package/dest/spartan/utils/bot.d.ts +28 -0
  187. package/dest/spartan/utils/bot.d.ts.map +1 -0
  188. package/dest/spartan/utils/bot.js +142 -0
  189. package/dest/spartan/utils/chaos.d.ts +79 -0
  190. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  191. package/dest/spartan/utils/chaos.js +142 -0
  192. package/dest/spartan/utils/clients.d.ts +39 -0
  193. package/dest/spartan/utils/clients.d.ts.map +1 -0
  194. package/dest/spartan/utils/clients.js +90 -0
  195. package/dest/spartan/utils/config.d.ts +19 -0
  196. package/dest/spartan/utils/config.d.ts.map +1 -0
  197. package/dest/spartan/utils/config.js +23 -0
  198. package/dest/spartan/utils/health.d.ts +63 -0
  199. package/dest/spartan/utils/health.d.ts.map +1 -0
  200. package/dest/spartan/utils/health.js +202 -0
  201. package/dest/spartan/utils/helm.d.ts +15 -0
  202. package/dest/spartan/utils/helm.d.ts.map +1 -0
  203. package/dest/spartan/utils/helm.js +47 -0
  204. package/dest/spartan/utils/index.d.ts +11 -0
  205. package/dest/spartan/utils/index.d.ts.map +1 -0
  206. package/dest/spartan/utils/index.js +22 -0
  207. package/dest/spartan/utils/k8s.d.ts +128 -0
  208. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  209. package/dest/spartan/utils/k8s.js +381 -0
  210. package/dest/spartan/utils/nodes.d.ts +40 -0
  211. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  212. package/dest/spartan/utils/nodes.js +461 -0
  213. package/dest/spartan/utils/pod_logs.d.ts +25 -0
  214. package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
  215. package/dest/spartan/utils/pod_logs.js +74 -0
  216. package/dest/spartan/utils/scripts.d.ts +30 -0
  217. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  218. package/dest/spartan/utils/scripts.js +81 -0
  219. package/dest/spartan/utils.d.ts +2 -260
  220. package/dest/spartan/utils.d.ts.map +1 -1
  221. package/dest/spartan/utils.js +1 -942
  222. package/dest/test-wallet/test_wallet.d.ts +105 -0
  223. package/dest/test-wallet/test_wallet.d.ts.map +1 -0
  224. package/dest/test-wallet/test_wallet.js +320 -0
  225. package/dest/test-wallet/utils.d.ts +76 -0
  226. package/dest/test-wallet/utils.d.ts.map +1 -0
  227. package/dest/test-wallet/utils.js +126 -0
  228. package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
  229. package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
  230. package/dest/test-wallet/wallet_worker_script.js +56 -0
  231. package/dest/test-wallet/worker_wallet.d.ts +53 -0
  232. package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
  233. package/dest/test-wallet/worker_wallet.js +157 -0
  234. package/dest/test-wallet/worker_wallet_schema.d.ts +4 -0
  235. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
  236. package/dest/test-wallet/worker_wallet_schema.js +23 -0
  237. package/package.json +53 -46
  238. package/src/automine/README.md +60 -0
  239. package/src/automine/automine_test_context.ts +153 -0
  240. package/src/automine/contracts/fixtures/storage_proof.json +915 -0
  241. package/src/automine/contracts/fixtures/storage_proof_fetcher.ts +190 -0
  242. package/src/automine/contracts/fixtures/storage_proof_fixture.ts +173 -0
  243. package/src/automine/delivery/interactive_handshake_responder.ts +125 -0
  244. package/src/automine/delivery/onchain_delivery_harness.ts +213 -0
  245. package/src/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.ts +56 -69
  246. package/src/{e2e_token_contract → automine/token}/token_contract_test.ts +51 -59
  247. package/src/automine/token/token_test_helpers.ts +138 -0
  248. package/src/bench/client_flows/benchmark.ts +21 -0
  249. package/src/bench/client_flows/client_flows_benchmark.ts +111 -90
  250. package/src/bench/client_flows/config.ts +9 -1
  251. package/src/bench/client_flows/data_extractor.ts +1 -0
  252. package/src/bench/utils.ts +123 -12
  253. package/src/composed/ha/ha_full_setup.ts +466 -0
  254. package/src/fixtures/authwit_proxy.ts +54 -0
  255. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  256. package/src/fixtures/e2e_prover_test.ts +102 -103
  257. package/src/fixtures/elu_monitor.ts +126 -0
  258. package/src/fixtures/fixtures.ts +110 -0
  259. package/src/fixtures/get_bb_config.ts +7 -6
  260. package/src/fixtures/ha_setup.ts +192 -0
  261. package/src/fixtures/index.ts +2 -0
  262. package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
  263. package/src/fixtures/setup.ts +421 -444
  264. package/src/fixtures/setup_p2p_test.ts +54 -54
  265. package/src/fixtures/timing.ts +97 -0
  266. package/src/fixtures/token_utils.ts +46 -10
  267. package/src/fixtures/utils.ts +2 -3
  268. package/src/fixtures/wait_helpers.ts +333 -0
  269. package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
  270. package/src/forward-compatibility/wallet_service.ts +106 -0
  271. package/src/guides/up_quick_start.sh +7 -4
  272. package/src/infra/README.md +12 -0
  273. package/src/install_legacy_contracts.cjs +75 -0
  274. package/src/legacy-jest-resolver.cjs +112 -0
  275. package/src/multi-node/README.md +95 -0
  276. package/src/multi-node/block-production/setup.ts +272 -0
  277. package/src/multi-node/governance/setup.ts +172 -0
  278. package/src/multi-node/multi_node_test_context.ts +447 -0
  279. package/src/multi-node/slashing/inactivity_setup.ts +139 -0
  280. package/src/multi-node/slashing/setup.ts +433 -0
  281. package/src/p2p/README.md +78 -0
  282. package/src/{e2e_p2p → p2p}/p2p_network.ts +132 -57
  283. package/src/p2p/reqresp/utils.ts +263 -0
  284. package/src/p2p/shared.ts +329 -0
  285. package/src/shared/cross_chain_test_harness.ts +52 -41
  286. package/src/shared/gas_portal_test_harness.ts +34 -16
  287. package/src/shared/index.ts +1 -0
  288. package/src/shared/jest_setup.ts +51 -1
  289. package/src/shared/mock_state_view.ts +188 -0
  290. package/src/shared/submit-transactions.ts +22 -19
  291. package/src/shared/timing_env.d.mts +39 -0
  292. package/src/shared/timing_env.mjs +363 -0
  293. package/src/shared/uniswap_l1_l2.ts +109 -74
  294. package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
  295. package/src/simulators/lending_simulator.ts +35 -17
  296. package/src/simulators/token_simulator.ts +6 -30
  297. package/src/single-node/README.md +60 -0
  298. package/src/single-node/cross-chain/cross_chain_messaging_test.ts +302 -0
  299. package/src/single-node/cross-chain/message_test_helpers.ts +125 -0
  300. package/src/{e2e_fees → single-node/fees}/bridging_race.notest.ts +20 -9
  301. package/src/{e2e_fees → single-node/fees}/fees_test.ts +120 -95
  302. package/src/single-node/l1-reorgs/setup.ts +93 -0
  303. package/src/single-node/partial-proofs/setup.ts +8 -0
  304. package/src/single-node/proving/setup.ts +15 -0
  305. package/src/single-node/recovery/setup.ts +8 -0
  306. package/src/single-node/setup.ts +63 -0
  307. package/src/single-node/single_node_test_context.ts +1041 -0
  308. package/src/spartan/setup_test_wallets.ts +208 -34
  309. package/src/spartan/tx_metrics.ts +255 -26
  310. package/src/spartan/utils/bot.ts +188 -0
  311. package/src/spartan/utils/chaos.ts +253 -0
  312. package/src/spartan/utils/clients.ts +100 -0
  313. package/src/spartan/utils/config.ts +29 -0
  314. package/src/spartan/utils/health.ts +255 -0
  315. package/src/spartan/utils/helm.ts +84 -0
  316. package/src/spartan/utils/index.ts +71 -0
  317. package/src/spartan/utils/k8s.ts +535 -0
  318. package/src/spartan/utils/nodes.ts +543 -0
  319. package/src/spartan/utils/pod_logs.ts +99 -0
  320. package/src/spartan/utils/scripts.ts +99 -0
  321. package/src/spartan/utils.ts +1 -1246
  322. package/src/test-wallet/test_wallet.ts +426 -0
  323. package/src/test-wallet/utils.ts +205 -0
  324. package/src/test-wallet/wallet_worker_script.ts +66 -0
  325. package/src/test-wallet/worker_wallet.ts +216 -0
  326. package/src/test-wallet/worker_wallet_schema.ts +14 -0
  327. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +0 -53
  328. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +0 -1
  329. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -47
  330. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +0 -1
  331. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +0 -128
  332. package/dest/e2e_deploy_contract/deploy_test.d.ts +0 -37
  333. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +0 -1
  334. package/dest/e2e_deploy_contract/deploy_test.js +0 -50
  335. package/dest/e2e_epochs/epochs_test.d.ts +0 -94
  336. package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
  337. package/dest/e2e_epochs/epochs_test.js +0 -339
  338. package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
  339. package/dest/e2e_fees/fees_test.d.ts +0 -88
  340. package/dest/e2e_fees/fees_test.d.ts.map +0 -1
  341. package/dest/e2e_l1_publisher/write_json.d.ts +0 -10
  342. package/dest/e2e_l1_publisher/write_json.d.ts.map +0 -1
  343. package/dest/e2e_l1_publisher/write_json.js +0 -62
  344. package/dest/e2e_multi_validator/utils.d.ts +0 -12
  345. package/dest/e2e_multi_validator/utils.d.ts.map +0 -1
  346. package/dest/e2e_nested_contract/nested_contract_test.d.ts +0 -26
  347. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +0 -1
  348. package/dest/e2e_nested_contract/nested_contract_test.js +0 -56
  349. package/dest/e2e_p2p/inactivity_slash_test.d.ts +0 -31
  350. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +0 -1
  351. package/dest/e2e_p2p/inactivity_slash_test.js +0 -136
  352. package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
  353. package/dest/e2e_p2p/shared.d.ts +0 -46
  354. package/dest/e2e_p2p/shared.d.ts.map +0 -1
  355. package/dest/e2e_p2p/shared.js +0 -184
  356. package/dest/e2e_token_contract/token_contract_test.d.ts +0 -42
  357. package/dest/e2e_token_contract/token_contract_test.d.ts.map +0 -1
  358. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +0 -194
  359. package/src/e2e_deploy_contract/deploy_test.ts +0 -85
  360. package/src/e2e_epochs/epochs_test.ts +0 -451
  361. package/src/e2e_l1_publisher/write_json.ts +0 -82
  362. package/src/e2e_nested_contract/nested_contract_test.ts +0 -75
  363. package/src/e2e_p2p/inactivity_slash_test.ts +0 -179
  364. package/src/e2e_p2p/shared.ts +0 -290
  365. /package/dest/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js} +0 -0
  366. /package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts} +0 -0
@@ -1,8 +1,90 @@
1
+ import type { AztecNode } from '@aztec/aztec.js/node';
2
+ import type { GasFees } from '@aztec/stdlib/gas';
1
3
  export declare const METRICS_PORT = 4318;
4
+ /** Default fee padding applied to predicted min fees in e2e tests. */
5
+ export declare const DEFAULT_MIN_FEE_PADDING = 5;
6
+ /**
7
+ * Large fee padding for txs that may be mined significantly later than when they were created,
8
+ * such as cloned txs in throughput/capacity benchmarks, where fees may spike between creation and mining.
9
+ */
10
+ export declare const LARGE_MIN_FEE_PADDING = 15;
11
+ /**
12
+ * Fee padding used by tests running under proposer pipelining. Under pipelining the fee-asset
13
+ * price modifier evolves faster across the build/publish gap, so client-set maxFeesPerGas (sized
14
+ * for the default 5x padding) was getting bumped past by the time the tx mined a few slots later.
15
+ * Observed worst case in CI: fee evolved ~20x between PXE snapshot and inclusion, exceeding even
16
+ * LARGE_MIN_FEE_PADDING (15x). Same multiplier and same class of problem as the published
17
+ * {@link TEST_FEE_PADDING}, re-exported under a name that captures the pipelining rationale.
18
+ */
19
+ export declare const PIPELINED_FEE_PADDING = 30;
20
+ /**
21
+ * Setup option preset that opts a test into proposer pipelining. Use with `setup()`:
22
+ *
23
+ * await setup(N, { ...PIPELINING_SETUP_OPTS, ...otherOpts });
24
+ *
25
+ * The preset runs the production Sequencer with the always-enforced timetable at real (wall-clock)
26
+ * timing, yielding exactly 2 blocks per slot. It sets:
27
+ * - `inboxLag: 2` so the sequencer sources L1->L2 messages from checkpoint N-1 (already sealed),
28
+ * avoiding `L1ToL2MessagesNotReadyError` when building for slot N during slot N-1.
29
+ * - `minTxsPerBlock: 0` so empty checkpoints land even when a tx arrives late in the build window
30
+ * (otherwise the chain stalls on alternating slots).
31
+ * - `aztecSlotDuration: 12` / `ethereumSlotDuration: 4` so the pipelined cycle fits inside the
32
+ * default 300s Jest hook budget. Tests that depend on the env-default 72s/12s should override.
33
+ * - `blockDurationMs: 3000` to cut exactly 2 blocks per slot. With `ethereumSlotDuration < 8` the
34
+ * timing model normalizes to `init=0.5`, `assemble=0.5`, `P=0`, `minExec=1`, so
35
+ * `maxBlocks = floor((S - init - (assemble + 2P + D)) / D) = floor((12 - 0.5 - (0.5 + 0 + 3)) / 3)
36
+ * = floor(8/3) = 2`. (`blockDurationMs: 2000` would give 4 blocks/slot; 3000 also matches the
37
+ * production default.)
38
+ * - `walletMinFeePadding: PIPELINED_FEE_PADDING` (30x) to absorb the wider fee evolution window.
39
+ */
40
+ export declare const PIPELINING_SETUP_OPTS: {
41
+ readonly inboxLag: 2;
42
+ readonly minTxsPerBlock: 0;
43
+ readonly aztecSlotDuration: 12;
44
+ readonly ethereumSlotDuration: 4;
45
+ readonly blockDurationMs: 3000;
46
+ readonly walletMinFeePadding: 30;
47
+ };
48
+ /**
49
+ * Setup option preset that opts a test into the deterministic AutomineSequencer path.
50
+ * Use only for single-sequencer tests that don't exercise block-building or consensus
51
+ * (e.g. e2e_token, e2e_amm, e2e_authwit). Not compatible with `p2p/*`,
52
+ * `multi-node/*`, `e2e_block_building`, or any multi-validator suite.
53
+ *
54
+ * await setup(N, { ...AUTOMINE_E2E_OPTS, ...otherOpts });
55
+ *
56
+ * The preset:
57
+ * - Swaps the production Sequencer for an AutomineSequencer that builds one block per
58
+ * submitted tx, publishes synchronously to L1, and owns all time control through a
59
+ * serial queue (see `sequencer-client/src/sequencer/automine/automine_sequencer.ts`).
60
+ * - Disables the validator client (the AutomineSequencer needs none).
61
+ * - Uses `inboxLag: 1` (synchronous) since the AutomineSequencer publishes one block per tx.
62
+ * - Runs anvil at a 4s interval (`ethereumSlotDuration: 4`); at runtime the AutomineSequencer
63
+ * flips anvil into automine so each submitted tx mines its L1 block immediately. Initial L1
64
+ * contract deployment (which runs before the sequencer starts) is mined immediately too via the
65
+ * global `automineL1Setup` default in `setup()`, instead of stalling on the 4s interval.
66
+ *
67
+ * Requires `aztecTargetCommitteeSize: 0`, which is the e2e default at `setup.ts:317`.
68
+ */
69
+ export declare const AUTOMINE_E2E_OPTS: {
70
+ readonly useAutomineSequencer: true;
71
+ readonly inboxLag: 1;
72
+ readonly minTxsPerBlock: 0;
73
+ readonly aztecSlotDuration: 12;
74
+ readonly ethereumSlotDuration: 4;
75
+ readonly walletMinFeePadding: 30;
76
+ };
77
+ /** Returns worst-case predicted min fees with padding applied, mirroring the BaseWallet pattern. */
78
+ export declare function getPaddedMaxFeesPerGas(node: AztecNode, padding?: number): Promise<GasFees>;
2
79
  export declare const shouldCollectMetrics: () => 4318 | undefined;
80
+ /** Returns the boot node UDP port from environment variable or default value. */
81
+ export declare function getBootNodeUdpPort(): number;
82
+ /** Returns the anvil port from environment variable or default value. */
83
+ export declare function getAnvilPort(): number;
3
84
  export declare const TEST_PEER_CHECK_INTERVAL_MS = 1000;
4
85
  export declare const TEST_MAX_PENDING_TX_POOL_COUNT = 10000;
5
86
  export declare const MNEMONIC = "test test test test test test test test test test test junk";
87
+ export declare const L1_DIRECT_WRITE_ACCOUNT_INDEX = 1;
6
88
  export declare const privateKey: Buffer<ArrayBuffer>;
7
89
  export declare const privateKey2: Buffer<ArrayBuffer>;
8
90
  export declare const U128_UNDERFLOW_ERROR = "Assertion failed: attempt to subtract with overflow";
@@ -12,4 +94,4 @@ export declare const DUPLICATE_NULLIFIER_ERROR: RegExp;
12
94
  export declare const NO_L1_TO_L2_MSG_ERROR: RegExp;
13
95
  export declare const STATIC_CALL_STATE_MODIFICATION_ERROR: RegExp;
14
96
  export declare const STATIC_CONTEXT_ASSERTION_ERROR: RegExp;
15
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZml4dHVyZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maXh0dXJlcy9maXh0dXJlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxlQUFPLE1BQU0sWUFBWSxPQUFPLENBQUM7QUFFakMsZUFBTyxNQUFNLG9CQUFvQix3QkFLaEMsQ0FBQztBQUVGLGVBQU8sTUFBTSwyQkFBMkIsT0FBTyxDQUFDO0FBQ2hELGVBQU8sTUFBTSw4QkFBOEIsUUFBUyxDQUFDO0FBRX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"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/fixtures/fixtures.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC,eAAO,MAAM,oBAAoB,wBAKhC,CAAC;AAEF,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAChD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AAErD,eAAO,MAAM,QAAQ,gEAAgE,CAAC;AACtF,eAAO,MAAM,UAAU,qBAAyF,CAAC;AACjH,eAAO,MAAM,WAAW,qBAAyF,CAAC;AAGlH,eAAO,MAAM,oBAAoB,wDAAwD,CAAC;AAC1F,eAAO,MAAM,mBAAmB,mDAAmD,CAAC;AACpF,eAAO,MAAM,qBAAqB,+EAA+E,CAAC;AAElH,eAAO,MAAM,yBAAyB,QAAgC,CAAC;AACvE,eAAO,MAAM,qBAAqB,QACwE,CAAC;AAC3G,eAAO,MAAM,oCAAoC,QAA0C,CAAC;AAC5F,eAAO,MAAM,8BAA8B,QAAkE,CAAC"}
1
+ {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/fixtures/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC,sEAAsE;AACtE,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,KAAmB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,qBAAqB;;;;;;;CAOxB,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,iBAAiB;;;;;;;CAOpB,CAAC;AAEX,oGAAoG;AACpG,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,SAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAOjH;AAED,eAAO,MAAM,oBAAoB,wBAKhC,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,yEAAyE;AACzE,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAChD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AAErD,eAAO,MAAM,QAAQ,gEAAgE,CAAC;AAOtF,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAE/C,eAAO,MAAM,UAAU,qBAAyF,CAAC;AACjH,eAAO,MAAM,WAAW,qBAAyF,CAAC;AAGlH,eAAO,MAAM,oBAAoB,wDAAwD,CAAC;AAC1F,eAAO,MAAM,mBAAmB,mDAAmD,CAAC;AACpF,eAAO,MAAM,qBAAqB,+EAA+E,CAAC;AAElH,eAAO,MAAM,yBAAyB,QAAgC,CAAC;AACvE,eAAO,MAAM,qBAAqB,QACwE,CAAC;AAC3G,eAAO,MAAM,oCAAoC,QAA0C,CAAC;AAC5F,eAAO,MAAM,8BAA8B,QAAkE,CAAC"}
@@ -1,13 +1,99 @@
1
+ import { TEST_FEE_PADDING } from '@aztec/aztec/testing';
1
2
  export const METRICS_PORT = 4318;
3
+ /** Default fee padding applied to predicted min fees in e2e tests. */ export const DEFAULT_MIN_FEE_PADDING = 5;
4
+ /**
5
+ * Large fee padding for txs that may be mined significantly later than when they were created,
6
+ * such as cloned txs in throughput/capacity benchmarks, where fees may spike between creation and mining.
7
+ */ export const LARGE_MIN_FEE_PADDING = 15;
8
+ /**
9
+ * Fee padding used by tests running under proposer pipelining. Under pipelining the fee-asset
10
+ * price modifier evolves faster across the build/publish gap, so client-set maxFeesPerGas (sized
11
+ * for the default 5x padding) was getting bumped past by the time the tx mined a few slots later.
12
+ * Observed worst case in CI: fee evolved ~20x between PXE snapshot and inclusion, exceeding even
13
+ * LARGE_MIN_FEE_PADDING (15x). Same multiplier and same class of problem as the published
14
+ * {@link TEST_FEE_PADDING}, re-exported under a name that captures the pipelining rationale.
15
+ */ export const PIPELINED_FEE_PADDING = TEST_FEE_PADDING;
16
+ /**
17
+ * Setup option preset that opts a test into proposer pipelining. Use with `setup()`:
18
+ *
19
+ * await setup(N, { ...PIPELINING_SETUP_OPTS, ...otherOpts });
20
+ *
21
+ * The preset runs the production Sequencer with the always-enforced timetable at real (wall-clock)
22
+ * timing, yielding exactly 2 blocks per slot. It sets:
23
+ * - `inboxLag: 2` so the sequencer sources L1->L2 messages from checkpoint N-1 (already sealed),
24
+ * avoiding `L1ToL2MessagesNotReadyError` when building for slot N during slot N-1.
25
+ * - `minTxsPerBlock: 0` so empty checkpoints land even when a tx arrives late in the build window
26
+ * (otherwise the chain stalls on alternating slots).
27
+ * - `aztecSlotDuration: 12` / `ethereumSlotDuration: 4` so the pipelined cycle fits inside the
28
+ * default 300s Jest hook budget. Tests that depend on the env-default 72s/12s should override.
29
+ * - `blockDurationMs: 3000` to cut exactly 2 blocks per slot. With `ethereumSlotDuration < 8` the
30
+ * timing model normalizes to `init=0.5`, `assemble=0.5`, `P=0`, `minExec=1`, so
31
+ * `maxBlocks = floor((S - init - (assemble + 2P + D)) / D) = floor((12 - 0.5 - (0.5 + 0 + 3)) / 3)
32
+ * = floor(8/3) = 2`. (`blockDurationMs: 2000` would give 4 blocks/slot; 3000 also matches the
33
+ * production default.)
34
+ * - `walletMinFeePadding: PIPELINED_FEE_PADDING` (30x) to absorb the wider fee evolution window.
35
+ */ export const PIPELINING_SETUP_OPTS = {
36
+ inboxLag: 2,
37
+ minTxsPerBlock: 0,
38
+ aztecSlotDuration: 12,
39
+ ethereumSlotDuration: 4,
40
+ blockDurationMs: 3000,
41
+ walletMinFeePadding: PIPELINED_FEE_PADDING
42
+ };
43
+ /**
44
+ * Setup option preset that opts a test into the deterministic AutomineSequencer path.
45
+ * Use only for single-sequencer tests that don't exercise block-building or consensus
46
+ * (e.g. e2e_token, e2e_amm, e2e_authwit). Not compatible with `p2p/*`,
47
+ * `multi-node/*`, `e2e_block_building`, or any multi-validator suite.
48
+ *
49
+ * await setup(N, { ...AUTOMINE_E2E_OPTS, ...otherOpts });
50
+ *
51
+ * The preset:
52
+ * - Swaps the production Sequencer for an AutomineSequencer that builds one block per
53
+ * submitted tx, publishes synchronously to L1, and owns all time control through a
54
+ * serial queue (see `sequencer-client/src/sequencer/automine/automine_sequencer.ts`).
55
+ * - Disables the validator client (the AutomineSequencer needs none).
56
+ * - Uses `inboxLag: 1` (synchronous) since the AutomineSequencer publishes one block per tx.
57
+ * - Runs anvil at a 4s interval (`ethereumSlotDuration: 4`); at runtime the AutomineSequencer
58
+ * flips anvil into automine so each submitted tx mines its L1 block immediately. Initial L1
59
+ * contract deployment (which runs before the sequencer starts) is mined immediately too via the
60
+ * global `automineL1Setup` default in `setup()`, instead of stalling on the 4s interval.
61
+ *
62
+ * Requires `aztecTargetCommitteeSize: 0`, which is the e2e default at `setup.ts:317`.
63
+ */ export const AUTOMINE_E2E_OPTS = {
64
+ useAutomineSequencer: true,
65
+ inboxLag: 1,
66
+ minTxsPerBlock: 0,
67
+ aztecSlotDuration: 12,
68
+ ethereumSlotDuration: 4,
69
+ walletMinFeePadding: TEST_FEE_PADDING
70
+ };
71
+ /** Returns worst-case predicted min fees with padding applied, mirroring the BaseWallet pattern. */ export async function getPaddedMaxFeesPerGas(node, padding = DEFAULT_MIN_FEE_PADDING) {
72
+ const predicted = await node.getPredictedMinFees();
73
+ const worstCase = predicted.length > 0 ? predicted.reduce((worst, fees)=>fees.feePerL2Gas > worst.feePerL2Gas ? fees : worst) : await node.getCurrentMinFees();
74
+ return worstCase.mul(1 + padding);
75
+ }
2
76
  export const shouldCollectMetrics = ()=>{
3
77
  if (process.env.COLLECT_METRICS) {
4
78
  return METRICS_PORT;
5
79
  }
6
80
  return undefined;
7
81
  };
82
+ /** Returns the boot node UDP port from environment variable or default value. */ export function getBootNodeUdpPort() {
83
+ return process.env.BOOT_NODE_UDP_PORT ? parseInt(process.env.BOOT_NODE_UDP_PORT, 10) : 4500;
84
+ }
85
+ /** Returns the anvil port from environment variable or default value. */ export function getAnvilPort() {
86
+ return process.env.ANVIL_PORT ? parseInt(process.env.ANVIL_PORT, 10) : 8545;
87
+ }
8
88
  export const TEST_PEER_CHECK_INTERVAL_MS = 1000;
9
89
  export const TEST_MAX_PENDING_TX_POOL_COUNT = 10_000; // Number of max pending TXs ~ 1.56GB
10
90
  export const MNEMONIC = 'test test test test test test test test test test test junk';
91
+ // Mnemonic account index for tests that issue direct L1 writes (e.g. bridging fee juice) while a
92
+ // sequencer is running. The deployer/sequencer publisher uses index 0, the prover index 2, and
93
+ // validators index 3+. Test-side viem writes and the publisher's l1-tx-utils track nonces
94
+ // independently, so sharing an account causes "replacement transaction underpriced" races; index 1
95
+ // is otherwise unused, so issuing those writes from it keeps them off the publisher's nonce stream.
96
+ export const L1_DIRECT_WRITE_ACCOUNT_INDEX = 1;
11
97
  export const privateKey = Buffer.from('ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', 'hex');
12
98
  export const privateKey2 = Buffer.from('59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', 'hex');
13
99
  /// Common errors
@@ -3,4 +3,4 @@ import type { BBConfig } from '@aztec/bb-prover';
3
3
  export declare const getBBConfig: (logger: Logger) => Promise<(BBConfig & {
4
4
  cleanup: () => Promise<void>;
5
5
  }) | undefined>;
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2JiX2NvbmZpZy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ZpeHR1cmVzL2dldF9iYl9jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDbEQsT0FBTyxLQUFLLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFrQmpELGVBQU8sTUFBTSxXQUFXOztlQXVDdkIsQ0FBQyJ9
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2JiX2NvbmZpZy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ZpeHR1cmVzL2dldF9iYl9jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDbEQsT0FBTyxLQUFLLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFvQmpELGVBQU8sTUFBTSxXQUFXOztlQXNDdkIsQ0FBQyJ9
@@ -1 +1 @@
1
- {"version":3,"file":"get_bb_config.d.ts","sourceRoot":"","sources":["../../src/fixtures/get_bb_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAkBjD,eAAO,MAAM,WAAW;;eAuCvB,CAAC"}
1
+ {"version":3,"file":"get_bb_config.d.ts","sourceRoot":"","sources":["../../src/fixtures/get_bb_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAoBjD,eAAO,MAAM,WAAW;;eAsCvB,CAAC"}
@@ -3,7 +3,7 @@ import fs from 'node:fs/promises';
3
3
  import { tmpdir } from 'node:os';
4
4
  import path from 'path';
5
5
  import { fileURLToPath } from 'url';
6
- const { BB_RELEASE_DIR = 'barretenberg/cpp/build/bin', BB_BINARY_PATH, BB_SKIP_CLEANUP = '', TEMP_DIR = tmpdir(), BB_WORKING_DIRECTORY = '', BB_NUM_IVC_VERIFIERS = '1', BB_IVC_CONCURRENCY = '1' } = process.env;
6
+ const { BB_RELEASE_DIR = 'barretenberg/cpp/build/bin', BB_BINARY_PATH, BB_SKIP_CLEANUP = '', TEMP_DIR = tmpdir(), BB_WORKING_DIRECTORY = '', BB_NUM_IVC_VERIFIERS = '8', BB_IVC_CONCURRENCY = '1', BB_CHONK_VERIFY_MAX_BATCH = '16', BB_CHONK_VERIFY_BATCH_CONCURRENCY = '6' } = process.env;
7
7
  export const getBBConfig = async (logger)=>{
8
8
  try {
9
9
  const bbBinaryPath = BB_BINARY_PATH ?? path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../', BB_RELEASE_DIR, 'bb-avm');
@@ -24,15 +24,15 @@ export const getBBConfig = async (logger)=>{
24
24
  'true'
25
25
  ].includes(BB_SKIP_CLEANUP);
26
26
  const cleanup = bbSkipCleanup ? ()=>Promise.resolve() : ()=>tryRmDir(directoryToCleanup);
27
- const numIvcVerifiers = Number(BB_NUM_IVC_VERIFIERS);
28
- const ivcConcurrency = Number(BB_IVC_CONCURRENCY);
29
27
  return {
30
28
  bbSkipCleanup,
31
29
  bbBinaryPath,
32
30
  bbWorkingDirectory,
33
31
  cleanup,
34
- numConcurrentIVCVerifiers: numIvcVerifiers,
35
- bbIVCConcurrency: ivcConcurrency
32
+ numConcurrentIVCVerifiers: Number(BB_NUM_IVC_VERIFIERS),
33
+ bbIVCConcurrency: Number(BB_IVC_CONCURRENCY),
34
+ bbChonkVerifyMaxBatch: Number(BB_CHONK_VERIFY_MAX_BATCH),
35
+ bbChonkVerifyConcurrency: Number(BB_CHONK_VERIFY_BATCH_CONCURRENCY)
36
36
  };
37
37
  } catch (err) {
38
38
  logger.error(`Native BB not available, error: ${err}`);
@@ -0,0 +1,71 @@
1
+ import { EthAddress } from '@aztec/aztec.js/addresses';
2
+ import type { Logger } from '@aztec/aztec.js/log';
3
+ import { SecretValue } from '@aztec/foundation/config';
4
+ import { Pool } from 'pg';
5
+ /**
6
+ * Configuration for HA database connection
7
+ */
8
+ export interface HADatabaseConfig {
9
+ /** PostgreSQL connection URL */
10
+ databaseUrl: SecretValue<string>;
11
+ /** Node ID for HA coordination */
12
+ nodeId: string;
13
+ /** Enable HA signing */
14
+ haSigningEnabled: boolean;
15
+ /** Polling interval in ms */
16
+ pollingIntervalMs: number;
17
+ /** How long to wait for a peer node's in-progress signing in ms */
18
+ peerSigningTimeoutMs: number;
19
+ /** Max stuck duties age in ms */
20
+ maxStuckDutiesAgeMs: number;
21
+ }
22
+ /**
23
+ * Get database configuration from environment variables
24
+ */
25
+ export declare function createHADatabaseConfig(nodeId: string): HADatabaseConfig;
26
+ /**
27
+ * Setup PostgreSQL database connection pool for HA tests
28
+ *
29
+ * Note: Database migrations should be run separately before starting tests,
30
+ * either via docker-compose entrypoint or manually with: aztec migrate-ha-db up
31
+ */
32
+ export declare function setupHADatabase(databaseUrl: string, logger?: Logger): Pool;
33
+ /**
34
+ * Clean up HA database - drop all tables
35
+ * Use this between tests to ensure clean state
36
+ */
37
+ export declare function cleanupHADatabase(pool: Pool, logger?: Logger): Promise<void>;
38
+ /**
39
+ * Query validator duties from the database
40
+ */
41
+ export declare function getValidatorDuties(pool: Pool, slot: bigint, dutyType?: 'ATTESTATION' | 'BLOCK_PROPOSAL' | 'GOVERNANCE_VOTE' | 'SLASHING_VOTE'): Promise<Array<{
42
+ slot: string;
43
+ dutyType: string;
44
+ validatorAddress: string;
45
+ nodeId: string;
46
+ startedAt: Date;
47
+ completedAt: Date | undefined;
48
+ }>>;
49
+ /**
50
+ * Convert private keys to Ethereum addresses
51
+ */
52
+ export declare function getAddressesFromPrivateKeys(privateKeys: `0x${string}`[]): string[];
53
+ /**
54
+ * Create initial validators from private keys for L1 contract deployment
55
+ */
56
+ export declare function createInitialValidatorsFromPrivateKeys(attesterPrivateKeys: `0x${string}`[]): Array<{
57
+ attester: EthAddress;
58
+ withdrawer: EthAddress;
59
+ privateKey: `0x${string}`;
60
+ bn254SecretKey: SecretValue<bigint>;
61
+ }>;
62
+ /**
63
+ * Verify no duplicate attestations per validator (HA coordination check)
64
+ * Groups duties by validator address and verifies each validator attested exactly once
65
+ */
66
+ export declare function verifyNoDuplicateAttestations(attestationDuties: Array<{
67
+ validatorAddress: string;
68
+ nodeId: string;
69
+ completedAt: Date | undefined;
70
+ }>, logger?: Logger): Map<string, typeof attestationDuties>;
71
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFfc2V0dXAuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maXh0dXJlcy9oYV9zZXR1cC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFFdkQsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDbEQsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBRXZELE9BQU8sRUFBRSxJQUFJLEVBQUUsTUFBTSxJQUFJLENBQUM7QUFHMUI7O0dBRUc7QUFDSCxNQUFNLFdBQVcsZ0JBQWdCO0lBQy9CLGdDQUFnQztJQUNoQyxXQUFXLEVBQUUsV0FBVyxDQUFDLE1BQU0sQ0FBQyxDQUFDO0lBQ2pDLGtDQUFrQztJQUNsQyxNQUFNLEVBQUUsTUFBTSxDQUFDO0lBQ2Ysd0JBQXdCO0lBQ3hCLGdCQUFnQixFQUFFLE9BQU8sQ0FBQztJQUMxQiw2QkFBNkI7SUFDN0IsaUJBQWlCLEVBQUUsTUFBTSxDQUFDO0lBQzFCLG1FQUFtRTtJQUNuRSxvQkFBb0IsRUFBRSxNQUFNLENBQUM7SUFDN0IsaUNBQWlDO0lBQ2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;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC;CAC/B,CAAC,EACF,MAAM,CAAC,EAAE,MAAM,GACd,GAAG,CAAC,MAAM,EAAE,OAAO,iBAAiB,CAAC,CAmBvC"}
@@ -0,0 +1,119 @@
1
+ import { EthAddress } from '@aztec/aztec.js/addresses';
2
+ import { Fr } from '@aztec/aztec.js/fields';
3
+ import { SecretValue } from '@aztec/foundation/config';
4
+ import { Pool } from 'pg';
5
+ import { privateKeyToAccount } from 'viem/accounts';
6
+ /**
7
+ * Get database configuration from environment variables
8
+ */ export function createHADatabaseConfig(nodeId) {
9
+ const databaseUrl = new SecretValue(process.env.DATABASE_URL || 'postgresql://aztec:aztec@localhost:5432/aztec_ha_test');
10
+ return {
11
+ databaseUrl,
12
+ nodeId,
13
+ haSigningEnabled: true,
14
+ pollingIntervalMs: 100,
15
+ peerSigningTimeoutMs: 3000,
16
+ maxStuckDutiesAgeMs: 72000
17
+ };
18
+ }
19
+ /**
20
+ * Setup PostgreSQL database connection pool for HA tests
21
+ *
22
+ * Note: Database migrations should be run separately before starting tests,
23
+ * either via docker-compose entrypoint or manually with: aztec migrate-ha-db up
24
+ */ export function setupHADatabase(databaseUrl, logger) {
25
+ try {
26
+ // Create connection pool for test usage
27
+ // Migrations are already run by docker-compose entrypoint before tests start
28
+ const pool = new Pool({
29
+ connectionString: databaseUrl
30
+ });
31
+ // pg-pool re-emits idle-client errors on the pool; with no listener the emit throws - in production this crashes
32
+ // the validator process.
33
+ pool.on('error', (err)=>logger?.warn(`HA database pool error: ${err.message}`));
34
+ logger?.info('Connected to HA database (migrations should already be applied)');
35
+ return pool;
36
+ } catch (error) {
37
+ logger?.error(`Failed to connect to HA database: ${error}`);
38
+ throw error;
39
+ }
40
+ }
41
+ /**
42
+ * Clean up HA database - drop all tables
43
+ * Use this between tests to ensure clean state
44
+ */ export async function cleanupHADatabase(pool, logger) {
45
+ try {
46
+ // Drop all HA tables
47
+ await pool.query('DROP TABLE IF EXISTS validator_duties CASCADE');
48
+ await pool.query('DROP TABLE IF EXISTS schema_version CASCADE');
49
+ // Drop migration tracking table (node-pg-migrate uses 'pgmigrations' by default)
50
+ // This ensures migrations will run fresh on next startup
51
+ await pool.query('DROP TABLE IF EXISTS pgmigrations CASCADE');
52
+ logger?.info('HA database cleaned up successfully');
53
+ } catch (error) {
54
+ logger?.error(`Failed to cleanup HA database: ${error}`);
55
+ throw error;
56
+ }
57
+ }
58
+ /**
59
+ * Query validator duties from the database
60
+ */ export async function getValidatorDuties(pool, slot, dutyType) {
61
+ const query = dutyType ? 'SELECT slot, duty_type, validator_address, node_id, started_at, completed_at FROM validator_duties WHERE slot = $1 AND duty_type = $2 ORDER BY started_at' : 'SELECT slot, duty_type, validator_address, node_id, started_at, completed_at FROM validator_duties WHERE slot = $1 ORDER BY started_at';
62
+ const params = dutyType ? [
63
+ slot.toString(),
64
+ dutyType
65
+ ] : [
66
+ slot.toString()
67
+ ];
68
+ const result = await pool.query(query, params);
69
+ return result.rows.map((row)=>({
70
+ slot: row.slot,
71
+ dutyType: row.duty_type,
72
+ validatorAddress: row.validator_address,
73
+ nodeId: row.node_id,
74
+ startedAt: row.started_at,
75
+ completedAt: row.completed_at
76
+ }));
77
+ }
78
+ /**
79
+ * Convert private keys to Ethereum addresses
80
+ */ export function getAddressesFromPrivateKeys(privateKeys) {
81
+ return privateKeys.map((pk)=>{
82
+ const account = privateKeyToAccount(pk);
83
+ return account.address;
84
+ });
85
+ }
86
+ /**
87
+ * Create initial validators from private keys for L1 contract deployment
88
+ */ export function createInitialValidatorsFromPrivateKeys(attesterPrivateKeys) {
89
+ return attesterPrivateKeys.map((pk)=>{
90
+ const account = privateKeyToAccount(pk);
91
+ return {
92
+ attester: EthAddress.fromString(account.address),
93
+ withdrawer: EthAddress.fromString(account.address),
94
+ privateKey: pk,
95
+ bn254SecretKey: new SecretValue(Fr.random().toBigInt())
96
+ };
97
+ });
98
+ }
99
+ /**
100
+ * Verify no duplicate attestations per validator (HA coordination check)
101
+ * Groups duties by validator address and verifies each validator attested exactly once
102
+ */ export function verifyNoDuplicateAttestations(attestationDuties, logger) {
103
+ const dutiesByValidator = new Map();
104
+ for (const duty of attestationDuties){
105
+ const existing = dutiesByValidator.get(duty.validatorAddress) || [];
106
+ existing.push(duty);
107
+ dutiesByValidator.set(duty.validatorAddress, existing);
108
+ }
109
+ for (const [validatorAddress, validatorDuties] of dutiesByValidator.entries()){
110
+ if (validatorDuties.length !== 1) {
111
+ throw new Error(`Validator ${validatorAddress} attested ${validatorDuties.length} times (expected exactly once)`);
112
+ }
113
+ if (!validatorDuties[0].completedAt) {
114
+ throw new Error(`Validator ${validatorAddress} attestation duty not completed`);
115
+ }
116
+ logger?.info(`Validator ${validatorAddress} attested once via node ${validatorDuties[0].nodeId}`);
117
+ }
118
+ return dutiesByValidator;
119
+ }
@@ -1,6 +1,8 @@
1
1
  export * from './fixtures.js';
2
+ export * from './ha_setup.js';
2
3
  export * from './logging.js';
3
4
  export * from './utils.js';
4
5
  export * from './token_utils.js';
6
+ export * from './wait_helpers.js';
5
7
  export * from './with_telemetry_utils.js';
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maXh0dXJlcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGVBQWUsQ0FBQztBQUM5QixjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLFlBQVksQ0FBQztBQUMzQixjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsMkJBQTJCLENBQUMifQ==
8
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maXh0dXJlcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGVBQWUsQ0FBQztBQUM5QixjQUFjLGVBQWUsQ0FBQztBQUM5QixjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLFlBQVksQ0FBQztBQUMzQixjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsY0FBYywyQkFBMkIsQ0FBQyJ9
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixtures/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixtures/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
@@ -1,5 +1,7 @@
1
1
  export * from './fixtures.js';
2
+ export * from './ha_setup.js';
2
3
  export * from './logging.js';
3
4
  export * from './utils.js';
4
5
  export * from './token_utils.js';
6
+ export * from './wait_helpers.js';
5
7
  export * from './with_telemetry_utils.js';
@@ -0,0 +1,25 @@
1
+ import { DefaultAccountContract } from '@aztec/accounts/defaults';
2
+ import type { ContractArtifact } from '@aztec/aztec.js/abi';
3
+ import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
4
+ import type { CompleteAddress } from '@aztec/aztec.js/addresses';
5
+ import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
6
+ /**
7
+ * The private key that matches the hardcoded public key in the SchnorrHardcodedAccountContract.
8
+ * The corresponding public key is baked into the Noir contract as a global constant.
9
+ */
10
+ export declare const SCHNORR_HARDCODED_PRIVATE_KEY: import("@aztec/aztec.js/fields").Fq;
11
+ /**
12
+ * Account contract backed by the SchnorrHardcodedAccount Noir contract.
13
+ * This contract verifies Schnorr signatures against a public key that is hardcoded
14
+ * in the contract artifact (not stored in a note), so it does not require on-chain
15
+ * deployment or initialization. Useful for tests that need a working account without
16
+ * mining any blocks.
17
+ */
18
+ export declare class SchnorrHardcodedKeyAccountContract extends DefaultAccountContract {
19
+ private privateKey;
20
+ constructor(privateKey?: GrumpkinScalar);
21
+ getContractArtifact(): Promise<ContractArtifact>;
22
+ getInitializationFunctionAndArgs(): Promise<undefined>;
23
+ getAuthWitnessProvider(_address: CompleteAddress): AuthWitnessProvider;
24
+ }
25
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2Nobm9ycl9oYXJkY29kZWRfYWNjb3VudF9jb250cmFjdC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ZpeHR1cmVzL3NjaG5vcnJfaGFyZGNvZGVkX2FjY291bnRfY29udHJhY3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHNCQUFzQixFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDbEUsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUM1RCxPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQ25FLE9BQU8sS0FBSyxFQUFFLGVBQWUsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBSWpFLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxtQ0FBbUMsQ0FBQztBQUduRTs7O0dBR0c7QUFDSCxlQUFPLE1BQU0sNkJBQTZCLHFDQUV6QyxDQUFDO0FBRUY7Ozs7OztHQU1HO0FBQ0gscUJBQWEsa0NBQW1DLFNBQVEsc0JBQXNCO0lBQ2hFLE9BQU8sQ0FBQyxVQUFVO0lBQTlCLFlBQW9CLFVBQVUsR0FBRSxjQUE4QyxFQUU3RTtJQUVRLG1CQUFtQixJQUFJLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUV4RDtJQUVELGdDQUFnQyx1QkFFL0I7SUFFRCxzQkFBc0IsQ0FBQyxRQUFRLEVBQUUsZUFBZSxHQUFHLG1CQUFtQixDQVNyRTtDQUNGIn0=
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schnorr_hardcoded_account_contract.d.ts","sourceRoot":"","sources":["../../src/fixtures/schnorr_hardcoded_account_contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAIjE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAGnE;;;GAGG;AACH,eAAO,MAAM,6BAA6B,qCAEzC,CAAC;AAEF;;;;;;GAMG;AACH,qBAAa,kCAAmC,SAAQ,sBAAsB;IAChE,OAAO,CAAC,UAAU;IAA9B,YAAoB,UAAU,GAAE,cAA8C,EAE7E;IAEQ,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAExD;IAED,gCAAgC,uBAE/B;IAED,sBAAsB,CAAC,QAAQ,EAAE,eAAe,GAAG,mBAAmB,CASrE;CACF"}
@@ -0,0 +1,37 @@
1
+ import { DefaultAccountContract } from '@aztec/accounts/defaults';
2
+ import { AuthWitness } from '@aztec/aztec.js/authorization';
3
+ import { Schnorr } from '@aztec/foundation/crypto/schnorr';
4
+ import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
5
+ import { SchnorrHardcodedAccountContractArtifact } from '@aztec/noir-contracts.js/SchnorrHardcodedAccount';
6
+ /**
7
+ * The private key that matches the hardcoded public key in the SchnorrHardcodedAccountContract.
8
+ * The corresponding public key is baked into the Noir contract as a global constant.
9
+ */ export const SCHNORR_HARDCODED_PRIVATE_KEY = GrumpkinScalar.fromHexString('0xd35d743ac0dfe3d6dbe6be8c877cb524a00ab1e3d52d7bada095dfc8894ccfa');
10
+ /**
11
+ * Account contract backed by the SchnorrHardcodedAccount Noir contract.
12
+ * This contract verifies Schnorr signatures against a public key that is hardcoded
13
+ * in the contract artifact (not stored in a note), so it does not require on-chain
14
+ * deployment or initialization. Useful for tests that need a working account without
15
+ * mining any blocks.
16
+ */ export class SchnorrHardcodedKeyAccountContract extends DefaultAccountContract {
17
+ privateKey;
18
+ constructor(privateKey = SCHNORR_HARDCODED_PRIVATE_KEY){
19
+ super(), this.privateKey = privateKey;
20
+ }
21
+ getContractArtifact() {
22
+ return Promise.resolve(SchnorrHardcodedAccountContractArtifact);
23
+ }
24
+ getInitializationFunctionAndArgs() {
25
+ return Promise.resolve(undefined);
26
+ }
27
+ getAuthWitnessProvider(_address) {
28
+ const privateKey = this.privateKey;
29
+ return {
30
+ async createAuthWit (messageHash) {
31
+ const signer = new Schnorr();
32
+ const signature = await signer.constructSignature(messageHash, privateKey);
33
+ return new AuthWitness(messageHash, signature.toLimbFields());
34
+ }
35
+ };
36
+ }
37
+ }