@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
@@ -61,10 +61,17 @@ The export is important there. The `AZTEC_DOCKER_IMAGE` env var is used as both:
61
61
  - the containers for the aztec infrastructure (validators, provers, etc)
62
62
 
63
63
  # Deploy Metrics
64
+
64
65
  ```bash
65
66
  ./spartan/bootstrap.sh metrics-kind
66
67
  ```
67
68
 
69
+ # Install Chaos Mesh
70
+
71
+ ```bash
72
+ ./spartan/bootstrap.sh chaos-mesh
73
+ ```
74
+
68
75
  # Deploy stuff
69
76
 
70
77
  ```bash
@@ -1,21 +1,31 @@
1
1
  import { generateSchnorrAccounts } from '@aztec/accounts/testing';
2
+ import { NO_FROM } from '@aztec/aztec.js/account';
2
3
  import { AztecAddress } from '@aztec/aztec.js/addresses';
4
+ import { DefaultWaitOpts, NO_WAIT } from '@aztec/aztec.js/contracts';
3
5
  import { L1FeeJuicePortalManager } from '@aztec/aztec.js/ethereum';
4
6
  import { FeeJuicePaymentMethodWithClaim } from '@aztec/aztec.js/fee';
5
7
  import { type FeePaymentMethod, SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee';
6
8
  import { Fr } from '@aztec/aztec.js/fields';
7
- import { type AztecNode, createAztecNodeClient } from '@aztec/aztec.js/node';
9
+ import { waitForL1ToL2MessageReady } from '@aztec/aztec.js/messaging';
10
+ import { type AztecNode, createAztecNodeClient, waitForTx } from '@aztec/aztec.js/node';
8
11
  import type { Wallet } from '@aztec/aztec.js/wallet';
9
- import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
12
+ import { createEthereumChain } from '@aztec/ethereum/chain';
13
+ import { createExtendedL1Client } from '@aztec/ethereum/client';
10
14
  import type { Logger } from '@aztec/foundation/log';
11
- import { retryUntil } from '@aztec/foundation/retry';
15
+ import { makeBackoff, retry, retryUntil } from '@aztec/foundation/retry';
12
16
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
17
+ import { Gas } from '@aztec/stdlib/gas';
13
18
  import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
14
- import { TestWallet, proveInteraction, registerInitialSandboxAccountsInWallet } from '@aztec/test-wallet/server';
19
+ import { TxStatus } from '@aztec/stdlib/tx';
20
+ import { getGasLimits } from '@aztec/wallet-sdk/base-wallet';
21
+ import { registerInitialLocalNetworkAccountsInWallet } from '@aztec/wallets/testing';
15
22
 
16
23
  import { getACVMConfig } from '../fixtures/get_acvm_config.js';
17
24
  import { getBBConfig } from '../fixtures/get_bb_config.js';
18
25
  import { getSponsoredFPCAddress, registerSponsoredFPC } from '../fixtures/utils.js';
26
+ import { TestWallet } from '../test-wallet/test_wallet.js';
27
+ import { proveInteraction } from '../test-wallet/utils.js';
28
+ import { WorkerWallet } from '../test-wallet/worker_wallet.js';
19
29
 
20
30
  export interface TestAccounts {
21
31
  aztecNode: AztecNode;
@@ -28,6 +38,11 @@ export interface TestAccounts {
28
38
  tokenAddress: AztecAddress;
29
39
  }
30
40
 
41
+ export type TestAccountsWithoutTokens = Omit<
42
+ TestAccounts,
43
+ 'tokenAddress' | 'tokenContract' | 'tokenName' | 'tokenAdminAddress'
44
+ >;
45
+
31
46
  const TOKEN_NAME = 'USDC';
32
47
  const TOKEN_SYMBOL = 'USD';
33
48
  const TOKEN_DECIMALS = 18n;
@@ -41,15 +56,17 @@ export async function setupTestAccountsWithTokens(
41
56
 
42
57
  const aztecNode = createAztecNodeClient(nodeUrl);
43
58
  const wallet = await TestWallet.create(aztecNode);
59
+ // Remote JSON-RPC node: keep the 1s poll cadence rather than the in-process TestWallet fast default.
60
+ wallet.setDefaultWaitInterval(DefaultWaitOpts.interval);
44
61
 
45
- const [recipientAccount, ...accounts] = (await registerInitialSandboxAccountsInWallet(wallet)).slice(
62
+ const [recipientAccount, ...accounts] = (await registerInitialLocalNetworkAccountsInWallet(wallet)).slice(
46
63
  0,
47
64
  ACCOUNT_COUNT + 1,
48
65
  );
49
66
 
50
67
  const tokenAdmin = accounts[0];
51
68
  const tokenAddress = await deployTokenAndMint(wallet, accounts, tokenAdmin, mintAmount, undefined, logger);
52
- const tokenContract = await TokenContract.at(tokenAddress, wallet);
69
+ const tokenContract = TokenContract.at(tokenAddress, wallet);
53
70
 
54
71
  return {
55
72
  aztecNode,
@@ -63,7 +80,7 @@ export async function setupTestAccountsWithTokens(
63
80
  };
64
81
  }
65
82
 
66
- export async function deploySponsoredTestAccounts(
83
+ export async function deploySponsoredTestAccountsWithTokens(
67
84
  wallet: TestWallet,
68
85
  aztecNode: AztecNode,
69
86
  mintAmount: bigint,
@@ -78,11 +95,19 @@ export async function deploySponsoredTestAccounts(
78
95
 
79
96
  const paymentMethod = new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
80
97
  const recipientDeployMethod = await recipientAccount.getDeployMethod();
81
- await recipientDeployMethod.send({ from: AztecAddress.ZERO, fee: { paymentMethod } }).wait({ timeout: 2400 });
98
+ await recipientDeployMethod.send({
99
+ from: NO_FROM,
100
+ fee: { paymentMethod },
101
+ wait: { timeout: 2400 },
102
+ });
82
103
  await Promise.all(
83
104
  fundedAccounts.map(async a => {
84
105
  const deployMethod = await a.getDeployMethod();
85
- await deployMethod.send({ from: AztecAddress.ZERO, fee: { paymentMethod } }).wait({ timeout: 2400 }); // increase timeout on purpose in order to account for two empty epochs
106
+ await deployMethod.send({
107
+ from: NO_FROM,
108
+ fee: { paymentMethod },
109
+ wait: { timeout: 2400 },
110
+ }); // increase timeout on purpose in order to account for two empty epochs
86
111
  logger.info(`Account deployed at ${a.address}`);
87
112
  }),
88
113
  );
@@ -96,7 +121,7 @@ export async function deploySponsoredTestAccounts(
96
121
  new SponsoredFeePaymentMethod(await getSponsoredFPCAddress()),
97
122
  logger,
98
123
  );
99
- const tokenContract = await TokenContract.at(tokenAddress, wallet);
124
+ const tokenContract = TokenContract.at(tokenAddress, wallet);
100
125
 
101
126
  return {
102
127
  aztecNode,
@@ -110,6 +135,139 @@ export async function deploySponsoredTestAccounts(
110
135
  };
111
136
  }
112
137
 
138
+ async function deployAccountWithDiagnostics(
139
+ account: { getDeployMethod: () => Promise<{ simulate: (opts: any) => any; send: (opts: any) => any }>; address: any },
140
+ paymentMethod: SponsoredFeePaymentMethod,
141
+ aztecNode: AztecNode,
142
+ logger: Logger,
143
+ accountLabel: string,
144
+ estimateGas?: boolean,
145
+ ): Promise<void> {
146
+ const deployMethod = await account.getDeployMethod();
147
+ let gasSettings: any;
148
+ if (estimateGas) {
149
+ const sim = await deployMethod.simulate({ from: NO_FROM, fee: { paymentMethod }, includeMetadata: true });
150
+ const { txsLimits } = await aztecNode.getNodeInfo();
151
+ gasSettings = getGasLimits(sim.gasUsed!, Gas.from(txsLimits.gas));
152
+ logger.info(`${accountLabel} estimated gas: DA=${gasSettings.gasLimits.daGas} L2=${gasSettings.gasLimits.l2Gas}`);
153
+ }
154
+
155
+ // Track the tx hash across retries so we don't re-send when the previous tx is still pending.
156
+ let sentTxHash: { txHash: any } | undefined;
157
+
158
+ await retry(
159
+ async () => {
160
+ // Check if already deployed (handles case where previous attempt succeeded but waitForTx timed out)
161
+ const existing = await aztecNode.getContract(account.address);
162
+ if (existing) {
163
+ logger.info(`${accountLabel} already deployed at ${account.address}, skipping`);
164
+ return;
165
+ }
166
+
167
+ // If we already sent a tx, check if it was dropped before deciding to re-send.
168
+ if (sentTxHash) {
169
+ const prevReceipt = await aztecNode.getTxReceipt(sentTxHash.txHash);
170
+ if (prevReceipt.isDropped()) {
171
+ logger.info(`${accountLabel} previous tx ${sentTxHash.txHash} was dropped, re-sending`);
172
+ sentTxHash = undefined;
173
+ } else {
174
+ logger.info(`${accountLabel} previous tx ${sentTxHash.txHash} still pending, waiting again...`);
175
+ }
176
+ }
177
+
178
+ if (!sentTxHash) {
179
+ const deployResult = await deployMethod.send({
180
+ from: NO_FROM,
181
+ fee: { paymentMethod, gasSettings },
182
+ wait: NO_WAIT,
183
+ });
184
+ sentTxHash = { txHash: deployResult.txHash };
185
+ logger.info(`${accountLabel} tx sent`, { txHash: sentTxHash.txHash.toString() });
186
+ }
187
+
188
+ const receipt = await waitForTx(aztecNode, sentTxHash.txHash, { timeout: 600 });
189
+ if (receipt.isDropped()) {
190
+ sentTxHash = undefined;
191
+ throw new Error(`${accountLabel} tx was dropped, retrying...`);
192
+ }
193
+ logger.info(`${accountLabel} deployed at ${account.address}`);
194
+ },
195
+ `deploy ${accountLabel}`,
196
+ makeBackoff([1, 2, 4, 8, 16]),
197
+ logger,
198
+ );
199
+ }
200
+
201
+ async function deployAccountsInBatches(
202
+ accounts: {
203
+ getDeployMethod: () => Promise<{ simulate: (opts: any) => any; send: (opts: any) => any }>;
204
+ address: any;
205
+ }[],
206
+ paymentMethod: SponsoredFeePaymentMethod,
207
+ aztecNode: AztecNode,
208
+ logger: Logger,
209
+ labelPrefix: string,
210
+ batchSize = 2,
211
+ estimateGas?: boolean,
212
+ ): Promise<void> {
213
+ for (let i = 0; i < accounts.length; i += batchSize) {
214
+ const batch = accounts.slice(i, i + batchSize);
215
+ await Promise.all(
216
+ batch.map((account, idx) =>
217
+ deployAccountWithDiagnostics(
218
+ account,
219
+ paymentMethod,
220
+ aztecNode,
221
+ logger,
222
+ `${labelPrefix}${i + idx + 1}`,
223
+ estimateGas,
224
+ ),
225
+ ),
226
+ );
227
+ }
228
+ }
229
+
230
+ export async function deploySponsoredTestAccounts(
231
+ wallet: TestWallet,
232
+ aztecNode: AztecNode,
233
+ logger: Logger,
234
+ numberOfFundedWallets = 1,
235
+ opts?: { estimateGas?: boolean },
236
+ ): Promise<TestAccountsWithoutTokens> {
237
+ const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
238
+ const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
239
+ const fundedAccounts = await Promise.all(funded.map(a => wallet.createSchnorrAccount(a.secret, a.salt)));
240
+
241
+ await registerSponsoredFPC(wallet);
242
+
243
+ const paymentMethod = new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
244
+
245
+ await deployAccountWithDiagnostics(
246
+ recipientAccount,
247
+ paymentMethod,
248
+ aztecNode,
249
+ logger,
250
+ 'Recipient account',
251
+ opts?.estimateGas,
252
+ );
253
+ await deployAccountsInBatches(
254
+ fundedAccounts,
255
+ paymentMethod,
256
+ aztecNode,
257
+ logger,
258
+ 'Funded account ',
259
+ 2,
260
+ opts?.estimateGas,
261
+ );
262
+
263
+ return {
264
+ aztecNode,
265
+ wallet,
266
+ accounts: fundedAccounts.map(acc => acc.address),
267
+ recipientAddress: recipientAccount.address,
268
+ };
269
+ }
270
+
113
271
  export async function deployTestAccountsWithTokens(
114
272
  nodeUrl: string,
115
273
  l1RpcUrls: string[],
@@ -120,6 +278,8 @@ export async function deployTestAccountsWithTokens(
120
278
  ): Promise<TestAccounts> {
121
279
  const aztecNode = createAztecNodeClient(nodeUrl);
122
280
  const wallet = await TestWallet.create(aztecNode);
281
+ // Remote JSON-RPC node: keep the 1s poll cadence rather than the in-process TestWallet fast default.
282
+ wallet.setDefaultWaitInterval(DefaultWaitOpts.interval);
123
283
 
124
284
  const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
125
285
  const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
@@ -138,7 +298,7 @@ export async function deployTestAccountsWithTokens(
138
298
  fundedAccounts.map(async (a, i) => {
139
299
  const paymentMethod = new FeeJuicePaymentMethodWithClaim(a.address, claims[i]);
140
300
  const deployMethod = await a.getDeployMethod();
141
- await deployMethod.send({ from: AztecAddress.ZERO, fee: { paymentMethod } }).wait();
301
+ await deployMethod.send({ from: NO_FROM, fee: { paymentMethod } });
142
302
  logger.info(`Account deployed at ${a.address}`);
143
303
  }),
144
304
  );
@@ -152,7 +312,7 @@ export async function deployTestAccountsWithTokens(
152
312
  undefined,
153
313
  logger,
154
314
  );
155
- const tokenContract = await TokenContract.at(tokenAddress, wallet);
315
+ const tokenContract = TokenContract.at(tokenAddress, wallet);
156
316
 
157
317
  return {
158
318
  aztecNode,
@@ -181,9 +341,7 @@ async function bridgeL1FeeJuice(
181
341
  const portal = await L1FeeJuicePortalManager.new(aztecNode, l1Client, log);
182
342
  const claim = await portal.bridgeTokensPublic(recipient, amount, true /* mint */);
183
343
 
184
- const isSynced = async () =>
185
- (await aztecNode.getL1ToL2MessageBlock(Fr.fromHexString(claim.messageHash))) !== undefined;
186
- await retryUntil(isSynced, `message ${claim.messageHash} sync`, 24, 0.5);
344
+ await waitForL1ToL2MessageReady(aztecNode, Fr.fromHexString(claim.messageHash), { timeoutSeconds: 24 });
187
345
 
188
346
  log.info(`Created a claim for ${amount} L1 fee juice to ${recipient}.`, claim);
189
347
  return claim;
@@ -214,25 +372,29 @@ async function deployTokenAndMint(
214
372
  logger: Logger,
215
373
  ) {
216
374
  logger.verbose(`Deploying TokenContract...`);
217
- const tokenContract = await TokenContract.deploy(wallet, admin, TOKEN_NAME, TOKEN_SYMBOL, TOKEN_DECIMALS)
218
- .send({
219
- from: admin,
220
- fee: {
221
- paymentMethod,
222
- },
223
- })
224
- .deployed({ timeout: 600 });
375
+ const { contract: tokenContract } = await TokenContract.deploy(
376
+ wallet,
377
+ admin,
378
+ TOKEN_NAME,
379
+ TOKEN_SYMBOL,
380
+ TOKEN_DECIMALS,
381
+ ).send({
382
+ from: admin,
383
+ fee: {
384
+ paymentMethod,
385
+ },
386
+ wait: { timeout: 600 },
387
+ });
225
388
 
226
389
  const tokenAddress = tokenContract.address;
227
390
 
228
391
  logger.verbose(`Minting ${mintAmount} public assets to the ${accounts.length} accounts...`);
229
392
 
230
393
  await Promise.all(
231
- accounts.map(async acc =>
232
- (await TokenContract.at(tokenAddress, wallet)).methods
233
- .mint_to_public(acc, mintAmount)
234
- .send({ from: admin, fee: { paymentMethod } })
235
- .wait({ timeout: 600 }),
394
+ accounts.map(acc =>
395
+ TokenContract.at(tokenAddress, wallet)
396
+ .methods.mint_to_public(acc, mintAmount)
397
+ .send({ from: admin, fee: { paymentMethod }, wait: { timeout: 600 } }),
236
398
  ),
237
399
  );
238
400
 
@@ -260,8 +422,8 @@ export async function performTransfers({
260
422
  // Default to sponsored fee payment if no fee method is provided
261
423
  const defaultFeePaymentMethod = feePaymentMethod || new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
262
424
  for (let i = 0; i < rounds; i++) {
263
- const txs = testAccounts.accounts.map(async acc => {
264
- const token = await TokenContract.at(testAccounts.tokenAddress, testAccounts.wallet);
425
+ const txs = testAccounts.accounts.map(acc => {
426
+ const token = TokenContract.at(testAccounts.tokenAddress, testAccounts.wallet);
265
427
  return proveInteraction(wallet, token.methods.transfer_in_public(acc, recipient, transferAmount, 0), {
266
428
  from: acc,
267
429
  fee: {
@@ -272,17 +434,25 @@ export async function performTransfers({
272
434
 
273
435
  const provenTxs = await Promise.all(txs);
274
436
 
275
- await Promise.all(provenTxs.map(t => t.send().wait({ timeout: 600 })));
437
+ // Wait only for the txs to be proposed, not checkpointed. This is enough to keep the chain
438
+ // loaded for the reorg scenario, and avoids each round blocking on the (slower) checkpoint lag.
439
+ await Promise.all(provenTxs.map(t => t.send({ wait: { timeout: 600, waitForStatus: TxStatus.PROPOSED } })));
276
440
 
277
441
  logger.info(`Completed round ${i + 1} / ${rounds}`);
278
442
  }
279
443
  }
280
444
 
445
+ export type WalletWrapper = {
446
+ wallet: TestWallet;
447
+ aztecNode: AztecNode;
448
+ cleanup: () => Promise<void>;
449
+ };
450
+
281
451
  export async function createWalletAndAztecNodeClient(
282
452
  nodeUrl: string,
283
453
  proverEnabled: boolean,
284
454
  logger: Logger,
285
- ): Promise<{ wallet: TestWallet; aztecNode: AztecNode; cleanup: () => Promise<void> }> {
455
+ ): Promise<WalletWrapper> {
286
456
  const aztecNode = createAztecNodeClient(nodeUrl);
287
457
  const [bbConfig, acvmConfig] = await Promise.all([getBBConfig(logger), getACVMConfig(logger)]);
288
458
  const pxeConfig = {
@@ -293,6 +463,8 @@ export async function createWalletAndAztecNodeClient(
293
463
  proverEnabled,
294
464
  };
295
465
  const wallet = await TestWallet.create(aztecNode, pxeConfig);
466
+ // Remote JSON-RPC node: keep the 1s poll cadence rather than the in-process TestWallet fast default.
467
+ wallet.setDefaultWaitInterval(DefaultWaitOpts.interval);
296
468
 
297
469
  return {
298
470
  wallet,
@@ -304,3 +476,42 @@ export async function createWalletAndAztecNodeClient(
304
476
  },
305
477
  };
306
478
  }
479
+
480
+ export type WorkerWalletWrapper = {
481
+ wallet: WorkerWallet;
482
+ aztecNode: AztecNode;
483
+ cleanup: () => Promise<void>;
484
+ };
485
+
486
+ export async function createWorkerWalletClient(
487
+ nodeUrl: string,
488
+ proverEnabled: boolean,
489
+ logger: Logger,
490
+ ): Promise<WorkerWalletWrapper> {
491
+ const aztecNode = createAztecNodeClient(nodeUrl);
492
+ const [bbConfig, acvmConfig] = await Promise.all([getBBConfig(logger), getACVMConfig(logger)]);
493
+
494
+ // Strip cleanup functions — they can't be structured-cloned for worker transfer
495
+ const { cleanup: bbCleanup, ...bbPaths } = bbConfig ?? {};
496
+ const { cleanup: acvmCleanup, ...acvmPaths } = acvmConfig ?? {};
497
+
498
+ const pxeConfig = {
499
+ dataDirectory: undefined,
500
+ dataStoreMapSizeKb: 1024 * 1024,
501
+ ...bbPaths,
502
+ ...acvmPaths,
503
+ proverEnabled,
504
+ };
505
+
506
+ const wallet = await WorkerWallet.create(nodeUrl, pxeConfig);
507
+
508
+ return {
509
+ wallet,
510
+ aztecNode,
511
+ async cleanup() {
512
+ await wallet.stop();
513
+ await bbCleanup?.();
514
+ await acvmCleanup?.();
515
+ },
516
+ };
517
+ }