@aztec/end-to-end 0.0.1-commit.f504929 → 0.0.1-commit.f5a9928

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 (322) hide show
  1. package/README.md +229 -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/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.d.ts +1 -1
  8. package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts.map +1 -0
  9. package/dest/automine/delivery/interactive_handshake_responder.d.ts +48 -0
  10. package/dest/automine/delivery/interactive_handshake_responder.d.ts.map +1 -0
  11. package/dest/automine/delivery/interactive_handshake_responder.js +76 -0
  12. package/dest/automine/delivery/onchain_delivery_harness.d.ts +19 -0
  13. package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -0
  14. package/dest/automine/delivery/onchain_delivery_harness.js +141 -0
  15. package/dest/automine/token/blacklist_token_contract_test.d.ts +49 -0
  16. package/dest/automine/token/blacklist_token_contract_test.d.ts.map +1 -0
  17. package/dest/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.js +23 -36
  18. package/dest/automine/token/token_contract_test.d.ts +40 -0
  19. package/dest/automine/token/token_contract_test.d.ts.map +1 -0
  20. package/dest/{e2e_token_contract → automine/token}/token_contract_test.js +24 -39
  21. package/dest/automine/token/token_test_helpers.d.ts +73 -0
  22. package/dest/automine/token/token_test_helpers.d.ts.map +1 -0
  23. package/dest/automine/token/token_test_helpers.js +97 -0
  24. package/dest/bench/client_flows/benchmark.d.ts +15 -1
  25. package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
  26. package/dest/bench/client_flows/benchmark.js +19 -0
  27. package/dest/bench/client_flows/client_flows_benchmark.d.ts +5 -5
  28. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  29. package/dest/bench/client_flows/client_flows_benchmark.js +62 -54
  30. package/dest/bench/utils.d.ts +3 -3
  31. package/dest/bench/utils.d.ts.map +1 -1
  32. package/dest/bench/utils.js +97 -6
  33. package/dest/composed/ha/ha_full_setup.d.ts +77 -0
  34. package/dest/composed/ha/ha_full_setup.d.ts.map +1 -0
  35. package/dest/composed/ha/ha_full_setup.js +383 -0
  36. package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts +12 -0
  37. package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts.map +1 -0
  38. package/dest/fixtures/authwit_proxy.d.ts +1 -1
  39. package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
  40. package/dest/fixtures/authwit_proxy.js +4 -0
  41. package/dest/fixtures/e2e_prover_test.d.ts +15 -11
  42. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  43. package/dest/fixtures/e2e_prover_test.js +56 -40
  44. package/dest/fixtures/fixtures.d.ts +79 -1
  45. package/dest/fixtures/fixtures.d.ts.map +1 -1
  46. package/dest/fixtures/fixtures.js +80 -0
  47. package/dest/fixtures/get_bb_config.d.ts +1 -1
  48. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  49. package/dest/fixtures/get_bb_config.js +5 -5
  50. package/dest/fixtures/ha_setup.d.ts +4 -4
  51. package/dest/fixtures/ha_setup.d.ts.map +1 -1
  52. package/dest/fixtures/ha_setup.js +5 -2
  53. package/dest/fixtures/index.d.ts +2 -1
  54. package/dest/fixtures/index.d.ts.map +1 -1
  55. package/dest/fixtures/index.js +1 -0
  56. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
  57. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
  58. package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
  59. package/dest/fixtures/setup.d.ts +86 -42
  60. package/dest/fixtures/setup.d.ts.map +1 -1
  61. package/dest/fixtures/setup.js +295 -200
  62. package/dest/fixtures/setup_p2p_test.d.ts +10 -6
  63. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  64. package/dest/fixtures/setup_p2p_test.js +11 -11
  65. package/dest/fixtures/standard_contracts_genesis.d.ts +16 -0
  66. package/dest/fixtures/standard_contracts_genesis.d.ts.map +1 -0
  67. package/dest/fixtures/standard_contracts_genesis.js +25 -0
  68. package/dest/fixtures/timing.d.ts +42 -0
  69. package/dest/fixtures/timing.d.ts.map +1 -0
  70. package/dest/fixtures/timing.js +72 -0
  71. package/dest/fixtures/token_utils.d.ts +22 -4
  72. package/dest/fixtures/token_utils.d.ts.map +1 -1
  73. package/dest/fixtures/token_utils.js +23 -6
  74. package/dest/fixtures/utils.d.ts +2 -2
  75. package/dest/fixtures/utils.d.ts.map +1 -1
  76. package/dest/fixtures/utils.js +1 -1
  77. package/dest/fixtures/wait_helpers.d.ts +135 -0
  78. package/dest/fixtures/wait_helpers.d.ts.map +1 -0
  79. package/dest/fixtures/wait_helpers.js +154 -0
  80. package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
  81. package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
  82. package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
  83. package/dest/forward-compatibility/wallet_service.d.ts +3 -0
  84. package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
  85. package/dest/forward-compatibility/wallet_service.js +109 -0
  86. package/dest/install_legacy_contracts.d.cts +13 -0
  87. package/dest/install_legacy_contracts.d.cts.map +1 -0
  88. package/dest/legacy-jest-resolver.d.cts +3 -0
  89. package/dest/legacy-jest-resolver.d.cts.map +1 -0
  90. package/dest/multi-node/block-production/setup.d.ts +97 -0
  91. package/dest/multi-node/block-production/setup.d.ts.map +1 -0
  92. package/dest/multi-node/block-production/setup.js +158 -0
  93. package/dest/multi-node/governance/setup.d.ts +67 -0
  94. package/dest/multi-node/governance/setup.d.ts.map +1 -0
  95. package/dest/multi-node/governance/setup.js +126 -0
  96. package/dest/multi-node/multi_node_test_context.d.ts +212 -0
  97. package/dest/multi-node/multi_node_test_context.d.ts.map +1 -0
  98. package/dest/multi-node/multi_node_test_context.js +347 -0
  99. package/dest/multi-node/slashing/inactivity_setup.d.ts +27 -0
  100. package/dest/multi-node/slashing/inactivity_setup.d.ts.map +1 -0
  101. package/dest/multi-node/slashing/inactivity_setup.js +111 -0
  102. package/dest/multi-node/slashing/setup.d.ts +167 -0
  103. package/dest/multi-node/slashing/setup.d.ts.map +1 -0
  104. package/dest/multi-node/slashing/setup.js +275 -0
  105. package/dest/{e2e_p2p → p2p}/p2p_network.d.ts +20 -11
  106. package/dest/p2p/p2p_network.d.ts.map +1 -0
  107. package/dest/{e2e_p2p → p2p}/p2p_network.js +83 -39
  108. package/dest/p2p/reqresp/utils.d.ts +19 -0
  109. package/dest/p2p/reqresp/utils.d.ts.map +1 -0
  110. package/dest/{e2e_p2p → p2p}/reqresp/utils.js +45 -29
  111. package/dest/p2p/shared.d.ts +72 -0
  112. package/dest/p2p/shared.d.ts.map +1 -0
  113. package/dest/p2p/shared.js +212 -0
  114. package/dest/shared/cross_chain_test_harness.d.ts +6 -4
  115. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  116. package/dest/shared/cross_chain_test_harness.js +33 -21
  117. package/dest/shared/gas_portal_test_harness.d.ts +8 -5
  118. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  119. package/dest/shared/gas_portal_test_harness.js +24 -12
  120. package/dest/shared/submit-transactions.d.ts +1 -1
  121. package/dest/shared/submit-transactions.d.ts.map +1 -1
  122. package/dest/shared/submit-transactions.js +12 -5
  123. package/dest/shared/timing_env.d.js +5 -0
  124. package/dest/shared/timing_env.js +365 -0
  125. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  126. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  127. package/dest/shared/uniswap_l1_l2.js +50 -40
  128. package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
  129. package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
  130. package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
  131. package/dest/simulators/lending_simulator.d.ts +10 -3
  132. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  133. package/dest/simulators/lending_simulator.js +25 -13
  134. package/dest/simulators/token_simulator.js +1 -1
  135. package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts +75 -0
  136. package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts.map +1 -0
  137. package/dest/single-node/cross-chain/cross_chain_messaging_test.js +209 -0
  138. package/dest/single-node/cross-chain/message_test_helpers.d.ts +38 -0
  139. package/dest/single-node/cross-chain/message_test_helpers.d.ts.map +1 -0
  140. package/dest/single-node/cross-chain/message_test_helpers.js +70 -0
  141. package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.d.ts +1 -1
  142. package/dest/single-node/fees/bridging_race.notest.d.ts.map +1 -0
  143. package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.js +17 -4
  144. package/dest/single-node/fees/fees_test.d.ts +95 -0
  145. package/dest/single-node/fees/fees_test.d.ts.map +1 -0
  146. package/dest/single-node/fees/fees_test.js +347 -0
  147. package/dest/single-node/l1-reorgs/setup.d.ts +42 -0
  148. package/dest/single-node/l1-reorgs/setup.d.ts.map +1 -0
  149. package/dest/single-node/l1-reorgs/setup.js +57 -0
  150. package/dest/single-node/partial-proofs/setup.d.ts +5 -0
  151. package/dest/single-node/partial-proofs/setup.d.ts.map +1 -0
  152. package/dest/single-node/partial-proofs/setup.js +5 -0
  153. package/dest/single-node/proving/setup.d.ts +5 -0
  154. package/dest/single-node/proving/setup.d.ts.map +1 -0
  155. package/dest/single-node/proving/setup.js +5 -0
  156. package/dest/single-node/recovery/setup.d.ts +5 -0
  157. package/dest/single-node/recovery/setup.d.ts.map +1 -0
  158. package/dest/single-node/recovery/setup.js +5 -0
  159. package/dest/single-node/setup.d.ts +49 -0
  160. package/dest/single-node/setup.d.ts.map +1 -0
  161. package/dest/single-node/setup.js +56 -0
  162. package/dest/single-node/single_node_test_context.d.ts +374 -0
  163. package/dest/single-node/single_node_test_context.d.ts.map +1 -0
  164. package/dest/single-node/single_node_test_context.js +847 -0
  165. package/dest/spartan/setup_test_wallets.d.ts +4 -2
  166. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  167. package/dest/spartan/setup_test_wallets.js +94 -48
  168. package/dest/spartan/tx_metrics.d.ts +27 -4
  169. package/dest/spartan/tx_metrics.d.ts.map +1 -1
  170. package/dest/spartan/tx_metrics.js +105 -20
  171. package/dest/spartan/utils/config.d.ts +9 -32
  172. package/dest/spartan/utils/config.d.ts.map +1 -1
  173. package/dest/spartan/utils/config.js +1 -0
  174. package/dest/spartan/utils/gossip_metrics.d.ts +9 -0
  175. package/dest/spartan/utils/gossip_metrics.d.ts.map +1 -0
  176. package/dest/spartan/utils/gossip_metrics.js +77 -0
  177. package/dest/spartan/utils/index.d.ts +3 -1
  178. package/dest/spartan/utils/index.d.ts.map +1 -1
  179. package/dest/spartan/utils/index.js +4 -0
  180. package/dest/spartan/utils/nodes.js +2 -2
  181. package/dest/spartan/utils/pod_logs.d.ts +25 -0
  182. package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
  183. package/dest/spartan/utils/pod_logs.js +74 -0
  184. package/dest/test-wallet/test_wallet.d.ts +47 -25
  185. package/dest/test-wallet/test_wallet.d.ts.map +1 -1
  186. package/dest/test-wallet/test_wallet.js +197 -91
  187. package/dest/test-wallet/utils.d.ts +38 -3
  188. package/dest/test-wallet/utils.d.ts.map +1 -1
  189. package/dest/test-wallet/utils.js +65 -10
  190. package/dest/test-wallet/wallet_worker_script.js +12 -4
  191. package/dest/test-wallet/worker_wallet.d.ts +9 -8
  192. package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
  193. package/dest/test-wallet/worker_wallet.js +10 -4
  194. package/dest/test-wallet/worker_wallet_schema.d.ts +3 -273
  195. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
  196. package/dest/test-wallet/worker_wallet_schema.js +15 -2
  197. package/package.json +48 -44
  198. package/src/automine/README.md +60 -0
  199. package/src/automine/automine_test_context.ts +153 -0
  200. package/src/automine/delivery/interactive_handshake_responder.ts +125 -0
  201. package/src/automine/delivery/onchain_delivery_harness.ts +213 -0
  202. package/src/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.ts +24 -47
  203. package/src/{e2e_token_contract → automine/token}/token_contract_test.ts +25 -48
  204. package/src/automine/token/token_test_helpers.ts +138 -0
  205. package/src/bench/client_flows/benchmark.ts +21 -0
  206. package/src/bench/client_flows/client_flows_benchmark.ts +108 -75
  207. package/src/bench/utils.ts +110 -6
  208. package/src/composed/ha/ha_full_setup.ts +466 -0
  209. package/src/fixtures/authwit_proxy.ts +4 -0
  210. package/src/fixtures/e2e_prover_test.ts +73 -63
  211. package/src/fixtures/fixtures.ts +100 -0
  212. package/src/fixtures/get_bb_config.ts +7 -6
  213. package/src/fixtures/ha_setup.ts +11 -5
  214. package/src/fixtures/index.ts +1 -0
  215. package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
  216. package/src/fixtures/setup.ts +372 -258
  217. package/src/fixtures/setup_p2p_test.ts +15 -11
  218. package/src/fixtures/standard_contracts_genesis.ts +28 -0
  219. package/src/fixtures/timing.ts +97 -0
  220. package/src/fixtures/token_utils.ts +40 -8
  221. package/src/fixtures/utils.ts +2 -3
  222. package/src/fixtures/wait_helpers.ts +333 -0
  223. package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
  224. package/src/forward-compatibility/wallet_service.ts +106 -0
  225. package/src/guides/up_quick_start.sh +5 -2
  226. package/src/infra/README.md +12 -0
  227. package/src/install_legacy_contracts.cjs +81 -0
  228. package/src/legacy-jest-resolver.cjs +98 -0
  229. package/src/multi-node/README.md +96 -0
  230. package/src/multi-node/block-production/setup.ts +272 -0
  231. package/src/multi-node/governance/setup.ts +172 -0
  232. package/src/multi-node/multi_node_test_context.ts +447 -0
  233. package/src/multi-node/slashing/inactivity_setup.ts +139 -0
  234. package/src/multi-node/slashing/setup.ts +433 -0
  235. package/src/p2p/README.md +78 -0
  236. package/src/{e2e_p2p → p2p}/p2p_network.ts +96 -51
  237. package/src/{e2e_p2p → p2p}/reqresp/utils.ts +56 -28
  238. package/src/p2p/shared.ts +329 -0
  239. package/src/shared/cross_chain_test_harness.ts +36 -17
  240. package/src/shared/gas_portal_test_harness.ts +32 -14
  241. package/src/shared/submit-transactions.ts +13 -5
  242. package/src/shared/timing_env.d.mts +39 -0
  243. package/src/shared/timing_env.mjs +363 -0
  244. package/src/shared/uniswap_l1_l2.ts +92 -50
  245. package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
  246. package/src/simulators/lending_simulator.ts +29 -13
  247. package/src/simulators/token_simulator.ts +1 -1
  248. package/src/single-node/README.md +66 -0
  249. package/src/single-node/cross-chain/cross_chain_messaging_test.ts +302 -0
  250. package/src/single-node/cross-chain/message_test_helpers.ts +125 -0
  251. package/src/{e2e_fees → single-node/fees}/bridging_race.notest.ts +19 -5
  252. package/src/single-node/fees/fees_test.ts +437 -0
  253. package/src/single-node/l1-reorgs/setup.ts +93 -0
  254. package/src/single-node/partial-proofs/setup.ts +8 -0
  255. package/src/single-node/proving/setup.ts +15 -0
  256. package/src/single-node/recovery/setup.ts +8 -0
  257. package/src/single-node/setup.ts +63 -0
  258. package/src/single-node/single_node_test_context.ts +1058 -0
  259. package/src/spartan/setup_test_wallets.ts +124 -45
  260. package/src/spartan/tx_metrics.ts +107 -23
  261. package/src/spartan/utils/config.ts +1 -0
  262. package/src/spartan/utils/gossip_metrics.ts +108 -0
  263. package/src/spartan/utils/index.ts +6 -0
  264. package/src/spartan/utils/nodes.ts +2 -2
  265. package/src/spartan/utils/pod_logs.ts +99 -0
  266. package/src/test-wallet/test_wallet.ts +227 -107
  267. package/src/test-wallet/utils.ts +104 -11
  268. package/src/test-wallet/wallet_worker_script.ts +11 -5
  269. package/src/test-wallet/worker_wallet.ts +19 -16
  270. package/src/test-wallet/worker_wallet_schema.ts +4 -3
  271. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +0 -55
  272. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +0 -1
  273. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -47
  274. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +0 -1
  275. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +0 -129
  276. package/dest/e2e_deploy_contract/deploy_test.d.ts +0 -37
  277. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +0 -1
  278. package/dest/e2e_deploy_contract/deploy_test.js +0 -50
  279. package/dest/e2e_epochs/epochs_test.d.ts +0 -102
  280. package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
  281. package/dest/e2e_epochs/epochs_test.js +0 -386
  282. package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
  283. package/dest/e2e_fees/fees_test.d.ts +0 -88
  284. package/dest/e2e_fees/fees_test.d.ts.map +0 -1
  285. package/dest/e2e_fees/fees_test.js +0 -248
  286. package/dest/e2e_l1_publisher/write_json.d.ts +0 -11
  287. package/dest/e2e_l1_publisher/write_json.d.ts.map +0 -1
  288. package/dest/e2e_l1_publisher/write_json.js +0 -56
  289. package/dest/e2e_multi_validator/utils.d.ts +0 -12
  290. package/dest/e2e_multi_validator/utils.d.ts.map +0 -1
  291. package/dest/e2e_nested_contract/nested_contract_test.d.ts +0 -26
  292. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +0 -1
  293. package/dest/e2e_nested_contract/nested_contract_test.js +0 -54
  294. package/dest/e2e_p2p/inactivity_slash_test.d.ts +0 -31
  295. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +0 -1
  296. package/dest/e2e_p2p/inactivity_slash_test.js +0 -136
  297. package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
  298. package/dest/e2e_p2p/reqresp/utils.d.ts +0 -22
  299. package/dest/e2e_p2p/reqresp/utils.d.ts.map +0 -1
  300. package/dest/e2e_p2p/shared.d.ts +0 -60
  301. package/dest/e2e_p2p/shared.d.ts.map +0 -1
  302. package/dest/e2e_p2p/shared.js +0 -204
  303. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +0 -2
  304. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +0 -1
  305. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +0 -1
  306. package/dest/e2e_token_contract/token_contract_test.d.ts +0 -44
  307. package/dest/e2e_token_contract/token_contract_test.d.ts.map +0 -1
  308. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +0 -193
  309. package/src/e2e_deploy_contract/deploy_test.ts +0 -85
  310. package/src/e2e_epochs/epochs_test.ts +0 -487
  311. package/src/e2e_fees/fees_test.ts +0 -328
  312. package/src/e2e_l1_publisher/write_json.ts +0 -77
  313. package/src/e2e_nested_contract/nested_contract_test.ts +0 -75
  314. package/src/e2e_p2p/inactivity_slash_test.ts +0 -179
  315. package/src/e2e_p2p/shared.ts +0 -333
  316. /package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fetcher.js +0 -0
  317. /package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.js +0 -0
  318. /package/dest/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js} +0 -0
  319. /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof.json +0 -0
  320. /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fetcher.ts +0 -0
  321. /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.ts +0 -0
  322. /package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts} +0 -0
@@ -0,0 +1,99 @@
1
+ import type { Logger } from '@aztec/foundation/log';
2
+
3
+ import { exec } from 'child_process';
4
+ import { promisify } from 'util';
5
+
6
+ import { getSequencers } from './nodes.js';
7
+
8
+ const execAsync = promisify(exec);
9
+
10
+ /** Parsed l2-block-built stats from a sequencer pod log line. */
11
+ export type BlockBuiltLogEntry = {
12
+ blockNumber: number;
13
+ txCount: number;
14
+ duration: number;
15
+ publicProcessDuration: number;
16
+ manaPerSec: number;
17
+ privateLogCount: number;
18
+ publicLogCount: number;
19
+ contractClassLogCount: number;
20
+ contractClassLogSize: number;
21
+ };
22
+
23
+ const FIELDS: (keyof BlockBuiltLogEntry)[] = [
24
+ 'blockNumber',
25
+ 'txCount',
26
+ 'duration',
27
+ 'publicProcessDuration',
28
+ 'manaPerSec',
29
+ 'privateLogCount',
30
+ 'publicLogCount',
31
+ 'contractClassLogCount',
32
+ 'contractClassLogSize',
33
+ ];
34
+
35
+ /**
36
+ * Fetches l2-block-built log entries from sequencer pods for given block numbers.
37
+ * Queries all validator pods (only the proposer will have the log for a given block).
38
+ *
39
+ * @param namespace - Kubernetes namespace
40
+ * @param sinceTime - ISO 8601 timestamp to limit log search (e.g., from before block building was re-enabled)
41
+ * @param blockNumbers - Set of block numbers to filter for
42
+ * @param logger - Logger instance
43
+ * @returns Array of parsed BlockBuiltLogEntry, de-duplicated by blockNumber, sorted ascending
44
+ */
45
+ export async function fetchBlockBuiltLogs(
46
+ namespace: string,
47
+ sinceTime: string,
48
+ blockNumbers: Set<number>,
49
+ logger: Logger,
50
+ ): Promise<BlockBuiltLogEntry[]> {
51
+ const pods = await getSequencers(namespace);
52
+ const entriesByBlock = new Map<number, BlockBuiltLogEntry>();
53
+
54
+ // Subtract 60s from sinceTime to account for clock skew between test runner and k8s pods.
55
+ // Block number filtering ensures we only match the right blocks, so extra lines are harmless.
56
+ const sinceDate = new Date(new Date(sinceTime).getTime() - 60_000);
57
+ const sinceFlag = sinceDate.toISOString();
58
+
59
+ for (const pod of pods) {
60
+ try {
61
+ const cmd = `kubectl logs ${pod} -n ${namespace} -c aztec --since-time=${sinceFlag}`;
62
+ logger.info(`Fetching logs: ${cmd}`);
63
+ const { stdout } = await execAsync(cmd, { maxBuffer: 10 * 1024 * 1024 });
64
+
65
+ const lines = stdout.split('\n');
66
+ const matchingLines = lines.filter(l => l.includes('l2-block-built'));
67
+ logger.info(`Pod ${pod}: ${lines.length} log lines, ${matchingLines.length} contain l2-block-built`);
68
+
69
+ for (const line of matchingLines) {
70
+ try {
71
+ const parsed = JSON.parse(line);
72
+ if (parsed.eventName !== 'l2-block-built' || !blockNumbers.has(parsed.blockNumber)) {
73
+ continue;
74
+ }
75
+ if (entriesByBlock.has(parsed.blockNumber)) {
76
+ continue;
77
+ }
78
+ const entry: BlockBuiltLogEntry = {} as BlockBuiltLogEntry;
79
+ for (const field of FIELDS) {
80
+ entry[field] = parsed[field] ?? 0;
81
+ }
82
+ entriesByBlock.set(entry.blockNumber, entry);
83
+ logger.verbose(`Parsed l2-block-built log for block ${entry.blockNumber}`, entry);
84
+ } catch {
85
+ // Not valid JSON, skip
86
+ }
87
+ }
88
+ } catch (err) {
89
+ logger.warn(`Failed to fetch logs from pod ${pod}: ${err}`);
90
+ }
91
+ }
92
+
93
+ if (entriesByBlock.size < blockNumbers.size) {
94
+ const missing = [...blockNumbers].filter(bn => !entriesByBlock.has(bn));
95
+ logger.warn(`Missing l2-block-built logs for block(s): ${missing.join(', ')}`);
96
+ }
97
+
98
+ return [...entriesByBlock.values()].sort((a, b) => a.blockNumber - b.blockNumber);
99
+ }
@@ -1,7 +1,9 @@
1
1
  import { EcdsaKAccountContract, EcdsaRAccountContract } from '@aztec/accounts/ecdsa';
2
- import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
3
- import { StubAccountContractArtifact, createStubAccount } from '@aztec/accounts/stub';
4
- import { type Account, type AccountContract, SignerlessAccount } from '@aztec/aztec.js/account';
2
+ import { StubEcdsaAccountContractArtifact, createStubEcdsaAccount } from '@aztec/accounts/ecdsa/stub';
3
+ import { SchnorrAccountContract, SchnorrInitializerlessAccountContract } from '@aztec/accounts/schnorr';
4
+ import { StubSchnorrAccountContractArtifact, createStubSchnorrAccount } from '@aztec/accounts/schnorr/stub';
5
+ import { type Account, type AccountContract, NO_FROM } from '@aztec/aztec.js/account';
6
+ import type { CompleteAddress } from '@aztec/aztec.js/addresses';
5
7
  import {
6
8
  type CallIntent,
7
9
  type ContractFunctionInteractionCallIntent,
@@ -11,23 +13,34 @@ import {
11
13
  isContractFunctionInteractionCallIntent,
12
14
  lookupValidity,
13
15
  } from '@aztec/aztec.js/authorization';
16
+ import { ContractFunctionInteraction } from '@aztec/aztec.js/contracts';
14
17
  import type { AztecNode } from '@aztec/aztec.js/node';
15
18
  import { AccountManager, type SendOptions } from '@aztec/aztec.js/wallet';
19
+ import { TxSimulationResultWithAppOffset } from '@aztec/aztec.js/wallet';
16
20
  import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
21
+ import { DefaultEntrypoint } from '@aztec/entrypoints/default';
17
22
  import { Fq, Fr } from '@aztec/foundation/curves/bn254';
18
23
  import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
19
- import type { AccessScopes, NotesFilter } from '@aztec/pxe/client/lazy';
24
+ import type { NotesFilter } from '@aztec/pxe/client/lazy';
20
25
  import { type PXEConfig, getPXEConfig } from '@aztec/pxe/config';
21
- import { PXE, type PXECreationOptions, createPXE } from '@aztec/pxe/server';
26
+ import { PXE, type PXECreationOptions, type TaggingSecretSource, createPXE } from '@aztec/pxe/server';
22
27
  import { AuthWitness } from '@aztec/stdlib/auth-witness';
23
28
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
24
- import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
25
- import { deriveSigningKey } from '@aztec/stdlib/keys';
29
+ import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
26
30
  import type { NoteDao } from '@aztec/stdlib/note';
27
- import type { BlockHeader, TxHash, TxReceipt, TxSimulationResult } from '@aztec/stdlib/tx';
31
+ import {
32
+ type BlockHeader,
33
+ type ContractOverrides,
34
+ SimulationOverrides,
35
+ type TxExecutionRequest,
36
+ type TxHash,
37
+ type TxReceipt,
38
+ } from '@aztec/stdlib/tx';
28
39
  import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
29
- import { BaseWallet, type FeeOptions } from '@aztec/wallet-sdk/base-wallet';
40
+ import { BaseWallet, type SimulateViaEntrypointOptions } from '@aztec/wallet-sdk/base-wallet';
41
+ import type { AccountType } from '@aztec/wallets/embedded';
30
42
 
43
+ import { DEFAULT_MIN_FEE_PADDING } from '../fixtures/fixtures.js';
31
44
  import { AztecNodeProxy, ProvenTx } from './utils.js';
32
45
 
33
46
  /**
@@ -36,6 +49,7 @@ import { AztecNodeProxy, ProvenTx } from './utils.js';
36
49
  export interface AccountData {
37
50
  secret: Fr;
38
51
  salt: Fr;
52
+ type?: AccountType;
39
53
  contract: AccountContract;
40
54
  }
41
55
 
@@ -44,12 +58,29 @@ export interface AccountData {
44
58
  * utilities
45
59
  * It is intended to be used in e2e tests.
46
60
  */
61
+ /**
62
+ * Poll interval (in seconds) for in-process TestWallet tx waits. In-process nodes reach CHECKPOINTED synchronously
63
+ * under automine and cheaply otherwise, so a sub-second cadence removes almost-pure dead time from every send().wait().
64
+ * Spartan tests run against remote JSON-RPC nodes and restore the 1s default via setDefaultWaitInterval.
65
+ */
66
+ export const IN_PROCESS_WAIT_INTERVAL_SECONDS = 0.25;
67
+
47
68
  export class TestWallet extends BaseWallet {
48
69
  constructor(
49
70
  pxe: PXE,
50
71
  private readonly nodeRef: AztecNodeProxy,
51
72
  ) {
52
73
  super(pxe, nodeRef);
74
+ this.minFeePadding = DEFAULT_MIN_FEE_PADDING;
75
+ this.defaultWaitInterval = IN_PROCESS_WAIT_INTERVAL_SECONDS;
76
+ }
77
+
78
+ /**
79
+ * Overrides the poll interval (in seconds) used when a send().wait() caller does not specify one. Pass `undefined`
80
+ * to fall back to the DefaultWaitOpts cadence. Spartan tests set this to 1 so they do not hammer remote nodes.
81
+ */
82
+ setDefaultWaitInterval(interval?: number): void {
83
+ this.defaultWaitInterval = interval;
53
84
  }
54
85
 
55
86
  static async create(
@@ -63,7 +94,9 @@ export class TestWallet extends BaseWallet {
63
94
  ...overridePXEConfig,
64
95
  });
65
96
  const pxe = await createPXE(nodeRef, pxeConfig, options);
66
- return new TestWallet(pxe, nodeRef);
97
+ const wallet = new TestWallet(pxe, nodeRef);
98
+ await wallet.initStubClasses();
99
+ return wallet;
67
100
  }
68
101
 
69
102
  /**
@@ -74,110 +107,170 @@ export class TestWallet extends BaseWallet {
74
107
  this.nodeRef.updateTargetNode(node);
75
108
  }
76
109
 
77
- createSchnorrAccount(secret: Fr, salt: Fr, signingKey?: Fq): Promise<AccountManager> {
78
- signingKey = signingKey ?? deriveSigningKey(secret);
79
- const accountData = {
110
+ createSchnorrAccount(secret: Fr, salt: Fr, signingKey: Fq): Promise<AccountManager> {
111
+ return this.createAccount({ secret, salt, type: 'schnorr', contract: new SchnorrAccountContract(signingKey) });
112
+ }
113
+
114
+ createSchnorrInitializerlessAccount(secret: Fr, salt: Fr, signingKey: Fq): Promise<AccountManager> {
115
+ return this.createAccount({
80
116
  secret,
81
117
  salt,
82
- contract: new SchnorrAccountContract(signingKey),
83
- };
84
- return this.createAccount(accountData);
118
+ type: 'schnorr_initializerless',
119
+ contract: new SchnorrInitializerlessAccountContract(signingKey),
120
+ });
85
121
  }
86
122
 
87
123
  createECDSARAccount(secret: Fr, salt: Fr, signingKey: Buffer): Promise<AccountManager> {
88
- const accountData = {
124
+ return this.createAccount({
89
125
  secret,
90
126
  salt,
127
+ type: 'ecdsasecp256r1',
91
128
  contract: new EcdsaRAccountContract(signingKey),
92
- };
93
- return this.createAccount(accountData);
129
+ });
94
130
  }
95
131
 
96
132
  createECDSAKAccount(secret: Fr, salt: Fr, signingKey: Buffer): Promise<AccountManager> {
97
- const accountData = {
133
+ return this.createAccount({
98
134
  secret,
99
135
  salt,
136
+ type: 'ecdsasecp256k1',
100
137
  contract: new EcdsaKAccountContract(signingKey),
101
- };
102
- return this.createAccount(accountData);
138
+ });
103
139
  }
104
140
 
105
- async getFakeAccountDataFor(address: AztecAddress) {
106
- const originalAccount = await this.getAccountFromAddress(address);
107
- if (originalAccount instanceof SignerlessAccount) {
108
- throw new Error(`Cannot create fake account data for SignerlessAccount at address: ${address}`);
109
- }
110
- const originalAddress = (originalAccount as Account).getCompleteAddress();
111
- const contractInstance = await this.pxe.getContractInstance(originalAddress.address);
112
- if (!contractInstance) {
113
- throw new Error(`No contract instance found for address: ${originalAddress.address}`);
114
- }
115
- const stubAccount = createStubAccount(originalAddress);
116
- const instance = await getContractInstanceFromInstantiationParams(StubAccountContractArtifact, {
117
- salt: Fr.random(),
118
- });
119
- return {
120
- account: stubAccount,
121
- instance,
122
- artifact: StubAccountContractArtifact,
123
- };
141
+ // Stub class ids, populated on wallet startup
142
+ // to avoid redundant work per simulation
143
+ private stubClassIds = new Map<AccountType, Fr>();
144
+
145
+ /**
146
+ * Hashes and registers the stub class for every supported account type with PXE, populating
147
+ * stubClassIds. Called on wallet initialization.
148
+ */
149
+ private async initStubClasses(): Promise<void> {
150
+ const { id: schnorrClassId } = await getContractClassFromArtifact(StubSchnorrAccountContractArtifact);
151
+ await this.pxe.registerContractClass(StubSchnorrAccountContractArtifact);
152
+
153
+ // ecdsa stubs share the same class id
154
+ const { id: ecdsaClassId } = await getContractClassFromArtifact(StubEcdsaAccountContractArtifact);
155
+ await this.pxe.registerContractClass(StubEcdsaAccountContractArtifact);
156
+
157
+ this.stubClassIds.set('schnorr', schnorrClassId);
158
+ // Initializerless accounts share the schnorr stub class for kernelless simulation.
159
+ this.stubClassIds.set('schnorr_initializerless', schnorrClassId);
160
+ this.stubClassIds.set('ecdsasecp256k1', ecdsaClassId);
161
+ this.stubClassIds.set('ecdsasecp256r1', ecdsaClassId);
124
162
  }
125
- protected accounts: Map<string, Account> = new Map();
126
163
 
127
164
  /**
128
- * Toggle for running "simulated simulations" when calling simulateTx.
129
- *
130
- * When this flag is true, simulateViaEntrypoint constructs a request using a fake account
131
- * (and accepts contract overrides on the input) and the PXE emulates kernel effects without
132
- * generating kernel witnesses. When false, simulateViaEntrypoint defers to the standard
133
- * simulation path via the real account entrypoint.
165
+ * Builds contract overrides for all provided addresses by replacing their account contracts with stub implementations.
134
166
  */
135
- private simulatedSimulations = false;
167
+ protected async buildAccountOverrides(addresses: AztecAddress[]): Promise<ContractOverrides> {
168
+ const accounts = await this.getAccounts();
169
+ const contracts: ContractOverrides = {};
170
+
171
+ const filtered = accounts.filter(acc => addresses.some(addr => addr.equals(acc.item)));
172
+
173
+ for (const account of filtered) {
174
+ const address = account.item;
175
+ const originalAccount = await this.getAccountFromAddress(address);
176
+ const completeAddress = originalAccount.getCompleteAddress();
177
+ const contractInstance = await this.pxe.getContractInstance(completeAddress.address);
178
+ if (!contractInstance) {
179
+ throw new Error(
180
+ `No contract instance found for address: ${completeAddress.address} during account override building. This is a bug!`,
181
+ );
182
+ }
183
+
184
+ const type = this.getTypeFor(address);
185
+ const stubClassId = this.stubClassIds.get(type);
186
+ if (!stubClassId) {
187
+ throw new Error(
188
+ `Stub class for account type '${type}' was not registered at wallet init. This is a bug — initStubClasses should cover every supported AccountType.`,
189
+ );
190
+ }
191
+
192
+ contracts[address.toString()] = {
193
+ instance: { ...contractInstance, currentContractClassId: stubClassId },
194
+ };
195
+ }
136
196
 
137
- enableSimulatedSimulations() {
138
- this.simulatedSimulations = true;
197
+ return contracts;
139
198
  }
140
199
 
141
- disableSimulatedSimulations() {
142
- this.simulatedSimulations = false;
200
+ protected accounts: Map<string, { account: Account; type: AccountType }> = new Map();
201
+
202
+ private getTypeFor(address: AztecAddress): AccountType {
203
+ return this.accounts.get(address.toString())?.type ?? 'schnorr';
204
+ }
205
+
206
+ private getStubAccountFor(address: AztecAddress, completeAddress: CompleteAddress) {
207
+ const type = this.getTypeFor(address);
208
+ return type === 'schnorr' || type === 'schnorr_initializerless'
209
+ ? createStubSchnorrAccount(completeAddress)
210
+ : createStubEcdsaAccount(completeAddress);
211
+ }
212
+
213
+ /**
214
+ * Controls how the test wallet simulates transactions:
215
+ * - `kernelless`: Skips kernel circuits but uses the real account contract. Default.
216
+ * - `kernelless-override`: Skips kernels and replaces the account with a stub that doesn't do authwit validation.
217
+ * - `full`: Uses real kernel circuits and real account contracts. Slow!
218
+ */
219
+ private simulationMode: 'kernelless' | 'kernelless-override' | 'full' = 'kernelless';
220
+
221
+ setSimulationMode(mode: 'kernelless' | 'kernelless-override' | 'full') {
222
+ this.simulationMode = mode;
143
223
  }
144
224
 
145
225
  setMinFeePadding(value?: number) {
146
- this.minFeePadding = value ?? 0.5;
226
+ this.minFeePadding = value ?? DEFAULT_MIN_FEE_PADDING;
147
227
  }
148
228
 
149
229
  protected getAccountFromAddress(address: AztecAddress): Promise<Account> {
150
- let account: Account | undefined;
151
- if (address.equals(AztecAddress.ZERO)) {
152
- account = new SignerlessAccount();
153
- } else {
154
- account = this.accounts.get(address?.toString() ?? '');
155
- }
230
+ const entry = this.accounts.get(address?.toString() ?? '');
156
231
 
157
- if (!account) {
232
+ if (!entry) {
158
233
  throw new Error(`Account not found in wallet for address: ${address}`);
159
234
  }
160
235
 
161
- return Promise.resolve(account);
236
+ return Promise.resolve(entry.account);
162
237
  }
163
238
 
164
239
  getAccounts() {
165
- return Promise.resolve(Array.from(this.accounts.values()).map(acc => ({ alias: '', item: acc.getAddress() })));
240
+ return Promise.resolve(
241
+ Array.from(this.accounts.values()).map(entry => ({ alias: '', item: entry.account.getAddress() })),
242
+ );
166
243
  }
167
244
 
168
245
  async createAccount(accountData?: AccountData): Promise<AccountManager> {
169
246
  const secret = accountData?.secret ?? Fr.random();
170
247
  const salt = accountData?.salt ?? Fr.random();
248
+ const type = accountData?.type ?? 'schnorr';
171
249
  const contract = accountData?.contract ?? new SchnorrAccountContract(GrumpkinScalar.random());
172
250
 
173
- const accountManager = await AccountManager.create(this, secret, contract, salt);
251
+ // Initializerless accounts have no deployment tx: the address commits to the signing public key
252
+ // (via the contract's immutablesHash, resolved by AccountManager.create) and the constructor's
253
+ // storage writes are materialized locally via a simulated "store" call below.
254
+ // Mirrors EmbeddedWallet.createAccountInternal.
255
+ const accountManager = await AccountManager.create(this, secret, contract, { salt });
174
256
 
175
257
  const instance = accountManager.getInstance();
176
258
  const artifact = await contract.getContractArtifact();
177
259
 
178
260
  await this.registerContract(instance, artifact, secret);
179
261
 
180
- this.accounts.set(accountManager.address.toString(), await accountManager.getAccount());
262
+ const address = accountManager.address.toString();
263
+ this.accounts.set(address, { account: await accountManager.getAccount(), type });
264
+
265
+ if (contract instanceof SchnorrInitializerlessAccountContract) {
266
+ const constructorAbi = artifact.functions.find(f => f.name === 'constructor');
267
+ if (!constructorAbi) {
268
+ throw new Error('Could not create SchnorrInitializerlessAccount: constructor ABI not found');
269
+ }
270
+ const { x, y } = await contract.getSigningPublicKey();
271
+ const storeCall = new ContractFunctionInteraction(this, instance.address, constructorAbi, [x, y]);
272
+ await storeCall.simulate({ from: instance.address });
273
+ }
181
274
 
182
275
  return accountManager;
183
276
  }
@@ -220,62 +313,80 @@ export class TestWallet extends BaseWallet {
220
313
  return account.createAuthWit(intentInnerHash, chainInfo);
221
314
  }
222
315
 
223
- /**
224
- * Override simulateViaEntrypoint to use fake accounts for kernelless simulation
225
- * when simulatedSimulations is enabled. Otherwise falls through to the real entrypoint path.
226
- */
227
316
  protected override async simulateViaEntrypoint(
228
317
  executionPayload: ExecutionPayload,
229
- from: AztecAddress,
230
- feeOptions: FeeOptions,
231
- scopes: AccessScopes,
232
- skipTxValidation?: boolean,
233
- skipFeeEnforcement?: boolean,
234
- ): Promise<TxSimulationResult> {
235
- if (!this.simulatedSimulations) {
236
- return super.simulateViaEntrypoint(
237
- executionPayload,
238
- from,
239
- feeOptions,
240
- scopes,
241
- skipTxValidation,
242
- skipFeeEnforcement,
243
- );
244
- }
318
+ opts: SimulateViaEntrypointOptions,
319
+ ): Promise<TxSimulationResultWithAppOffset> {
320
+ const { from, feeOptions, additionalScopes, skipTxValidation, skipFeeEnforcement, sendMessagesAs } = opts;
321
+ const scopes = this.scopesFrom(from, additionalScopes ?? [], sendMessagesAs);
322
+ const skipKernels = this.simulationMode !== 'full';
323
+ const useOverride = this.simulationMode === 'kernelless-override';
245
324
 
246
325
  const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
247
- const executionOptions: DefaultAccountEntrypointOptions = {
248
- txNonce: Fr.random(),
249
- cancellable: this.cancellableTransactions,
250
- feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions,
251
- };
252
326
  const finalExecutionPayload = feeExecutionPayload
253
327
  ? mergeExecutionPayloads([feeExecutionPayload, executionPayload])
254
328
  : executionPayload;
255
- const { account: fromAccount, instance, artifact } = await this.getFakeAccountDataFor(from);
256
329
  const chainInfo = await this.getChainInfo();
257
- const txRequest = await fromAccount.createTxExecutionRequest(
258
- finalExecutionPayload,
259
- feeOptions.gasSettings,
260
- chainInfo,
261
- executionOptions,
262
- );
263
- const contractOverrides = {
264
- [from.toString()]: { instance, artifact },
265
- };
266
- return this.pxe.simulateTx(txRequest, {
330
+
331
+ let overrides = opts.overrides;
332
+ let txRequest: TxExecutionRequest;
333
+ if (useOverride) {
334
+ const accountOverrides = await this.buildAccountOverrides(scopes);
335
+ overrides = new SimulationOverrides({
336
+ publicStorage: overrides?.publicStorage,
337
+ contracts: { ...overrides?.contracts, ...accountOverrides },
338
+ });
339
+ }
340
+
341
+ if (from === NO_FROM) {
342
+ const entrypoint = new DefaultEntrypoint();
343
+ txRequest = await entrypoint.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo);
344
+ } else {
345
+ let fromAccount: Account;
346
+ if (useOverride) {
347
+ const originalAccount = await this.getAccountFromAddress(from);
348
+ fromAccount = this.getStubAccountFor(from, originalAccount.getCompleteAddress());
349
+ } else {
350
+ fromAccount = await this.getAccountFromAddress(from);
351
+ }
352
+ const executionOptions: DefaultAccountEntrypointOptions = {
353
+ txNonce: Fr.random(),
354
+ cancellable: this.cancellableTransactions,
355
+ // If from is an address, feeOptions include the way the account contract should handle the fee payment
356
+ feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions!,
357
+ };
358
+ txRequest = await fromAccount.createTxExecutionRequest(
359
+ finalExecutionPayload,
360
+ feeOptions.gasSettings,
361
+ chainInfo,
362
+ executionOptions,
363
+ );
364
+ }
365
+
366
+ const result = await this.pxe.simulateTx(txRequest, {
267
367
  simulatePublic: true,
268
- skipFeeEnforcement: true,
269
- skipTxValidation: true,
270
- overrides: { contracts: contractOverrides },
368
+ skipKernels,
369
+ skipFeeEnforcement,
370
+ skipTxValidation,
371
+ overrides,
271
372
  scopes,
373
+ senderForTags: this.senderForTagsFrom(from, sendMessagesAs),
272
374
  });
375
+ const appCallOffset = await this.computeAppCallOffset(from, feeOptions);
376
+ return TxSimulationResultWithAppOffset.fromResultAndOffset(result, appCallOffset);
273
377
  }
274
378
 
275
379
  async proveTx(exec: ExecutionPayload, opts: Omit<SendOptions, 'wait'>): Promise<ProvenTx> {
276
- const fee = await this.completeFeeOptions(opts.from, exec.feePayer, opts.fee?.gasSettings);
380
+ const fee = await this.completeFeeOptions({
381
+ from: opts.from,
382
+ feePayer: exec.feePayer,
383
+ gasSettings: opts.fee?.gasSettings,
384
+ });
277
385
  const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(exec, opts.from, fee);
278
- const txProvingResult = await this.pxe.proveTx(txRequest, this.scopesFrom(opts.from, opts.additionalScopes));
386
+ const txProvingResult = await this.pxe.proveTx(txRequest, {
387
+ scopes: this.scopesFrom(opts.from, opts.additionalScopes ?? [], opts.sendMessagesAs),
388
+ senderForTags: this.senderForTagsFrom(opts.from, opts.sendMessagesAs),
389
+ });
279
390
  return new ProvenTx(
280
391
  this.aztecNode,
281
392
  await txProvingResult.toTx(),
@@ -297,7 +408,16 @@ export class TestWallet extends BaseWallet {
297
408
  }
298
409
 
299
410
  sync(): Promise<void> {
300
- return this.pxe.debug.sync();
411
+ return this.pxe.sync();
412
+ }
413
+
414
+ /**
415
+ * Registers a non-sender tagging-secret source (e.g. a raw out-of-band shared secret) so this PXE discovers messages
416
+ * tagged with it. Test-only surface over {@link PXE.registerTaggingSecretSource}, which the base `Wallet` does not
417
+ * expose. The `address-derived` (sender) variant is excluded: use {@link Wallet.registerSender} for that.
418
+ */
419
+ registerTaggingSecretSource(source: Exclude<TaggingSecretSource, { kind: 'address-derived' }>): Promise<void> {
420
+ return this.pxe.registerTaggingSecretSource(source);
301
421
  }
302
422
 
303
423
  stop(): Promise<void> {