@aztec/simulator 4.0.0-nightly.20250907 → 4.0.0-nightly.20260108
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.
- package/dest/client.d.ts +1 -1
- package/dest/common/errors.d.ts +2 -8
- package/dest/common/errors.d.ts.map +1 -1
- package/dest/common/index.d.ts +1 -1
- package/dest/common/stats/index.d.ts +1 -1
- package/dest/common/stats/stats.d.ts +1 -1
- package/dest/private/acvm/acvm.d.ts +1 -1
- package/dest/private/acvm/acvm_types.d.ts +1 -1
- package/dest/private/acvm/deserialize.d.ts +2 -2
- package/dest/private/acvm/deserialize.d.ts.map +1 -1
- package/dest/private/acvm/deserialize.js +1 -1
- package/dest/private/acvm/index.d.ts +1 -1
- package/dest/private/acvm/serialize.d.ts +2 -2
- package/dest/private/acvm/serialize.d.ts.map +1 -1
- package/dest/private/acvm/serialize.js +1 -1
- package/dest/private/acvm_native.d.ts +2 -3
- package/dest/private/acvm_native.d.ts.map +1 -1
- package/dest/private/acvm_native.js +15 -13
- package/dest/private/acvm_wasm.d.ts +1 -1
- package/dest/private/acvm_wasm.d.ts.map +1 -1
- package/dest/private/acvm_wasm_with_blobs.d.ts +1 -1
- package/dest/private/acvm_wasm_with_blobs.d.ts.map +1 -1
- package/dest/private/circuit_recording/circuit_recorder.d.ts +1 -1
- package/dest/private/circuit_recording/circuit_recorder.d.ts.map +1 -1
- package/dest/private/circuit_recording/circuit_recorder.js +16 -15
- package/dest/private/circuit_recording/file_circuit_recorder.d.ts +1 -1
- package/dest/private/circuit_recording/file_circuit_recorder.d.ts.map +1 -1
- package/dest/private/circuit_recording/memory_circuit_recorder.d.ts +1 -1
- package/dest/private/circuit_recording/memory_circuit_recorder.d.ts.map +1 -1
- package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts +2 -2
- package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts.map +1 -1
- package/dest/private/circuit_simulator.d.ts +1 -1
- package/dest/private/factory.d.ts +1 -1
- package/dest/public/avm/avm_context.d.ts +2 -2
- package/dest/public/avm/avm_context.d.ts.map +1 -1
- package/dest/public/avm/avm_contract_call_result.d.ts +2 -2
- package/dest/public/avm/avm_contract_call_result.d.ts.map +1 -1
- package/dest/public/avm/avm_execution_environment.d.ts +5 -4
- package/dest/public/avm/avm_execution_environment.d.ts.map +1 -1
- package/dest/public/avm/avm_execution_environment.js +5 -5
- package/dest/public/avm/avm_gas.d.ts +2 -2
- package/dest/public/avm/avm_gas.d.ts.map +1 -1
- package/dest/public/avm/avm_gas.js +2 -2
- package/dest/public/avm/avm_machine_state.d.ts +2 -2
- package/dest/public/avm/avm_machine_state.d.ts.map +1 -1
- package/dest/public/avm/avm_memory_types.d.ts +20 -14
- package/dest/public/avm/avm_memory_types.d.ts.map +1 -1
- package/dest/public/avm/avm_memory_types.js +10 -3
- package/dest/public/avm/avm_simulator.d.ts +4 -3
- package/dest/public/avm/avm_simulator.d.ts.map +1 -1
- package/dest/public/avm/avm_simulator.js +19 -25
- package/dest/public/avm/avm_simulator_interface.d.ts +1 -1
- package/dest/public/avm/errors.d.ts +13 -16
- package/dest/public/avm/errors.d.ts.map +1 -1
- package/dest/public/avm/errors.js +21 -22
- package/dest/public/avm/fixtures/avm_simulation_tester.d.ts +3 -2
- package/dest/public/avm/fixtures/avm_simulation_tester.d.ts.map +1 -1
- package/dest/public/avm/fixtures/avm_simulation_tester.js +14 -6
- package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts +4 -2
- package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts.map +1 -1
- package/dest/public/avm/fixtures/base_avm_simulation_tester.js +23 -1
- package/dest/public/avm/fixtures/initializers.d.ts +2 -3
- package/dest/public/avm/fixtures/initializers.d.ts.map +1 -1
- package/dest/public/avm/fixtures/initializers.js +6 -4
- package/dest/public/avm/fixtures/utils.d.ts +4 -3
- package/dest/public/avm/fixtures/utils.d.ts.map +1 -1
- package/dest/public/avm/fixtures/utils.js +3 -2
- package/dest/public/avm/index.d.ts +1 -1
- package/dest/public/avm/opcodes/accrued_substate.d.ts +3 -3
- package/dest/public/avm/opcodes/accrued_substate.d.ts.map +1 -1
- package/dest/public/avm/opcodes/accrued_substate.js +8 -8
- package/dest/public/avm/opcodes/addressing_mode.d.ts +1 -1
- package/dest/public/avm/opcodes/addressing_mode.d.ts.map +1 -1
- package/dest/public/avm/opcodes/addressing_mode.js +4 -5
- package/dest/public/avm/opcodes/arithmetic.d.ts +10 -8
- package/dest/public/avm/opcodes/arithmetic.d.ts.map +1 -1
- package/dest/public/avm/opcodes/arithmetic.js +11 -1
- package/dest/public/avm/opcodes/bitwise.d.ts +5 -5
- package/dest/public/avm/opcodes/bitwise.d.ts.map +1 -1
- package/dest/public/avm/opcodes/comparators.d.ts +4 -4
- package/dest/public/avm/opcodes/comparators.d.ts.map +1 -1
- package/dest/public/avm/opcodes/contract.d.ts +1 -1
- package/dest/public/avm/opcodes/contract.d.ts.map +1 -1
- package/dest/public/avm/opcodes/control_flow.d.ts +1 -1
- package/dest/public/avm/opcodes/control_flow.d.ts.map +1 -1
- package/dest/public/avm/opcodes/conversion.d.ts +1 -1
- package/dest/public/avm/opcodes/conversion.d.ts.map +1 -1
- package/dest/public/avm/opcodes/conversion.js +3 -0
- package/dest/public/avm/opcodes/ec_add.d.ts +2 -2
- package/dest/public/avm/opcodes/ec_add.d.ts.map +1 -1
- package/dest/public/avm/opcodes/ec_add.js +6 -6
- package/dest/public/avm/opcodes/environment_getters.d.ts +3 -3
- package/dest/public/avm/opcodes/environment_getters.d.ts.map +1 -1
- package/dest/public/avm/opcodes/environment_getters.js +7 -9
- package/dest/public/avm/opcodes/external_calls.d.ts +1 -1
- package/dest/public/avm/opcodes/external_calls.d.ts.map +1 -1
- package/dest/public/avm/opcodes/external_calls.js +1 -1
- package/dest/public/avm/opcodes/hashing.d.ts +2 -2
- package/dest/public/avm/opcodes/hashing.d.ts.map +1 -1
- package/dest/public/avm/opcodes/hashing.js +9 -4
- package/dest/public/avm/opcodes/index.d.ts +1 -1
- package/dest/public/avm/opcodes/instruction.d.ts +2 -2
- package/dest/public/avm/opcodes/instruction.d.ts.map +1 -1
- package/dest/public/avm/opcodes/instruction.js +5 -6
- package/dest/public/avm/opcodes/instruction_impl.d.ts +1 -1
- package/dest/public/avm/opcodes/instruction_impl.d.ts.map +1 -1
- package/dest/public/avm/opcodes/memory.d.ts +2 -2
- package/dest/public/avm/opcodes/memory.d.ts.map +1 -1
- package/dest/public/avm/opcodes/memory.js +1 -1
- package/dest/public/avm/opcodes/misc.d.ts +3 -2
- package/dest/public/avm/opcodes/misc.d.ts.map +1 -1
- package/dest/public/avm/opcodes/misc.js +28 -8
- package/dest/public/avm/opcodes/storage.d.ts +3 -3
- package/dest/public/avm/opcodes/storage.d.ts.map +1 -1
- package/dest/public/avm/revert_reason.d.ts +2 -2
- package/dest/public/avm/revert_reason.d.ts.map +1 -1
- package/dest/public/avm/revert_reason.js +3 -2
- package/dest/public/avm/serialization/buffer_cursor.d.ts +1 -1
- package/dest/public/avm/serialization/buffer_cursor.d.ts.map +1 -1
- package/dest/public/avm/serialization/bytecode_serialization.d.ts +1 -1
- package/dest/public/avm/serialization/bytecode_serialization.d.ts.map +1 -1
- package/dest/public/avm/serialization/bytecode_serialization.js +9 -6
- package/dest/public/avm/serialization/instruction_serialization.d.ts +9 -1
- package/dest/public/avm/serialization/instruction_serialization.d.ts.map +1 -1
- package/dest/public/avm/serialization/instruction_serialization.js +11 -1
- package/dest/public/avm/test_utils.d.ts +4 -4
- package/dest/public/avm/test_utils.d.ts.map +1 -1
- package/dest/public/avm/test_utils.js +7 -10
- package/dest/public/contracts_db_checkpoint.d.ts +16 -0
- package/dest/public/contracts_db_checkpoint.d.ts.map +1 -0
- package/dest/public/contracts_db_checkpoint.js +30 -0
- package/dest/public/db_interfaces.d.ts +14 -2
- package/dest/public/db_interfaces.d.ts.map +1 -1
- package/dest/public/debug_fn_name.d.ts +15 -2
- package/dest/public/debug_fn_name.d.ts.map +1 -1
- package/dest/public/debug_fn_name.js +28 -2
- package/dest/public/executor_metrics.d.ts +3 -2
- package/dest/public/executor_metrics.d.ts.map +1 -1
- package/dest/public/executor_metrics.js +1 -1
- package/dest/public/executor_metrics_interface.d.ts +3 -2
- package/dest/public/executor_metrics_interface.d.ts.map +1 -1
- package/dest/public/fixtures/amm_test.d.ts +1 -1
- package/dest/public/fixtures/amm_test.js +2 -2
- package/dest/public/fixtures/bulk_test.d.ts +1 -1
- package/dest/public/fixtures/bulk_test.d.ts.map +1 -1
- package/dest/public/fixtures/bulk_test.js +59 -177
- package/dest/public/fixtures/custom_bytecode_tester.d.ts +34 -0
- package/dest/public/fixtures/custom_bytecode_tester.d.ts.map +1 -0
- package/dest/public/fixtures/custom_bytecode_tester.js +53 -0
- package/dest/public/fixtures/custom_bytecode_tests.d.ts +12 -0
- package/dest/public/fixtures/custom_bytecode_tests.d.ts.map +1 -0
- package/dest/public/fixtures/custom_bytecode_tests.js +174 -0
- package/dest/public/fixtures/index.d.ts +5 -2
- package/dest/public/fixtures/index.d.ts.map +1 -1
- package/dest/public/fixtures/index.js +4 -1
- package/dest/public/fixtures/minimal_public_tx.d.ts +4 -9
- package/dest/public/fixtures/minimal_public_tx.d.ts.map +1 -1
- package/dest/public/fixtures/minimal_public_tx.js +8 -32
- package/dest/public/fixtures/opcode_spammer.d.ts +123 -0
- package/dest/public/fixtures/opcode_spammer.d.ts.map +1 -0
- package/dest/public/fixtures/opcode_spammer.js +1681 -0
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts +25 -5
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +1 -1
- package/dest/public/fixtures/public_tx_simulation_tester.js +63 -17
- package/dest/public/fixtures/simple_contract_data_source.d.ts +5 -4
- package/dest/public/fixtures/simple_contract_data_source.d.ts.map +1 -1
- package/dest/public/fixtures/simple_contract_data_source.js +4 -4
- package/dest/public/fixtures/token_test.d.ts +6 -2
- package/dest/public/fixtures/token_test.d.ts.map +1 -1
- package/dest/public/fixtures/token_test.js +13 -12
- package/dest/public/fixtures/utils.d.ts +2 -2
- package/dest/public/fixtures/utils.d.ts.map +1 -1
- package/dest/public/fixtures/utils.js +7 -6
- package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts +46 -0
- package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts.map +1 -0
- package/dest/public/fuzzing/avm_fuzzer_simulator.js +139 -0
- package/dest/public/fuzzing/avm_simulator_bin.d.ts +2 -0
- package/dest/public/fuzzing/avm_simulator_bin.d.ts.map +1 -0
- package/dest/public/fuzzing/avm_simulator_bin.js +100 -0
- package/dest/public/hinting_db_sources.d.ts +16 -4
- package/dest/public/hinting_db_sources.d.ts.map +1 -1
- package/dest/public/hinting_db_sources.js +74 -13
- package/dest/public/index.d.ts +3 -2
- package/dest/public/index.d.ts.map +1 -1
- package/dest/public/index.js +1 -1
- package/dest/public/public_db_sources.d.ts +24 -65
- package/dest/public/public_db_sources.d.ts.map +1 -1
- package/dest/public/public_db_sources.js +85 -132
- package/dest/public/public_errors.d.ts +12 -0
- package/dest/public/public_errors.d.ts.map +1 -0
- package/dest/public/public_errors.js +13 -0
- package/dest/public/public_processor/guarded_merkle_tree.d.ts +6 -2
- package/dest/public/public_processor/guarded_merkle_tree.d.ts.map +1 -1
- package/dest/public/public_processor/guarded_merkle_tree.js +8 -0
- package/dest/public/public_processor/public_processor.d.ts +11 -13
- package/dest/public/public_processor/public_processor.d.ts.map +1 -1
- package/dest/public/public_processor/public_processor.js +477 -70
- package/dest/public/public_processor/public_processor_metrics.d.ts +1 -1
- package/dest/public/public_processor/public_processor_metrics.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.d.ts +18 -0
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.js +98 -0
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts +53 -0
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator.js +131 -0
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.d.ts +42 -0
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.js +86 -0
- package/dest/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.d.ts +30 -0
- package/dest/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.js +171 -0
- package/dest/public/public_tx_simulator/dumping_cpp_public_tx_simulator.d.ts +22 -0
- package/dest/public/public_tx_simulator/dumping_cpp_public_tx_simulator.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/dumping_cpp_public_tx_simulator.js +52 -0
- package/dest/public/public_tx_simulator/factories.d.ts +13 -0
- package/dest/public/public_tx_simulator/factories.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/factories.js +28 -0
- package/dest/public/public_tx_simulator/index.d.ts +6 -1
- package/dest/public/public_tx_simulator/index.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/index.js +3 -0
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.d.ts +16 -8
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.js +7 -8
- package/dest/public/public_tx_simulator/public_tx_context.d.ts +9 -4
- package/dest/public/public_tx_simulator/public_tx_context.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/public_tx_context.js +22 -10
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts +22 -29
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/public_tx_simulator.js +178 -127
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.d.ts +32 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.js +1 -0
- package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.d.ts +4 -3
- package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.js +396 -20
- package/dest/public/side_effect_errors.d.ts +42 -2
- package/dest/public/side_effect_errors.d.ts.map +1 -1
- package/dest/public/side_effect_errors.js +70 -1
- package/dest/public/side_effect_trace.d.ts +13 -7
- package/dest/public/side_effect_trace.d.ts.map +1 -1
- package/dest/public/side_effect_trace.js +36 -21
- package/dest/public/side_effect_trace_interface.d.ts +9 -4
- package/dest/public/side_effect_trace_interface.d.ts.map +1 -1
- package/dest/public/state_manager/index.d.ts +1 -1
- package/dest/public/state_manager/nullifiers.d.ts +2 -5
- package/dest/public/state_manager/nullifiers.d.ts.map +1 -1
- package/dest/public/state_manager/nullifiers.js +1 -6
- package/dest/public/state_manager/public_storage.d.ts +2 -2
- package/dest/public/state_manager/public_storage.d.ts.map +1 -1
- package/dest/public/state_manager/public_storage.js +1 -1
- package/dest/public/state_manager/state_manager.d.ts +16 -13
- package/dest/public/state_manager/state_manager.d.ts.map +1 -1
- package/dest/public/state_manager/state_manager.js +64 -21
- package/dest/public/test_executor_metrics.d.ts +4 -3
- package/dest/public/test_executor_metrics.d.ts.map +1 -1
- package/dest/public/test_executor_metrics.js +5 -4
- package/dest/public/unique_class_ids.d.ts +1 -1
- package/dest/public/unique_class_ids.d.ts.map +1 -1
- package/dest/public/utils.d.ts +1 -1
- package/dest/server.d.ts +1 -1
- package/dest/testing.d.ts +1 -1
- package/package.json +24 -19
- package/src/common/errors.ts +1 -1
- package/src/private/acvm/deserialize.ts +1 -1
- package/src/private/acvm/serialize.ts +1 -1
- package/src/private/acvm_native.ts +18 -11
- package/src/private/circuit_recording/circuit_recorder.ts +17 -16
- package/src/private/circuit_recording/simulator_recorder_wrapper.ts +1 -1
- package/src/public/avm/avm_context.ts +1 -1
- package/src/public/avm/avm_contract_call_result.ts +1 -1
- package/src/public/avm/avm_execution_environment.ts +4 -3
- package/src/public/avm/avm_gas.ts +5 -5
- package/src/public/avm/avm_machine_state.ts +1 -1
- package/src/public/avm/avm_memory_types.ts +12 -3
- package/src/public/avm/avm_simulator.ts +24 -33
- package/src/public/avm/errors.ts +24 -27
- package/src/public/avm/fixtures/avm_simulation_tester.ts +14 -4
- package/src/public/avm/fixtures/base_avm_simulation_tester.ts +33 -1
- package/src/public/avm/fixtures/initializers.ts +7 -8
- package/src/public/avm/fixtures/utils.ts +3 -2
- package/src/public/avm/opcodes/accrued_substate.ts +5 -5
- package/src/public/avm/opcodes/addressing_mode.ts +5 -5
- package/src/public/avm/opcodes/arithmetic.ts +13 -1
- package/src/public/avm/opcodes/conversion.ts +4 -0
- package/src/public/avm/opcodes/ec_add.ts +6 -6
- package/src/public/avm/opcodes/environment_getters.ts +10 -12
- package/src/public/avm/opcodes/external_calls.ts +1 -1
- package/src/public/avm/opcodes/hashing.ts +10 -4
- package/src/public/avm/opcodes/instruction.ts +8 -6
- package/src/public/avm/opcodes/memory.ts +1 -1
- package/src/public/avm/opcodes/misc.ts +41 -7
- package/src/public/avm/revert_reason.ts +6 -3
- package/src/public/avm/serialization/bytecode_serialization.ts +17 -6
- package/src/public/avm/serialization/instruction_serialization.ts +13 -1
- package/src/public/avm/test_utils.ts +7 -15
- package/src/public/contracts_db_checkpoint.ts +41 -0
- package/src/public/db_interfaces.ts +16 -1
- package/src/public/debug_fn_name.ts +35 -3
- package/src/public/executor_metrics.ts +2 -1
- package/src/public/executor_metrics_interface.ts +2 -1
- package/src/public/fixtures/amm_test.ts +2 -2
- package/src/public/fixtures/bulk_test.ts +39 -26
- package/src/public/fixtures/custom_bytecode_tester.ts +83 -0
- package/src/public/fixtures/custom_bytecode_tests.ts +219 -0
- package/src/public/fixtures/index.ts +8 -1
- package/src/public/fixtures/minimal_public_tx.ts +9 -42
- package/src/public/fixtures/opcode_spammer.ts +1638 -0
- package/src/public/fixtures/public_tx_simulation_tester.ts +90 -22
- package/src/public/fixtures/simple_contract_data_source.ts +8 -9
- package/src/public/fixtures/token_test.ts +18 -10
- package/src/public/fixtures/utils.ts +5 -6
- package/src/public/fuzzing/avm_fuzzer_simulator.ts +240 -0
- package/src/public/fuzzing/avm_simulator_bin.ts +140 -0
- package/src/public/hinting_db_sources.ts +117 -10
- package/src/public/index.ts +8 -1
- package/src/public/public_db_sources.ts +112 -175
- package/src/public/public_errors.ts +14 -0
- package/src/public/public_processor/guarded_merkle_tree.ts +10 -1
- package/src/public/public_processor/public_processor.ts +112 -79
- package/src/public/public_tx_simulator/contract_provider_for_cpp.ts +121 -0
- package/src/public/public_tx_simulator/cpp_public_tx_simulator.ts +200 -0
- package/src/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.ts +132 -0
- package/src/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.ts +237 -0
- package/src/public/public_tx_simulator/dumping_cpp_public_tx_simulator.ts +81 -0
- package/src/public/public_tx_simulator/factories.ts +41 -0
- package/src/public/public_tx_simulator/index.ts +5 -0
- package/src/public/public_tx_simulator/measured_public_tx_simulator.ts +13 -14
- package/src/public/public_tx_simulator/public_tx_context.ts +20 -7
- package/src/public/public_tx_simulator/public_tx_simulator.ts +265 -179
- package/src/public/public_tx_simulator/public_tx_simulator_interface.ts +33 -0
- package/src/public/public_tx_simulator/telemetry_public_tx_simulator.ts +4 -13
- package/src/public/side_effect_errors.ts +91 -1
- package/src/public/side_effect_trace.ts +49 -24
- package/src/public/side_effect_trace_interface.ts +7 -1
- package/src/public/state_manager/nullifiers.ts +2 -8
- package/src/public/state_manager/public_storage.ts +1 -1
- package/src/public/state_manager/state_manager.ts +87 -39
- package/src/public/test_executor_metrics.ts +7 -5
- package/dest/public/bytecode_errors.d.ts +0 -4
- package/dest/public/bytecode_errors.d.ts.map +0 -1
- package/dest/public/bytecode_errors.js +0 -6
- package/dest/public/tx_contract_cache.d.ts +0 -41
- package/dest/public/tx_contract_cache.d.ts.map +0 -1
- package/dest/public/tx_contract_cache.js +0 -49
- package/src/public/bytecode_errors.ts +0 -6
- package/src/public/tx_contract_cache.ts +0 -69
|
@@ -1,39 +1,30 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { type Logger } from '@aztec/foundation/log';
|
|
3
|
-
import {
|
|
3
|
+
import { PublicSimulatorConfig, PublicTxResult } from '@aztec/stdlib/avm';
|
|
4
4
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
5
|
-
import
|
|
5
|
+
import { Gas } from '@aztec/stdlib/gas';
|
|
6
6
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
7
7
|
import { type GlobalVariables, NestedProcessReturnValues, PublicCallRequestWithCalldata, Tx, TxExecutionPhase } from '@aztec/stdlib/tx';
|
|
8
8
|
import type { AvmFinalizedCallResult } from '../avm/avm_contract_call_result.js';
|
|
9
9
|
import { type PublicContractsDB } from '../public_db_sources.js';
|
|
10
10
|
import type { PublicPersistableStateManager } from '../state_manager/state_manager.js';
|
|
11
11
|
import { PublicTxContext } from './public_tx_context.js';
|
|
12
|
-
|
|
12
|
+
import type { PublicTxSimulatorInterface } from './public_tx_simulator_interface.js';
|
|
13
|
+
/** Only used internally. */
|
|
14
|
+
type ProcessedPhase = {
|
|
13
15
|
phase: TxExecutionPhase;
|
|
14
16
|
durationMs?: number;
|
|
15
17
|
returnValues: NestedProcessReturnValues[];
|
|
16
18
|
reverted: boolean;
|
|
17
19
|
revertReason?: SimulationError;
|
|
18
20
|
};
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
revertCode: RevertCode;
|
|
24
|
-
/** Revert reason, if any */
|
|
25
|
-
revertReason?: SimulationError;
|
|
26
|
-
processedPhases: ProcessedPhase[];
|
|
27
|
-
};
|
|
28
|
-
export declare class PublicTxSimulator {
|
|
29
|
-
private merkleTree;
|
|
30
|
-
private contractsDB;
|
|
31
|
-
private globalVariables;
|
|
32
|
-
private doMerkleOperations;
|
|
33
|
-
private skipFeeEnforcement;
|
|
34
|
-
private clientInitiatedSimulation;
|
|
21
|
+
export declare class PublicTxSimulator implements PublicTxSimulatorInterface {
|
|
22
|
+
protected merkleTree: MerkleTreeWriteOperations;
|
|
23
|
+
protected contractsDB: PublicContractsDB;
|
|
24
|
+
protected globalVariables: GlobalVariables;
|
|
35
25
|
protected log: Logger;
|
|
36
|
-
|
|
26
|
+
protected readonly config: PublicSimulatorConfig;
|
|
27
|
+
constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables, config?: Partial<PublicSimulatorConfig>);
|
|
37
28
|
/**
|
|
38
29
|
* Simulate a transaction's public portion including all of its phases.
|
|
39
30
|
* @param tx - The transaction to simulate.
|
|
@@ -72,16 +63,18 @@ export declare class PublicTxSimulator {
|
|
|
72
63
|
/**
|
|
73
64
|
* Insert the non-revertible accumulated data from private into the public state.
|
|
74
65
|
*/
|
|
75
|
-
protected insertNonRevertiblesFromPrivate(context: PublicTxContext
|
|
66
|
+
protected insertNonRevertiblesFromPrivate(context: PublicTxContext): Promise<void>;
|
|
76
67
|
/**
|
|
77
68
|
* Insert the revertible accumulated data from private into the public state.
|
|
78
|
-
*
|
|
69
|
+
* Throws TxSimRevertibleInsertionsRevert if there is some checked error during revertible insertions.
|
|
70
|
+
* This function checks for the following errors:
|
|
71
|
+
* - NullifierLimitReachedError
|
|
72
|
+
* - NullifierCollisionError
|
|
73
|
+
* - NoteHashLimitReachedError
|
|
74
|
+
* - L2ToL1MessageLimitReachedError
|
|
79
75
|
*/
|
|
80
|
-
protected insertRevertiblesFromPrivate(context: PublicTxContext
|
|
76
|
+
protected insertRevertiblesFromPrivate(context: PublicTxContext): Promise<void>;
|
|
81
77
|
private payFee;
|
|
82
|
-
/**
|
|
83
|
-
* Generate the proving request for the AVM circ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CLEVBQUUsT0FBTyxFQUFFLGVBQWUsR0FBRyxPQUFPLENBQUMsY0FBYyxDQUFDLENBbUN4RztJQUVEOzs7Ozs7T0FNRztJQUNILFVBQWdCLG9CQUFvQixDQUNsQyxLQUFLLEVBQUUsZ0JBQWdCLEVBQ3ZCLE9BQU8sRUFBRSxlQUFlLEVBQ3hCLFdBQVcsRUFBRSw2QkFBNkIsR0FDekMsT0FBTyxDQUFDLHNCQUFzQixDQUFDLENBMkJqQztJQUVEOzs7Ozs7Ozs7Ozs7T0FZRztJQUNILFVBQWdCLDRCQUE0QixDQUMxQyxZQUFZLEVBQUUsNkJBQTZCLEVBQzNDLEVBQUUsT0FBTyxFQUFFLFFBQVEsRUFBRSxFQUFFLDZCQUE2QixFQUNwRCxZQUFZLEVBQUUsR0FBRyxFQUNqQixjQUFjLEVBQUUsRUFBRSxFQUNsQixNQUFNLEVBQUUsTUFBTSxHQUNiLE9BQU8sQ0FBQyxzQkFBc0IsQ0FBQyxDQXFCakM7SUFFRDs7T0FFRztJQUNILFVBQWdCLCtCQUErQixDQUFDLE9BQU8sRUFBRSxlQUFlLGlCQXlCdkU7SUFFRDs7Ozs7Ozs7T0FRRztJQUNILFVBQWdCLDRCQUE0QixDQUFDLE9BQU8sRUFBRSxlQUFlLGlCQTBFcEU7WUFFYSxNQUFNO0NBbUNyQiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_tx_simulator.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/public_tx_simulator.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"public_tx_simulator.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/public_tx_simulator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAGlE,OAAO,EAAgC,qBAAqB,EAAkB,cAAc,EAA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AQ,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,CA2BjC;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,31 +1,56 @@
|
|
|
1
1
|
import { AVM_MAX_PROCESSABLE_L2_GAS } from '@aztec/constants';
|
|
2
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
-
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
3
|
+
import { ProtocolContractAddress, ProtocolContractsList } from '@aztec/protocol-contracts';
|
|
4
4
|
import { computeFeePayerBalanceStorageSlot } from '@aztec/protocol-contracts/fee-juice';
|
|
5
|
-
import {
|
|
5
|
+
import { AvmExecutionHints, AvmTxHint, PublicSimulatorConfig, PublicTxEffect, PublicTxResult } from '@aztec/stdlib/avm';
|
|
6
6
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
7
|
-
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
8
7
|
import { NestedProcessReturnValues, TxExecutionPhase } from '@aztec/stdlib/tx';
|
|
8
|
+
import { strict as assert } from 'assert';
|
|
9
9
|
import { AvmSimulator } from '../avm/index.js';
|
|
10
10
|
import { getPublicFunctionDebugName } from '../debug_fn_name.js';
|
|
11
11
|
import { HintingMerkleWriteOperations, HintingPublicContractsDB } from '../hinting_db_sources.js';
|
|
12
12
|
import { PublicTreesDB } from '../public_db_sources.js';
|
|
13
|
+
import { L2ToL1MessageLimitReachedError, NoteHashLimitReachedError, NullifierCollisionError, NullifierLimitReachedError } from '../side_effect_errors.js';
|
|
13
14
|
import { PublicTxContext } from './public_tx_context.js';
|
|
15
|
+
// The errors below are only thrown here in the public tx simulator,
|
|
16
|
+
// and only during revertible phases (revertible insertions, app logic and teardown).
|
|
17
|
+
// These are strictly "checked" errors (not exported and never propagated).
|
|
18
|
+
// They are used internally for control flow to trigger rollbacks to the post-setup state.
|
|
19
|
+
/**
|
|
20
|
+
* Error thrown when public tx simulation reverts in a known/checked way during revertible insertions.
|
|
21
|
+
*/ class TxSimRevertibleInsertionsRevert extends Error {
|
|
22
|
+
constructor(){
|
|
23
|
+
super('Public Tx Simulation reverted during Revertible Insertions');
|
|
24
|
+
this.name = 'TxSimRevertibleInsertionsRevert';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Error thrown when public tx simulation reverts during app logic.
|
|
29
|
+
*/ class TxSimAppLogicRevert extends Error {
|
|
30
|
+
constructor(){
|
|
31
|
+
super('Public Tx Simulation reverted during App Logic');
|
|
32
|
+
this.name = 'TxSimAppLogicRevert';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Error thrown when public tx simulation reverts during teardown.
|
|
37
|
+
*/ class TxSimTeardownRevert extends Error {
|
|
38
|
+
constructor(){
|
|
39
|
+
super('Public Tx Simulation reverted during Teardown');
|
|
40
|
+
this.name = 'TxSimTeardownRevert';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
14
43
|
export class PublicTxSimulator {
|
|
15
44
|
merkleTree;
|
|
16
45
|
contractsDB;
|
|
17
46
|
globalVariables;
|
|
18
|
-
doMerkleOperations;
|
|
19
|
-
skipFeeEnforcement;
|
|
20
|
-
clientInitiatedSimulation;
|
|
21
47
|
log;
|
|
22
|
-
|
|
48
|
+
config;
|
|
49
|
+
constructor(merkleTree, contractsDB, globalVariables, config){
|
|
23
50
|
this.merkleTree = merkleTree;
|
|
24
51
|
this.contractsDB = contractsDB;
|
|
25
52
|
this.globalVariables = globalVariables;
|
|
26
|
-
this.
|
|
27
|
-
this.skipFeeEnforcement = skipFeeEnforcement;
|
|
28
|
-
this.clientInitiatedSimulation = clientInitiatedSimulation;
|
|
53
|
+
this.config = PublicSimulatorConfig.from(config ?? {});
|
|
29
54
|
this.log = createLogger(`simulator:public_tx_simulator`);
|
|
30
55
|
}
|
|
31
56
|
/**
|
|
@@ -33,99 +58,98 @@ export class PublicTxSimulator {
|
|
|
33
58
|
* @param tx - The transaction to simulate.
|
|
34
59
|
* @returns The result of the transaction's public execution.
|
|
35
60
|
*/ async simulate(tx) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
const txHash = this.computeTxHash(tx);
|
|
62
|
+
this.log.debug(`Simulating ${tx.publicFunctionCalldata.length} public calls for tx ${txHash}`, {
|
|
63
|
+
txHash
|
|
64
|
+
});
|
|
65
|
+
// Create hinting DBs.
|
|
66
|
+
const hints = new AvmExecutionHints(this.globalVariables, AvmTxHint.fromTx(tx, this.globalVariables.gasFees), ProtocolContractsList);
|
|
67
|
+
const hintingMerkleTree = await HintingMerkleWriteOperations.create(this.merkleTree, hints);
|
|
68
|
+
const hintingTreesDB = new PublicTreesDB(hintingMerkleTree);
|
|
69
|
+
const hintingContractsDB = new HintingPublicContractsDB(this.contractsDB, hints);
|
|
70
|
+
const context = await PublicTxContext.create(hintingTreesDB, hintingContractsDB, tx, this.globalVariables, ProtocolContractsList, this.config.proverId);
|
|
71
|
+
// This will throw if there is a nullifier collision.
|
|
72
|
+
// In that case the transaction will be thrown out.
|
|
73
|
+
await this.insertNonRevertiblesFromPrivate(context);
|
|
74
|
+
const processedPhases = [];
|
|
75
|
+
if (context.hasPhase(TxExecutionPhase.SETUP)) {
|
|
76
|
+
// This will throw if the setup phase reverts.
|
|
48
77
|
// In that case the transaction will be thrown out.
|
|
49
|
-
await this.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// This will throw if the setup phase reverts.
|
|
53
|
-
// In that case the transaction will be thrown out.
|
|
54
|
-
const setupResult = await this.simulatePhase(TxExecutionPhase.SETUP, context);
|
|
55
|
-
if (setupResult.reverted) {
|
|
56
|
-
throw new Error(`Setup phase reverted! The transaction will be thrown out. ${setupResult.revertReason?.message}`);
|
|
57
|
-
}
|
|
58
|
-
processedPhases.push(setupResult);
|
|
78
|
+
const setupResult = await this.simulatePhase(TxExecutionPhase.SETUP, context);
|
|
79
|
+
if (setupResult.reverted) {
|
|
80
|
+
throw new Error(`[SETUP] UNRECOVERABLE ERROR! The transaction will be thrown out. ${setupResult.revertReason?.message}`);
|
|
59
81
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
82
|
+
processedPhases.push(setupResult);
|
|
83
|
+
}
|
|
84
|
+
// The checkpoint we should go back to if anything from now on reverts.
|
|
85
|
+
await context.state.fork();
|
|
86
|
+
hintingContractsDB.createCheckpoint();
|
|
87
|
+
try {
|
|
88
|
+
// This will throw if there is a nullifier collision or other insertion error (limit reached).
|
|
89
|
+
await this.insertRevertiblesFromPrivate(context);
|
|
90
|
+
// Only proceed with app logic if there was no revert during revertible insertion.
|
|
91
|
+
if (context.hasPhase(TxExecutionPhase.APP_LOGIC)) {
|
|
92
|
+
const appLogicResult = await this.simulatePhase(TxExecutionPhase.APP_LOGIC, context);
|
|
93
|
+
processedPhases.push(appLogicResult);
|
|
94
|
+
if (appLogicResult.reverted) {
|
|
95
|
+
throw new TxSimAppLogicRevert();
|
|
72
96
|
}
|
|
73
|
-
}
|
|
74
|
-
|
|
97
|
+
}
|
|
98
|
+
} catch (e) {
|
|
99
|
+
if (e instanceof TxSimRevertibleInsertionsRevert || e instanceof TxSimAppLogicRevert) {
|
|
75
100
|
// We revert to the post-setup state.
|
|
76
101
|
await context.state.discardForkedState();
|
|
102
|
+
hintingContractsDB.revertCheckpoint();
|
|
77
103
|
// But we also create a new fork so that the teardown phase can transparently
|
|
78
104
|
// commit or rollback at the end of teardown.
|
|
79
105
|
await context.state.fork();
|
|
106
|
+
hintingContractsDB.createCheckpoint();
|
|
107
|
+
} else {
|
|
108
|
+
// Unchecked/unknown error - re-throw as-is
|
|
109
|
+
throw e;
|
|
80
110
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
111
|
+
}
|
|
112
|
+
try {
|
|
113
|
+
if (context.hasPhase(TxExecutionPhase.TEARDOWN)) {
|
|
114
|
+
const teardownResult = await this.simulatePhase(TxExecutionPhase.TEARDOWN, context);
|
|
115
|
+
processedPhases.push(teardownResult);
|
|
116
|
+
if (teardownResult.reverted) {
|
|
117
|
+
throw new TxSimTeardownRevert();
|
|
88
118
|
}
|
|
89
|
-
// We commit the forked state and we are done.
|
|
90
|
-
await context.state.mergeForkedState();
|
|
91
|
-
} catch (e) {
|
|
92
|
-
this.log.debug(String(e));
|
|
93
|
-
// We rollback to the post-setup state.
|
|
94
|
-
await context.state.discardForkedState();
|
|
95
119
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
120
|
+
// We commit the forked state and we are done.
|
|
121
|
+
await context.state.mergeForkedState();
|
|
122
|
+
hintingContractsDB.commitCheckpoint();
|
|
123
|
+
} catch (e) {
|
|
124
|
+
if (e instanceof TxSimTeardownRevert) {
|
|
125
|
+
// We revert to the post-setup state and we are done.
|
|
126
|
+
await context.state.discardForkedState();
|
|
127
|
+
hintingContractsDB.revertCheckpoint();
|
|
128
|
+
} else {
|
|
129
|
+
// Unchecked/unknown error - re-throw as-is
|
|
130
|
+
throw e;
|
|
99
131
|
}
|
|
100
|
-
await this.payFee(context);
|
|
101
|
-
const publicInputs = await context.generateAvmCircuitPublicInputs();
|
|
102
|
-
const avmProvingRequest = PublicTxSimulator.generateProvingRequest(publicInputs, hints);
|
|
103
|
-
const revertCode = context.getFinalRevertCode();
|
|
104
|
-
// Commit contracts from this TX to the block-level cache and clear tx cache
|
|
105
|
-
// If the tx reverted, only commit non-revertible contracts
|
|
106
|
-
// NOTE: You can't create contracts in public, so this is only relevant for private-created contracts
|
|
107
|
-
// FIXME(fcarreiro): this should conceptually use the hinted contracts db.
|
|
108
|
-
// However things should work as they are now because the hinted db would still pick up the new contracts.
|
|
109
|
-
this.contractsDB.commitContractsForTx(/*onlyNonRevertibles=*/ !revertCode.isOK());
|
|
110
|
-
return {
|
|
111
|
-
avmProvingRequest,
|
|
112
|
-
gasUsed: {
|
|
113
|
-
totalGas: context.getActualGasUsed(),
|
|
114
|
-
teardownGas: context.teardownGasUsed,
|
|
115
|
-
publicGas: context.getActualPublicGasUsed(),
|
|
116
|
-
billedGas: context.getTotalGasUsed()
|
|
117
|
-
},
|
|
118
|
-
revertCode,
|
|
119
|
-
revertReason: context.revertReason,
|
|
120
|
-
processedPhases: processedPhases
|
|
121
|
-
};
|
|
122
|
-
} finally{
|
|
123
|
-
// Make sure there are no new contracts in the tx-level cache.
|
|
124
|
-
// They should either be committed to block-level cache or cleared.
|
|
125
|
-
// FIXME(fcarreiro): this should conceptually use the hinted contracts db.
|
|
126
|
-
// However things should work as they are now because the hinted db would still pick up the new contracts.
|
|
127
|
-
this.contractsDB.clearContractsForTx();
|
|
128
132
|
}
|
|
133
|
+
context.halt();
|
|
134
|
+
// Such transactions should be filtered by GasTxValidator.
|
|
135
|
+
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}`);
|
|
136
|
+
await this.payFee(context);
|
|
137
|
+
const publicInputs = await context.generateAvmCircuitPublicInputs();
|
|
138
|
+
const revertCode = context.getFinalRevertCode();
|
|
139
|
+
// We only return the app logic phase information, and only 1 per phase.
|
|
140
|
+
const appLogicReturnValues = processedPhases.find(({ phase })=>phase === TxExecutionPhase.APP_LOGIC)?.returnValues ?? [];
|
|
141
|
+
// TODO(fcarreiro): This is a temporary backwards compatibility layer until we migrate to the C++ simulator.
|
|
142
|
+
if (context.revertReason !== undefined) {
|
|
143
|
+
appLogicReturnValues.revertReason = context.revertReason;
|
|
144
|
+
}
|
|
145
|
+
// Create PublicTxEffect from PublicInputs.
|
|
146
|
+
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()));
|
|
147
|
+
return new PublicTxResult(/*gasUsed=*/ {
|
|
148
|
+
totalGas: context.getActualGasUsed(),
|
|
149
|
+
teardownGas: context.teardownGasUsed,
|
|
150
|
+
publicGas: context.getActualPublicGasUsed(),
|
|
151
|
+
billedGas: context.getTotalGasUsed()
|
|
152
|
+
}, /*revertCode=*/ revertCode, /*publicTxEffect=*/ publicTxEffect, /*callStackMetadata=*/ appLogicReturnValues, /*logs=*/ context.state.getActiveStateManager().getLogs(), /*hints=*/ hints, /*publicInputs=*/ publicInputs);
|
|
129
153
|
}
|
|
130
154
|
computeTxHash(tx) {
|
|
131
155
|
return tx.getTxHash();
|
|
@@ -179,7 +203,7 @@ export class PublicTxSimulator {
|
|
|
179
203
|
context.consumeGas(phase, gasUsed);
|
|
180
204
|
this.log.debug(`Simulated enqueued public call (${fnName}) consumed ${gasUsed.l2Gas} L2 gas ending with ${result.gasLeft.l2Gas} L2 gas left.`);
|
|
181
205
|
if (result.reverted) {
|
|
182
|
-
const culprit = `${contractAddress}:${
|
|
206
|
+
const culprit = `${contractAddress}:${fnName}`;
|
|
183
207
|
context.revert(phase, result.revertReason, culprit);
|
|
184
208
|
}
|
|
185
209
|
return result;
|
|
@@ -200,13 +224,13 @@ export class PublicTxSimulator {
|
|
|
200
224
|
const address = request.contractAddress;
|
|
201
225
|
const sender = request.msgSender;
|
|
202
226
|
this.log.debug(`Executing enqueued public call to external function ${fnName}@${address} with ${allocatedGas.l2Gas} allocated L2 gas.`);
|
|
203
|
-
const simulator = await AvmSimulator.create(stateManager, address, sender, transactionFee, this.globalVariables, request.isStaticCall, calldata, allocatedGas, this.
|
|
227
|
+
const simulator = await AvmSimulator.create(stateManager, address, sender, transactionFee, this.globalVariables, request.isStaticCall, calldata, allocatedGas, this.config);
|
|
204
228
|
const avmCallResult = await simulator.execute();
|
|
205
229
|
return avmCallResult.finalize();
|
|
206
230
|
}
|
|
207
231
|
/**
|
|
208
232
|
* Insert the non-revertible accumulated data from private into the public state.
|
|
209
|
-
*/ async insertNonRevertiblesFromPrivate(context
|
|
233
|
+
*/ async insertNonRevertiblesFromPrivate(context) {
|
|
210
234
|
const stateManager = context.state.getActiveStateManager();
|
|
211
235
|
for (const siloedNullifier of context.nonRevertibleAccumulatedDataFromPrivate.nullifiers.filter((n)=>!n.isEmpty())){
|
|
212
236
|
await stateManager.writeSiloedNullifier(siloedNullifier);
|
|
@@ -221,46 +245,81 @@ export class PublicTxSimulator {
|
|
|
221
245
|
stateManager.writeScopedL2ToL1Message(l2ToL1Message);
|
|
222
246
|
}
|
|
223
247
|
}
|
|
224
|
-
// add new contracts to the contracts db so that their
|
|
225
|
-
//
|
|
226
|
-
//
|
|
227
|
-
//
|
|
228
|
-
|
|
248
|
+
// add new contracts to the contracts db so that their code may be found and called
|
|
249
|
+
// FIXME(fcarreiro): this should conceptually use the hinting contracts db.
|
|
250
|
+
// However, things work as expected because later calls to getters on the hintingContractsDB
|
|
251
|
+
// will pick up the new contracts and will generate the necessary hints.
|
|
252
|
+
// So, a consumer of the hints will always see the new contracts.
|
|
253
|
+
await this.contractsDB.addContracts(context.nonRevertibleContractDeploymentData);
|
|
229
254
|
}
|
|
230
255
|
/**
|
|
231
256
|
* Insert the revertible accumulated data from private into the public state.
|
|
232
|
-
*
|
|
233
|
-
|
|
257
|
+
* Throws TxSimRevertibleInsertionsRevert if there is some checked error during revertible insertions.
|
|
258
|
+
* This function checks for the following errors:
|
|
259
|
+
* - NullifierLimitReachedError
|
|
260
|
+
* - NullifierCollisionError
|
|
261
|
+
* - NoteHashLimitReachedError
|
|
262
|
+
* - L2ToL1MessageLimitReachedError
|
|
263
|
+
*/ async insertRevertiblesFromPrivate(context) {
|
|
234
264
|
const stateManager = context.state.getActiveStateManager();
|
|
235
265
|
try {
|
|
236
266
|
for (const siloedNullifier of context.revertibleAccumulatedDataFromPrivate.nullifiers.filter((n)=>!n.isEmpty())){
|
|
237
267
|
await stateManager.writeSiloedNullifier(siloedNullifier);
|
|
238
268
|
}
|
|
239
269
|
} catch (e) {
|
|
240
|
-
|
|
241
|
-
|
|
270
|
+
if (e instanceof NullifierLimitReachedError || e instanceof NullifierCollisionError) {
|
|
271
|
+
context.revert(TxExecutionPhase.APP_LOGIC, new SimulationError(`Error encountered when inserting revertible nullifiers from private.\nDetails: ${e.message}`, []));
|
|
272
|
+
throw new TxSimRevertibleInsertionsRevert();
|
|
273
|
+
} else {
|
|
274
|
+
// Unchecked/unknown error - re-throw as-is
|
|
275
|
+
throw e;
|
|
276
|
+
}
|
|
242
277
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
278
|
+
try {
|
|
279
|
+
for (const noteHash of context.revertibleAccumulatedDataFromPrivate.noteHashes){
|
|
280
|
+
if (!noteHash.isEmpty()) {
|
|
281
|
+
// Revertible note hashes from private are not hashed with nonce, since private can't know their final position, only we can.
|
|
282
|
+
await stateManager.writeSiloedNoteHash(noteHash);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
} catch (e) {
|
|
286
|
+
if (e instanceof NoteHashLimitReachedError) {
|
|
287
|
+
context.revert(TxExecutionPhase.APP_LOGIC, new SimulationError(`Error encountered when inserting revertible note hashes from private.\nDetails: ${e.message}`, []));
|
|
288
|
+
throw new TxSimRevertibleInsertionsRevert();
|
|
289
|
+
} else {
|
|
290
|
+
// Unchecked/unknown error - re-throw as-is
|
|
291
|
+
throw e;
|
|
247
292
|
}
|
|
248
293
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
294
|
+
try {
|
|
295
|
+
for (const l2ToL1Message of context.revertibleAccumulatedDataFromPrivate.l2ToL1Msgs){
|
|
296
|
+
if (!l2ToL1Message.isEmpty()) {
|
|
297
|
+
stateManager.writeScopedL2ToL1Message(l2ToL1Message);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
} catch (e) {
|
|
301
|
+
if (e instanceof L2ToL1MessageLimitReachedError) {
|
|
302
|
+
context.revert(TxExecutionPhase.APP_LOGIC, new SimulationError(`Error encountered when inserting revertible L2-to-L1 messages from private.\nDetails: ${e.message}`, []));
|
|
303
|
+
throw new TxSimRevertibleInsertionsRevert();
|
|
304
|
+
} else {
|
|
305
|
+
// Unchecked/unknown error - re-throw as-is
|
|
306
|
+
throw e;
|
|
252
307
|
}
|
|
253
308
|
}
|
|
254
309
|
// add new contracts to the contracts db so that their functions may be found and called
|
|
255
|
-
// FIXME(fcarreiro): this should conceptually use the
|
|
256
|
-
// However things
|
|
257
|
-
|
|
258
|
-
|
|
310
|
+
// FIXME(fcarreiro): this should conceptually use the hinting contracts db.
|
|
311
|
+
// However, things work as expected because later calls to getters on the hintingContractsDB
|
|
312
|
+
// will pick up the new contracts and will generate the necessary hints.
|
|
313
|
+
// So, a consumer of the hints will always see the new contracts.
|
|
314
|
+
await this.contractsDB.addContracts(context.revertibleContractDeploymentData);
|
|
259
315
|
}
|
|
260
316
|
async payFee(context) {
|
|
261
317
|
const txFee = context.getTransactionFee(TxExecutionPhase.TEARDOWN);
|
|
262
318
|
if (context.feePayer.isZero()) {
|
|
263
|
-
|
|
319
|
+
// Real transactions are enforced by private kernel to have nonzero fee payer.
|
|
320
|
+
// Real transactions cannot skip fee enforcement (skipping fee enforcement makes them unprovable).
|
|
321
|
+
assert(this.config.skipFeeEnforcement, 'Fee payer cannot be 0 unless skipping fee enforcement for simulation');
|
|
322
|
+
this.log.debug(`Fee payer is 0. Skipping fee enforcement. No one is paying the fee of ${txFee.toBigInt()}`);
|
|
264
323
|
return;
|
|
265
324
|
}
|
|
266
325
|
const feeJuiceAddress = ProtocolContractAddress.FeeJuice;
|
|
@@ -271,21 +330,13 @@ export class PublicTxSimulator {
|
|
|
271
330
|
// We allow to fake the balance of the fee payer to allow fee estimation
|
|
272
331
|
// When mocking the balance of the fee payer, the circuit should not be able to prove the simulation
|
|
273
332
|
if (currentBalance.lt(txFee)) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
333
|
+
// Without "skipFeeEnforcement", such transactions should be filtered by GasTxValidator.
|
|
334
|
+
assert(this.config.skipFeeEnforcement, `Not enough balance for fee payer to pay for transaction (got ${currentBalance.toBigInt()} needs ${txFee.toBigInt()})`);
|
|
335
|
+
this.log.debug(`Fee payer balance insufficient, but we're skipping fee enforcement`);
|
|
336
|
+
// We still proceed and perform the storage write to minimize deviation from normal execution.
|
|
337
|
+
currentBalance = txFee;
|
|
279
338
|
}
|
|
280
339
|
const updatedBalance = currentBalance.sub(txFee);
|
|
281
340
|
await stateManager.writeStorage(feeJuiceAddress, balanceSlot, updatedBalance, true);
|
|
282
341
|
}
|
|
283
|
-
/**
|
|
284
|
-
* Generate the proving request for the AVM circuit.
|
|
285
|
-
*/ static generateProvingRequest(publicInputs, hints) {
|
|
286
|
-
return {
|
|
287
|
-
type: ProvingRequestType.PUBLIC_VM,
|
|
288
|
-
inputs: new AvmCircuitInputs(hints, publicInputs)
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
342
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { PublicTxResult } from '@aztec/stdlib/avm';
|
|
2
|
+
import type { Tx } from '@aztec/stdlib/tx';
|
|
3
|
+
export interface PublicTxSimulatorInterface {
|
|
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>;
|
|
18
|
+
}
|
|
19
|
+
export interface MeasuredPublicTxSimulatorInterface {
|
|
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>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX3R4X3NpbXVsYXRvcl9pbnRlcmZhY2UuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaWMvcHVibGljX3R4X3NpbXVsYXRvci9wdWJsaWNfdHhfc2ltdWxhdG9yX2ludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxjQUFjLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUN4RCxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUUzQyxNQUFNLFdBQVcsMEJBQTBCO0lBQ3pDLFFBQVEsQ0FBQyxFQUFFLEVBQUUsRUFBRSxHQUFHLE9BQU8sQ0FBQyxjQUFjLENBQUMsQ0FBQztJQUMxQzs7Ozs7Ozs7Ozs7T0FXRztJQUNILE1BQU0sQ0FBQyxDQUFDLGFBQWEsQ0FBQyxFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUM7Q0FDaEQ7QUFFRCxNQUFNLFdBQVcsa0NBQWtDO0lBQ2pELFFBQVEsQ0FBQyxFQUFFLEVBQUUsRUFBRSxFQUFFLE9BQU8sRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLGNBQWMsQ0FBQyxDQUFDO0lBQzNEOzs7Ozs7OztPQVFHO0lBQ0gsTUFBTSxDQUFDLENBQUMsYUFBYSxDQUFDLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQztDQUNoRCJ9
|
|
@@ -0,0 +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,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/
|
|
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';
|
|
@@ -13,8 +14,8 @@ import { PublicTxContext } from './public_tx_context.js';
|
|
|
13
14
|
*/
|
|
14
15
|
export declare class TelemetryPublicTxSimulator extends MeasuredPublicTxSimulator {
|
|
15
16
|
readonly tracer: Tracer;
|
|
16
|
-
constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables,
|
|
17
|
+
constructor(merkleTree: MerkleTreeWriteOperations, contractsDB: PublicContractsDB, globalVariables: GlobalVariables, telemetryClient?: TelemetryClient, config?: Partial<PublicSimulatorConfig>);
|
|
17
18
|
protected simulateEnqueuedCall(phase: TxExecutionPhase, context: PublicTxContext, callRequest: PublicCallRequestWithCalldata): Promise<AvmFinalizedCallResult>;
|
|
18
19
|
protected simulateEnqueuedCallInternal(stateManager: PublicPersistableStateManager, callRequest: PublicCallRequestWithCalldata, allocatedGas: Gas, transactionFee: Fr, fnName: string): Promise<AvmFinalizedCallResult>;
|
|
19
20
|
}
|
|
20
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVsZW1ldHJ5X3B1YmxpY190eF9zaW11bGF0b3IuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaWMvcHVibGljX3R4X3NpbXVsYXRvci90ZWxlbWV0cnlfcHVibGljX3R4X3NpbXVsYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUN6RCxPQUFPLEtBQUssRUFBRSxxQkFBcUIsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQy9ELE9BQU8sS0FBSyxFQUFFLEdBQUcsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQzdDLE9BQU8sS0FBSyxFQUFFLHlCQUF5QixFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDckUsT0FBTyxFQUF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IsY0FBYyxFQUFFLEVBQUUsRUFDbEIsTUFBTSxFQUFFLE1BQU0sR0FDYixPQUFPLENBQUMsc0JBQXNCLENBQUMsQ0FFakM7Q0FDRiJ9
|
|
@@ -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,EAAE,EAAE,MAAM,
|
|
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,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,KAAK,eAAe,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzG,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,MAAM,EAAiC,MAAM,yBAAyB,CAAC;AAEvH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAEjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,yBAAyB;IAEvE,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,YACE,UAAU,EAAE,yBAAyB,EACrC,WAAW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