@aztec/simulator 0.0.1-commit.24de95ac → 0.0.1-commit.2ed92850

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 (350) hide show
  1. package/README.md +2 -0
  2. package/dest/client.d.ts +1 -1
  3. package/dest/common/errors.d.ts +2 -2
  4. package/dest/common/errors.d.ts.map +1 -1
  5. package/dest/common/index.d.ts +1 -1
  6. package/dest/common/stats/index.d.ts +1 -1
  7. package/dest/common/stats/stats.d.ts +1 -1
  8. package/dest/private/acvm/acvm.d.ts +1 -1
  9. package/dest/private/acvm/acvm_types.d.ts +1 -1
  10. package/dest/private/acvm/deserialize.d.ts +2 -2
  11. package/dest/private/acvm/deserialize.d.ts.map +1 -1
  12. package/dest/private/acvm/deserialize.js +1 -1
  13. package/dest/private/acvm/index.d.ts +1 -1
  14. package/dest/private/acvm/serialize.d.ts +2 -2
  15. package/dest/private/acvm/serialize.d.ts.map +1 -1
  16. package/dest/private/acvm/serialize.js +1 -1
  17. package/dest/private/acvm_native.d.ts +1 -1
  18. package/dest/private/acvm_native.d.ts.map +1 -1
  19. package/dest/private/acvm_wasm.d.ts +1 -1
  20. package/dest/private/acvm_wasm.d.ts.map +1 -1
  21. package/dest/private/acvm_wasm_with_blobs.d.ts +1 -1
  22. package/dest/private/acvm_wasm_with_blobs.d.ts.map +1 -1
  23. package/dest/private/circuit_recording/circuit_recorder.d.ts +1 -1
  24. package/dest/private/circuit_recording/circuit_recorder.d.ts.map +1 -1
  25. package/dest/private/circuit_recording/circuit_recorder.js +16 -15
  26. package/dest/private/circuit_recording/file_circuit_recorder.d.ts +1 -1
  27. package/dest/private/circuit_recording/file_circuit_recorder.d.ts.map +1 -1
  28. package/dest/private/circuit_recording/memory_circuit_recorder.d.ts +1 -1
  29. package/dest/private/circuit_recording/memory_circuit_recorder.d.ts.map +1 -1
  30. package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts +1 -1
  31. package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts.map +1 -1
  32. package/dest/private/circuit_simulator.d.ts +1 -1
  33. package/dest/private/factory.d.ts +1 -1
  34. package/dest/public/avm/avm_context.d.ts +3 -3
  35. package/dest/public/avm/avm_context.d.ts.map +1 -1
  36. package/dest/public/avm/avm_contract_call_result.d.ts +6 -6
  37. package/dest/public/avm/avm_contract_call_result.d.ts.map +1 -1
  38. package/dest/public/avm/avm_contract_call_result.js +3 -3
  39. package/dest/public/avm/avm_execution_environment.d.ts +9 -8
  40. package/dest/public/avm/avm_execution_environment.d.ts.map +1 -1
  41. package/dest/public/avm/avm_execution_environment.js +5 -8
  42. package/dest/public/avm/avm_gas.d.ts +2 -2
  43. package/dest/public/avm/avm_gas.d.ts.map +1 -1
  44. package/dest/public/avm/avm_machine_state.d.ts +7 -6
  45. package/dest/public/avm/avm_machine_state.d.ts.map +1 -1
  46. package/dest/public/avm/avm_machine_state.js +3 -2
  47. package/dest/public/avm/avm_memory_types.d.ts +14 -14
  48. package/dest/public/avm/avm_memory_types.d.ts.map +1 -1
  49. package/dest/public/avm/avm_memory_types.js +4 -1
  50. package/dest/public/avm/avm_simulator.d.ts +5 -3
  51. package/dest/public/avm/avm_simulator.d.ts.map +1 -1
  52. package/dest/public/avm/avm_simulator.js +13 -11
  53. package/dest/public/avm/avm_simulator_interface.d.ts +1 -1
  54. package/dest/public/avm/calldata.d.ts +51 -0
  55. package/dest/public/avm/calldata.d.ts.map +1 -0
  56. package/dest/public/avm/calldata.js +63 -0
  57. package/dest/public/avm/errors.d.ts +8 -2
  58. package/dest/public/avm/errors.d.ts.map +1 -1
  59. package/dest/public/avm/errors.js +14 -2
  60. package/dest/public/avm/fixtures/avm_simulation_tester.d.ts +1 -1
  61. package/dest/public/avm/fixtures/avm_simulation_tester.d.ts.map +1 -1
  62. package/dest/public/avm/fixtures/avm_simulation_tester.js +15 -5
  63. package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts +2 -2
  64. package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts.map +1 -1
  65. package/dest/public/avm/fixtures/base_avm_simulation_tester.js +1 -1
  66. package/dest/public/avm/fixtures/initializers.d.ts +2 -3
  67. package/dest/public/avm/fixtures/initializers.d.ts.map +1 -1
  68. package/dest/public/avm/fixtures/initializers.js +8 -5
  69. package/dest/public/avm/fixtures/utils.d.ts +4 -3
  70. package/dest/public/avm/fixtures/utils.d.ts.map +1 -1
  71. package/dest/public/avm/fixtures/utils.js +3 -2
  72. package/dest/public/avm/index.d.ts +1 -1
  73. package/dest/public/avm/opcodes/accrued_substate.d.ts +15 -15
  74. package/dest/public/avm/opcodes/accrued_substate.d.ts.map +1 -1
  75. package/dest/public/avm/opcodes/accrued_substate.js +33 -29
  76. package/dest/public/avm/opcodes/addressing_mode.d.ts +1 -1
  77. package/dest/public/avm/opcodes/addressing_mode.d.ts.map +1 -1
  78. package/dest/public/avm/opcodes/addressing_mode.js +2 -2
  79. package/dest/public/avm/opcodes/arithmetic.d.ts +3 -1
  80. package/dest/public/avm/opcodes/arithmetic.d.ts.map +1 -1
  81. package/dest/public/avm/opcodes/arithmetic.js +12 -2
  82. package/dest/public/avm/opcodes/bitwise.d.ts +3 -3
  83. package/dest/public/avm/opcodes/bitwise.d.ts.map +1 -1
  84. package/dest/public/avm/opcodes/bitwise.js +5 -5
  85. package/dest/public/avm/opcodes/comparators.d.ts +1 -1
  86. package/dest/public/avm/opcodes/comparators.d.ts.map +1 -1
  87. package/dest/public/avm/opcodes/comparators.js +1 -1
  88. package/dest/public/avm/opcodes/contract.d.ts +3 -3
  89. package/dest/public/avm/opcodes/contract.d.ts.map +1 -1
  90. package/dest/public/avm/opcodes/contract.js +8 -8
  91. package/dest/public/avm/opcodes/control_flow.d.ts +3 -3
  92. package/dest/public/avm/opcodes/control_flow.d.ts.map +1 -1
  93. package/dest/public/avm/opcodes/control_flow.js +4 -4
  94. package/dest/public/avm/opcodes/conversion.d.ts +3 -3
  95. package/dest/public/avm/opcodes/conversion.d.ts.map +1 -1
  96. package/dest/public/avm/opcodes/conversion.js +4 -4
  97. package/dest/public/avm/opcodes/ec_add.d.ts +3 -3
  98. package/dest/public/avm/opcodes/ec_add.d.ts.map +1 -1
  99. package/dest/public/avm/opcodes/ec_add.js +17 -8
  100. package/dest/public/avm/opcodes/environment_getters.d.ts +5 -5
  101. package/dest/public/avm/opcodes/environment_getters.d.ts.map +1 -1
  102. package/dest/public/avm/opcodes/environment_getters.js +6 -6
  103. package/dest/public/avm/opcodes/external_calls.d.ts +9 -9
  104. package/dest/public/avm/opcodes/external_calls.d.ts.map +1 -1
  105. package/dest/public/avm/opcodes/external_calls.js +23 -22
  106. package/dest/public/avm/opcodes/hashing.d.ts +7 -7
  107. package/dest/public/avm/opcodes/hashing.d.ts.map +1 -1
  108. package/dest/public/avm/opcodes/hashing.js +21 -16
  109. package/dest/public/avm/opcodes/index.d.ts +1 -1
  110. package/dest/public/avm/opcodes/instruction.d.ts +2 -2
  111. package/dest/public/avm/opcodes/instruction.d.ts.map +1 -1
  112. package/dest/public/avm/opcodes/instruction_impl.d.ts +4 -4
  113. package/dest/public/avm/opcodes/instruction_impl.d.ts.map +1 -1
  114. package/dest/public/avm/opcodes/instruction_impl.js +4 -4
  115. package/dest/public/avm/opcodes/memory.d.ts +13 -13
  116. package/dest/public/avm/opcodes/memory.d.ts.map +1 -1
  117. package/dest/public/avm/opcodes/memory.js +26 -26
  118. package/dest/public/avm/opcodes/misc.d.ts +3 -3
  119. package/dest/public/avm/opcodes/misc.d.ts.map +1 -1
  120. package/dest/public/avm/opcodes/misc.js +8 -8
  121. package/dest/public/avm/opcodes/storage.d.ts +14 -13
  122. package/dest/public/avm/opcodes/storage.d.ts.map +1 -1
  123. package/dest/public/avm/opcodes/storage.js +34 -24
  124. package/dest/public/avm/revert_reason.d.ts +2 -2
  125. package/dest/public/avm/revert_reason.d.ts.map +1 -1
  126. package/dest/public/avm/revert_reason.js +3 -2
  127. package/dest/public/avm/serialization/buffer_cursor.d.ts +1 -1
  128. package/dest/public/avm/serialization/buffer_cursor.d.ts.map +1 -1
  129. package/dest/public/avm/serialization/bytecode_serialization.d.ts +1 -1
  130. package/dest/public/avm/serialization/bytecode_serialization.d.ts.map +1 -1
  131. package/dest/public/avm/serialization/bytecode_serialization.js +9 -6
  132. package/dest/public/avm/serialization/instruction_serialization.d.ts +1 -1
  133. package/dest/public/avm/serialization/instruction_serialization.js +1 -1
  134. package/dest/public/avm/test_utils.d.ts +2 -2
  135. package/dest/public/avm/test_utils.d.ts.map +1 -1
  136. package/dest/public/avm/test_utils.js +1 -1
  137. package/dest/public/contracts_db_checkpoint.d.ts +16 -0
  138. package/dest/public/contracts_db_checkpoint.d.ts.map +1 -0
  139. package/dest/public/contracts_db_checkpoint.js +30 -0
  140. package/dest/public/db_interfaces.d.ts +14 -2
  141. package/dest/public/db_interfaces.d.ts.map +1 -1
  142. package/dest/public/debug_fn_name.d.ts +16 -3
  143. package/dest/public/debug_fn_name.d.ts.map +1 -1
  144. package/dest/public/debug_fn_name.js +31 -3
  145. package/dest/public/executor_metrics.d.ts +3 -2
  146. package/dest/public/executor_metrics.d.ts.map +1 -1
  147. package/dest/public/executor_metrics.js +9 -35
  148. package/dest/public/executor_metrics_interface.d.ts +3 -2
  149. package/dest/public/executor_metrics_interface.d.ts.map +1 -1
  150. package/dest/public/fixtures/amm_test.d.ts +1 -1
  151. package/dest/public/fixtures/amm_test.js +2 -2
  152. package/dest/public/fixtures/bulk_test.d.ts +3 -3
  153. package/dest/public/fixtures/bulk_test.d.ts.map +1 -1
  154. package/dest/public/fixtures/bulk_test.js +5 -69
  155. package/dest/public/fixtures/custom_bytecode_tester.d.ts +29 -7
  156. package/dest/public/fixtures/custom_bytecode_tester.d.ts.map +1 -1
  157. package/dest/public/fixtures/custom_bytecode_tester.js +36 -12
  158. package/dest/public/fixtures/custom_bytecode_tests.d.ts +11 -8
  159. package/dest/public/fixtures/custom_bytecode_tests.d.ts.map +1 -1
  160. package/dest/public/fixtures/custom_bytecode_tests.js +83 -18
  161. package/dest/public/fixtures/index.d.ts +4 -2
  162. package/dest/public/fixtures/index.d.ts.map +1 -1
  163. package/dest/public/fixtures/index.js +3 -1
  164. package/dest/public/fixtures/minimal_public_tx.d.ts +2 -8
  165. package/dest/public/fixtures/minimal_public_tx.d.ts.map +1 -1
  166. package/dest/public/fixtures/minimal_public_tx.js +6 -16
  167. package/dest/public/fixtures/opcode_spammer.d.ts +123 -0
  168. package/dest/public/fixtures/opcode_spammer.d.ts.map +1 -0
  169. package/dest/public/fixtures/opcode_spammer.js +1693 -0
  170. package/dest/public/fixtures/public_tx_simulation_tester.d.ts +24 -6
  171. package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +1 -1
  172. package/dest/public/fixtures/public_tx_simulation_tester.js +62 -21
  173. package/dest/public/fixtures/simple_contract_data_source.d.ts +5 -4
  174. package/dest/public/fixtures/simple_contract_data_source.d.ts.map +1 -1
  175. package/dest/public/fixtures/simple_contract_data_source.js +4 -4
  176. package/dest/public/fixtures/token_test.d.ts +6 -2
  177. package/dest/public/fixtures/token_test.d.ts.map +1 -1
  178. package/dest/public/fixtures/token_test.js +13 -12
  179. package/dest/public/fixtures/utils.d.ts +2 -2
  180. package/dest/public/fixtures/utils.d.ts.map +1 -1
  181. package/dest/public/fixtures/utils.js +4 -3
  182. package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts +60 -0
  183. package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts.map +1 -0
  184. package/dest/public/fuzzing/avm_fuzzer_simulator.js +171 -0
  185. package/dest/public/fuzzing/avm_simulator_bin.d.ts +2 -0
  186. package/dest/public/fuzzing/avm_simulator_bin.d.ts.map +1 -0
  187. package/dest/public/fuzzing/avm_simulator_bin.js +118 -0
  188. package/dest/public/hinting_db_sources.d.ts +14 -4
  189. package/dest/public/hinting_db_sources.d.ts.map +1 -1
  190. package/dest/public/hinting_db_sources.js +71 -13
  191. package/dest/public/index.d.ts +3 -2
  192. package/dest/public/index.d.ts.map +1 -1
  193. package/dest/public/index.js +1 -1
  194. package/dest/public/public_db_sources.d.ts +22 -63
  195. package/dest/public/public_db_sources.d.ts.map +1 -1
  196. package/dest/public/public_db_sources.js +74 -131
  197. package/dest/public/public_errors.d.ts +1 -1
  198. package/dest/public/public_errors.d.ts.map +1 -1
  199. package/dest/public/public_processor/guarded_merkle_tree.d.ts +6 -4
  200. package/dest/public/public_processor/guarded_merkle_tree.d.ts.map +1 -1
  201. package/dest/public/public_processor/guarded_merkle_tree.js +5 -0
  202. package/dest/public/public_processor/public_processor.d.ts +12 -19
  203. package/dest/public/public_processor/public_processor.d.ts.map +1 -1
  204. package/dest/public/public_processor/public_processor.js +456 -64
  205. package/dest/public/public_processor/public_processor_metrics.d.ts +1 -1
  206. package/dest/public/public_processor/public_processor_metrics.d.ts.map +1 -1
  207. package/dest/public/public_processor/public_processor_metrics.js +12 -45
  208. package/dest/public/public_tx_simulator/contract_provider_for_cpp.d.ts +18 -0
  209. package/dest/public/public_tx_simulator/contract_provider_for_cpp.d.ts.map +1 -0
  210. package/dest/public/public_tx_simulator/contract_provider_for_cpp.js +98 -0
  211. package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts +34 -22
  212. package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts.map +1 -1
  213. package/dest/public/public_tx_simulator/cpp_public_tx_simulator.js +93 -50
  214. package/dest/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.d.ts +42 -0
  215. package/dest/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.d.ts.map +1 -0
  216. package/dest/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.js +86 -0
  217. package/dest/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.d.ts +30 -0
  218. package/dest/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.d.ts.map +1 -0
  219. package/dest/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.js +171 -0
  220. package/dest/public/public_tx_simulator/dumping_cpp_public_tx_simulator.d.ts +22 -0
  221. package/dest/public/public_tx_simulator/dumping_cpp_public_tx_simulator.d.ts.map +1 -0
  222. package/dest/public/public_tx_simulator/dumping_cpp_public_tx_simulator.js +52 -0
  223. package/dest/public/public_tx_simulator/factories.d.ts +13 -0
  224. package/dest/public/public_tx_simulator/factories.d.ts.map +1 -0
  225. package/dest/public/public_tx_simulator/factories.js +28 -0
  226. package/dest/public/public_tx_simulator/index.d.ts +5 -1
  227. package/dest/public/public_tx_simulator/index.d.ts.map +1 -1
  228. package/dest/public/public_tx_simulator/index.js +3 -0
  229. package/dest/public/public_tx_simulator/measured_public_tx_simulator.d.ts +14 -7
  230. package/dest/public/public_tx_simulator/measured_public_tx_simulator.d.ts.map +1 -1
  231. package/dest/public/public_tx_simulator/measured_public_tx_simulator.js +5 -5
  232. package/dest/public/public_tx_simulator/public_tx_context.d.ts +6 -3
  233. package/dest/public/public_tx_simulator/public_tx_context.d.ts.map +1 -1
  234. package/dest/public/public_tx_simulator/public_tx_context.js +13 -5
  235. package/dest/public/public_tx_simulator/public_tx_simulator.d.ts +13 -32
  236. package/dest/public/public_tx_simulator/public_tx_simulator.d.ts.map +1 -1
  237. package/dest/public/public_tx_simulator/public_tx_simulator.js +115 -129
  238. package/dest/public/public_tx_simulator/public_tx_simulator_interface.d.ts +25 -2
  239. package/dest/public/public_tx_simulator/public_tx_simulator_interface.d.ts.map +1 -1
  240. package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.d.ts +4 -4
  241. package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.d.ts.map +1 -1
  242. package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.js +395 -19
  243. package/dest/public/side_effect_errors.d.ts +1 -1
  244. package/dest/public/side_effect_errors.d.ts.map +1 -1
  245. package/dest/public/side_effect_trace.d.ts +2 -2
  246. package/dest/public/side_effect_trace.d.ts.map +1 -1
  247. package/dest/public/side_effect_trace.js +1 -1
  248. package/dest/public/side_effect_trace_interface.d.ts +3 -4
  249. package/dest/public/side_effect_trace_interface.d.ts.map +1 -1
  250. package/dest/public/state_manager/index.d.ts +1 -1
  251. package/dest/public/state_manager/nullifiers.d.ts +2 -2
  252. package/dest/public/state_manager/nullifiers.d.ts.map +1 -1
  253. package/dest/public/state_manager/public_storage.d.ts +2 -2
  254. package/dest/public/state_manager/public_storage.d.ts.map +1 -1
  255. package/dest/public/state_manager/public_storage.js +1 -1
  256. package/dest/public/state_manager/state_manager.d.ts +9 -11
  257. package/dest/public/state_manager/state_manager.d.ts.map +1 -1
  258. package/dest/public/state_manager/state_manager.js +12 -8
  259. package/dest/public/test_executor_metrics.d.ts +4 -3
  260. package/dest/public/test_executor_metrics.d.ts.map +1 -1
  261. package/dest/public/test_executor_metrics.js +5 -4
  262. package/dest/public/unique_class_ids.d.ts +1 -1
  263. package/dest/public/unique_class_ids.d.ts.map +1 -1
  264. package/dest/public/utils.d.ts +1 -1
  265. package/dest/server.d.ts +1 -1
  266. package/dest/testing.d.ts +1 -1
  267. package/package.json +21 -20
  268. package/src/common/errors.ts +1 -1
  269. package/src/private/acvm/deserialize.ts +1 -1
  270. package/src/private/acvm/serialize.ts +1 -1
  271. package/src/private/circuit_recording/circuit_recorder.ts +17 -16
  272. package/src/public/avm/avm_context.ts +2 -2
  273. package/src/public/avm/avm_contract_call_result.ts +8 -6
  274. package/src/public/avm/avm_execution_environment.ts +13 -10
  275. package/src/public/avm/avm_gas.ts +3 -3
  276. package/src/public/avm/avm_machine_state.ts +7 -6
  277. package/src/public/avm/avm_memory_types.ts +5 -1
  278. package/src/public/avm/avm_simulator.ts +19 -14
  279. package/src/public/avm/calldata.ts +100 -0
  280. package/src/public/avm/errors.ts +17 -3
  281. package/src/public/avm/fixtures/avm_simulation_tester.ts +18 -4
  282. package/src/public/avm/fixtures/base_avm_simulation_tester.ts +1 -1
  283. package/src/public/avm/fixtures/initializers.ts +10 -11
  284. package/src/public/avm/fixtures/utils.ts +3 -2
  285. package/src/public/avm/opcodes/accrued_substate.ts +21 -15
  286. package/src/public/avm/opcodes/addressing_mode.ts +2 -2
  287. package/src/public/avm/opcodes/arithmetic.ts +14 -2
  288. package/src/public/avm/opcodes/bitwise.ts +3 -3
  289. package/src/public/avm/opcodes/comparators.ts +1 -1
  290. package/src/public/avm/opcodes/contract.ts +4 -7
  291. package/src/public/avm/opcodes/control_flow.ts +2 -2
  292. package/src/public/avm/opcodes/conversion.ts +3 -3
  293. package/src/public/avm/opcodes/ec_add.ts +15 -6
  294. package/src/public/avm/opcodes/environment_getters.ts +7 -7
  295. package/src/public/avm/opcodes/external_calls.ts +17 -15
  296. package/src/public/avm/opcodes/hashing.ts +16 -10
  297. package/src/public/avm/opcodes/instruction_impl.ts +2 -2
  298. package/src/public/avm/opcodes/memory.ts +20 -20
  299. package/src/public/avm/opcodes/misc.ts +6 -6
  300. package/src/public/avm/opcodes/storage.ts +30 -22
  301. package/src/public/avm/revert_reason.ts +6 -3
  302. package/src/public/avm/serialization/bytecode_serialization.ts +17 -6
  303. package/src/public/avm/serialization/instruction_serialization.ts +1 -1
  304. package/src/public/avm/test_utils.ts +1 -1
  305. package/src/public/contracts_db_checkpoint.ts +41 -0
  306. package/src/public/db_interfaces.ts +16 -1
  307. package/src/public/debug_fn_name.ts +39 -5
  308. package/src/public/executor_metrics.ts +9 -35
  309. package/src/public/executor_metrics_interface.ts +2 -1
  310. package/src/public/fixtures/amm_test.ts +2 -2
  311. package/src/public/fixtures/bulk_test.ts +9 -9
  312. package/src/public/fixtures/custom_bytecode_tester.ts +54 -20
  313. package/src/public/fixtures/custom_bytecode_tests.ts +111 -18
  314. package/src/public/fixtures/index.ts +7 -1
  315. package/src/public/fixtures/minimal_public_tx.ts +7 -17
  316. package/src/public/fixtures/opcode_spammer.ts +1754 -0
  317. package/src/public/fixtures/public_tx_simulation_tester.ts +85 -21
  318. package/src/public/fixtures/simple_contract_data_source.ts +8 -9
  319. package/src/public/fixtures/token_test.ts +18 -10
  320. package/src/public/fixtures/utils.ts +2 -3
  321. package/src/public/fuzzing/avm_fuzzer_simulator.ts +288 -0
  322. package/src/public/fuzzing/avm_simulator_bin.ts +175 -0
  323. package/src/public/hinting_db_sources.ts +112 -10
  324. package/src/public/index.ts +6 -4
  325. package/src/public/public_db_sources.ts +93 -172
  326. package/src/public/public_processor/guarded_merkle_tree.ts +8 -3
  327. package/src/public/public_processor/public_processor.ts +86 -59
  328. package/src/public/public_processor/public_processor_metrics.ts +11 -45
  329. package/src/public/public_tx_simulator/contract_provider_for_cpp.ts +121 -0
  330. package/src/public/public_tx_simulator/cpp_public_tx_simulator.ts +137 -57
  331. package/src/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.ts +132 -0
  332. package/src/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.ts +237 -0
  333. package/src/public/public_tx_simulator/dumping_cpp_public_tx_simulator.ts +81 -0
  334. package/src/public/public_tx_simulator/factories.ts +41 -0
  335. package/src/public/public_tx_simulator/index.ts +4 -0
  336. package/src/public/public_tx_simulator/measured_public_tx_simulator.ts +10 -14
  337. package/src/public/public_tx_simulator/public_tx_context.ts +9 -3
  338. package/src/public/public_tx_simulator/public_tx_simulator.ts +171 -196
  339. package/src/public/public_tx_simulator/public_tx_simulator_interface.ts +24 -2
  340. package/src/public/public_tx_simulator/telemetry_public_tx_simulator.ts +3 -3
  341. package/src/public/side_effect_trace.ts +1 -1
  342. package/src/public/side_effect_trace_interface.ts +1 -1
  343. package/src/public/state_manager/nullifiers.ts +1 -1
  344. package/src/public/state_manager/public_storage.ts +1 -1
  345. package/src/public/state_manager/state_manager.ts +16 -30
  346. package/src/public/test_executor_metrics.ts +7 -5
  347. package/dest/public/tx_contract_cache.d.ts +0 -41
  348. package/dest/public/tx_contract_cache.d.ts.map +0 -1
  349. package/dest/public/tx_contract_cache.js +0 -49
  350. package/src/public/tx_contract_cache.ts +0 -69
@@ -1,47 +1,31 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { type Logger } from '@aztec/foundation/log';
3
- import { type AvmProvingRequest, type RevertCode } from '@aztec/stdlib/avm';
3
+ import { PublicSimulatorConfig, PublicTxResult } from '@aztec/stdlib/avm';
4
4
  import { SimulationError } from '@aztec/stdlib/errors';
5
- import type { Gas, GasUsed } from '@aztec/stdlib/gas';
6
- import type { DebugLog } from '@aztec/stdlib/logs';
5
+ import { Gas } from '@aztec/stdlib/gas';
7
6
  import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
8
- import { type GlobalVariables, NestedProcessReturnValues, PublicCallRequestWithCalldata, Tx, TxExecutionPhase } from '@aztec/stdlib/tx';
7
+ import { type GlobalVariables, NestedProcessReturnValues, ProtocolContracts, PublicCallRequestWithCalldata, Tx, TxExecutionPhase } from '@aztec/stdlib/tx';
9
8
  import type { AvmFinalizedCallResult } from '../avm/avm_contract_call_result.js';
10
9
  import { type PublicContractsDB } from '../public_db_sources.js';
11
10
  import type { PublicPersistableStateManager } from '../state_manager/state_manager.js';
12
11
  import { PublicTxContext } from './public_tx_context.js';
13
12
  import type { PublicTxSimulatorInterface } from './public_tx_simulator_interface.js';
14
- export type ProcessedPhase = {
13
+ /** Only used internally. */
14
+ type ProcessedPhase = {
15
15
  phase: TxExecutionPhase;
16
16
  durationMs?: number;
17
17
  returnValues: NestedProcessReturnValues[];
18
18
  reverted: boolean;
19
19
  revertReason?: SimulationError;
20
20
  };
21
- export type PublicTxResult = {
22
- avmProvingRequest: AvmProvingRequest;
23
- /** Gas used during the execution of this tx */
24
- gasUsed: GasUsed;
25
- revertCode: RevertCode;
26
- /** Revert reason, if any */
27
- revertReason?: SimulationError;
28
- processedPhases: ProcessedPhase[];
29
- logs: DebugLog[];
30
- };
31
- export type PublicTxSimulatorConfig = {
32
- proverId: Fr;
33
- doMerkleOperations: boolean;
34
- skipFeeEnforcement: boolean;
35
- clientInitiatedSimulation: boolean;
36
- maxDebugLogMemoryReads: number;
37
- };
38
21
  export declare class PublicTxSimulator implements PublicTxSimulatorInterface {
39
22
  protected merkleTree: MerkleTreeWriteOperations;
40
23
  protected contractsDB: PublicContractsDB;
41
24
  protected globalVariables: GlobalVariables;
25
+ protected protocolContracts: ProtocolContracts;
42
26
  protected log: Logger;
43
- private config;
44
- constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables, config?: Partial<PublicTxSimulatorConfig>);
27
+ protected readonly config: PublicSimulatorConfig;
28
+ constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables, config?: Partial<PublicSimulatorConfig>, protocolContracts?: ProtocolContracts);
45
29
  /**
46
30
  * Simulate a transaction's public portion including all of its phases.
47
31
  * @param tx - The transaction to simulate.
@@ -80,7 +64,7 @@ export declare class PublicTxSimulator implements PublicTxSimulatorInterface {
80
64
  /**
81
65
  * Insert the non-revertible accumulated data from private into the public state.
82
66
  */
83
- protected insertNonRevertiblesFromPrivate(context: PublicTxContext, tx: Tx): Promise<void>;
67
+ protected insertNonRevertiblesFromPrivate(context: PublicTxContext): Promise<void>;
84
68
  /**
85
69
  * Insert the revertible accumulated data from private into the public state.
86
70
  * Throws TxSimRevertibleInsertionsRevert if there is some checked error during revertible insertions.
@@ -90,11 +74,8 @@ export declare class PublicTxSimulator implements PublicTxSimulatorInterface {
90
74
  * - NoteHashLimitReachedError
91
75
  * - L2ToL1MessageLimitReachedError
92
76
  */
93
- protected insertRevertiblesFromPrivate(context: PublicTxContext, tx: Tx): Promise<void>;
77
+ protected insertRevertiblesFromPrivate(context: PublicTxContext): Promise<void>;
94
78
  private payFee;
95
- /**
96
- * Generate the proving request for the AVM circuit.
97
- */
98
- private static generateProvingRequest;
99
79
  }
100
- //# sourceMappingURL=public_tx_simulator.d.ts.map
80
+ export {};
81
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX3R4X3NpbXVsYXRvci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOl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AS,CAAC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IAEjD,YACY,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,iBAAiB,EAC9B,eAAe,EAAE,eAAe,EAC1C,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,EAC7B,iBAAiB,GAAE,iBAAyC,EAIvE;IAED;;;;OAIG;IACU,QAAQ,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CA0IrD;IAED,SAAS,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,qCAE7B;IAED;;;;OAIG;IACH,UAAgB,aAAa,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAmCxG;IAED;;;;;;OAMG;IACH,UAAgB,oBAAoB,CAClC,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,6BAA6B,GACzC,OAAO,CAAC,sBAAsB,CAAC,CA+BjC;IAED;;;;;;;;;;;;OAYG;IACH,UAAgB,4BAA4B,CAC1C,YAAY,EAAE,6BAA6B,EAC3C,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,6BAA6B,EACpD,YAAY,EAAE,GAAG,EACjB,cAAc,EAAE,EAAE,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,sBAAsB,CAAC,CAqBjC;IAED;;OAEG;IACH,UAAgB,+BAA+B,CAAC,OAAO,EAAE,eAAe,iBAyBvE;IAED;;;;;;;;OAQG;IACH,UAAgB,4BAA4B,CAAC,OAAO,EAAE,eAAe,iBA0EpE;YAEa,MAAM;CAmCrB"}
@@ -1,13 +1,12 @@
1
- import { AVM_MAX_PROCESSABLE_L2_GAS, DEFAULT_MAX_DEBUG_LOG_MEMORY_READS } from '@aztec/constants';
2
- import { Fr } from '@aztec/foundation/fields';
1
+ import { AVM_MAX_PROCESSABLE_L2_GAS } from '@aztec/constants';
3
2
  import { createLogger } from '@aztec/foundation/log';
4
3
  import { ProtocolContractAddress, ProtocolContractsList } from '@aztec/protocol-contracts';
5
4
  import { computeFeePayerBalanceStorageSlot } from '@aztec/protocol-contracts/fee-juice';
6
- import { AvmCircuitInputs, AvmExecutionHints, AvmTxHint } from '@aztec/stdlib/avm';
5
+ import { AvmExecutionHints, AvmTxHint, PublicSimulatorConfig, PublicTxEffect, PublicTxResult } from '@aztec/stdlib/avm';
7
6
  import { SimulationError } from '@aztec/stdlib/errors';
8
- import { ProvingRequestType } from '@aztec/stdlib/proofs';
9
7
  import { NestedProcessReturnValues, TxExecutionPhase } from '@aztec/stdlib/tx';
10
8
  import { strict as assert } from 'assert';
9
+ import { CallDataArray } from '../avm/calldata.js';
11
10
  import { AvmSimulator } from '../avm/index.js';
12
11
  import { getPublicFunctionDebugName } from '../debug_fn_name.js';
13
12
  import { HintingMerkleWriteOperations, HintingPublicContractsDB } from '../hinting_db_sources.js';
@@ -46,19 +45,15 @@ export class PublicTxSimulator {
46
45
  merkleTree;
47
46
  contractsDB;
48
47
  globalVariables;
48
+ protocolContracts;
49
49
  log;
50
50
  config;
51
- constructor(merkleTree, contractsDB, globalVariables, config){
51
+ constructor(merkleTree, contractsDB, globalVariables, config, protocolContracts = ProtocolContractsList){
52
52
  this.merkleTree = merkleTree;
53
53
  this.contractsDB = contractsDB;
54
54
  this.globalVariables = globalVariables;
55
- this.config = {
56
- proverId: config?.proverId ?? Fr.ZERO,
57
- doMerkleOperations: config?.doMerkleOperations ?? false,
58
- skipFeeEnforcement: config?.skipFeeEnforcement ?? false,
59
- clientInitiatedSimulation: config?.clientInitiatedSimulation ?? false,
60
- maxDebugLogMemoryReads: config?.maxDebugLogMemoryReads ?? DEFAULT_MAX_DEBUG_LOG_MEMORY_READS
61
- };
55
+ this.protocolContracts = protocolContracts;
56
+ this.config = PublicSimulatorConfig.from(config ?? {});
62
57
  this.log = createLogger(`simulator:public_tx_simulator`);
63
58
  }
64
59
  /**
@@ -66,107 +61,98 @@ export class PublicTxSimulator {
66
61
  * @param tx - The transaction to simulate.
67
62
  * @returns The result of the transaction's public execution.
68
63
  */ async simulate(tx) {
69
- try {
70
- const txHash = this.computeTxHash(tx);
71
- this.log.debug(`Simulating ${tx.publicFunctionCalldata.length} public calls for tx ${txHash}`, {
72
- txHash
73
- });
74
- // Create hinting DBs.
75
- const hints = new AvmExecutionHints(this.globalVariables, AvmTxHint.fromTx(tx, this.globalVariables.gasFees), ProtocolContractsList);
76
- const hintingMerkleTree = await HintingMerkleWriteOperations.create(this.merkleTree, hints);
77
- const hintingTreesDB = new PublicTreesDB(hintingMerkleTree);
78
- const hintingContractsDB = new HintingPublicContractsDB(this.contractsDB, hints);
79
- const context = await PublicTxContext.create(hintingTreesDB, hintingContractsDB, tx, this.globalVariables, ProtocolContractsList, this.config.doMerkleOperations, this.config.proverId);
80
- // This will throw if there is a nullifier collision.
64
+ const txHash = this.computeTxHash(tx);
65
+ this.log.debug(`Simulating ${tx.publicFunctionCalldata.length} public calls for tx ${txHash}`, {
66
+ txHash
67
+ });
68
+ // Create hinting DBs.
69
+ const hints = new AvmExecutionHints(this.globalVariables, AvmTxHint.fromTx(tx, this.globalVariables.gasFees), this.protocolContracts);
70
+ const hintingMerkleTree = await HintingMerkleWriteOperations.create(this.merkleTree, hints);
71
+ const hintingTreesDB = new PublicTreesDB(hintingMerkleTree);
72
+ const hintingContractsDB = new HintingPublicContractsDB(this.contractsDB, hints);
73
+ const context = await PublicTxContext.create(hintingTreesDB, hintingContractsDB, tx, this.globalVariables, this.protocolContracts, this.config.proverId);
74
+ // This will throw if there is a nullifier collision.
75
+ // In that case the transaction will be thrown out.
76
+ await this.insertNonRevertiblesFromPrivate(context);
77
+ const processedPhases = [];
78
+ if (context.hasPhase(TxExecutionPhase.SETUP)) {
79
+ // This will throw if the setup phase reverts.
81
80
  // In that case the transaction will be thrown out.
82
- await this.insertNonRevertiblesFromPrivate(context, tx);
83
- const processedPhases = [];
84
- if (context.hasPhase(TxExecutionPhase.SETUP)) {
85
- // This will throw if the setup phase reverts.
86
- // In that case the transaction will be thrown out.
87
- const setupResult = await this.simulatePhase(TxExecutionPhase.SETUP, context);
88
- if (setupResult.reverted) {
89
- throw new Error(`Setup phase reverted! The transaction will be thrown out. ${setupResult.revertReason?.message}`);
90
- }
91
- processedPhases.push(setupResult);
81
+ const setupResult = await this.simulatePhase(TxExecutionPhase.SETUP, context);
82
+ if (setupResult.reverted) {
83
+ throw new Error(`[SETUP] UNRECOVERABLE ERROR! The transaction will be thrown out. ${setupResult.revertReason?.message}`);
92
84
  }
93
- // The checkpoint we should go back to if anything from now on reverts.
94
- await context.state.fork();
95
- try {
96
- // This will throw if there is a nullifier collision or other insertion error (limit reached).
97
- await this.insertRevertiblesFromPrivate(context, tx);
98
- // Only proceed with app logic if there was no revert during revertible insertion.
99
- if (context.hasPhase(TxExecutionPhase.APP_LOGIC)) {
100
- const appLogicResult = await this.simulatePhase(TxExecutionPhase.APP_LOGIC, context);
101
- processedPhases.push(appLogicResult);
102
- if (appLogicResult.reverted) {
103
- throw new TxSimAppLogicRevert();
104
- }
105
- }
106
- } catch (e) {
107
- if (e instanceof TxSimRevertibleInsertionsRevert || e instanceof TxSimAppLogicRevert) {
108
- // We revert to the post-setup state.
109
- await context.state.discardForkedState();
110
- // But we also create a new fork so that the teardown phase can transparently
111
- // commit or rollback at the end of teardown.
112
- await context.state.fork();
113
- } else {
114
- // Unchecked/unknown error - re-throw as-is
115
- throw e;
85
+ processedPhases.push(setupResult);
86
+ }
87
+ // The checkpoint we should go back to if anything from now on reverts.
88
+ await context.state.fork();
89
+ hintingContractsDB.createCheckpoint();
90
+ try {
91
+ // This will throw if there is a nullifier collision or other insertion error (limit reached).
92
+ await this.insertRevertiblesFromPrivate(context);
93
+ // Only proceed with app logic if there was no revert during revertible insertion.
94
+ if (context.hasPhase(TxExecutionPhase.APP_LOGIC)) {
95
+ const appLogicResult = await this.simulatePhase(TxExecutionPhase.APP_LOGIC, context);
96
+ processedPhases.push(appLogicResult);
97
+ if (appLogicResult.reverted) {
98
+ throw new TxSimAppLogicRevert();
116
99
  }
117
100
  }
118
- try {
119
- if (context.hasPhase(TxExecutionPhase.TEARDOWN)) {
120
- const teardownResult = await this.simulatePhase(TxExecutionPhase.TEARDOWN, context);
121
- processedPhases.push(teardownResult);
122
- if (teardownResult.reverted) {
123
- throw new TxSimTeardownRevert();
124
- }
125
- }
126
- // We commit the forked state and we are done.
127
- await context.state.mergeForkedState();
128
- } catch (e) {
129
- if (e instanceof TxSimTeardownRevert) {
130
- // We revert to the post-setup state and we are done.
131
- await context.state.discardForkedState();
132
- } else {
133
- // Unchecked/unknown error - re-throw as-is
134
- throw e;
101
+ } catch (e) {
102
+ if (e instanceof TxSimRevertibleInsertionsRevert || e instanceof TxSimAppLogicRevert) {
103
+ // We revert to the post-setup state.
104
+ await context.state.discardForkedState();
105
+ hintingContractsDB.revertCheckpoint();
106
+ // But we also create a new fork so that the teardown phase can transparently
107
+ // commit or rollback at the end of teardown.
108
+ await context.state.fork();
109
+ hintingContractsDB.createCheckpoint();
110
+ } else {
111
+ // Unchecked/unknown error - re-throw as-is
112
+ throw e;
113
+ }
114
+ }
115
+ try {
116
+ if (context.hasPhase(TxExecutionPhase.TEARDOWN)) {
117
+ const teardownResult = await this.simulatePhase(TxExecutionPhase.TEARDOWN, context);
118
+ processedPhases.push(teardownResult);
119
+ if (teardownResult.reverted) {
120
+ throw new TxSimTeardownRevert();
135
121
  }
136
122
  }
137
- context.halt();
138
- // Such transactions should be filtered by GasTxValidator.
139
- assert(context.getActualGasUsed().l2Gas <= AVM_MAX_PROCESSABLE_L2_GAS, `Transaction consumes ${context.getActualGasUsed().l2Gas} L2 gas, which exceeds the AVM maximum processable gas of ${AVM_MAX_PROCESSABLE_L2_GAS}`);
140
- await this.payFee(context);
141
- const publicInputs = await context.generateAvmCircuitPublicInputs();
142
- const avmProvingRequest = PublicTxSimulator.generateProvingRequest(publicInputs, hints);
143
- const revertCode = context.getFinalRevertCode();
144
- // Commit contracts from this TX to the block-level cache and clear tx cache
145
- // If the tx reverted, only commit non-revertible contracts
146
- // NOTE: You can't create contracts in public, so this is only relevant for private-created contracts
147
- // FIXME(fcarreiro): this should conceptually use the hinted contracts db.
148
- // However things should work as they are now because the hinted db would still pick up the new contracts.
149
- this.contractsDB.commitContractsForTx(/*onlyNonRevertibles=*/ !revertCode.isOK());
150
- return {
151
- avmProvingRequest,
152
- gasUsed: {
153
- totalGas: context.getActualGasUsed(),
154
- teardownGas: context.teardownGasUsed,
155
- publicGas: context.getActualPublicGasUsed(),
156
- billedGas: context.getTotalGasUsed()
157
- },
158
- revertCode,
159
- revertReason: context.revertReason,
160
- processedPhases: processedPhases,
161
- logs: context.state.getActiveStateManager().getLogs()
162
- };
163
- } finally{
164
- // Make sure there are no new contracts in the tx-level cache.
165
- // They should either be committed to block-level cache or cleared.
166
- // FIXME(fcarreiro): this should conceptually use the hinted contracts db.
167
- // However things should work as they are now because the hinted db would still pick up the new contracts.
168
- this.contractsDB.clearContractsForTx();
123
+ // We commit the forked state and we are done.
124
+ await context.state.mergeForkedState();
125
+ hintingContractsDB.commitCheckpoint();
126
+ } catch (e) {
127
+ if (e instanceof TxSimTeardownRevert) {
128
+ // We revert to the post-setup state and we are done.
129
+ await context.state.discardForkedState();
130
+ hintingContractsDB.revertCheckpoint();
131
+ } else {
132
+ // Unchecked/unknown error - re-throw as-is
133
+ throw e;
134
+ }
169
135
  }
136
+ context.halt();
137
+ // Such transactions should be filtered by GasTxValidator.
138
+ assert(context.getActualGasUsed().l2Gas <= AVM_MAX_PROCESSABLE_L2_GAS, `Transaction consumes ${context.getActualGasUsed().l2Gas} L2 gas, which exceeds the AVM maximum processable gas of ${AVM_MAX_PROCESSABLE_L2_GAS}`);
139
+ await this.payFee(context);
140
+ const publicInputs = await context.generateAvmCircuitPublicInputs();
141
+ const revertCode = context.getFinalRevertCode();
142
+ // We only return the app logic phase information, and only 1 per phase.
143
+ const appLogicReturnValues = processedPhases.find(({ phase })=>phase === TxExecutionPhase.APP_LOGIC)?.returnValues ?? [];
144
+ // TODO(fcarreiro): This is a temporary backwards compatibility layer until we migrate to the C++ simulator.
145
+ if (context.revertReason !== undefined) {
146
+ appLogicReturnValues.revertReason = context.revertReason;
147
+ }
148
+ // Create PublicTxEffect from PublicInputs.
149
+ const publicTxEffect = new PublicTxEffect(publicInputs.transactionFee, publicInputs.accumulatedData.noteHashes.filter((h)=>!h.isEmpty()), publicInputs.accumulatedData.nullifiers.filter((n)=>!n.isEmpty()), publicInputs.accumulatedData.l2ToL1Msgs.filter((m)=>!m.isEmpty()), publicInputs.accumulatedData.publicLogs.toLogs(), publicInputs.accumulatedData.publicDataWrites.filter((w)=>!w.isEmpty()));
150
+ return new PublicTxResult(/*gasUsed=*/ {
151
+ totalGas: context.getActualGasUsed(),
152
+ teardownGas: context.teardownGasUsed,
153
+ publicGas: context.getActualPublicGasUsed(),
154
+ billedGas: context.getTotalGasUsed()
155
+ }, /*revertCode=*/ revertCode, /*publicTxEffect=*/ publicTxEffect, /*callStackMetadata=*/ appLogicReturnValues, /*logs=*/ context.state.getActiveStateManager().getLogs(), /*hints=*/ hints, /*publicInputs=*/ publicInputs);
170
156
  }
171
157
  computeTxHash(tx) {
172
158
  return tx.getTxHash();
@@ -191,7 +177,7 @@ export class PublicTxSimulator {
191
177
  }
192
178
  const callRequest = callRequests[i];
193
179
  const enqueuedCallResult = await this.simulateEnqueuedCall(phase, context, callRequest);
194
- returnValues.push(new NestedProcessReturnValues(enqueuedCallResult.output));
180
+ returnValues.push(new NestedProcessReturnValues(enqueuedCallResult.output.bestEffortReadAll()));
195
181
  if (enqueuedCallResult.reverted) {
196
182
  reverted = true;
197
183
  revertReason = enqueuedCallResult.revertReason;
@@ -213,14 +199,14 @@ export class PublicTxSimulator {
213
199
  */ async simulateEnqueuedCall(phase, context, callRequest) {
214
200
  const stateManager = context.state.getActiveStateManager();
215
201
  const contractAddress = callRequest.request.contractAddress;
216
- const fnName = await getPublicFunctionDebugName(this.contractsDB, contractAddress, callRequest.calldata);
202
+ const fnName = await getPublicFunctionDebugName(this.contractsDB, contractAddress, new CallDataArray(callRequest.calldata));
217
203
  const allocatedGas = context.getGasLeftAtPhase(phase);
218
204
  const result = await this.simulateEnqueuedCallInternal(stateManager, callRequest, allocatedGas, /*transactionFee=*/ context.getTransactionFee(phase), fnName);
219
205
  const gasUsed = allocatedGas.sub(result.gasLeft); // by enqueued call
220
206
  context.consumeGas(phase, gasUsed);
221
207
  this.log.debug(`Simulated enqueued public call (${fnName}) consumed ${gasUsed.l2Gas} L2 gas ending with ${result.gasLeft.l2Gas} L2 gas left.`);
222
208
  if (result.reverted) {
223
- const culprit = `${contractAddress}:${callRequest.functionSelector}`;
209
+ const culprit = `${contractAddress}:${fnName}`;
224
210
  context.revert(phase, result.revertReason, culprit);
225
211
  }
226
212
  return result;
@@ -241,13 +227,13 @@ export class PublicTxSimulator {
241
227
  const address = request.contractAddress;
242
228
  const sender = request.msgSender;
243
229
  this.log.debug(`Executing enqueued public call to external function ${fnName}@${address} with ${allocatedGas.l2Gas} allocated L2 gas.`);
244
- const simulator = await AvmSimulator.create(stateManager, address, sender, transactionFee, this.globalVariables, request.isStaticCall, calldata, allocatedGas, this.config.clientInitiatedSimulation, this.config.maxDebugLogMemoryReads);
230
+ const simulator = await AvmSimulator.create(stateManager, address, sender, transactionFee, this.globalVariables, request.isStaticCall, new CallDataArray(calldata), allocatedGas, this.config);
245
231
  const avmCallResult = await simulator.execute();
246
232
  return avmCallResult.finalize();
247
233
  }
248
234
  /**
249
235
  * Insert the non-revertible accumulated data from private into the public state.
250
- */ async insertNonRevertiblesFromPrivate(context, tx) {
236
+ */ async insertNonRevertiblesFromPrivate(context) {
251
237
  const stateManager = context.state.getActiveStateManager();
252
238
  for (const siloedNullifier of context.nonRevertibleAccumulatedDataFromPrivate.nullifiers.filter((n)=>!n.isEmpty())){
253
239
  await stateManager.writeSiloedNullifier(siloedNullifier);
@@ -262,11 +248,12 @@ export class PublicTxSimulator {
262
248
  stateManager.writeScopedL2ToL1Message(l2ToL1Message);
263
249
  }
264
250
  }
265
- // add new contracts to the contracts db so that their functions may be found and called
266
- // TODO(#6464): Should we allow emitting contracts in the private setup phase?
267
- // FIXME(fcarreiro): this should conceptually use the hinted contracts db.
268
- // However things should work as they are now because the hinted db would still pick up the new contracts.
269
- await this.contractsDB.addNewNonRevertibleContracts(tx);
251
+ // add new contracts to the contracts db so that their code may be found and called
252
+ // FIXME(fcarreiro): this should conceptually use the hinting contracts db.
253
+ // However, things work as expected because later calls to getters on the hintingContractsDB
254
+ // will pick up the new contracts and will generate the necessary hints.
255
+ // So, a consumer of the hints will always see the new contracts.
256
+ await this.contractsDB.addContracts(context.nonRevertibleContractDeploymentData);
270
257
  }
271
258
  /**
272
259
  * Insert the revertible accumulated data from private into the public state.
@@ -276,7 +263,7 @@ export class PublicTxSimulator {
276
263
  * - NullifierCollisionError
277
264
  * - NoteHashLimitReachedError
278
265
  * - L2ToL1MessageLimitReachedError
279
- */ async insertRevertiblesFromPrivate(context, tx) {
266
+ */ async insertRevertiblesFromPrivate(context) {
280
267
  const stateManager = context.state.getActiveStateManager();
281
268
  try {
282
269
  for (const siloedNullifier of context.revertibleAccumulatedDataFromPrivate.nullifiers.filter((n)=>!n.isEmpty())){
@@ -323,14 +310,19 @@ export class PublicTxSimulator {
323
310
  }
324
311
  }
325
312
  // add new contracts to the contracts db so that their functions may be found and called
326
- // FIXME(fcarreiro): this should conceptually use the hinted contracts db.
327
- // However things should work as they are now because the hinted db would still pick up the new contracts.
328
- await this.contractsDB.addNewRevertibleContracts(tx);
313
+ // FIXME(fcarreiro): this should conceptually use the hinting contracts db.
314
+ // However, things work as expected because later calls to getters on the hintingContractsDB
315
+ // will pick up the new contracts and will generate the necessary hints.
316
+ // So, a consumer of the hints will always see the new contracts.
317
+ await this.contractsDB.addContracts(context.revertibleContractDeploymentData);
329
318
  }
330
319
  async payFee(context) {
331
320
  const txFee = context.getTransactionFee(TxExecutionPhase.TEARDOWN);
332
321
  if (context.feePayer.isZero()) {
333
- this.log.debug(`No one is paying the fee of ${txFee.toBigInt()}`);
322
+ // Real transactions are enforced by private kernel to have nonzero fee payer.
323
+ // Real transactions cannot skip fee enforcement (skipping fee enforcement makes them unprovable).
324
+ assert(this.config.skipFeeEnforcement, 'Fee payer cannot be 0 unless skipping fee enforcement for simulation');
325
+ this.log.debug(`Fee payer is 0. Skipping fee enforcement. No one is paying the fee of ${txFee.toBigInt()}`);
334
326
  return;
335
327
  }
336
328
  const feeJuiceAddress = ProtocolContractAddress.FeeJuice;
@@ -343,17 +335,11 @@ export class PublicTxSimulator {
343
335
  if (currentBalance.lt(txFee)) {
344
336
  // Without "skipFeeEnforcement", such transactions should be filtered by GasTxValidator.
345
337
  assert(this.config.skipFeeEnforcement, `Not enough balance for fee payer to pay for transaction (got ${currentBalance.toBigInt()} needs ${txFee.toBigInt()})`);
338
+ this.log.debug(`Fee payer balance insufficient, but we're skipping fee enforcement`);
339
+ // We still proceed and perform the storage write to minimize deviation from normal execution.
346
340
  currentBalance = txFee;
347
341
  }
348
342
  const updatedBalance = currentBalance.sub(txFee);
349
343
  await stateManager.writeStorage(feeJuiceAddress, balanceSlot, updatedBalance, true);
350
344
  }
351
- /**
352
- * Generate the proving request for the AVM circuit.
353
- */ static generateProvingRequest(publicInputs, hints) {
354
- return {
355
- type: ProvingRequestType.PUBLIC_VM,
356
- inputs: new AvmCircuitInputs(hints, publicInputs)
357
- };
358
- }
359
345
  }
@@ -1,9 +1,32 @@
1
+ import type { PublicTxResult } from '@aztec/stdlib/avm';
1
2
  import type { Tx } from '@aztec/stdlib/tx';
2
- import type { PublicTxResult } from './public_tx_simulator.js';
3
3
  export interface PublicTxSimulatorInterface {
4
4
  simulate(tx: Tx): Promise<PublicTxResult>;
5
+ /**
6
+ * Cancel the current simulation if one is in progress.
7
+ * This signals the underlying simulator (e.g., C++) to stop at the next safe point.
8
+ * Safe to call even if no simulation is in progress.
9
+ * Optional - not all implementations support cancellation.
10
+ *
11
+ * @param waitTimeoutMs - If provided, wait up to this many ms for the simulation to actually stop.
12
+ * This is important because signaling cancellation doesn't immediately stop C++ -
13
+ * it only sets a flag that C++ checks at certain points. If C++ is in the middle
14
+ * of a slow operation (e.g., pad_trees), it won't stop until that completes.
15
+ * @returns Promise that resolves when cancellation is signaled (and optionally when simulation stops)
16
+ */
17
+ cancel?(waitTimeoutMs?: number): Promise<void>;
5
18
  }
6
19
  export interface MeasuredPublicTxSimulatorInterface {
7
20
  simulate(tx: Tx, txLabel: string): Promise<PublicTxResult>;
21
+ /**
22
+ * Cancel the current simulation if one is in progress.
23
+ * This signals the underlying simulator (e.g., C++) to stop at the next safe point.
24
+ * Safe to call even if no simulation is in progress.
25
+ * Optional - not all implementations support cancellation.
26
+ *
27
+ * @param waitTimeoutMs - If provided, wait up to this many ms for the simulation to actually stop.
28
+ * @returns Promise that resolves when cancellation is signaled (and optionally when simulation stops)
29
+ */
30
+ cancel?(waitTimeoutMs?: number): Promise<void>;
8
31
  }
9
- //# sourceMappingURL=public_tx_simulator_interface.d.ts.map
32
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX3R4X3NpbXVsYXRvcl9pbnRlcmZhY2UuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaWMvcHVibGljX3R4X3NpbXVsYXRvci9wdWJsaWNfdHhfc2ltdWxhdG9yX2ludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxjQUFjLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUN4RCxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUUzQyxNQUFNLFdBQVcsMEJBQTBCO0lBQ3pDLFFBQVEsQ0FBQyxFQUFFLEVBQUUsRUFBRSxHQUFHLE9BQU8sQ0FBQyxjQUFjLENBQUMsQ0FBQztJQUMxQzs7Ozs7Ozs7Ozs7T0FXRztJQUNILE1BQU0sQ0FBQyxDQUFDLGFBQWEsQ0FBQyxFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUM7Q0FDaEQ7QUFFRCxNQUFNLFdBQVcsa0NBQWtDO0lBQ2pELFFBQVEsQ0FBQyxFQUFFLEVBQUUsRUFBRSxFQUFFLE9BQU8sRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLGNBQWMsQ0FBQyxDQUFDO0lBQzNEOzs7Ozs7OztPQVFHO0lBQ0gsTUFBTSxDQUFDLENBQUMsYUFBYSxDQUFDLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQztDQUNoRCJ9
@@ -1 +1 @@
1
- {"version":3,"file":"public_tx_simulator_interface.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/public_tx_simulator_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC5D"}
1
+ {"version":3,"file":"public_tx_simulator_interface.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/public_tx_simulator_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1C;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3D;;;;;;;;OAQG;IACH,MAAM,CAAC,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD"}
@@ -1,4 +1,5 @@
1
- import type { Fr } from '@aztec/foundation/fields';
1
+ import type { Fr } from '@aztec/foundation/curves/bn254';
2
+ import type { PublicSimulatorConfig } from '@aztec/stdlib/avm';
2
3
  import type { Gas } from '@aztec/stdlib/gas';
3
4
  import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
4
5
  import { type GlobalVariables, PublicCallRequestWithCalldata, TxExecutionPhase } from '@aztec/stdlib/tx';
@@ -8,14 +9,13 @@ import type { PublicContractsDB } from '../public_db_sources.js';
8
9
  import type { PublicPersistableStateManager } from '../state_manager/state_manager.js';
9
10
  import { MeasuredPublicTxSimulator } from './measured_public_tx_simulator.js';
10
11
  import { PublicTxContext } from './public_tx_context.js';
11
- import type { PublicTxSimulatorConfig } from './public_tx_simulator.js';
12
12
  /**
13
13
  * A public tx simulator that tracks runtime/production metrics with telemetry.
14
14
  */
15
15
  export declare class TelemetryPublicTxSimulator extends MeasuredPublicTxSimulator {
16
16
  readonly tracer: Tracer;
17
- constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables, telemetryClient?: TelemetryClient, config?: Partial<PublicTxSimulatorConfig>);
17
+ constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables, telemetryClient?: TelemetryClient, config?: Partial<PublicSimulatorConfig>);
18
18
  protected simulateEnqueuedCall(phase: TxExecutionPhase, context: PublicTxContext, callRequest: PublicCallRequestWithCalldata): Promise<AvmFinalizedCallResult>;
19
19
  protected simulateEnqueuedCallInternal(stateManager: PublicPersistableStateManager, callRequest: PublicCallRequestWithCalldata, allocatedGas: Gas, transactionFee: Fr, fnName: string): Promise<AvmFinalizedCallResult>;
20
20
  }
21
- //# sourceMappingURL=telemetry_public_tx_simulator.d.ts.map
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVsZW1ldHJ5X3B1YmxpY190eF9zaW11bGF0b3IuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaWMvcHVibGljX3R4X3NpbXVsYXRvci90ZWxlbWV0cnlfcHVibGljX3R4X3NpbXVsYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUN6RCxPQUFPLEtBQUssRUFBRSxxQkFBcUIsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQy9ELE9BQU8sS0FBSyxFQUFFLEdBQUcsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQzdDLE9BQU8sS0FBSyxFQUFFLHlCQUF5QixFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDckUsT0FBTyxFQUFFLEtBQUssZUFBZSxFQUFFLDZCQUE2QixFQUFFLGdCQUFnQixFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDekcsT0FBTyxFQUFjLEtBQUssZUFBZSxFQUFFLEtBQUssTUFBTSxFQUFpQyxNQUFNLHlCQUF5QixDQUFDO0FBRXZILE9BQU8sS0FBSyxFQUFFLHNCQUFzQixFQUFFLE1BQU0sb0NBQW9DLENBQUM7QUFFakYsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSw2QkFBNkIsRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBQ3ZGLE9BQU8sRUFBRSx5QkFBeUIsRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBQzlFLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUV6RDs7R0FFRztBQUNILHFCQUFhLDBCQUEyQixTQUFRLHlCQUF5QjtJQUV2RSxTQUFnQixNQUFNLEVBQUUsTUFBTSxDQUFDO0lBRS9CLFlBQ0UsVUFBVSxFQUFFLHlCQUF5QixFQUNyQyxXQUFXLEVBQUUsaUJBQWlCLEVBQzlCLGVBQWUsRUFBRSxlQUFlLEVBQ2hDLGVBQWUsR0FBRSxlQUFzQyxFQUN2RCxNQUFNLENBQUMsRUFBRSxPQUFPLENBQUMscUJBQXFCLENBQUMsRUFLeEM7SUFFRCxVQU15QixvQkFBb0IsQ0FDM0MsS0FBSyxFQUFFLGdCQUFnQixFQUN2QixPQUFPLEVBQUUsZUFBZSxFQUN4QixXQUFXLEVBQUUsNkJBQTZCLEdBQ3pDLE9BQU8sQ0FBQyxzQkFBc0IsQ0FBQyxDQUVqQztJQUVELFVBTXlCLDRCQUE0QixDQUNuRCxZQUFZLEVBQUUsNkJBQTZCLEVBQzNDLFdBQVcsRUFBRSw2QkFBNkIsRUFDMUMsWUFBWSxFQUFFLEdBQUcsRUFDakIsY0FBYyxFQUFFLEVBQUUsRUFDbEIsTUFBTSxFQUFFLE1BQU0sR0FDYixPQUFPLENBQUMsc0JBQXNCLENBQUMsQ0FFakM7Q0FDRiJ9
@@ -1 +1 @@
1
- {"version":3,"file":"telemetry_public_tx_simulator.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/telemetry_public_tx_simulator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA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