@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
@@ -0,0 +1,365 @@
1
+ import { appendFileSync, writeFileSync } from 'node:fs';
2
+ import { basename } from 'node:path';
3
+ import CustomEnvironment from '../../../foundation/src/jest/env.mjs';
4
+ // Per-test e2e timing environment. Gated entirely on the TEST_TIMING_FILE env var: when unset, this
5
+ // behaves exactly like the base CustomEnvironment (it only delegates). When set, it records, per test
6
+ // worker process, the time spent in jest before/after hooks and the test body, and folds in the named
7
+ // spans recorded via the `testSpan()` wrapper (fixtures/timing.ts) through a collector shared on
8
+ // `this.global`.
9
+ //
10
+ // Output is one JSONL file per worker process (the env runs once per worker). Each line carries a
11
+ // `type` discriminator and is one of:
12
+ // - `type: 'test'` (`name` set): beforeEach hooks, the it() body, afterEach hooks for one test; or
13
+ // - `type: 'suite'` (`name: null`): the suite-scoped beforeAll/afterAll hooks for the whole file.
14
+ //
15
+ // Each line also gains a `spans` map: per `category:label` tag the test/suite touched, the collector
16
+ // records `{ count, totalMs, busyMs, maxMs }`. `busyMs` is the duration of the union of the spans'
17
+ // `[start, end)` intervals on the shared `performance.now()` clock, so concurrent spans (Promise.all
18
+ // fan-out) do not inflate it the way `totalMs` does. The legacy `setupFnMs`/`teardownFnMs` fields are
19
+ // kept for back-compat, derived from the `setup:env`/`teardown:env` spans.
20
+ //
21
+ // When `TEST_TIMING_SPANS=1`, the collector additionally retains every raw span occurrence and emits
22
+ // one `type:"span"` line per occurrence (owner, name, ms) for deep dives, at the cost of a larger file.
23
+ export default class TimingEnvironment extends CustomEnvironment {
24
+ constructor(config, context){
25
+ super(config, context);
26
+ this.timingFile = process.env.TEST_TIMING_FILE;
27
+ if (!this.timingFile) {
28
+ return;
29
+ }
30
+ this.suite = basename(context?.testPath ?? config?.testPath ?? 'unknown').replace(/\.test\.[cm]?[jt]s$/, '');
31
+ this.meta = {
32
+ commit: process.env.COMMIT_HASH ?? null,
33
+ branch: process.env.TARGET_BRANCH ?? process.env.REF_NAME ?? null,
34
+ runId: process.env.RUN_ID ?? null
35
+ };
36
+ // Opt-in per-occurrence emission for deep dives (off by default keeps the JSONL one line per test).
37
+ this.emitSpanLines = process.env.TEST_TIMING_SPANS === '1';
38
+ // Shared collector. The instrumented helpers (running in the sandbox realm) read
39
+ // `globalThis.__e2eTimings`; this env (host realm) reads `this.global.__e2eTimings` — they are the
40
+ // same object. `current` is the full name of the test currently running (null during
41
+ // beforeAll/afterAll), used to attribute each span to a test or to the suite-scoped line. `spans`
42
+ // accumulates every recorded span until flush. The `start`/`end` timestamps come from the sandbox
43
+ // realm's `performance.now()`; Node's perf clock is process-wide (one monotonic origin across all
44
+ // realms), so merging the intervals here for `busyMs` is valid.
45
+ this.collector = {
46
+ current: null,
47
+ spans: []
48
+ };
49
+ this.global.__e2eTimings = this.collector;
50
+ // Records to flush as JSONL on teardown. One per test plus one suite-scoped record.
51
+ this.records = [];
52
+ this.recordsByName = new Map();
53
+ // The suite-scoped record (beforeAll/afterAll); bodyMs/totalMs are computed at flush time.
54
+ this.suiteRecord = {
55
+ name: null,
56
+ status: 'passed',
57
+ beforeHooksMs: 0,
58
+ afterHooksMs: 0
59
+ };
60
+ // Start times keyed by hook type (beforeAll/beforeEach/afterAll/afterEach).
61
+ this.hookStarts = {};
62
+ this.testStarts = new Map();
63
+ // Guards against double-flushing (we flush on both the teardown event and the teardown method).
64
+ this.flushed = false;
65
+ // Raw per-occurrence spans retained only when TEST_TIMING_SPANS=1, emitted as `type:"span"` lines.
66
+ this.rawSpans = [];
67
+ }
68
+ // Flush on the teardown method too: the jest lifecycle always calls this, whereas the 'teardown'
69
+ // event is not reliably delivered when a test run is interrupted. Whichever fires first wins.
70
+ async teardown() {
71
+ this.finalizeAndFlush();
72
+ await super.teardown();
73
+ }
74
+ async handleTestEvent(event, state) {
75
+ // Run the base env first so its unhandledRejection patching for after-hooks stays intact.
76
+ await super.handleTestEvent(event, state);
77
+ if (!this.timingFile) {
78
+ return;
79
+ }
80
+ const now = Date.now();
81
+ switch(event.name){
82
+ case 'hook_start':
83
+ {
84
+ this.hookStarts[event.hook.type] = now;
85
+ break;
86
+ }
87
+ case 'hook_success':
88
+ case 'hook_failure':
89
+ {
90
+ const start = this.hookStarts[event.hook.type];
91
+ if (start === undefined) {
92
+ break;
93
+ }
94
+ delete this.hookStarts[event.hook.type];
95
+ const ms = now - start;
96
+ if (event.hook.type === 'beforeEach') {
97
+ this.addToCurrent('beforeHooksMs', ms);
98
+ } else if (event.hook.type === 'afterEach') {
99
+ this.addToCurrent('afterHooksMs', ms);
100
+ } else if (event.hook.type === 'beforeAll') {
101
+ this.suiteRecord.beforeHooksMs += ms;
102
+ } else if (event.hook.type === 'afterAll') {
103
+ this.suiteRecord.afterHooksMs += ms;
104
+ }
105
+ break;
106
+ }
107
+ case 'test_start':
108
+ {
109
+ const name = this.fullTestName(event.test);
110
+ const record = {
111
+ type: 'test',
112
+ name,
113
+ status: 'passed',
114
+ setupFnMs: 0,
115
+ beforeHooksMs: 0,
116
+ bodyMs: 0,
117
+ teardownFnMs: 0,
118
+ afterHooksMs: 0,
119
+ totalMs: 0,
120
+ startedAt: new Date(now).toISOString()
121
+ };
122
+ this.records.push(record);
123
+ this.recordsByName.set(name, record);
124
+ this.testStarts.set(name, now);
125
+ this.collector.current = name;
126
+ break;
127
+ }
128
+ case 'test_fn_start':
129
+ {
130
+ this.testStarts.set(`fn:${this.fullTestName(event.test)}`, now);
131
+ break;
132
+ }
133
+ case 'test_fn_success':
134
+ case 'test_fn_failure':
135
+ {
136
+ const name = this.fullTestName(event.test);
137
+ const start = this.testStarts.get(`fn:${name}`);
138
+ const record = this.recordsByName.get(name);
139
+ if (record && start !== undefined) {
140
+ record.bodyMs = now - start;
141
+ }
142
+ if (record && event.name === 'test_fn_failure') {
143
+ record.status = 'failed';
144
+ }
145
+ break;
146
+ }
147
+ case 'test_done':
148
+ {
149
+ const name = this.fullTestName(event.test);
150
+ const record = this.recordsByName.get(name);
151
+ const start = this.testStarts.get(name);
152
+ if (record && start !== undefined) {
153
+ record.totalMs = now - start;
154
+ }
155
+ if (record && event.test?.errors?.length) {
156
+ record.status = 'failed';
157
+ }
158
+ this.collector.current = null;
159
+ break;
160
+ }
161
+ case 'teardown':
162
+ {
163
+ this.finalizeAndFlush();
164
+ break;
165
+ }
166
+ default:
167
+ break;
168
+ }
169
+ }
170
+ /** The record for the test currently running, if any. */ currentRecord() {
171
+ return this.collector.current ? this.recordsByName.get(this.collector.current) : undefined;
172
+ }
173
+ /** Adds `ms` to a hook bucket on the current per-test record, or the suite record during beforeAll/afterAll. */ addToCurrent(field, ms) {
174
+ const record = this.currentRecord();
175
+ if (record) {
176
+ record[field] += ms;
177
+ }
178
+ }
179
+ /** Builds the full test name by walking up the describe blocks, matching jest's currentTestName. */ fullTestName(test) {
180
+ if (!test) {
181
+ return null;
182
+ }
183
+ const parts = [];
184
+ let node = test;
185
+ while(node && node.name && node.name !== 'ROOT_DESCRIBE_BLOCK'){
186
+ parts.unshift(node.name);
187
+ node = node.parent;
188
+ }
189
+ return parts.join(' ');
190
+ }
191
+ /** Folds the collected spans into the per-test / suite records via {@link foldSpansInto}, then drains the collector. */ foldSpans() {
192
+ const rawSpans = foldSpansInto(this.collector.spans, {
193
+ recordsByName: this.recordsByName,
194
+ suiteRecord: this.suiteRecord,
195
+ emitSpanLines: this.emitSpanLines
196
+ });
197
+ this.rawSpans.push(...rawSpans);
198
+ this.collector.spans = [];
199
+ }
200
+ /** Folds spans into records, finalizes the suite-scoped record, and writes all JSONL. */ finalizeAndFlush() {
201
+ if (this.flushed || !this.timingFile) {
202
+ return;
203
+ }
204
+ this.flushed = true;
205
+ this.foldSpans();
206
+ const lines = [];
207
+ for (const record of this.records){
208
+ lines.push(this.toLine({
209
+ ...record
210
+ }));
211
+ }
212
+ lines.push(this.toLine({
213
+ type: 'suite',
214
+ name: null,
215
+ status: 'passed',
216
+ setupFnMs: this.suiteRecord.setupFnMs ?? 0,
217
+ beforeHooksMs: this.suiteRecord.beforeHooksMs,
218
+ teardownFnMs: this.suiteRecord.teardownFnMs ?? 0,
219
+ afterHooksMs: this.suiteRecord.afterHooksMs,
220
+ totalMs: this.suiteRecord.beforeHooksMs + this.suiteRecord.afterHooksMs,
221
+ spans: this.suiteRecord.spans
222
+ }));
223
+ for (const raw of this.rawSpans){
224
+ lines.push(this.toLine({
225
+ type: 'span',
226
+ name: raw.owner,
227
+ span: raw.name,
228
+ ms: raw.ms
229
+ }));
230
+ }
231
+ const payload = lines.join('\n') + '\n';
232
+ try {
233
+ // One file per worker process, but a worker may run several suites: append so we keep them all.
234
+ appendFileSync(this.timingFile, payload);
235
+ } catch {
236
+ try {
237
+ writeFileSync(this.timingFile, payload);
238
+ } catch {
239
+ // Timing is best-effort; never fail a test because we couldn't write the file.
240
+ }
241
+ }
242
+ }
243
+ /** Flattens metadata onto a record and serializes to a single JSON line, rounding all Ms fields. */ toLine(record) {
244
+ const obj = {
245
+ suite: this.suite,
246
+ ...record,
247
+ ...this.meta
248
+ };
249
+ for (const key of Object.keys(obj)){
250
+ if (key.endsWith('Ms') && typeof obj[key] === 'number') {
251
+ obj[key] = Math.round(obj[key]);
252
+ }
253
+ }
254
+ // Round the nested span aggregates' Ms fields too (totalMs/busyMs/maxMs per tag).
255
+ if (obj.spans && typeof obj.spans === 'object') {
256
+ for (const agg of Object.values(obj.spans)){
257
+ for (const key of Object.keys(agg)){
258
+ if (key.endsWith('Ms') && typeof agg[key] === 'number') {
259
+ agg[key] = Math.round(agg[key]);
260
+ }
261
+ }
262
+ }
263
+ }
264
+ return JSON.stringify(obj);
265
+ }
266
+ }
267
+ /**
268
+ * Aggregates a list of `{ start, end }` spans of one tag into `{ count, totalMs, busyMs, maxMs }`.
269
+ * `totalMs` is the naive sum of per-occurrence durations (correct for serial repeats); `busyMs` is
270
+ * the duration of the union of the `[start, end)` intervals (concurrency-correct — N concurrent
271
+ * spans collapse to their wall-clock span instead of summing to ~N×); `maxMs` is the longest single
272
+ * occurrence. All durations are on the shared process-wide `performance.now()` clock. Does not mutate
273
+ * the input array.
274
+ */ export function aggregateSpans(spans) {
275
+ let totalMs = 0;
276
+ let maxMs = 0;
277
+ for (const span of spans){
278
+ const ms = span.end - span.start;
279
+ totalMs += ms;
280
+ if (ms > maxMs) {
281
+ maxMs = ms;
282
+ }
283
+ }
284
+ // busyMs: sort by start and merge overlapping intervals, summing the merged lengths.
285
+ const sorted = [
286
+ ...spans
287
+ ].sort((a, b)=>a.start - b.start);
288
+ let busyMs = 0;
289
+ let mergeStart = null;
290
+ let mergeEnd = null;
291
+ for (const span of sorted){
292
+ if (mergeStart === null) {
293
+ mergeStart = span.start;
294
+ mergeEnd = span.end;
295
+ } else if (span.start <= mergeEnd) {
296
+ if (span.end > mergeEnd) {
297
+ mergeEnd = span.end;
298
+ }
299
+ } else {
300
+ busyMs += mergeEnd - mergeStart;
301
+ mergeStart = span.start;
302
+ mergeEnd = span.end;
303
+ }
304
+ }
305
+ if (mergeStart !== null) {
306
+ busyMs += mergeEnd - mergeStart;
307
+ }
308
+ return {
309
+ count: spans.length,
310
+ totalMs,
311
+ busyMs,
312
+ maxMs
313
+ };
314
+ }
315
+ /**
316
+ * Groups `spans` by owner, then by tag, and attaches a `spans` map of aggregates to the matching
317
+ * per-test record (looked up in `recordsByName`) or, for `null`-owner spans, to `suiteRecord`. Also
318
+ * derives the back-compat `setupFnMs` / `teardownFnMs` fields from the `setup:env:<mode>` /
319
+ * `teardown:env` aggregates (additive over any pre-existing value). Spans whose owner matches no
320
+ * record (e.g. the pinned `other:mempool-feeder` owner) are dropped. Returns the raw per-occurrence
321
+ * list (`{ owner, name, ms }`), which is empty unless `emitSpanLines` is set.
322
+ */ export function foldSpansInto(spans, { recordsByName, suiteRecord, emitSpanLines = false }) {
323
+ const rawSpans = [];
324
+ // Group by owner (null owner → suite record), then by tag.
325
+ const byOwner = new Map();
326
+ for (const span of spans){
327
+ const owner = span.owner ?? null;
328
+ let byName = byOwner.get(owner);
329
+ if (!byName) {
330
+ byName = new Map();
331
+ byOwner.set(owner, byName);
332
+ }
333
+ let list = byName.get(span.name);
334
+ if (!list) {
335
+ list = [];
336
+ byName.set(span.name, list);
337
+ }
338
+ list.push(span);
339
+ if (emitSpanLines) {
340
+ rawSpans.push({
341
+ owner,
342
+ name: span.name,
343
+ ms: span.end - span.start
344
+ });
345
+ }
346
+ }
347
+ for (const [owner, byName] of byOwner){
348
+ const record = owner === null ? suiteRecord : recordsByName.get(owner);
349
+ if (!record) {
350
+ continue;
351
+ }
352
+ const aggregates = {};
353
+ for (const [name, list] of byName){
354
+ aggregates[name] = aggregateSpans(list);
355
+ }
356
+ record.spans = aggregates;
357
+ // Back-compat: the legacy fn-span buckets are derived from the top-level env setup/teardown tags.
358
+ // The top-level setup is tagged `setup:env:<proverMode>` (the mode is a closed set, distinct from
359
+ // the `:anvil`/`:l1-deploy`/... sub-phase tags), so sum those three exact tags.
360
+ const setupFnMs = (aggregates['setup:env:none']?.totalMs ?? 0) + (aggregates['setup:env:fake']?.totalMs ?? 0) + (aggregates['setup:env:real']?.totalMs ?? 0);
361
+ record.setupFnMs = setupFnMs + (record.setupFnMs ?? 0);
362
+ record.teardownFnMs = (aggregates['teardown:env']?.totalMs ?? 0) + (record.teardownFnMs ?? 0);
363
+ }
364
+ return rawSpans;
365
+ }
@@ -1,3 +1,3 @@
1
1
  import { type EndToEndContext } from '../fixtures/utils.js';
2
2
  export declare const uniswapL1L2TestSuite: (setup: () => Promise<EndToEndContext>, cleanup: () => Promise<void>, expectedForkBlockNumber?: number) => void;
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW5pc3dhcF9sMV9sMi5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NoYXJlZC91bmlzd2FwX2wxX2wyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXdCQSxPQUFPLEVBQUUsS0FBSyxlQUFlLEVBQW1DLE1BQU0sc0JBQXNCLENBQUM7QUFZN0YsZUFBTyxNQUFNLG9CQUFvQixpSEF5K0JoQyxDQUFDIn0=
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW5pc3dhcF9sMV9sMi5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NoYXJlZC91bmlzd2FwX2wxX2wyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQSxPQUFPLEVBQUUsS0FBSyxlQUFlLEVBQStCLE1BQU0sc0JBQXNCLENBQUM7QUFhekYsZUFBTyxNQUFNLG9CQUFvQixpSEE0Z0NoQyxDQUFDIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,KAAK,eAAe,EAAmC,MAAM,sBAAsB,CAAC;AAY7F,eAAO,MAAM,oBAAoB,iHAy+BhC,CAAC"}
1
+ {"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,eAAe,EAA+B,MAAM,sBAAsB,CAAC;AAazF,eAAO,MAAM,oBAAoB,iHA4gChC,CAAC"}