@aztec/simulator 6.0.0-nightly.20260605 → 6.0.0-nightly.20260721
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 -3
- package/dest/client.d.ts.map +1 -1
- package/dest/client.js +0 -2
- package/dest/private/circuit_recording/circuit_recorder.d.ts +36 -23
- package/dest/private/circuit_recording/circuit_recorder.d.ts.map +1 -1
- package/dest/private/circuit_recording/circuit_recorder.js +65 -69
- package/dest/private/circuit_recording/file_circuit_recorder.d.ts +7 -19
- package/dest/private/circuit_recording/file_circuit_recorder.d.ts.map +1 -1
- package/dest/private/circuit_recording/file_circuit_recorder.js +38 -42
- package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts +1 -1
- package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts.map +1 -1
- package/dest/private/circuit_recording/simulator_recorder_wrapper.js +11 -14
- package/dest/public/avm/testing/account_proof_fetcher.d.ts +2 -0
- package/dest/public/avm/testing/account_proof_fetcher.d.ts.map +1 -0
- package/dest/public/avm/{fixtures → testing}/base_avm_simulation_tester.d.ts +1 -1
- package/dest/public/avm/testing/base_avm_simulation_tester.d.ts.map +1 -0
- package/dest/public/avm/{fixtures → testing}/base_avm_simulation_tester.js +1 -1
- package/dest/public/avm/testing/utils.d.ts +32 -0
- package/dest/public/avm/testing/utils.d.ts.map +1 -0
- package/dest/public/avm/{fixtures → testing}/utils.js +1 -34
- package/dest/public/avm_simulator.d.ts +28 -0
- package/dest/public/avm_simulator.d.ts.map +1 -0
- package/dest/public/avm_simulator.js +4 -0
- package/dest/public/avm_simulator_pool.d.ts +45 -0
- package/dest/public/avm_simulator_pool.d.ts.map +1 -0
- package/dest/public/avm_simulator_pool.js +197 -0
- package/dest/public/cdb/generated/api_types.d.ts +171 -0
- package/dest/public/cdb/generated/api_types.d.ts.map +1 -0
- package/dest/public/cdb/generated/api_types.js +314 -0
- package/dest/public/cdb/generated/server.d.ts +26 -0
- package/dest/public/cdb/generated/server.d.ts.map +1 -0
- package/dest/public/cdb/generated/server.js +135 -0
- package/dest/public/cdb_ipc_server.d.ts +33 -0
- package/dest/public/cdb_ipc_server.d.ts.map +1 -0
- package/dest/public/cdb_ipc_server.js +153 -0
- package/dest/public/fixtures/amm_test.js +2 -2
- package/dest/public/fixtures/bulk_test.js +2 -2
- package/dest/public/fixtures/custom_bytecode_tester.d.ts +1 -1
- package/dest/public/fixtures/custom_bytecode_tester.d.ts.map +1 -1
- package/dest/public/fixtures/custom_bytecode_tester.js +2 -2
- package/dest/public/fixtures/index.d.ts +2 -4
- package/dest/public/fixtures/index.d.ts.map +1 -1
- package/dest/public/fixtures/index.js +1 -3
- package/dest/public/fixtures/public_processor_test_env.d.ts +30 -0
- package/dest/public/fixtures/public_processor_test_env.d.ts.map +1 -0
- package/dest/public/fixtures/public_processor_test_env.js +73 -0
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts +11 -7
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +1 -1
- package/dest/public/fixtures/public_tx_simulation_tester.js +33 -43
- package/dest/public/fixtures/simple_contract_data_source.js +1 -1
- package/dest/public/fixtures/token_test.js +3 -3
- package/dest/public/fixtures/utils.d.ts +1 -1
- package/dest/public/fixtures/utils.d.ts.map +1 -1
- package/dest/public/fixtures/utils.js +5 -3
- package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts +11 -4
- package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts.map +1 -1
- package/dest/public/fuzzing/avm_fuzzer_simulator.js +24 -10
- package/dest/public/fuzzing/avm_simulator_bin.js +4 -4
- package/dest/public/index.d.ts +5 -2
- package/dest/public/index.d.ts.map +1 -1
- package/dest/public/index.js +2 -1
- package/dest/public/public_db_sources.d.ts +2 -2
- package/dest/public/public_db_sources.d.ts.map +1 -1
- package/dest/public/public_db_sources.js +1 -1
- package/dest/public/public_processor/guarded_merkle_tree.d.ts +4 -3
- package/dest/public/public_processor/guarded_merkle_tree.d.ts.map +1 -1
- package/dest/public/public_processor/guarded_merkle_tree.js +3 -0
- package/dest/public/public_processor/public_processor.d.ts +8 -4
- package/dest/public/public_processor/public_processor.d.ts.map +1 -1
- package/dest/public/public_processor/public_processor.js +18 -14
- package/dest/public/public_tx_simulator/dumping_public_tx_simulator.d.ts +17 -0
- package/dest/public/public_tx_simulator/dumping_public_tx_simulator.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/{dumping_cpp_public_tx_simulator.js → dumping_public_tx_simulator.js} +10 -23
- package/dest/public/public_tx_simulator/factories.d.ts +8 -8
- package/dest/public/public_tx_simulator/factories.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/factories.js +8 -8
- package/dest/public/public_tx_simulator/index.d.ts +4 -6
- package/dest/public/public_tx_simulator/index.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/index.js +2 -4
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts +42 -75
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/public_tx_simulator.js +98 -323
- package/dest/public/public_tx_simulator/public_tx_simulator_base.d.ts +24 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_base.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_base.js +31 -0
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.d.ts +5 -5
- package/dest/public/test_executor_metrics.d.ts +1 -6
- package/dest/public/test_executor_metrics.d.ts.map +1 -1
- package/dest/public/test_executor_metrics.js +0 -22
- package/package.json +22 -19
- package/src/client.ts +0 -2
- package/src/private/circuit_recording/circuit_recorder.ts +84 -78
- package/src/private/circuit_recording/file_circuit_recorder.ts +38 -48
- package/src/private/circuit_recording/simulator_recorder_wrapper.ts +9 -15
- package/src/public/avm/{fixtures → testing}/base_avm_simulation_tester.ts +1 -1
- package/src/public/avm/{fixtures → testing}/utils.ts +1 -40
- package/src/public/avm_simulator.ts +29 -0
- package/src/public/avm_simulator_pool.ts +226 -0
- package/src/public/cdb/generated/api_types.ts +457 -0
- package/src/public/cdb/generated/server.ts +109 -0
- package/src/public/cdb_ipc_server.ts +197 -0
- package/src/public/fixtures/amm_test.ts +2 -2
- package/src/public/fixtures/bulk_test.ts +2 -2
- package/src/public/fixtures/custom_bytecode_tester.ts +2 -2
- package/src/public/fixtures/index.ts +1 -3
- package/src/public/fixtures/public_processor_test_env.ts +88 -0
- package/src/public/fixtures/public_tx_simulation_tester.ts +41 -55
- package/src/public/fixtures/simple_contract_data_source.ts +1 -1
- package/src/public/fixtures/token_test.ts +3 -3
- package/src/public/fixtures/utils.ts +6 -11
- package/src/public/fuzzing/avm_fuzzer_simulator.ts +25 -10
- package/src/public/fuzzing/avm_simulator_bin.ts +3 -5
- package/src/public/index.ts +7 -3
- package/src/public/public_db_sources.ts +1 -1
- package/src/public/public_processor/guarded_merkle_tree.ts +5 -2
- package/src/public/public_processor/public_processor.ts +24 -17
- package/src/public/public_tx_simulator/{dumping_cpp_public_tx_simulator.ts → dumping_public_tx_simulator.ts} +15 -31
- package/src/public/public_tx_simulator/factories.ts +27 -10
- package/src/public/public_tx_simulator/index.ts +6 -5
- package/src/public/public_tx_simulator/public_tx_simulator.ts +139 -480
- package/src/public/public_tx_simulator/public_tx_simulator_base.ts +37 -0
- package/src/public/public_tx_simulator/public_tx_simulator_interface.ts +5 -5
- package/src/public/test_executor_metrics.ts +0 -24
- package/dest/public/avm/avm_context.d.ts +0 -41
- package/dest/public/avm/avm_context.d.ts.map +0 -1
- package/dest/public/avm/avm_context.js +0 -44
- package/dest/public/avm/avm_contract_call_result.d.ts +0 -32
- package/dest/public/avm/avm_contract_call_result.d.ts.map +0 -1
- package/dest/public/avm/avm_contract_call_result.js +0 -54
- package/dest/public/avm/avm_execution_environment.d.ts +0 -24
- package/dest/public/avm/avm_execution_environment.d.ts.map +0 -1
- package/dest/public/avm/avm_execution_environment.js +0 -33
- package/dest/public/avm/avm_gas.d.ts +0 -44
- package/dest/public/avm/avm_gas.d.ts.map +0 -1
- package/dest/public/avm/avm_gas.js +0 -195
- package/dest/public/avm/avm_machine_state.d.ts +0 -98
- package/dest/public/avm/avm_machine_state.d.ts.map +0 -1
- package/dest/public/avm/avm_machine_state.js +0 -110
- package/dest/public/avm/avm_memory_types.d.ts +0 -275
- package/dest/public/avm/avm_memory_types.d.ts.map +0 -1
- package/dest/public/avm/avm_memory_types.js +0 -354
- package/dest/public/avm/avm_simulator.d.ts +0 -41
- package/dest/public/avm/avm_simulator.d.ts.map +0 -1
- package/dest/public/avm/avm_simulator.js +0 -192
- package/dest/public/avm/avm_simulator_interface.d.ts +0 -9
- package/dest/public/avm/avm_simulator_interface.d.ts.map +0 -1
- package/dest/public/avm/avm_simulator_interface.js +0 -3
- package/dest/public/avm/calldata.d.ts +0 -51
- package/dest/public/avm/calldata.d.ts.map +0 -1
- package/dest/public/avm/calldata.js +0 -64
- package/dest/public/avm/errors.d.ts +0 -104
- package/dest/public/avm/errors.d.ts.map +0 -1
- package/dest/public/avm/errors.js +0 -141
- package/dest/public/avm/fixtures/account_proof_fetcher.d.ts +0 -2
- package/dest/public/avm/fixtures/account_proof_fetcher.d.ts.map +0 -1
- package/dest/public/avm/fixtures/avm_simulation_tester.d.ts +0 -22
- package/dest/public/avm/fixtures/avm_simulation_tester.d.ts.map +0 -1
- package/dest/public/avm/fixtures/avm_simulation_tester.js +0 -84
- package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts.map +0 -1
- package/dest/public/avm/fixtures/initializers.d.ts +0 -42
- package/dest/public/avm/fixtures/initializers.d.ts.map +0 -1
- package/dest/public/avm/fixtures/initializers.js +0 -45
- package/dest/public/avm/fixtures/utils.d.ts +0 -39
- package/dest/public/avm/fixtures/utils.d.ts.map +0 -1
- package/dest/public/avm/index.d.ts +0 -2
- package/dest/public/avm/index.d.ts.map +0 -1
- package/dest/public/avm/index.js +0 -1
- package/dest/public/avm/opcodes/accrued_substate.d.ts +0 -74
- package/dest/public/avm/opcodes/accrued_substate.d.ts.map +0 -1
- package/dest/public/avm/opcodes/accrued_substate.js +0 -254
- package/dest/public/avm/opcodes/addressing_mode.d.ts +0 -31
- package/dest/public/avm/opcodes/addressing_mode.d.ts.map +0 -1
- package/dest/public/avm/opcodes/addressing_mode.js +0 -94
- package/dest/public/avm/opcodes/arithmetic.d.ts +0 -49
- package/dest/public/avm/opcodes/arithmetic.d.ts.map +0 -1
- package/dest/public/avm/opcodes/arithmetic.js +0 -97
- package/dest/public/avm/opcodes/bitwise.d.ts +0 -42
- package/dest/public/avm/opcodes/bitwise.d.ts.map +0 -1
- package/dest/public/avm/opcodes/bitwise.js +0 -99
- package/dest/public/avm/opcodes/comparators.d.ts +0 -25
- package/dest/public/avm/opcodes/comparators.d.ts.map +0 -1
- package/dest/public/avm/opcodes/comparators.js +0 -43
- package/dest/public/avm/opcodes/contract.d.ts +0 -21
- package/dest/public/avm/opcodes/contract.d.ts.map +0 -1
- package/dest/public/avm/opcodes/contract.js +0 -69
- package/dest/public/avm/opcodes/control_flow.d.ts +0 -41
- package/dest/public/avm/opcodes/control_flow.d.ts.map +0 -1
- package/dest/public/avm/opcodes/control_flow.js +0 -107
- package/dest/public/avm/opcodes/conversion.d.ts +0 -18
- package/dest/public/avm/opcodes/conversion.d.ts.map +0 -1
- package/dest/public/avm/opcodes/conversion.js +0 -333
- package/dest/public/avm/opcodes/ec_add.d.ts +0 -17
- package/dest/public/avm/opcodes/ec_add.d.ts.map +0 -1
- package/dest/public/avm/opcodes/ec_add.js +0 -79
- package/dest/public/avm/opcodes/environment_getters.d.ts +0 -28
- package/dest/public/avm/opcodes/environment_getters.d.ts.map +0 -1
- package/dest/public/avm/opcodes/environment_getters.js +0 -77
- package/dest/public/avm/opcodes/external_calls.d.ts +0 -59
- package/dest/public/avm/opcodes/external_calls.d.ts.map +0 -1
- package/dest/public/avm/opcodes/external_calls.js +0 -210
- package/dest/public/avm/opcodes/hashing.d.ts +0 -36
- package/dest/public/avm/opcodes/hashing.d.ts.map +0 -1
- package/dest/public/avm/opcodes/hashing.js +0 -119
- package/dest/public/avm/opcodes/index.d.ts +0 -16
- package/dest/public/avm/opcodes/index.d.ts.map +0 -1
- package/dest/public/avm/opcodes/index.js +0 -15
- package/dest/public/avm/opcodes/instruction.d.ts +0 -74
- package/dest/public/avm/opcodes/instruction.d.ts.map +0 -1
- package/dest/public/avm/opcodes/instruction.js +0 -95
- package/dest/public/avm/opcodes/instruction_impl.d.ts +0 -19
- package/dest/public/avm/opcodes/instruction_impl.d.ts.map +0 -1
- package/dest/public/avm/opcodes/instruction_impl.js +0 -30
- package/dest/public/avm/opcodes/memory.d.ts +0 -74
- package/dest/public/avm/opcodes/memory.d.ts.map +0 -1
- package/dest/public/avm/opcodes/memory.js +0 -257
- package/dest/public/avm/opcodes/misc.d.ts +0 -18
- package/dest/public/avm/opcodes/misc.d.ts.map +0 -1
- package/dest/public/avm/opcodes/misc.js +0 -73
- package/dest/public/avm/opcodes/storage.d.ts +0 -25
- package/dest/public/avm/opcodes/storage.d.ts.map +0 -1
- package/dest/public/avm/opcodes/storage.js +0 -78
- package/dest/public/avm/revert_reason.d.ts +0 -18
- package/dest/public/avm/revert_reason.d.ts.map +0 -1
- package/dest/public/avm/revert_reason.js +0 -39
- package/dest/public/avm/serialization/buffer_cursor.d.ts +0 -26
- package/dest/public/avm/serialization/buffer_cursor.d.ts.map +0 -1
- package/dest/public/avm/serialization/buffer_cursor.js +0 -99
- package/dest/public/avm/serialization/bytecode_serialization.d.ts +0 -17
- package/dest/public/avm/serialization/bytecode_serialization.d.ts.map +0 -1
- package/dest/public/avm/serialization/bytecode_serialization.js +0 -336
- package/dest/public/avm/serialization/instruction_serialization.d.ts +0 -114
- package/dest/public/avm/serialization/instruction_serialization.d.ts.map +0 -1
- package/dest/public/avm/serialization/instruction_serialization.js +0 -261
- package/dest/public/avm/test_utils.d.ts +0 -15
- package/dest/public/avm/test_utils.d.ts.map +0 -1
- package/dest/public/avm/test_utils.js +0 -44
- package/dest/public/debug_fn_name.d.ts +0 -18
- package/dest/public/debug_fn_name.d.ts.map +0 -1
- package/dest/public/debug_fn_name.js +0 -37
- package/dest/public/fixtures/custom_bytecode_tests.d.ts +0 -14
- package/dest/public/fixtures/custom_bytecode_tests.d.ts.map +0 -1
- package/dest/public/fixtures/custom_bytecode_tests.js +0 -234
- package/dest/public/fixtures/minimal_public_tx.d.ts +0 -4
- package/dest/public/fixtures/minimal_public_tx.d.ts.map +0 -1
- package/dest/public/fixtures/minimal_public_tx.js +0 -19
- package/dest/public/fixtures/opcode_spammer.d.ts +0 -122
- package/dest/public/fixtures/opcode_spammer.d.ts.map +0 -1
- package/dest/public/fixtures/opcode_spammer.js +0 -1645
- package/dest/public/hinting_db_sources.d.ts +0 -80
- package/dest/public/hinting_db_sources.d.ts.map +0 -1
- package/dest/public/hinting_db_sources.js +0 -356
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.d.ts +0 -19
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.d.ts.map +0 -1
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.js +0 -99
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts +0 -53
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts.map +0 -1
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator.js +0 -131
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.d.ts +0 -42
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.d.ts.map +0 -1
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.js +0 -86
- package/dest/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.d.ts +0 -30
- package/dest/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.d.ts.map +0 -1
- package/dest/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.js +0 -171
- package/dest/public/public_tx_simulator/dumping_cpp_public_tx_simulator.d.ts +0 -23
- package/dest/public/public_tx_simulator/dumping_cpp_public_tx_simulator.d.ts.map +0 -1
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.d.ts +0 -31
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.d.ts.map +0 -1
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.js +0 -51
- package/dest/public/public_tx_simulator/public_tx_context.d.ts +0 -135
- package/dest/public/public_tx_simulator/public_tx_context.d.ts.map +0 -1
- package/dest/public/public_tx_simulator/public_tx_context.js +0 -298
- package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.d.ts +0 -21
- package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.d.ts.map +0 -1
- package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.js +0 -415
- package/dest/public/side_effect_trace.d.ts +0 -87
- package/dest/public/side_effect_trace.d.ts.map +0 -1
- package/dest/public/side_effect_trace.js +0 -199
- package/dest/public/side_effect_trace_interface.d.ts +0 -22
- package/dest/public/side_effect_trace_interface.d.ts.map +0 -1
- package/dest/public/side_effect_trace_interface.js +0 -1
- package/dest/public/state_manager/index.d.ts +0 -2
- package/dest/public/state_manager/index.d.ts.map +0 -1
- package/dest/public/state_manager/index.js +0 -1
- package/dest/public/state_manager/nullifiers.d.ts +0 -61
- package/dest/public/state_manager/nullifiers.d.ts.map +0 -1
- package/dest/public/state_manager/nullifiers.js +0 -92
- package/dest/public/state_manager/public_storage.d.ts +0 -66
- package/dest/public/state_manager/public_storage.d.ts.map +0 -1
- package/dest/public/state_manager/public_storage.js +0 -145
- package/dest/public/state_manager/state_manager.d.ts +0 -170
- package/dest/public/state_manager/state_manager.d.ts.map +0 -1
- package/dest/public/state_manager/state_manager.js +0 -402
- package/src/public/avm/avm_context.ts +0 -61
- package/src/public/avm/avm_contract_call_result.ts +0 -69
- package/src/public/avm/avm_execution_environment.ts +0 -51
- package/src/public/avm/avm_gas.ts +0 -183
- package/src/public/avm/avm_machine_state.ts +0 -170
- package/src/public/avm/avm_memory_types.ts +0 -440
- package/src/public/avm/avm_simulator.ts +0 -279
- package/src/public/avm/avm_simulator_interface.ts +0 -8
- package/src/public/avm/calldata.ts +0 -101
- package/src/public/avm/errors.ts +0 -177
- package/src/public/avm/fixtures/avm_simulation_tester.ts +0 -122
- package/src/public/avm/fixtures/initializers.ts +0 -103
- package/src/public/avm/index.ts +0 -1
- package/src/public/avm/opcodes/accrued_substate.ts +0 -285
- package/src/public/avm/opcodes/addressing_mode.ts +0 -111
- package/src/public/avm/opcodes/arithmetic.ts +0 -129
- package/src/public/avm/opcodes/bitwise.ts +0 -113
- package/src/public/avm/opcodes/comparators.ts +0 -55
- package/src/public/avm/opcodes/contract.ts +0 -76
- package/src/public/avm/opcodes/control_flow.ts +0 -123
- package/src/public/avm/opcodes/conversion.ts +0 -104
- package/src/public/avm/opcodes/ec_add.ts +0 -86
- package/src/public/avm/opcodes/environment_getters.ts +0 -87
- package/src/public/avm/opcodes/external_calls.ts +0 -262
- package/src/public/avm/opcodes/hashing.ts +0 -151
- package/src/public/avm/opcodes/index.ts +0 -15
- package/src/public/avm/opcodes/instruction.ts +0 -136
- package/src/public/avm/opcodes/instruction_impl.ts +0 -36
- package/src/public/avm/opcodes/memory.ts +0 -293
- package/src/public/avm/opcodes/misc.ts +0 -102
- package/src/public/avm/opcodes/storage.ts +0 -95
- package/src/public/avm/revert_reason.ts +0 -58
- package/src/public/avm/serialization/buffer_cursor.ts +0 -118
- package/src/public/avm/serialization/bytecode_serialization.ts +0 -215
- package/src/public/avm/serialization/instruction_serialization.ts +0 -249
- package/src/public/avm/test_utils.ts +0 -64
- package/src/public/debug_fn_name.ts +0 -52
- package/src/public/fixtures/custom_bytecode_tests.ts +0 -366
- package/src/public/fixtures/minimal_public_tx.ts +0 -26
- package/src/public/fixtures/opcode_spammer.ts +0 -1713
- package/src/public/hinting_db_sources.ts +0 -610
- package/src/public/public_tx_simulator/contract_provider_for_cpp.ts +0 -125
- package/src/public/public_tx_simulator/cpp_public_tx_simulator.ts +0 -210
- package/src/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.ts +0 -134
- package/src/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.ts +0 -239
- package/src/public/public_tx_simulator/measured_public_tx_simulator.ts +0 -105
- package/src/public/public_tx_simulator/public_tx_context.ts +0 -482
- package/src/public/public_tx_simulator/telemetry_public_tx_simulator.ts +0 -63
- package/src/public/side_effect_trace.ts +0 -293
- package/src/public/side_effect_trace_interface.ts +0 -28
- package/src/public/state_manager/index.ts +0 -1
- package/src/public/state_manager/nullifiers.ts +0 -103
- package/src/public/state_manager/public_storage.ts +0 -174
- package/src/public/state_manager/state_manager.ts +0 -569
- /package/dest/public/avm/{fixtures → testing}/account_proof_fetcher.js +0 -0
- /package/src/public/avm/{fixtures → testing}/account_proof.json +0 -0
- /package/src/public/avm/{fixtures → testing}/account_proof_fetcher.ts +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Logger, type LoggerBindings } from '@aztec/foundation/log';
|
|
2
|
+
import { PublicSimulatorConfig } from '@aztec/stdlib/avm';
|
|
3
|
+
import type { GlobalVariables, ProtocolContracts, Tx } from '@aztec/stdlib/tx';
|
|
4
|
+
import type { AvmSimulator } from '../avm_simulator.js';
|
|
5
|
+
import type { PublicContractsDB } from '../public_db_sources.js';
|
|
6
|
+
/**
|
|
7
|
+
* Shared base for public tx simulators: holds the common configuration, the {@link AvmSimulator} used
|
|
8
|
+
* to run the transaction's public calls, the contracts DB and fork id that scope the simulation's
|
|
9
|
+
* contract-data lookups, the logger, and the tx-hash helper. Concrete simulators extend this and
|
|
10
|
+
* implement `simulate`.
|
|
11
|
+
*/
|
|
12
|
+
export declare abstract class PublicTxSimulatorBase {
|
|
13
|
+
protected avmSimulator: AvmSimulator;
|
|
14
|
+
protected globalVariables: GlobalVariables;
|
|
15
|
+
protected contractsDB: PublicContractsDB;
|
|
16
|
+
protected forkId: number;
|
|
17
|
+
protected protocolContracts: ProtocolContracts;
|
|
18
|
+
protected log: Logger;
|
|
19
|
+
protected readonly config: PublicSimulatorConfig;
|
|
20
|
+
protected readonly bindings?: LoggerBindings;
|
|
21
|
+
constructor(avmSimulator: AvmSimulator, globalVariables: GlobalVariables, contractsDB: PublicContractsDB, forkId: number, config?: Partial<PublicSimulatorConfig>, protocolContracts?: ProtocolContracts, bindings?: LoggerBindings);
|
|
22
|
+
protected computeTxHash(tx: Tx): import("@aztec/stdlib/tx").TxHash;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX3R4X3NpbXVsYXRvcl9iYXNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcHVibGljL3B1YmxpY190eF9zaW11bGF0b3IvcHVibGljX3R4X3NpbXVsYXRvcl9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBRSxLQUFLLGNBQWMsRUFBZ0IsTUFBTSx1QkFBdUIsQ0FBQztBQUV2RixPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUMxRCxPQUFPLEtBQUssRUFBRSxlQUFlLEVBQUUsaUJBQWlCLEVBQUUsRUFBRSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFL0UsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDeEQsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUVqRTs7Ozs7R0FLRztBQUNILDhCQUFzQixxQkFBcUI7SUFNdkMsU0FBUyxDQUFDLFlBQVksRUFBRSxZQUFZO0lBQ3BDLFNBQVMsQ0FBQyxlQUFlLEVBQUUsZUFBZTtJQUMxQyxTQUFTLENBQUMsV0FBVyxFQUFFLGlCQUFpQjtJQUN4QyxTQUFTLENBQUMsTUFBTSxFQUFFLE1BQU07SUFFe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;IAC1C,SAAS,CAAC,WAAW,EAAE,iBAAiB;IACxC,SAAS,CAAC,MAAM,EAAE,MAAM;IAExB,SAAS,CAAC,iBAAiB,EAAE,iBAAiB;IAVhD,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACjD,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE7C,YACY,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,iBAAiB,EAC9B,MAAM,EAAE,MAAM,EACxB,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,EAC7B,iBAAiB,GAAE,iBAAyC,EACtE,QAAQ,CAAC,EAAE,cAAc,EAK1B;IAED,SAAS,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,qCAE7B;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
2
|
+
import { ProtocolContractsList } from '@aztec/protocol-contracts';
|
|
3
|
+
import { PublicSimulatorConfig } from '@aztec/stdlib/avm';
|
|
4
|
+
/**
|
|
5
|
+
* Shared base for public tx simulators: holds the common configuration, the {@link AvmSimulator} used
|
|
6
|
+
* to run the transaction's public calls, the contracts DB and fork id that scope the simulation's
|
|
7
|
+
* contract-data lookups, the logger, and the tx-hash helper. Concrete simulators extend this and
|
|
8
|
+
* implement `simulate`.
|
|
9
|
+
*/ export class PublicTxSimulatorBase {
|
|
10
|
+
avmSimulator;
|
|
11
|
+
globalVariables;
|
|
12
|
+
contractsDB;
|
|
13
|
+
forkId;
|
|
14
|
+
protocolContracts;
|
|
15
|
+
log;
|
|
16
|
+
config;
|
|
17
|
+
bindings;
|
|
18
|
+
constructor(avmSimulator, globalVariables, contractsDB, forkId, config, protocolContracts = ProtocolContractsList, bindings){
|
|
19
|
+
this.avmSimulator = avmSimulator;
|
|
20
|
+
this.globalVariables = globalVariables;
|
|
21
|
+
this.contractsDB = contractsDB;
|
|
22
|
+
this.forkId = forkId;
|
|
23
|
+
this.protocolContracts = protocolContracts;
|
|
24
|
+
this.config = PublicSimulatorConfig.from(config ?? {});
|
|
25
|
+
this.bindings = bindings;
|
|
26
|
+
this.log = createLogger(`simulator:public_tx_simulator`, bindings);
|
|
27
|
+
}
|
|
28
|
+
computeTxHash(tx) {
|
|
29
|
+
return tx.getTxHash();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -4,14 +4,14 @@ export interface PublicTxSimulatorInterface {
|
|
|
4
4
|
simulate(tx: Tx): Promise<PublicTxResult>;
|
|
5
5
|
/**
|
|
6
6
|
* Cancel the current simulation if one is in progress.
|
|
7
|
-
* This signals the underlying simulator
|
|
7
|
+
* This signals the underlying simulator to stop at the next safe point.
|
|
8
8
|
* Safe to call even if no simulation is in progress.
|
|
9
9
|
* Optional - not all implementations support cancellation.
|
|
10
10
|
*
|
|
11
11
|
* @param waitTimeoutMs - If provided, wait up to this many ms for the simulation to actually stop.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* Cancellation is cooperative: signaling it only sets a flag the simulator
|
|
13
|
+
* checks at certain points, so if it's mid slow-operation it won't stop until
|
|
14
|
+
* that completes.
|
|
15
15
|
* @returns Promise that resolves when cancellation is signaled (and optionally when simulation stops)
|
|
16
16
|
*/
|
|
17
17
|
cancel?(waitTimeoutMs?: number): Promise<void>;
|
|
@@ -20,7 +20,7 @@ export interface MeasuredPublicTxSimulatorInterface {
|
|
|
20
20
|
simulate(tx: Tx, txLabel: string): Promise<PublicTxResult>;
|
|
21
21
|
/**
|
|
22
22
|
* Cancel the current simulation if one is in progress.
|
|
23
|
-
* This signals the underlying simulator
|
|
23
|
+
* This signals the underlying simulator to stop at the next safe point.
|
|
24
24
|
* Safe to call even if no simulation is in progress.
|
|
25
25
|
* Optional - not all implementations support cancellation.
|
|
26
26
|
*
|
|
@@ -13,10 +13,6 @@ export interface PublicTxMetrics {
|
|
|
13
13
|
totalDurationMs: number;
|
|
14
14
|
manaUsed: number | undefined;
|
|
15
15
|
totalInstructionsExecuted: number;
|
|
16
|
-
bytecodeSizes: {
|
|
17
|
-
contractName: string;
|
|
18
|
-
sizeBytes: number;
|
|
19
|
-
}[];
|
|
20
16
|
nonRevertiblePrivateInsertionsUs: number | undefined;
|
|
21
17
|
revertiblePrivateInsertionsUs: number | undefined;
|
|
22
18
|
enqueuedCalls: PublicEnqueuedCallMetrics[];
|
|
@@ -51,11 +47,10 @@ export declare class TestExecutorMetrics implements ExecutorMetricsInterface {
|
|
|
51
47
|
recordEnqueuedCallSimulation(fnName: string, durationMs: number, manaUsed: number, totalInstructionsExecuted: number): void;
|
|
52
48
|
recordEnqueuedCallSimulationFailure(fnName: string, durationMs: number, manaUsed: number, totalInstructionsExecuted: number): void;
|
|
53
49
|
recordPrivateEffectsInsertion(durationUs: number, type: 'revertible' | 'non-revertible'): void;
|
|
54
|
-
recordBytecodeSize(txLabel: string, contractName: string, sizeBytes: number): void;
|
|
55
50
|
recordProverMetrics(txLabel: string, metrics: Partial<PublicTxMetrics>): void;
|
|
56
51
|
prettyPrint(filter?: PublicTxMetricsFilter): void;
|
|
57
52
|
toPrettyString(filter?: PublicTxMetricsFilter): string;
|
|
58
53
|
toJSON(indent?: number): string;
|
|
59
54
|
toGithubActionBenchmarkJSON(indent?: number): string;
|
|
60
55
|
}
|
|
61
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdF9leGVjdXRvcl9tZXRyaWNzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHVibGljL3Rlc3RfZXhlY3V0b3JfbWV0cmljcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQWUsS0FBSyxjQUFjLEVBQWdCL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UUsTUFBTSxRQUdsQztJQW9CRCw2QkFBNkIsQ0FBQyxVQUFVLEVBQUUsTUFBTSxFQUFFLElBQUksRUFBRSxZQUFZLEdBQUcsZ0JBQWdCLFFBZ0J0RjtJQUVELG1CQUFtQixDQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsT0FBTyxFQUFFLE9BQU8sQ0FBQyxlQUFlLENBQUMsUUFVckU7SUFFRCxXQUFXLENBQUMsTUFBTSxHQUFFLHFCQUFpRCxRQUVwRTtJQUVELGNBQWMsQ0FBQyxNQUFNLEdBQUUscUJBQWlELFVBK0V2RTtJQTBCRCxNQUFNLENBQUMsTUFBTSxTQUFJLFVBRWhCO0lBRUQsMkJBQTJCLENBQUMsTUFBTSxTQUFJLFVBNEZyQztDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test_executor_metrics.d.ts","sourceRoot":"","sources":["../../src/public/test_executor_metrics.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAEvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAEhF,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB,EAAE,MAAM,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAE9B,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,yBAAyB,EAAE,MAAM,CAAC;IAClC,
|
|
1
|
+
{"version":3,"file":"test_executor_metrics.d.ts","sourceRoot":"","sources":["../../src/public/test_executor_metrics.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;IACH,MAAM,IAAA;IACN,SAAS,IAAA;IACT,YAAY,IAAA;IACZ,OAAO,IAAA;CACR;AA2BD,qBAAa,mBAAoB,YAAW,wBAAwB;;IAClE,OAAO,CAAC,MAAM,CAAS;IAEvB,OAAO,CAAC,SAAS,CAA2C;IAC5D,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,OAAO,CAAoB;IAEnC,YAAY,QAAQ,CAAC,EAAE,cAAc,EAEpC;IAED,0BAA0B,CAAC,OAAO,EAAE,MAAM,QAMzC;IAED,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,UAAU,QAgBtF;IAED,4BAA4B,CAC1B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,yBAAyB,EAAE,MAAM,QAGlC;IAED,mCAAmC,CACjC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,yBAAyB,EAAE,MAAM,QAGlC;IAoBD,6BAA6B,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,gBAAgB,QAgBtF;IAED,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,QAUrE;IAED,WAAW,CAAC,MAAM,GAAE,qBAAiD,QAEpE;IAED,cAAc,CAAC,MAAM,GAAE,qBAAiD,UA+EvE;IA0BD,MAAM,CAAC,MAAM,SAAI,UAEhB;IAED,2BAA2B,CAAC,MAAM,SAAI,UA4FrC;CACF"}
|
|
@@ -24,7 +24,6 @@ function createEmptyTxMetrics() {
|
|
|
24
24
|
totalDurationMs: 0,
|
|
25
25
|
manaUsed: 0,
|
|
26
26
|
totalInstructionsExecuted: 0,
|
|
27
|
-
bytecodeSizes: [],
|
|
28
27
|
nonRevertiblePrivateInsertionsUs: undefined,
|
|
29
28
|
revertiblePrivateInsertionsUs: undefined,
|
|
30
29
|
enqueuedCalls: [],
|
|
@@ -100,14 +99,6 @@ export class TestExecutorMetrics {
|
|
|
100
99
|
txMetrics.nonRevertiblePrivateInsertionsUs = durationUs;
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
|
-
recordBytecodeSize(txLabel, contractName, sizeBytes) {
|
|
104
|
-
const txMetrics = this.txMetrics.get(txLabel);
|
|
105
|
-
assert(txMetrics, `Cannot record bytecode size for unknown tx label: ${txLabel}`);
|
|
106
|
-
txMetrics.bytecodeSizes.push({
|
|
107
|
-
contractName,
|
|
108
|
-
sizeBytes
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
102
|
recordProverMetrics(txLabel, metrics) {
|
|
112
103
|
if (!this.txMetrics.has(txLabel)) {
|
|
113
104
|
this.txMetrics.set(txLabel, createEmptyTxMetrics());
|
|
@@ -141,12 +132,6 @@ export class TestExecutorMetrics {
|
|
|
141
132
|
if (filter === 3 || filter === 1 || filter === 0) {
|
|
142
133
|
pretty += `${INDENT0}Total instructions executed: ${fmtNum(txMetrics.totalInstructionsExecuted)}\n`;
|
|
143
134
|
}
|
|
144
|
-
if ((filter === 1 || filter === 0) && txMetrics.bytecodeSizes.length > 0) {
|
|
145
|
-
pretty += `${INDENT0}Bytecode sizes:\n`;
|
|
146
|
-
for (const { contractName, sizeBytes } of txMetrics.bytecodeSizes){
|
|
147
|
-
pretty += `${INDENT1}${contractName}: ${fmtNum(sizeBytes, 'bytes')}\n`;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
135
|
if (filter === 2 || filter === 0) {
|
|
151
136
|
pretty += `${INDENT0}Private insertions:\n`;
|
|
152
137
|
pretty += `${INDENT1}Non-revertible: ${fmtNum(txMetrics.nonRevertiblePrivateInsertionsUs / 1_000, 'ms')}\n`;
|
|
@@ -313,13 +298,6 @@ export class TestExecutorMetrics {
|
|
|
313
298
|
});
|
|
314
299
|
}
|
|
315
300
|
}
|
|
316
|
-
for (const { contractName, sizeBytes } of txMetrics.bytecodeSizes){
|
|
317
|
-
data.push({
|
|
318
|
-
name: `${txLabel}/bytecodeSizeBytes/${contractName}`,
|
|
319
|
-
value: sizeBytes,
|
|
320
|
-
unit: 'bytes'
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
301
|
}
|
|
324
302
|
return JSON.stringify(data, null, indent);
|
|
325
303
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/simulator",
|
|
3
|
-
"version": "6.0.0-nightly.
|
|
3
|
+
"version": "6.0.0-nightly.20260721",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/server.js",
|
|
7
7
|
"./client": "./dest/client.js",
|
|
8
8
|
"./testing": "./dest/testing.js",
|
|
9
|
-
"./public/fixtures": "./dest/public/fixtures/index.js"
|
|
10
|
-
"./public/avm/opcodes": "./dest/public/avm/opcodes/index.js"
|
|
9
|
+
"./public/fixtures": "./dest/public/fixtures/index.js"
|
|
11
10
|
},
|
|
12
11
|
"typedocOptions": {
|
|
13
12
|
"entryPoints": [
|
|
@@ -20,8 +19,9 @@
|
|
|
20
19
|
"build": "yarn clean && ../scripts/tsc.sh",
|
|
21
20
|
"build:dev": "../scripts/tsc.sh --watch",
|
|
22
21
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
22
|
+
"generate": "node --experimental-strip-types --experimental-transform-types --no-warnings ../../ipc-codegen/src/generate.ts --schema ../../barretenberg/cpp/src/barretenberg/cdb/cdb_schema.json --lang ts --server --out src/public/cdb/generated",
|
|
23
23
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}",
|
|
24
|
-
"build:fuzzer": "yarn clean && ../scripts/tsc.sh"
|
|
24
|
+
"build:fuzzer": "yarn clean && yarn generate && ../scripts/tsc.sh"
|
|
25
25
|
},
|
|
26
26
|
"inherits": [
|
|
27
27
|
"../package.common.json"
|
|
@@ -64,26 +64,29 @@
|
|
|
64
64
|
]
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@aztec/
|
|
68
|
-
"@aztec/
|
|
69
|
-
"@aztec/
|
|
70
|
-
"@aztec/
|
|
71
|
-
"@aztec/
|
|
72
|
-
"@aztec/noir-
|
|
73
|
-
"@aztec/noir-
|
|
74
|
-
"@aztec/protocol-
|
|
75
|
-
"@aztec/
|
|
76
|
-
"@aztec/
|
|
77
|
-
"@aztec/
|
|
78
|
-
"@aztec/
|
|
67
|
+
"@aztec/bb-avm-sim": "6.0.0-nightly.20260721",
|
|
68
|
+
"@aztec/constants": "6.0.0-nightly.20260721",
|
|
69
|
+
"@aztec/foundation": "6.0.0-nightly.20260721",
|
|
70
|
+
"@aztec/ipc-runtime": "6.0.0-nightly.20260721",
|
|
71
|
+
"@aztec/native": "6.0.0-nightly.20260721",
|
|
72
|
+
"@aztec/noir-acvm_js": "6.0.0-nightly.20260721",
|
|
73
|
+
"@aztec/noir-noirc_abi": "6.0.0-nightly.20260721",
|
|
74
|
+
"@aztec/noir-protocol-circuits-types": "6.0.0-nightly.20260721",
|
|
75
|
+
"@aztec/noir-types": "6.0.0-nightly.20260721",
|
|
76
|
+
"@aztec/protocol-contracts": "6.0.0-nightly.20260721",
|
|
77
|
+
"@aztec/standard-contracts": "6.0.0-nightly.20260721",
|
|
78
|
+
"@aztec/stdlib": "6.0.0-nightly.20260721",
|
|
79
|
+
"@aztec/telemetry-client": "6.0.0-nightly.20260721",
|
|
80
|
+
"@aztec/world-state": "6.0.0-nightly.20260721",
|
|
79
81
|
"lodash.clonedeep": "^4.5.0",
|
|
80
82
|
"lodash.merge": "^4.6.2",
|
|
83
|
+
"msgpackr": "^1.11.2",
|
|
81
84
|
"tslib": "^2.4.0"
|
|
82
85
|
},
|
|
83
86
|
"devDependencies": {
|
|
84
|
-
"@aztec/kv-store": "6.0.0-nightly.
|
|
85
|
-
"@aztec/noir-contracts.js": "6.0.0-nightly.
|
|
86
|
-
"@aztec/noir-test-contracts.js": "6.0.0-nightly.
|
|
87
|
+
"@aztec/kv-store": "6.0.0-nightly.20260721",
|
|
88
|
+
"@aztec/noir-contracts.js": "6.0.0-nightly.20260721",
|
|
89
|
+
"@aztec/noir-test-contracts.js": "6.0.0-nightly.20260721",
|
|
87
90
|
"@jest/globals": "^30.0.0",
|
|
88
91
|
"@types/jest": "^30.0.0",
|
|
89
92
|
"@types/lodash.clonedeep": "^4.5.7",
|
package/src/client.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export * from './private/acvm/index.js';
|
|
2
2
|
export { WASMSimulator } from './private/acvm_wasm.js';
|
|
3
|
-
export { SimulatorRecorderWrapper } from './private/circuit_recording/simulator_recorder_wrapper.js';
|
|
4
|
-
export { MemoryCircuitRecorder } from './private/circuit_recording/memory_circuit_recorder.js';
|
|
5
3
|
export { type CircuitSimulator, type DecodedError } from './private/circuit_simulator.js';
|
|
6
4
|
export * from './common/index.js';
|
|
@@ -3,6 +3,8 @@ import { type Logger, type LoggerBindings, resolveLogger } from '@aztec/foundati
|
|
|
3
3
|
import { Timer } from '@aztec/foundation/timer';
|
|
4
4
|
import type { ForeignCallHandler, ForeignCallInput, ForeignCallOutput } from '@aztec/noir-acvm_js';
|
|
5
5
|
|
|
6
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
7
|
+
|
|
6
8
|
import type { ACIRCallback } from '../acvm/acvm.js';
|
|
7
9
|
import type { ACVMWitness } from '../acvm/acvm_types.js';
|
|
8
10
|
|
|
@@ -43,10 +45,23 @@ export class CircuitRecording {
|
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
|
|
48
|
+
/** Inputs needed to open a recording for a single circuit execution. */
|
|
49
|
+
export type RecordingMetadata = {
|
|
50
|
+
input: ACVMWitness;
|
|
51
|
+
bytecode: Buffer;
|
|
52
|
+
circuitName: string;
|
|
53
|
+
functionName: string;
|
|
54
|
+
};
|
|
55
|
+
|
|
46
56
|
/**
|
|
47
57
|
* Class responsible for recording circuit inputs necessary to replay the circuit. These inputs are the initial witness
|
|
48
58
|
* map and the oracle calls made during the circuit execution/witness generation.
|
|
49
59
|
*
|
|
60
|
+
* The active recording for an execution lives in `AsyncLocalStorage`, so each (possibly nested) circuit execution owns
|
|
61
|
+
* its own recording and concurrent or re-entrant executions cannot corrupt one another's state. Nested executions
|
|
62
|
+
* (`aztec_prv_callPrivateFunction`, utility calls) re-enter {@link record}, which links the child to the recording
|
|
63
|
+
* active in the enclosing async context and lets ALS restore the parent automatically when the child completes.
|
|
64
|
+
*
|
|
50
65
|
* Example recording object:
|
|
51
66
|
* ```json
|
|
52
67
|
* {
|
|
@@ -91,37 +106,44 @@ export class CircuitRecording {
|
|
|
91
106
|
export class CircuitRecorder {
|
|
92
107
|
protected readonly logger: Logger;
|
|
93
108
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
private stackDepth: number = 0;
|
|
97
|
-
private newCircuit: boolean = true;
|
|
109
|
+
readonly #recordings = new AsyncLocalStorage<CircuitRecording>();
|
|
98
110
|
|
|
99
111
|
protected constructor(loggerOrBindings?: Logger | LoggerBindings) {
|
|
100
112
|
this.logger = resolveLogger('simulator:acvm:recording', loggerOrBindings);
|
|
101
113
|
}
|
|
102
114
|
|
|
103
115
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
116
|
+
* Records a single circuit execution. Opens a recording for the circuit (linked as a child of the recording active
|
|
117
|
+
* in the current async context, if any), runs `fn` within that recording's context, and finalizes it. The recording
|
|
118
|
+
* is returned alongside the result so callers can derive per-circuit stats (e.g. oracle timings).
|
|
119
|
+
*
|
|
120
|
+
* Recorder bookkeeping never alters execution: if `fn` throws, the error is attached to the recording and re-thrown
|
|
121
|
+
* unchanged.
|
|
122
|
+
* @param metadata - Identifies the circuit and its initial witness.
|
|
123
|
+
* @param fn - Runs the circuit execution; its oracle calls are recorded into this recording.
|
|
111
124
|
*/
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
this.recording.setParent(parentRef);
|
|
122
|
-
}
|
|
125
|
+
record<T>(metadata: RecordingMetadata, fn: () => Promise<T>): Promise<{ result: T; recording: CircuitRecording }> {
|
|
126
|
+
const parent = this.#recordings.getStore();
|
|
127
|
+
const recording = new CircuitRecording(
|
|
128
|
+
metadata.circuitName,
|
|
129
|
+
metadata.functionName,
|
|
130
|
+
sha512(metadata.bytecode).toString('hex'),
|
|
131
|
+
Object.fromEntries(metadata.input),
|
|
132
|
+
);
|
|
133
|
+
recording.setParent(parent);
|
|
123
134
|
|
|
124
|
-
return
|
|
135
|
+
return this.#recordings.run(recording, async () => {
|
|
136
|
+
await this.onStart(recording);
|
|
137
|
+
try {
|
|
138
|
+
const result = await fn();
|
|
139
|
+
await this.onFinish(recording);
|
|
140
|
+
return { result, recording };
|
|
141
|
+
} catch (error) {
|
|
142
|
+
recording.error = JSON.stringify(error);
|
|
143
|
+
await this.onError(recording, error);
|
|
144
|
+
throw error;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
125
147
|
}
|
|
126
148
|
|
|
127
149
|
/**
|
|
@@ -147,7 +169,9 @@ export class CircuitRecorder {
|
|
|
147
169
|
}
|
|
148
170
|
|
|
149
171
|
/**
|
|
150
|
-
* Wraps a user circuit callback to record all oracle calls.
|
|
172
|
+
* Wraps a user circuit callback to record all oracle calls. A nested circuit entered via an oracle (e.g.
|
|
173
|
+
* `aztec_prv_callPrivateFunction`) re-enters {@link record}, so its own oracle calls land on the child recording and
|
|
174
|
+
* this circuit's calls (including the entering oracle call itself) land on this recording once the child completes.
|
|
151
175
|
* @param callback - The original circuit callback.
|
|
152
176
|
* @returns A wrapped callback that records all oracle interactions which is to be provided to the ACVM.
|
|
153
177
|
*/
|
|
@@ -161,38 +185,16 @@ export class CircuitRecorder {
|
|
|
161
185
|
throw new Error(`Oracle method ${name} not found when setting up recording callback`);
|
|
162
186
|
}
|
|
163
187
|
|
|
164
|
-
const isExternalCall = (name as keyof ACIRCallback) === 'aztec_prv_callPrivateFunction';
|
|
165
|
-
|
|
166
188
|
recordingCallback[name as keyof ACIRCallback] = (...args: ForeignCallInput[]): ReturnType<typeof fn> => {
|
|
167
189
|
const timer = new Timer();
|
|
168
|
-
// If we're entering another circuit via `aztec_prv_callPrivateFunction`, we increase the stack depth and set the
|
|
169
|
-
// newCircuit variable to ensure we are creating a new recording object.
|
|
170
|
-
if (isExternalCall) {
|
|
171
|
-
this.stackDepth++;
|
|
172
|
-
this.newCircuit = true;
|
|
173
|
-
}
|
|
174
190
|
const result = fn.call(callback, ...args);
|
|
175
191
|
if (result instanceof Promise) {
|
|
176
192
|
return result.then(async r => {
|
|
177
|
-
|
|
178
|
-
// so that the parent circuit continues with its existing recording
|
|
179
|
-
// Note: recording restoration is handled by finish()
|
|
180
|
-
if (isExternalCall) {
|
|
181
|
-
this.stackDepth--;
|
|
182
|
-
this.newCircuit = false;
|
|
183
|
-
}
|
|
184
|
-
await this.recordCall(name, args, r, timer.ms(), this.stackDepth);
|
|
193
|
+
await this.recordCall(name, args, r, timer.ms());
|
|
185
194
|
return r;
|
|
186
195
|
}) as ReturnType<typeof fn>;
|
|
187
196
|
}
|
|
188
|
-
|
|
189
|
-
// so that the parent circuit continues with its existing recording
|
|
190
|
-
// Note: recording restoration is handled by finish()
|
|
191
|
-
if (isExternalCall) {
|
|
192
|
-
this.stackDepth--;
|
|
193
|
-
this.newCircuit = false;
|
|
194
|
-
}
|
|
195
|
-
void this.recordCall(name, args, result, timer.ms(), this.stackDepth);
|
|
197
|
+
void this.recordCall(name, args, result, timer.ms());
|
|
196
198
|
return result;
|
|
197
199
|
};
|
|
198
200
|
}
|
|
@@ -209,55 +211,59 @@ export class CircuitRecorder {
|
|
|
209
211
|
return async (name: string, inputs: ForeignCallInput[]): Promise<ForeignCallOutput[]> => {
|
|
210
212
|
const timer = new Timer();
|
|
211
213
|
const result = await callback(name, inputs);
|
|
212
|
-
await this.recordCall(name, inputs, result, timer.ms()
|
|
214
|
+
await this.recordCall(name, inputs, result, timer.ms());
|
|
213
215
|
return result;
|
|
214
216
|
};
|
|
215
217
|
}
|
|
216
218
|
|
|
217
219
|
/**
|
|
218
|
-
* Records a single oracle/foreign call with its inputs and outputs
|
|
220
|
+
* Records a single oracle/foreign call with its inputs and outputs against the recording active in the current
|
|
221
|
+
* async context.
|
|
219
222
|
* @param name - Name of the call
|
|
220
223
|
* @param inputs - Input arguments
|
|
221
224
|
* @param outputs - Output results
|
|
222
225
|
*/
|
|
223
|
-
recordCall(name: string, inputs: unknown[], outputs: unknown, time: number
|
|
226
|
+
recordCall(name: string, inputs: unknown[], outputs: unknown, time: number): Promise<OracleCall> {
|
|
227
|
+
const recording = this.#recordings.getStore();
|
|
224
228
|
const entry = {
|
|
225
229
|
name,
|
|
226
230
|
inputs,
|
|
227
231
|
outputs,
|
|
228
232
|
time,
|
|
229
|
-
stackDepth,
|
|
233
|
+
stackDepth: depthOf(recording),
|
|
230
234
|
};
|
|
231
|
-
|
|
235
|
+
// Outside any active recording context (e.g. a stray call after the scope closed, or a direct unit-test call)
|
|
236
|
+
// there is nowhere to record; return the entry without throwing into the execution path.
|
|
237
|
+
recording?.oracleCalls.push(entry);
|
|
232
238
|
return Promise.resolve(entry);
|
|
233
239
|
}
|
|
234
240
|
|
|
235
|
-
/**
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
finish(): Promise<CircuitRecording> {
|
|
239
|
-
const result = this.recording;
|
|
240
|
-
// If this is the top-level circuit recording, we reset the state for the next simulator call
|
|
241
|
-
if (!result!.parent) {
|
|
242
|
-
this.newCircuit = true;
|
|
243
|
-
this.recording = undefined;
|
|
244
|
-
} else {
|
|
245
|
-
// For nested circuits (utility calls, nested contract calls), restore to parent recording
|
|
246
|
-
// Note: we don't set newCircuit=false here because:
|
|
247
|
-
// - For privateCallPrivateFunction, the callback wrapper will set it to false
|
|
248
|
-
// - For utility calls, we want newCircuit to remain true so the next circuit creates its own recording
|
|
249
|
-
this.recording = result!.parent;
|
|
250
|
-
}
|
|
251
|
-
return Promise.resolve(result!);
|
|
241
|
+
/** The recording active in the current async context, if any. */
|
|
242
|
+
protected currentRecording(): CircuitRecording | undefined {
|
|
243
|
+
return this.#recordings.getStore();
|
|
252
244
|
}
|
|
253
245
|
|
|
254
|
-
/**
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
return
|
|
246
|
+
/** Hook invoked when a recording opens, within the recording's context. Overridden to persist recordings. */
|
|
247
|
+
protected onStart(_recording: CircuitRecording): Promise<void> {
|
|
248
|
+
return Promise.resolve();
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/** Hook invoked when a recording completes successfully, within the recording's context. */
|
|
252
|
+
protected onFinish(_recording: CircuitRecording): Promise<void> {
|
|
253
|
+
return Promise.resolve();
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/** Hook invoked when a recording's execution throws, within the recording's context. */
|
|
257
|
+
protected onError(_recording: CircuitRecording, _error: unknown): Promise<void> {
|
|
258
|
+
return Promise.resolve();
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/** Depth of a recording in the call tree: 0 for a top-level circuit, incremented per nested circuit. */
|
|
263
|
+
function depthOf(recording: CircuitRecording | undefined): number {
|
|
264
|
+
let depth = 0;
|
|
265
|
+
for (let ancestor = recording?.parent; ancestor; ancestor = ancestor.parent) {
|
|
266
|
+
depth++;
|
|
262
267
|
}
|
|
268
|
+
return depth;
|
|
263
269
|
}
|