@aztec/simulator 0.0.0-test.1 → 0.0.1-commit.017a351
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/README.md +12 -4
- package/dest/client.d.ts +6 -4
- package/dest/client.d.ts.map +1 -1
- package/dest/client.js +4 -2
- package/dest/common/errors.d.ts +6 -9
- package/dest/common/errors.d.ts.map +1 -1
- package/dest/common/errors.js +51 -32
- package/dest/common/index.d.ts +1 -2
- package/dest/common/index.d.ts.map +1 -1
- package/dest/common/index.js +0 -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 +15 -7
- package/dest/private/acvm/acvm.d.ts.map +1 -1
- package/dest/private/acvm/acvm.js +14 -19
- package/dest/private/acvm/acvm_types.d.ts +2 -2
- package/dest/private/acvm/acvm_types.d.ts.map +1 -1
- package/dest/private/acvm/deserialize.d.ts +19 -20
- package/dest/private/acvm/deserialize.d.ts.map +1 -1
- package/dest/private/acvm/deserialize.js +32 -24
- package/dest/private/acvm/index.d.ts +1 -2
- package/dest/private/acvm/index.d.ts.map +1 -1
- package/dest/private/acvm/index.js +0 -1
- package/dest/private/acvm/serialize.d.ts +21 -4
- package/dest/private/acvm/serialize.d.ts.map +1 -1
- package/dest/private/acvm/serialize.js +54 -1
- package/dest/private/acvm_native.d.ts +41 -0
- package/dest/private/acvm_native.d.ts.map +1 -0
- package/dest/private/{providers/acvm_native.js → acvm_native.js} +34 -26
- package/dest/private/acvm_wasm.d.ts +16 -0
- package/dest/private/acvm_wasm.d.ts.map +1 -0
- package/dest/private/acvm_wasm.js +67 -0
- package/dest/private/acvm_wasm_with_blobs.d.ts +20 -0
- package/dest/private/acvm_wasm_with_blobs.d.ts.map +1 -0
- package/dest/private/acvm_wasm_with_blobs.js +35 -0
- package/dest/private/circuit_recording/circuit_recorder.d.ts +109 -0
- package/dest/private/circuit_recording/circuit_recorder.d.ts.map +1 -0
- package/dest/private/circuit_recording/circuit_recorder.js +212 -0
- package/dest/private/circuit_recording/file_circuit_recorder.d.ts +32 -0
- package/dest/private/circuit_recording/file_circuit_recorder.d.ts.map +1 -0
- package/dest/private/circuit_recording/file_circuit_recorder.js +135 -0
- package/dest/private/circuit_recording/memory_circuit_recorder.d.ts +10 -0
- package/dest/private/circuit_recording/memory_circuit_recorder.d.ts.map +1 -0
- package/dest/private/circuit_recording/memory_circuit_recorder.js +9 -0
- package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts +21 -0
- package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts.map +1 -0
- package/dest/private/circuit_recording/simulator_recorder_wrapper.js +44 -0
- package/dest/private/circuit_simulator.d.ts +35 -0
- package/dest/private/circuit_simulator.d.ts.map +1 -0
- package/dest/private/circuit_simulator.js +43 -0
- package/dest/private/factory.d.ts +12 -0
- package/dest/private/factory.d.ts.map +1 -0
- package/dest/private/{providers/factory.js → factory.js} +8 -5
- package/dest/public/avm/avm_context.d.ts +8 -8
- package/dest/public/avm/avm_context.d.ts.map +1 -1
- package/dest/public/avm/avm_contract_call_result.d.ts +8 -6
- package/dest/public/avm/avm_contract_call_result.d.ts.map +1 -1
- package/dest/public/avm/avm_contract_call_result.js +12 -8
- package/dest/public/avm/avm_execution_environment.d.ts +9 -6
- package/dest/public/avm/avm_execution_environment.d.ts.map +1 -1
- package/dest/public/avm/avm_execution_environment.js +5 -3
- package/dest/public/avm/avm_gas.d.ts +5 -21
- package/dest/public/avm/avm_gas.d.ts.map +1 -1
- package/dest/public/avm/avm_gas.js +29 -37
- package/dest/public/avm/avm_machine_state.d.ts +9 -6
- package/dest/public/avm/avm_machine_state.d.ts.map +1 -1
- package/dest/public/avm/avm_machine_state.js +5 -2
- package/dest/public/avm/avm_memory_types.d.ts +100 -89
- package/dest/public/avm/avm_memory_types.d.ts.map +1 -1
- package/dest/public/avm/avm_memory_types.js +21 -7
- package/dest/public/avm/avm_simulator.d.ts +8 -7
- package/dest/public/avm/avm_simulator.d.ts.map +1 -1
- package/dest/public/avm/avm_simulator.js +33 -43
- package/dest/public/avm/avm_simulator_interface.d.ts +9 -0
- package/dest/public/avm/avm_simulator_interface.d.ts.map +1 -0
- package/dest/public/avm/avm_simulator_interface.js +3 -0
- package/dest/public/avm/calldata.d.ts +51 -0
- package/dest/public/avm/calldata.d.ts.map +1 -0
- package/dest/public/avm/calldata.js +64 -0
- package/dest/public/avm/errors.d.ts +11 -29
- package/dest/public/avm/errors.d.ts.map +1 -1
- package/dest/public/avm/errors.js +19 -57
- package/dest/public/avm/fixtures/account_proof_fetcher.d.ts +2 -0
- package/dest/public/avm/fixtures/account_proof_fetcher.d.ts.map +1 -0
- package/dest/public/avm/fixtures/account_proof_fetcher.js +152 -0
- package/dest/public/avm/fixtures/avm_simulation_tester.d.ts +6 -5
- package/dest/public/avm/fixtures/avm_simulation_tester.d.ts.map +1 -1
- package/dest/public/avm/fixtures/avm_simulation_tester.js +26 -18
- package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts +9 -6
- package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts.map +1 -1
- package/dest/public/avm/fixtures/base_avm_simulation_tester.js +53 -15
- package/dest/public/avm/fixtures/initializers.d.ts +42 -0
- package/dest/public/avm/fixtures/initializers.d.ts.map +1 -0
- package/dest/public/avm/fixtures/initializers.js +45 -0
- package/dest/public/avm/fixtures/utils.d.ts +39 -0
- package/dest/public/avm/fixtures/utils.d.ts.map +1 -0
- package/dest/public/avm/fixtures/utils.js +99 -0
- package/dest/public/avm/index.d.ts +1 -3
- package/dest/public/avm/index.d.ts.map +1 -1
- package/dest/public/avm/index.js +0 -2
- package/dest/public/avm/opcodes/accrued_substate.d.ts +18 -19
- package/dest/public/avm/opcodes/accrued_substate.d.ts.map +1 -1
- package/dest/public/avm/opcodes/accrued_substate.js +61 -59
- package/dest/public/avm/opcodes/addressing_mode.d.ts +12 -8
- package/dest/public/avm/opcodes/addressing_mode.d.ts.map +1 -1
- package/dest/public/avm/opcodes/addressing_mode.js +46 -26
- package/dest/public/avm/opcodes/arithmetic.d.ts +14 -2
- package/dest/public/avm/opcodes/arithmetic.d.ts.map +1 -1
- package/dest/public/avm/opcodes/arithmetic.js +27 -3
- package/dest/public/avm/opcodes/bitwise.d.ts +8 -16
- package/dest/public/avm/opcodes/bitwise.d.ts.map +1 -1
- package/dest/public/avm/opcodes/bitwise.js +22 -29
- package/dest/public/avm/opcodes/comparators.d.ts +1 -1
- package/dest/public/avm/opcodes/comparators.d.ts.map +1 -1
- package/dest/public/avm/opcodes/comparators.js +3 -3
- package/dest/public/avm/opcodes/contract.d.ts +5 -5
- package/dest/public/avm/opcodes/contract.d.ts.map +1 -1
- package/dest/public/avm/opcodes/contract.js +16 -13
- package/dest/public/avm/opcodes/control_flow.d.ts +3 -3
- package/dest/public/avm/opcodes/control_flow.d.ts.map +1 -1
- package/dest/public/avm/opcodes/control_flow.js +13 -11
- package/dest/public/avm/opcodes/conversion.d.ts +4 -3
- package/dest/public/avm/opcodes/conversion.d.ts.map +1 -1
- package/dest/public/avm/opcodes/conversion.js +270 -6
- package/dest/public/avm/opcodes/ec_add.d.ts +3 -5
- package/dest/public/avm/opcodes/ec_add.d.ts.map +1 -1
- package/dest/public/avm/opcodes/ec_add.js +28 -33
- package/dest/public/avm/opcodes/environment_getters.d.ts +5 -5
- package/dest/public/avm/opcodes/environment_getters.d.ts.map +1 -1
- package/dest/public/avm/opcodes/environment_getters.js +20 -22
- package/dest/public/avm/opcodes/external_calls.d.ts +14 -13
- package/dest/public/avm/opcodes/external_calls.d.ts.map +1 -1
- package/dest/public/avm/opcodes/external_calls.js +52 -46
- package/dest/public/avm/opcodes/hashing.d.ts +7 -7
- package/dest/public/avm/opcodes/hashing.d.ts.map +1 -1
- package/dest/public/avm/opcodes/hashing.js +24 -19
- package/dest/public/avm/opcodes/index.d.ts +1 -1
- package/dest/public/avm/opcodes/instruction.d.ts +15 -11
- package/dest/public/avm/opcodes/instruction.d.ts.map +1 -1
- package/dest/public/avm/opcodes/instruction.js +23 -19
- package/dest/public/avm/opcodes/instruction_impl.d.ts +4 -4
- package/dest/public/avm/opcodes/instruction_impl.d.ts.map +1 -1
- package/dest/public/avm/opcodes/instruction_impl.js +4 -4
- package/dest/public/avm/opcodes/memory.d.ts +15 -15
- package/dest/public/avm/opcodes/memory.d.ts.map +1 -1
- package/dest/public/avm/opcodes/memory.js +52 -48
- package/dest/public/avm/opcodes/misc.d.ts +4 -3
- package/dest/public/avm/opcodes/misc.d.ts.map +1 -1
- package/dest/public/avm/opcodes/misc.js +42 -17
- package/dest/public/avm/opcodes/storage.d.ts +14 -13
- package/dest/public/avm/opcodes/storage.d.ts.map +1 -1
- package/dest/public/avm/opcodes/storage.js +39 -27
- package/dest/public/avm/revert_reason.d.ts +18 -0
- package/dest/public/avm/revert_reason.d.ts.map +1 -0
- package/dest/public/avm/revert_reason.js +39 -0
- package/dest/public/avm/serialization/buffer_cursor.d.ts +1 -3
- package/dest/public/avm/serialization/buffer_cursor.d.ts.map +1 -1
- package/dest/public/avm/serialization/bytecode_serialization.d.ts +3 -7
- package/dest/public/avm/serialization/bytecode_serialization.d.ts.map +1 -1
- package/dest/public/avm/serialization/bytecode_serialization.js +81 -77
- package/dest/public/avm/serialization/instruction_serialization.d.ts +15 -6
- package/dest/public/avm/serialization/instruction_serialization.d.ts.map +1 -1
- package/dest/public/avm/serialization/instruction_serialization.js +71 -36
- package/dest/public/avm/test_utils.d.ts +12 -15
- package/dest/public/avm/test_utils.d.ts.map +1 -1
- package/dest/public/avm/test_utils.js +17 -25
- 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 +68 -0
- package/dest/public/db_interfaces.d.ts.map +1 -0
- package/dest/public/db_interfaces.js +3 -0
- package/dest/public/debug_fn_name.d.ts +18 -0
- package/dest/public/debug_fn_name.d.ts.map +1 -0
- package/dest/public/debug_fn_name.js +37 -0
- package/dest/public/executor_metrics.d.ts +12 -4
- package/dest/public/executor_metrics.d.ts.map +1 -1
- package/dest/public/executor_metrics.js +33 -23
- package/dest/public/executor_metrics_interface.d.ts +10 -0
- package/dest/public/executor_metrics_interface.d.ts.map +1 -0
- package/dest/public/executor_metrics_interface.js +1 -0
- package/dest/public/fixtures/amm_test.d.ts +10 -0
- package/dest/public/fixtures/amm_test.d.ts.map +1 -0
- package/dest/public/fixtures/amm_test.js +213 -0
- package/dest/public/fixtures/bulk_test.d.ts +6 -0
- package/dest/public/fixtures/bulk_test.d.ts.map +1 -0
- package/dest/public/fixtures/bulk_test.js +289 -0
- 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 +14 -0
- package/dest/public/fixtures/custom_bytecode_tests.d.ts.map +1 -0
- package/dest/public/fixtures/custom_bytecode_tests.js +234 -0
- package/dest/public/fixtures/index.d.ts +10 -1
- package/dest/public/fixtures/index.d.ts.map +1 -1
- package/dest/public/fixtures/index.js +9 -0
- package/dest/public/fixtures/minimal_public_tx.d.ts +4 -0
- package/dest/public/fixtures/minimal_public_tx.d.ts.map +1 -0
- package/dest/public/fixtures/minimal_public_tx.js +19 -0
- package/dest/public/fixtures/opcode_spammer.d.ts +122 -0
- package/dest/public/fixtures/opcode_spammer.d.ts.map +1 -0
- package/dest/public/fixtures/opcode_spammer.js +1645 -0
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts +56 -15
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +1 -1
- package/dest/public/fixtures/public_tx_simulation_tester.js +164 -71
- package/dest/public/fixtures/simple_contract_data_source.d.ts +36 -0
- package/dest/public/fixtures/simple_contract_data_source.d.ts.map +1 -0
- package/dest/public/{avm/fixtures → fixtures}/simple_contract_data_source.js +31 -10
- package/dest/public/fixtures/token_test.d.ts +12 -0
- package/dest/public/fixtures/token_test.d.ts.map +1 -0
- package/dest/public/fixtures/token_test.js +96 -0
- package/dest/public/fixtures/utils.d.ts +18 -5
- package/dest/public/fixtures/utils.d.ts.map +1 -1
- package/dest/public/fixtures/utils.js +112 -70
- package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts +60 -0
- package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts.map +1 -0
- package/dest/public/fuzzing/avm_fuzzer_simulator.js +171 -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 +118 -0
- package/dest/public/hinting_db_sources.d.ts +81 -0
- package/dest/public/hinting_db_sources.d.ts.map +1 -0
- package/dest/public/hinting_db_sources.js +359 -0
- package/dest/public/index.d.ts +6 -9
- package/dest/public/index.d.ts.map +1 -1
- package/dest/public/index.js +4 -7
- package/dest/public/public_db_sources.d.ts +58 -104
- package/dest/public/public_db_sources.d.ts.map +1 -1
- package/dest/public/public_db_sources.js +227 -194
- 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 +52 -0
- package/dest/public/public_processor/guarded_merkle_tree.d.ts.map +1 -0
- package/dest/public/public_processor/guarded_merkle_tree.js +116 -0
- package/dest/public/public_processor/public_processor.d.ts +32 -39
- package/dest/public/public_processor/public_processor.d.ts.map +1 -1
- package/dest/public/public_processor/public_processor.js +642 -167
- package/dest/public/public_processor/public_processor_metrics.d.ts +7 -4
- package/dest/public/public_processor/public_processor_metrics.d.ts.map +1 -1
- package/dest/public/public_processor/public_processor_metrics.js +37 -46
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.d.ts +19 -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 +99 -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 +126 -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 +167 -0
- package/dest/public/public_tx_simulator/dumping_cpp_public_tx_simulator.d.ts +23 -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 +14 -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 +8 -0
- package/dest/public/public_tx_simulator/index.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/index.js +5 -0
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.d.ts +31 -0
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.js +51 -0
- package/dest/public/public_tx_simulator/public_tx_context.d.ts +31 -33
- package/dest/public/public_tx_simulator/public_tx_context.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/public_tx_context.js +83 -105
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts +42 -58
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/public_tx_simulator.js +225 -207
- 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 +21 -0
- package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.d.ts.map +1 -0
- package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.js +415 -0
- 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 +24 -69
- package/dest/public/side_effect_trace.d.ts.map +1 -1
- package/dest/public/side_effect_trace.js +74 -124
- package/dest/public/side_effect_trace_interface.d.ts +13 -25
- package/dest/public/side_effect_trace_interface.d.ts.map +1 -1
- package/dest/public/state_manager/index.d.ts +2 -0
- package/dest/public/state_manager/index.d.ts.map +1 -0
- package/dest/public/state_manager/index.js +1 -0
- package/dest/public/{avm/journal → state_manager}/nullifiers.d.ts +4 -7
- package/dest/public/state_manager/nullifiers.d.ts.map +1 -0
- package/dest/public/{avm/journal → state_manager}/nullifiers.js +3 -8
- package/dest/public/{avm/journal → state_manager}/public_storage.d.ts +4 -4
- package/dest/public/state_manager/public_storage.d.ts.map +1 -0
- package/dest/public/{avm/journal → state_manager}/public_storage.js +1 -1
- package/dest/public/state_manager/state_manager.d.ts +170 -0
- package/dest/public/state_manager/state_manager.d.ts.map +1 -0
- package/dest/public/state_manager/state_manager.js +402 -0
- package/dest/public/test_executor_metrics.d.ts +61 -0
- package/dest/public/test_executor_metrics.d.ts.map +1 -0
- package/dest/public/test_executor_metrics.js +329 -0
- 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 +3 -5
- package/dest/public/utils.d.ts.map +1 -1
- package/dest/public/utils.js +4 -21
- package/dest/server.d.ts +7 -4
- package/dest/server.d.ts.map +1 -1
- package/dest/server.js +5 -2
- package/dest/testing.d.ts +2 -0
- package/dest/testing.d.ts.map +1 -0
- package/dest/testing.js +1 -0
- package/package.json +39 -33
- package/src/client.ts +5 -3
- package/src/common/errors.ts +80 -45
- package/src/common/index.ts +0 -1
- package/src/private/acvm/acvm.ts +21 -35
- package/src/private/acvm/acvm_types.ts +1 -1
- package/src/private/acvm/deserialize.ts +36 -30
- package/src/private/acvm/index.ts +0 -1
- package/src/private/acvm/serialize.ts +64 -1
- package/src/private/{providers/acvm_native.ts → acvm_native.ts} +57 -28
- package/src/private/acvm_wasm.ts +79 -0
- package/src/private/acvm_wasm_with_blobs.ts +54 -0
- package/src/private/circuit_recording/circuit_recorder.ts +263 -0
- package/src/private/circuit_recording/file_circuit_recorder.ts +163 -0
- package/src/private/circuit_recording/memory_circuit_recorder.ts +13 -0
- package/src/private/circuit_recording/simulator_recorder_wrapper.ts +91 -0
- package/src/private/circuit_simulator.ts +90 -0
- package/src/private/{providers/factory.ts → factory.ts} +13 -10
- package/src/public/avm/avm_context.ts +6 -6
- package/src/public/avm/avm_contract_call_result.ts +23 -9
- package/src/public/avm/avm_execution_environment.ts +17 -5
- package/src/public/avm/avm_gas.ts +27 -39
- package/src/public/avm/avm_machine_state.ts +12 -6
- package/src/public/avm/avm_memory_types.ts +24 -7
- package/src/public/avm/avm_simulator.ts +58 -63
- package/src/public/avm/avm_simulator_interface.ts +8 -0
- package/src/public/avm/calldata.ts +101 -0
- package/src/public/avm/errors.ts +20 -75
- package/src/public/avm/fixtures/account_proof.json +553 -0
- package/src/public/avm/fixtures/account_proof_fetcher.ts +166 -0
- package/src/public/avm/fixtures/avm_simulation_tester.ts +41 -24
- package/src/public/avm/fixtures/base_avm_simulation_tester.ts +66 -13
- package/src/public/avm/fixtures/initializers.ts +103 -0
- package/src/public/avm/fixtures/utils.ts +154 -0
- package/src/public/avm/index.ts +0 -2
- package/src/public/avm/opcodes/accrued_substate.ts +84 -52
- package/src/public/avm/opcodes/addressing_mode.ts +56 -32
- package/src/public/avm/opcodes/arithmetic.ts +37 -3
- package/src/public/avm/opcodes/bitwise.ts +33 -29
- package/src/public/avm/opcodes/comparators.ts +6 -3
- package/src/public/avm/opcodes/contract.ts +15 -11
- package/src/public/avm/opcodes/control_flow.ts +19 -10
- package/src/public/avm/opcodes/conversion.ts +29 -5
- package/src/public/avm/opcodes/ec_add.ts +30 -37
- package/src/public/avm/opcodes/environment_getters.ts +28 -23
- package/src/public/avm/opcodes/external_calls.ts +70 -36
- package/src/public/avm/opcodes/hashing.ts +39 -13
- package/src/public/avm/opcodes/instruction.ts +31 -21
- package/src/public/avm/opcodes/instruction_impl.ts +2 -2
- package/src/public/avm/opcodes/memory.ts +81 -42
- package/src/public/avm/opcodes/misc.ts +61 -19
- package/src/public/avm/opcodes/storage.ts +47 -23
- package/src/public/avm/revert_reason.ts +58 -0
- package/src/public/avm/serialization/buffer_cursor.ts +4 -1
- package/src/public/avm/serialization/bytecode_serialization.ts +90 -81
- package/src/public/avm/serialization/instruction_serialization.ts +76 -35
- package/src/public/avm/test_utils.ts +25 -42
- package/src/public/contracts_db_checkpoint.ts +41 -0
- package/src/public/db_interfaces.ts +76 -0
- package/src/public/debug_fn_name.ts +52 -0
- package/src/public/executor_metrics.ts +49 -23
- package/src/public/executor_metrics_interface.ts +15 -0
- package/src/public/fixtures/amm_test.ts +331 -0
- package/src/public/fixtures/bulk_test.ts +194 -0
- package/src/public/fixtures/custom_bytecode_tester.ts +83 -0
- package/src/public/fixtures/custom_bytecode_tests.ts +366 -0
- package/src/public/fixtures/index.ts +13 -0
- package/src/public/fixtures/minimal_public_tx.ts +26 -0
- package/src/public/fixtures/opcode_spammer.ts +1713 -0
- package/src/public/fixtures/public_tx_simulation_tester.ts +264 -114
- package/src/public/{avm/fixtures → fixtures}/simple_contract_data_source.ts +37 -20
- package/src/public/fixtures/token_test.ts +148 -0
- package/src/public/fixtures/utils.ts +156 -80
- package/src/public/fuzzing/avm_fuzzer_simulator.ts +288 -0
- package/src/public/fuzzing/avm_simulator_bin.ts +175 -0
- package/src/public/hinting_db_sources.ts +614 -0
- package/src/public/index.ts +11 -8
- package/src/public/public_db_sources.ts +295 -258
- package/src/public/public_errors.ts +14 -0
- package/src/public/public_processor/guarded_merkle_tree.ts +161 -0
- package/src/public/public_processor/public_processor.ts +354 -227
- package/src/public/public_processor/public_processor_metrics.ts +30 -46
- package/src/public/public_tx_simulator/contract_provider_for_cpp.ts +125 -0
- package/src/public/public_tx_simulator/cpp_public_tx_simulator.ts +201 -0
- package/src/public/public_tx_simulator/cpp_public_tx_simulator_with_hinted_dbs.ts +134 -0
- package/src/public/public_tx_simulator/cpp_vs_ts_public_tx_simulator.ts +232 -0
- package/src/public/public_tx_simulator/dumping_cpp_public_tx_simulator.ts +83 -0
- package/src/public/public_tx_simulator/factories.ts +44 -0
- package/src/public/public_tx_simulator/index.ts +7 -0
- package/src/public/public_tx_simulator/measured_public_tx_simulator.ts +105 -0
- package/src/public/public_tx_simulator/public_tx_context.ts +187 -209
- package/src/public/public_tx_simulator/public_tx_simulator.ts +320 -263
- package/src/public/public_tx_simulator/public_tx_simulator_interface.ts +33 -0
- package/src/public/public_tx_simulator/telemetry_public_tx_simulator.ts +63 -0
- package/src/public/side_effect_errors.ts +91 -1
- package/src/public/side_effect_trace.ts +99 -322
- package/src/public/side_effect_trace_interface.ts +11 -59
- package/src/public/state_manager/index.ts +1 -0
- package/src/public/{avm/journal → state_manager}/nullifiers.ts +6 -12
- package/src/public/{avm/journal → state_manager}/public_storage.ts +3 -3
- package/src/public/state_manager/state_manager.ts +569 -0
- package/src/public/test_executor_metrics.ts +421 -0
- package/src/public/utils.ts +5 -21
- package/src/server.ts +6 -3
- package/src/testing.ts +1 -0
- package/dest/common/db_interfaces.d.ts +0 -80
- package/dest/common/db_interfaces.d.ts.map +0 -1
- package/dest/common/db_interfaces.js +0 -1
- package/dest/common/debug_fn_name.d.ts +0 -5
- package/dest/common/debug_fn_name.d.ts.map +0 -1
- package/dest/common/debug_fn_name.js +0 -6
- package/dest/common/message_load_oracle_inputs.d.ts +0 -15
- package/dest/common/message_load_oracle_inputs.d.ts.map +0 -1
- package/dest/common/message_load_oracle_inputs.js +0 -15
- package/dest/private/acvm/oracle/index.d.ts +0 -14
- package/dest/private/acvm/oracle/index.d.ts.map +0 -1
- package/dest/private/acvm/oracle/index.js +0 -2
- package/dest/private/acvm/oracle/oracle.d.ts +0 -49
- package/dest/private/acvm/oracle/oracle.d.ts.map +0 -1
- package/dest/private/acvm/oracle/oracle.js +0 -263
- package/dest/private/acvm/oracle/typed_oracle.d.ts +0 -83
- package/dest/private/acvm/oracle/typed_oracle.d.ts.map +0 -1
- package/dest/private/acvm/oracle/typed_oracle.js +0 -132
- package/dest/private/execution_data_provider.d.ts +0 -261
- package/dest/private/execution_data_provider.d.ts.map +0 -1
- package/dest/private/execution_data_provider.js +0 -14
- package/dest/private/execution_note_cache.d.ts +0 -93
- package/dest/private/execution_note_cache.d.ts.map +0 -1
- package/dest/private/execution_note_cache.js +0 -180
- package/dest/private/hashed_values_cache.d.ts +0 -28
- package/dest/private/hashed_values_cache.d.ts.map +0 -1
- package/dest/private/hashed_values_cache.js +0 -46
- package/dest/private/index.d.ts +0 -13
- package/dest/private/index.d.ts.map +0 -1
- package/dest/private/index.js +0 -12
- package/dest/private/pick_notes.d.ts +0 -85
- package/dest/private/pick_notes.d.ts.map +0 -1
- package/dest/private/pick_notes.js +0 -51
- package/dest/private/private_execution.d.ts +0 -25
- package/dest/private/private_execution.d.ts.map +0 -1
- package/dest/private/private_execution.js +0 -92
- package/dest/private/private_execution_oracle.d.ts +0 -215
- package/dest/private/private_execution_oracle.d.ts.map +0 -1
- package/dest/private/private_execution_oracle.js +0 -382
- package/dest/private/providers/acvm_native.d.ts +0 -40
- package/dest/private/providers/acvm_native.d.ts.map +0 -1
- package/dest/private/providers/acvm_wasm.d.ts +0 -15
- package/dest/private/providers/acvm_wasm.d.ts.map +0 -1
- package/dest/private/providers/acvm_wasm.js +0 -62
- package/dest/private/providers/acvm_wasm_with_blobs.d.ts +0 -19
- package/dest/private/providers/acvm_wasm_with_blobs.d.ts.map +0 -1
- package/dest/private/providers/acvm_wasm_with_blobs.js +0 -32
- package/dest/private/providers/factory.d.ts +0 -12
- package/dest/private/providers/factory.d.ts.map +0 -1
- package/dest/private/providers/simulation_provider.d.ts +0 -19
- package/dest/private/providers/simulation_provider.d.ts.map +0 -1
- package/dest/private/providers/simulation_provider.js +0 -24
- package/dest/private/simulator.d.ts +0 -34
- package/dest/private/simulator.d.ts.map +0 -1
- package/dest/private/simulator.js +0 -76
- package/dest/private/unconstrained_execution.d.ts +0 -10
- package/dest/private/unconstrained_execution.d.ts.map +0 -1
- package/dest/private/unconstrained_execution.js +0 -27
- package/dest/private/unconstrained_execution_oracle.d.ts +0 -161
- package/dest/private/unconstrained_execution_oracle.d.ts.map +0 -1
- package/dest/private/unconstrained_execution_oracle.js +0 -258
- package/dest/public/avm/bytecode_utils.d.ts +0 -5
- package/dest/public/avm/bytecode_utils.d.ts.map +0 -1
- package/dest/public/avm/bytecode_utils.js +0 -17
- package/dest/public/avm/fixtures/index.d.ts +0 -84
- package/dest/public/avm/fixtures/index.d.ts.map +0 -1
- package/dest/public/avm/fixtures/index.js +0 -175
- package/dest/public/avm/fixtures/simple_contract_data_source.d.ts +0 -35
- package/dest/public/avm/fixtures/simple_contract_data_source.d.ts.map +0 -1
- package/dest/public/avm/journal/index.d.ts +0 -2
- package/dest/public/avm/journal/index.d.ts.map +0 -1
- package/dest/public/avm/journal/index.js +0 -1
- package/dest/public/avm/journal/journal.d.ts +0 -209
- package/dest/public/avm/journal/journal.d.ts.map +0 -1
- package/dest/public/avm/journal/journal.js +0 -486
- package/dest/public/avm/journal/nullifiers.d.ts.map +0 -1
- package/dest/public/avm/journal/public_storage.d.ts.map +0 -1
- 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/execution.d.ts +0 -108
- package/dest/public/execution.d.ts.map +0 -1
- package/dest/public/execution.js +0 -9
- 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/dest/test/utils.d.ts +0 -13
- package/dest/test/utils.d.ts.map +0 -1
- package/dest/test/utils.js +0 -22
- package/src/common/db_interfaces.ts +0 -94
- package/src/common/debug_fn_name.ts +0 -18
- package/src/common/message_load_oracle_inputs.ts +0 -15
- package/src/private/acvm/oracle/index.ts +0 -16
- package/src/private/acvm/oracle/oracle.ts +0 -455
- package/src/private/acvm/oracle/typed_oracle.ts +0 -259
- package/src/private/execution_data_provider.ts +0 -323
- package/src/private/execution_note_cache.ts +0 -217
- package/src/private/hashed_values_cache.ts +0 -55
- package/src/private/index.ts +0 -16
- package/src/private/pick_notes.ts +0 -141
- package/src/private/private_execution.ts +0 -151
- package/src/private/private_execution_oracle.ts +0 -614
- package/src/private/providers/acvm_wasm.ts +0 -63
- package/src/private/providers/acvm_wasm_with_blobs.ts +0 -50
- package/src/private/providers/simulation_provider.ts +0 -45
- package/src/private/simulator.ts +0 -147
- package/src/private/unconstrained_execution.ts +0 -50
- package/src/private/unconstrained_execution_oracle.ts +0 -373
- package/src/public/avm/bytecode_utils.ts +0 -17
- package/src/public/avm/fixtures/index.ts +0 -296
- package/src/public/avm/journal/index.ts +0 -1
- package/src/public/avm/journal/journal.ts +0 -742
- package/src/public/avm/opcodes/.eslintrc.cjs +0 -8
- package/src/public/bytecode_errors.ts +0 -6
- package/src/public/execution.ts +0 -140
- package/src/public/tx_contract_cache.ts +0 -69
- package/src/test/utils.ts +0 -36
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { MAX_ETH_ADDRESS_VALUE } from '@aztec/constants';
|
|
2
|
+
|
|
3
|
+
import { NullifierCollisionError } from '../../side_effect_errors.js';
|
|
1
4
|
import type { AvmContext } from '../avm_context.js';
|
|
2
5
|
import { TypeTag, Uint1 } from '../avm_memory_types.js';
|
|
3
6
|
import { InstructionExecutionError, StaticCallAlterationError } from '../errors.js';
|
|
4
|
-
import { NullifierCollisionError } from '../journal/nullifiers.js';
|
|
5
7
|
import { Opcode, OperandType } from '../serialization/instruction_serialization.js';
|
|
6
8
|
import { Addressing } from './addressing_mode.js';
|
|
7
9
|
import { Instruction } from './instruction.js';
|
|
@@ -19,7 +21,7 @@ export class NoteHashExists extends Instruction {
|
|
|
19
21
|
];
|
|
20
22
|
|
|
21
23
|
constructor(
|
|
22
|
-
private
|
|
24
|
+
private addressingMode: number,
|
|
23
25
|
private noteHashOffset: number,
|
|
24
26
|
private leafIndexOffset: number,
|
|
25
27
|
private existsOffset: number,
|
|
@@ -29,15 +31,19 @@ export class NoteHashExists extends Instruction {
|
|
|
29
31
|
|
|
30
32
|
public async execute(context: AvmContext): Promise<void> {
|
|
31
33
|
const memory = context.machineState.memory;
|
|
32
|
-
|
|
34
|
+
const addressing = Addressing.fromWire(this.addressingMode);
|
|
35
|
+
|
|
36
|
+
context.machineState.consumeGas(
|
|
37
|
+
this.baseGasCost(addressing.indirectOperandsCount(), addressing.relativeOperandsCount()),
|
|
38
|
+
);
|
|
33
39
|
const operands = [this.noteHashOffset, this.leafIndexOffset, this.existsOffset];
|
|
34
|
-
const addressing = Addressing.fromWire(this.indirect, operands.length);
|
|
35
40
|
const [noteHashOffset, leafIndexOffset, existsOffset] = addressing.resolve(operands, memory);
|
|
36
|
-
memory.
|
|
41
|
+
memory.checkTag(TypeTag.FIELD, noteHashOffset);
|
|
42
|
+
memory.checkTag(TypeTag.UINT64, leafIndexOffset);
|
|
37
43
|
|
|
38
44
|
// Note that this instruction accepts any type in memory, and converts to Field.
|
|
39
45
|
const noteHash = memory.get(noteHashOffset).toFr();
|
|
40
|
-
const leafIndex = memory.get(leafIndexOffset).
|
|
46
|
+
const leafIndex = memory.get(leafIndexOffset).toBigInt();
|
|
41
47
|
|
|
42
48
|
const exists = await context.persistableState.checkNoteHashExists(context.environment.address, noteHash, leafIndex);
|
|
43
49
|
memory.set(existsOffset, exists ? new Uint1(1) : new Uint1(0));
|
|
@@ -50,16 +56,22 @@ export class EmitNoteHash extends Instruction {
|
|
|
50
56
|
// Informs (de)serialization. See Instruction.deserialize.
|
|
51
57
|
static readonly wireFormat = [OperandType.UINT8, OperandType.UINT8, OperandType.UINT16];
|
|
52
58
|
|
|
53
|
-
constructor(
|
|
59
|
+
constructor(
|
|
60
|
+
private addressingMode: number,
|
|
61
|
+
private noteHashOffset: number,
|
|
62
|
+
) {
|
|
54
63
|
super();
|
|
55
64
|
}
|
|
56
65
|
|
|
57
66
|
public async execute(context: AvmContext): Promise<void> {
|
|
58
67
|
const memory = context.machineState.memory;
|
|
59
|
-
|
|
68
|
+
const addressing = Addressing.fromWire(this.addressingMode);
|
|
69
|
+
|
|
70
|
+
context.machineState.consumeGas(
|
|
71
|
+
this.baseGasCost(addressing.indirectOperandsCount(), addressing.relativeOperandsCount()),
|
|
72
|
+
);
|
|
60
73
|
|
|
61
74
|
const operands = [this.noteHashOffset];
|
|
62
|
-
const addressing = Addressing.fromWire(this.indirect, operands.length);
|
|
63
75
|
const [noteHashOffset] = addressing.resolve(operands, memory);
|
|
64
76
|
memory.checkTag(TypeTag.FIELD, noteHashOffset);
|
|
65
77
|
|
|
@@ -76,18 +88,11 @@ export class NullifierExists extends Instruction {
|
|
|
76
88
|
static type: string = 'NULLIFIEREXISTS';
|
|
77
89
|
static readonly opcode: Opcode = Opcode.NULLIFIEREXISTS;
|
|
78
90
|
// Informs (de)serialization. See Instruction.deserialize.
|
|
79
|
-
static readonly wireFormat = [
|
|
80
|
-
OperandType.UINT8,
|
|
81
|
-
OperandType.UINT8,
|
|
82
|
-
OperandType.UINT16,
|
|
83
|
-
OperandType.UINT16,
|
|
84
|
-
OperandType.UINT16,
|
|
85
|
-
];
|
|
91
|
+
static readonly wireFormat = [OperandType.UINT8, OperandType.UINT8, OperandType.UINT16, OperandType.UINT16];
|
|
86
92
|
|
|
87
93
|
constructor(
|
|
88
|
-
private
|
|
89
|
-
private
|
|
90
|
-
private addressOffset: number,
|
|
94
|
+
private addressingMode: number,
|
|
95
|
+
private siloedNullifierOffset: number,
|
|
91
96
|
private existsOffset: number,
|
|
92
97
|
) {
|
|
93
98
|
super();
|
|
@@ -95,16 +100,18 @@ export class NullifierExists extends Instruction {
|
|
|
95
100
|
|
|
96
101
|
public async execute(context: AvmContext): Promise<void> {
|
|
97
102
|
const memory = context.machineState.memory;
|
|
98
|
-
|
|
103
|
+
const addressing = Addressing.fromWire(this.addressingMode);
|
|
99
104
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
memory.checkTags(TypeTag.FIELD, nullifierOffset, addressOffset);
|
|
105
|
+
context.machineState.consumeGas(
|
|
106
|
+
this.baseGasCost(addressing.indirectOperandsCount(), addressing.relativeOperandsCount()),
|
|
107
|
+
);
|
|
104
108
|
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
-
|
|
109
|
+
const operands = [this.siloedNullifierOffset, this.existsOffset];
|
|
110
|
+
const [siloedNullifierOffset, existsOffset] = addressing.resolve(operands, memory);
|
|
111
|
+
memory.checkTag(TypeTag.FIELD, siloedNullifierOffset);
|
|
112
|
+
|
|
113
|
+
const siloedNullifier = memory.get(siloedNullifierOffset).toFr();
|
|
114
|
+
const exists = await context.persistableState.checkSiloedNullifierExists(siloedNullifier);
|
|
108
115
|
|
|
109
116
|
memory.set(existsOffset, exists ? new Uint1(1) : new Uint1(0));
|
|
110
117
|
}
|
|
@@ -116,7 +123,10 @@ export class EmitNullifier extends Instruction {
|
|
|
116
123
|
// Informs (de)serialization. See Instruction.deserialize.
|
|
117
124
|
static readonly wireFormat = [OperandType.UINT8, OperandType.UINT8, OperandType.UINT16];
|
|
118
125
|
|
|
119
|
-
constructor(
|
|
126
|
+
constructor(
|
|
127
|
+
private addressingMode: number,
|
|
128
|
+
private nullifierOffset: number,
|
|
129
|
+
) {
|
|
120
130
|
super();
|
|
121
131
|
}
|
|
122
132
|
|
|
@@ -126,10 +136,13 @@ export class EmitNullifier extends Instruction {
|
|
|
126
136
|
}
|
|
127
137
|
|
|
128
138
|
const memory = context.machineState.memory;
|
|
129
|
-
|
|
139
|
+
const addressing = Addressing.fromWire(this.addressingMode);
|
|
140
|
+
|
|
141
|
+
context.machineState.consumeGas(
|
|
142
|
+
this.baseGasCost(addressing.indirectOperandsCount(), addressing.relativeOperandsCount()),
|
|
143
|
+
);
|
|
130
144
|
|
|
131
145
|
const operands = [this.nullifierOffset];
|
|
132
|
-
const addressing = Addressing.fromWire(this.indirect, operands.length);
|
|
133
146
|
const [nullifierOffset] = addressing.resolve(operands, memory);
|
|
134
147
|
memory.checkTag(TypeTag.FIELD, nullifierOffset);
|
|
135
148
|
|
|
@@ -162,7 +175,7 @@ export class L1ToL2MessageExists extends Instruction {
|
|
|
162
175
|
];
|
|
163
176
|
|
|
164
177
|
constructor(
|
|
165
|
-
private
|
|
178
|
+
private addressingMode: number,
|
|
166
179
|
private msgHashOffset: number,
|
|
167
180
|
private msgLeafIndexOffset: number,
|
|
168
181
|
private existsOffset: number,
|
|
@@ -172,32 +185,36 @@ export class L1ToL2MessageExists extends Instruction {
|
|
|
172
185
|
|
|
173
186
|
public async execute(context: AvmContext): Promise<void> {
|
|
174
187
|
const memory = context.machineState.memory;
|
|
175
|
-
|
|
188
|
+
const addressing = Addressing.fromWire(this.addressingMode);
|
|
189
|
+
|
|
190
|
+
context.machineState.consumeGas(
|
|
191
|
+
this.baseGasCost(addressing.indirectOperandsCount(), addressing.relativeOperandsCount()),
|
|
192
|
+
);
|
|
176
193
|
|
|
177
194
|
const operands = [this.msgHashOffset, this.msgLeafIndexOffset, this.existsOffset];
|
|
178
|
-
const addressing = Addressing.fromWire(this.indirect, operands.length);
|
|
179
195
|
const [msgHashOffset, msgLeafIndexOffset, existsOffset] = addressing.resolve(operands, memory);
|
|
180
|
-
|
|
196
|
+
|
|
197
|
+
memory.checkTag(TypeTag.FIELD, msgHashOffset);
|
|
198
|
+
memory.checkTag(TypeTag.UINT64, msgLeafIndexOffset);
|
|
181
199
|
|
|
182
200
|
const msgHash = memory.get(msgHashOffset).toFr();
|
|
183
201
|
const msgLeafIndex = memory.get(msgLeafIndexOffset).toFr();
|
|
184
|
-
const exists = await context.persistableState.checkL1ToL2MessageExists(
|
|
185
|
-
context.environment.address,
|
|
186
|
-
msgHash,
|
|
187
|
-
msgLeafIndex,
|
|
188
|
-
);
|
|
202
|
+
const exists = await context.persistableState.checkL1ToL2MessageExists(msgHash, msgLeafIndex);
|
|
189
203
|
memory.set(existsOffset, exists ? new Uint1(1) : new Uint1(0));
|
|
190
204
|
}
|
|
191
205
|
}
|
|
192
206
|
|
|
193
|
-
export class
|
|
194
|
-
|
|
195
|
-
static
|
|
196
|
-
static readonly opcode: Opcode = Opcode.EMITUNENCRYPTEDLOG;
|
|
207
|
+
export class EmitPublicLog extends Instruction {
|
|
208
|
+
static type: string = 'EMITPUBLICLOG';
|
|
209
|
+
static readonly opcode: Opcode = Opcode.EMITPUBLICLOG;
|
|
197
210
|
// Informs (de)serialization. See Instruction.deserialize.
|
|
198
211
|
static readonly wireFormat = [OperandType.UINT8, OperandType.UINT8, OperandType.UINT16, OperandType.UINT16];
|
|
199
212
|
|
|
200
|
-
constructor(
|
|
213
|
+
constructor(
|
|
214
|
+
private addressingMode: number,
|
|
215
|
+
private logSizeOffset: number,
|
|
216
|
+
private logOffset: number,
|
|
217
|
+
) {
|
|
201
218
|
super();
|
|
202
219
|
}
|
|
203
220
|
|
|
@@ -207,17 +224,21 @@ export class EmitUnencryptedLog extends Instruction {
|
|
|
207
224
|
}
|
|
208
225
|
|
|
209
226
|
const memory = context.machineState.memory;
|
|
227
|
+
const addressing = Addressing.fromWire(this.addressingMode);
|
|
210
228
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
229
|
+
context.machineState.consumeGas(
|
|
230
|
+
this.baseGasCost(addressing.indirectOperandsCount(), addressing.relativeOperandsCount()),
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
const operands = [this.logSizeOffset, this.logOffset];
|
|
234
|
+
const [logSizeOffset, logOffset] = addressing.resolve(operands, memory);
|
|
214
235
|
memory.checkTag(TypeTag.UINT32, logSizeOffset);
|
|
215
236
|
const logSize = memory.get(logSizeOffset).toNumber();
|
|
216
|
-
memory.checkTagsRange(TypeTag.FIELD, logOffset, logSize);
|
|
217
237
|
|
|
218
238
|
const contractAddress = context.environment.address;
|
|
219
239
|
|
|
220
|
-
context.machineState.consumeGas(this.
|
|
240
|
+
context.machineState.consumeGas(this.dynamicGasCost(logSize));
|
|
241
|
+
memory.checkTagsRange(TypeTag.FIELD, logOffset, logSize);
|
|
221
242
|
const log = memory.getSlice(logOffset, logSize).map(f => f.toFr());
|
|
222
243
|
context.persistableState.writePublicLog(contractAddress, log);
|
|
223
244
|
}
|
|
@@ -229,7 +250,11 @@ export class SendL2ToL1Message extends Instruction {
|
|
|
229
250
|
// Informs (de)serialization. See Instruction.deserialize.
|
|
230
251
|
static readonly wireFormat = [OperandType.UINT8, OperandType.UINT8, OperandType.UINT16, OperandType.UINT16];
|
|
231
252
|
|
|
232
|
-
constructor(
|
|
253
|
+
constructor(
|
|
254
|
+
private addressingMode: number,
|
|
255
|
+
private recipientOffset: number,
|
|
256
|
+
private contentOffset: number,
|
|
257
|
+
) {
|
|
233
258
|
super();
|
|
234
259
|
}
|
|
235
260
|
|
|
@@ -239,14 +264,21 @@ export class SendL2ToL1Message extends Instruction {
|
|
|
239
264
|
}
|
|
240
265
|
|
|
241
266
|
const memory = context.machineState.memory;
|
|
242
|
-
|
|
267
|
+
const addressing = Addressing.fromWire(this.addressingMode);
|
|
268
|
+
|
|
269
|
+
context.machineState.consumeGas(
|
|
270
|
+
this.baseGasCost(addressing.indirectOperandsCount(), addressing.relativeOperandsCount()),
|
|
271
|
+
);
|
|
243
272
|
|
|
244
273
|
const operands = [this.recipientOffset, this.contentOffset];
|
|
245
|
-
const addressing = Addressing.fromWire(this.indirect, operands.length);
|
|
246
274
|
const [recipientOffset, contentOffset] = addressing.resolve(operands, memory);
|
|
247
275
|
memory.checkTags(TypeTag.FIELD, recipientOffset, contentOffset);
|
|
248
276
|
|
|
249
277
|
const recipient = memory.get(recipientOffset).toFr();
|
|
278
|
+
|
|
279
|
+
if (recipient.toBigInt() > MAX_ETH_ADDRESS_VALUE) {
|
|
280
|
+
throw new InstructionExecutionError(`SENDL2TOL1MSG: Recipient address is too large`);
|
|
281
|
+
}
|
|
250
282
|
const content = memory.get(contentOffset).toFr();
|
|
251
283
|
context.persistableState.writeL2ToL1Message(context.environment.address, recipient, content);
|
|
252
284
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { AVM_MAX_OPERANDS } from '@aztec/constants';
|
|
2
|
+
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
3
|
+
import type { Tuple } from '@aztec/foundation/serialize';
|
|
4
|
+
|
|
1
5
|
import { strict as assert } from 'assert';
|
|
2
6
|
|
|
3
|
-
import { TaggedMemory, type TaggedMemoryInterface } from '../avm_memory_types.js';
|
|
4
|
-
import { RelativeAddressOutOfRangeError } from '../errors.js';
|
|
7
|
+
import { MemoryValue, TaggedMemory, type TaggedMemoryInterface, TypeTag } from '../avm_memory_types.js';
|
|
8
|
+
import { RelativeAddressOutOfRangeError, TagCheckError } from '../errors.js';
|
|
5
9
|
|
|
6
10
|
export enum AddressingMode {
|
|
7
11
|
DIRECT = 0,
|
|
@@ -13,21 +17,26 @@ export enum AddressingMode {
|
|
|
13
17
|
/** A class to represent the addressing mode of an instruction. */
|
|
14
18
|
export class Addressing {
|
|
15
19
|
public constructor(
|
|
16
|
-
/** The addressing mode for each operand.
|
|
17
|
-
private readonly modePerOperand: AddressingMode
|
|
20
|
+
/** The addressing mode for each possible operand. */
|
|
21
|
+
private readonly modePerOperand: Tuple<AddressingMode, typeof AVM_MAX_OPERANDS>,
|
|
18
22
|
) {}
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
public static fromModes(modes: AddressingMode[]): Addressing {
|
|
25
|
+
assert(modes.length <= AVM_MAX_OPERANDS, 'Too many operands for addressing mode');
|
|
26
|
+
return new Addressing(padArrayEnd(modes, AddressingMode.DIRECT, AVM_MAX_OPERANDS));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public static fromWire(wireModes: number): Addressing {
|
|
30
|
+
// The modes are stored in the wire format as one or two bytes, with each two bits representing the modes for an operand.
|
|
31
|
+
// Even bits are indirect, odd bits are relative.
|
|
32
|
+
const modes = new Array<AddressingMode>(AVM_MAX_OPERANDS);
|
|
33
|
+
for (let i = 0; i < AVM_MAX_OPERANDS; i++) {
|
|
26
34
|
modes[i] =
|
|
27
|
-
(((wireModes >> i) & 1) * AddressingMode.INDIRECT) |
|
|
28
|
-
(((wireModes >> (i +
|
|
35
|
+
(((wireModes >> (i * 2)) & 1) * AddressingMode.INDIRECT) |
|
|
36
|
+
(((wireModes >> (i * 2 + 1)) & 1) * AddressingMode.RELATIVE);
|
|
29
37
|
}
|
|
30
|
-
|
|
38
|
+
// Casting the array to tuple since it should be more performant than using makeTuple
|
|
39
|
+
return new Addressing(modes as Tuple<AddressingMode, typeof AVM_MAX_OPERANDS>);
|
|
31
40
|
}
|
|
32
41
|
|
|
33
42
|
public toWire(): number {
|
|
@@ -36,50 +45,65 @@ export class Addressing {
|
|
|
36
45
|
let wire: number = 0;
|
|
37
46
|
for (let i = 0; i < this.modePerOperand.length; i++) {
|
|
38
47
|
if (this.modePerOperand[i] & AddressingMode.INDIRECT) {
|
|
39
|
-
wire |= 1 << i;
|
|
48
|
+
wire |= 1 << (i * 2);
|
|
40
49
|
}
|
|
41
50
|
if (this.modePerOperand[i] & AddressingMode.RELATIVE) {
|
|
42
|
-
wire |= 1 << (
|
|
51
|
+
wire |= 1 << (i * 2 + 1);
|
|
43
52
|
}
|
|
44
53
|
}
|
|
45
54
|
return wire;
|
|
46
55
|
}
|
|
47
56
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
57
|
+
public indirectOperandsCount(): number {
|
|
58
|
+
return this.modePerOperand.filter(mode => mode & AddressingMode.INDIRECT).length;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public relativeOperandsCount(): number {
|
|
62
|
+
return this.modePerOperand.filter(mode => mode & AddressingMode.RELATIVE).length;
|
|
51
63
|
}
|
|
52
64
|
|
|
53
65
|
/**
|
|
54
66
|
* Resolves the offsets using the addressing mode.
|
|
55
67
|
* @param offsets The offsets to resolve.
|
|
56
68
|
* @param mem The memory to use for resolution.
|
|
57
|
-
* @returns The resolved offsets. The length of the returned array is the same as the length of the input array.
|
|
69
|
+
* @returns The resolved offsets. The length of the returned array is the same as the length of the input array and the resolved offsets are guaranteed to be valid addresses.
|
|
70
|
+
* @throws An error if any step failed. Should be treated as a black box.
|
|
58
71
|
*/
|
|
59
72
|
public resolve(offsets: number[], mem: TaggedMemoryInterface): number[] {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
let didRelativeOnce = false;
|
|
64
|
-
let baseAddr = 0;
|
|
73
|
+
const resolved: number[] = new Array(offsets.length);
|
|
74
|
+
// These will be read (once) if we have any relative operands.
|
|
75
|
+
let baseAddr: MemoryValue | undefined;
|
|
65
76
|
|
|
66
77
|
for (const [i, offset] of offsets.entries()) {
|
|
67
78
|
const mode = this.modePerOperand[i];
|
|
79
|
+
// The given offsets are assumed to be valid addresses.
|
|
68
80
|
resolved[i] = offset;
|
|
69
81
|
if (mode & AddressingMode.RELATIVE) {
|
|
70
|
-
if (!
|
|
71
|
-
mem.
|
|
72
|
-
|
|
73
|
-
|
|
82
|
+
if (!baseAddr) {
|
|
83
|
+
baseAddr = mem.get(0);
|
|
84
|
+
const baseAddrTag = baseAddr.getTag();
|
|
85
|
+
if (!TaggedMemory.isValidMemoryAddressTag(baseAddrTag!)) {
|
|
86
|
+
throw TagCheckError.forBaseAddress(TypeTag[baseAddrTag!]);
|
|
87
|
+
}
|
|
74
88
|
}
|
|
75
|
-
resolved[i]
|
|
89
|
+
// Here we know that resolved[i] is at most 32 bits and baseAddr is at most 32 bits.
|
|
90
|
+
// Therefore, the addition is safe since the `number` type fits more than 33 bits.
|
|
91
|
+
resolved[i] += Number(baseAddr.toBigInt());
|
|
76
92
|
if (resolved[i] >= TaggedMemory.MAX_MEMORY_SIZE) {
|
|
77
|
-
throw new RelativeAddressOutOfRangeError(baseAddr, offset);
|
|
93
|
+
throw new RelativeAddressOutOfRangeError(Number(baseAddr.toBigInt()), offset);
|
|
78
94
|
}
|
|
79
95
|
}
|
|
80
96
|
if (mode & AddressingMode.INDIRECT) {
|
|
81
|
-
|
|
82
|
-
|
|
97
|
+
// At this point we know that resolved[i] is a valid memory address.
|
|
98
|
+
const resolvedValue = mem.get(resolved[i]);
|
|
99
|
+
const resolvedTag = resolvedValue.getTag();
|
|
100
|
+
|
|
101
|
+
// Final check.
|
|
102
|
+
if (!TaggedMemory.isValidMemoryAddressTag(resolvedTag)) {
|
|
103
|
+
throw TagCheckError.forIndirectAddress(resolved[i], TypeTag[resolvedTag]);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
resolved[i] = Number(resolvedValue.toBigInt());
|
|
83
107
|
}
|
|
84
108
|
}
|
|
85
109
|
return resolved;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AvmContext } from '../avm_context.js';
|
|
2
2
|
import {
|
|
3
3
|
type Field,
|
|
4
|
+
type IntegralValue,
|
|
4
5
|
type MemoryValue,
|
|
5
6
|
TaggedMemory,
|
|
6
7
|
type TaggedMemoryInterface,
|
|
@@ -14,10 +15,13 @@ import { ThreeOperandInstruction } from './instruction_impl.js';
|
|
|
14
15
|
export abstract class ThreeOperandArithmeticInstruction extends ThreeOperandInstruction {
|
|
15
16
|
public async execute(context: AvmContext): Promise<void> {
|
|
16
17
|
const memory = context.machineState.memory;
|
|
17
|
-
|
|
18
|
+
const addressing = Addressing.fromWire(this.addressingMode);
|
|
19
|
+
|
|
20
|
+
context.machineState.consumeGas(
|
|
21
|
+
this.baseGasCost(addressing.indirectOperandsCount(), addressing.relativeOperandsCount()),
|
|
22
|
+
);
|
|
18
23
|
|
|
19
24
|
const operands = [this.aOffset, this.bOffset, this.dstOffset];
|
|
20
|
-
const addressing = Addressing.fromWire(this.indirect, operands.length);
|
|
21
25
|
const [aOffset, bOffset, dstOffset] = addressing.resolve(operands, memory);
|
|
22
26
|
this.checkTags(memory, aOffset, bOffset);
|
|
23
27
|
|
|
@@ -84,7 +88,9 @@ export class FieldDiv extends ThreeOperandArithmeticInstruction {
|
|
|
84
88
|
static readonly opcode = Opcode.FDIV_8; // FIXME: needed for gas.
|
|
85
89
|
|
|
86
90
|
protected compute(a: Field, b: Field): Field {
|
|
87
|
-
|
|
91
|
+
if (b.toBigInt() === 0n) {
|
|
92
|
+
throw new ArithmeticError('Division by zero');
|
|
93
|
+
}
|
|
88
94
|
return a.fdiv(b);
|
|
89
95
|
}
|
|
90
96
|
|
|
@@ -93,3 +99,31 @@ export class FieldDiv extends ThreeOperandArithmeticInstruction {
|
|
|
93
99
|
memory.checkTag(TypeTag.FIELD, aOffset); // Follows that bOffset has also tag of type Field
|
|
94
100
|
}
|
|
95
101
|
}
|
|
102
|
+
|
|
103
|
+
export class Shl extends ThreeOperandArithmeticInstruction {
|
|
104
|
+
static readonly type: string = 'SHL';
|
|
105
|
+
static readonly opcode = Opcode.SHL_8; // FIXME: needed for gas.
|
|
106
|
+
|
|
107
|
+
protected override compute(a: IntegralValue, b: IntegralValue): IntegralValue {
|
|
108
|
+
return a.shl(b);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
protected override checkTags(memory: TaggedMemoryInterface, aOffset: number, bOffset: number) {
|
|
112
|
+
memory.checkTagsAreSame(aOffset, bOffset);
|
|
113
|
+
TaggedMemory.checkIsIntegralTag(memory.getTag(aOffset)); // Follows that bOffset tag is also of integral type
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export class Shr extends ThreeOperandArithmeticInstruction {
|
|
118
|
+
static readonly type: string = 'SHR';
|
|
119
|
+
static readonly opcode = Opcode.SHR_8; // FIXME: needed for gas.
|
|
120
|
+
|
|
121
|
+
protected override compute(a: IntegralValue, b: IntegralValue): IntegralValue {
|
|
122
|
+
return a.shr(b);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
protected override checkTags(memory: TaggedMemoryInterface, aOffset: number, bOffset: number) {
|
|
126
|
+
memory.checkTagsAreSame(aOffset, bOffset);
|
|
127
|
+
TaggedMemory.checkIsIntegralTag(memory.getTag(aOffset)); // Follows that bOffset tag is also of integral type
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AvmContext } from '../avm_context.js';
|
|
2
|
+
import { getBitwiseDynamicGasMultiplier } from '../avm_gas.js';
|
|
2
3
|
import { type IntegralValue, TaggedMemory, type TaggedMemoryInterface, TypeTag } from '../avm_memory_types.js';
|
|
3
4
|
import { Opcode, OperandType } from '../serialization/instruction_serialization.js';
|
|
4
5
|
import { Addressing } from './addressing_mode.js';
|
|
@@ -8,13 +9,19 @@ import { ThreeOperandInstruction } from './instruction_impl.js';
|
|
|
8
9
|
abstract class ThreeOperandBitwiseInstruction extends ThreeOperandInstruction {
|
|
9
10
|
public async execute(context: AvmContext): Promise<void> {
|
|
10
11
|
const memory = context.machineState.memory;
|
|
11
|
-
|
|
12
|
+
const addressing = Addressing.fromWire(this.addressingMode);
|
|
13
|
+
|
|
14
|
+
context.machineState.consumeGas(
|
|
15
|
+
this.baseGasCost(addressing.indirectOperandsCount(), addressing.relativeOperandsCount()),
|
|
16
|
+
);
|
|
12
17
|
|
|
13
18
|
const operands = [this.aOffset, this.bOffset, this.dstOffset];
|
|
14
|
-
const addressing = Addressing.fromWire(this.indirect, operands.length);
|
|
15
19
|
const [aOffset, bOffset, dstOffset] = addressing.resolve(operands, memory);
|
|
16
20
|
this.checkTags(memory, aOffset, bOffset);
|
|
17
21
|
|
|
22
|
+
const multiplier = this.getDynamicMultiplier(memory.getTag(aOffset));
|
|
23
|
+
context.machineState.consumeGas(this.dynamicGasCost(multiplier));
|
|
24
|
+
|
|
18
25
|
const a = memory.getAs<IntegralValue>(aOffset);
|
|
19
26
|
const b = memory.getAs<IntegralValue>(bOffset);
|
|
20
27
|
|
|
@@ -27,6 +34,10 @@ abstract class ThreeOperandBitwiseInstruction extends ThreeOperandInstruction {
|
|
|
27
34
|
TaggedMemory.checkIsIntegralTag(memory.getTag(aOffset));
|
|
28
35
|
memory.checkTagsAreSame(aOffset, bOffset);
|
|
29
36
|
}
|
|
37
|
+
|
|
38
|
+
protected getDynamicMultiplier(_lhsTag: TypeTag): number {
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
30
41
|
}
|
|
31
42
|
|
|
32
43
|
export class And extends ThreeOperandBitwiseInstruction {
|
|
@@ -36,6 +47,10 @@ export class And extends ThreeOperandBitwiseInstruction {
|
|
|
36
47
|
protected override compute(a: IntegralValue, b: IntegralValue): IntegralValue {
|
|
37
48
|
return a.and(b);
|
|
38
49
|
}
|
|
50
|
+
|
|
51
|
+
protected override getDynamicMultiplier(lhsTag: TypeTag): number {
|
|
52
|
+
return getBitwiseDynamicGasMultiplier(lhsTag);
|
|
53
|
+
}
|
|
39
54
|
}
|
|
40
55
|
|
|
41
56
|
export class Or extends ThreeOperandBitwiseInstruction {
|
|
@@ -45,6 +60,10 @@ export class Or extends ThreeOperandBitwiseInstruction {
|
|
|
45
60
|
protected override compute(a: IntegralValue, b: IntegralValue): IntegralValue {
|
|
46
61
|
return a.or(b);
|
|
47
62
|
}
|
|
63
|
+
|
|
64
|
+
protected override getDynamicMultiplier(lhsTag: TypeTag): number {
|
|
65
|
+
return getBitwiseDynamicGasMultiplier(lhsTag);
|
|
66
|
+
}
|
|
48
67
|
}
|
|
49
68
|
|
|
50
69
|
export class Xor extends ThreeOperandBitwiseInstruction {
|
|
@@ -54,31 +73,9 @@ export class Xor extends ThreeOperandBitwiseInstruction {
|
|
|
54
73
|
protected override compute(a: IntegralValue, b: IntegralValue): IntegralValue {
|
|
55
74
|
return a.xor(b);
|
|
56
75
|
}
|
|
57
|
-
}
|
|
58
76
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
static readonly opcode = Opcode.SHL_8; // FIXME: needed for gas.
|
|
62
|
-
|
|
63
|
-
protected override compute(a: IntegralValue, b: IntegralValue): IntegralValue {
|
|
64
|
-
return a.shl(b);
|
|
65
|
-
}
|
|
66
|
-
protected override checkTags(memory: TaggedMemoryInterface, aOffset: number, bOffset: number) {
|
|
67
|
-
TaggedMemory.checkIsIntegralTag(memory.getTag(aOffset));
|
|
68
|
-
memory.checkTag(TypeTag.UINT8, bOffset);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export class Shr extends ThreeOperandBitwiseInstruction {
|
|
73
|
-
static readonly type: string = 'SHR';
|
|
74
|
-
static readonly opcode = Opcode.SHR_8; // FIXME: needed for gas.
|
|
75
|
-
|
|
76
|
-
protected override compute(a: IntegralValue, b: IntegralValue): IntegralValue {
|
|
77
|
-
return a.shr(b);
|
|
78
|
-
}
|
|
79
|
-
protected override checkTags(memory: TaggedMemoryInterface, aOffset: number, bOffset: number) {
|
|
80
|
-
TaggedMemory.checkIsIntegralTag(memory.getTag(aOffset));
|
|
81
|
-
memory.checkTag(TypeTag.UINT8, bOffset);
|
|
77
|
+
protected override getDynamicMultiplier(lhsTag: TypeTag): number {
|
|
78
|
+
return getBitwiseDynamicGasMultiplier(lhsTag);
|
|
82
79
|
}
|
|
83
80
|
}
|
|
84
81
|
|
|
@@ -89,16 +86,23 @@ export class Not extends Instruction {
|
|
|
89
86
|
static readonly wireFormat8 = [OperandType.UINT8, OperandType.UINT8, OperandType.UINT8, OperandType.UINT8];
|
|
90
87
|
static readonly wireFormat16 = [OperandType.UINT8, OperandType.UINT8, OperandType.UINT16, OperandType.UINT16];
|
|
91
88
|
|
|
92
|
-
constructor(
|
|
89
|
+
constructor(
|
|
90
|
+
private addressingMode: number,
|
|
91
|
+
private srcOffset: number,
|
|
92
|
+
private dstOffset: number,
|
|
93
|
+
) {
|
|
93
94
|
super();
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
public async execute(context: AvmContext): Promise<void> {
|
|
97
98
|
const memory = context.machineState.memory;
|
|
98
|
-
|
|
99
|
+
const addressing = Addressing.fromWire(this.addressingMode);
|
|
100
|
+
|
|
101
|
+
context.machineState.consumeGas(
|
|
102
|
+
this.baseGasCost(addressing.indirectOperandsCount(), addressing.relativeOperandsCount()),
|
|
103
|
+
);
|
|
99
104
|
|
|
100
105
|
const operands = [this.srcOffset, this.dstOffset];
|
|
101
|
-
const addressing = Addressing.fromWire(this.indirect, operands.length);
|
|
102
106
|
const [srcOffset, dstOffset] = addressing.resolve(operands, memory);
|
|
103
107
|
TaggedMemory.checkIsIntegralTag(memory.getTag(srcOffset));
|
|
104
108
|
const value = memory.getAs<IntegralValue>(srcOffset);
|
|
@@ -7,12 +7,15 @@ import { ThreeOperandInstruction } from './instruction_impl.js';
|
|
|
7
7
|
abstract class ComparatorInstruction extends ThreeOperandInstruction {
|
|
8
8
|
public async execute(context: AvmContext): Promise<void> {
|
|
9
9
|
const memory = context.machineState.memory;
|
|
10
|
-
|
|
10
|
+
const addressing = Addressing.fromWire(this.addressingMode);
|
|
11
|
+
|
|
12
|
+
context.machineState.consumeGas(
|
|
13
|
+
this.baseGasCost(addressing.indirectOperandsCount(), addressing.relativeOperandsCount()),
|
|
14
|
+
);
|
|
11
15
|
|
|
12
16
|
const operands = [this.aOffset, this.bOffset, this.dstOffset];
|
|
13
|
-
const addressing = Addressing.fromWire(this.indirect, operands.length);
|
|
14
17
|
const [aOffset, bOffset, dstOffset] = addressing.resolve(operands, memory);
|
|
15
|
-
memory.checkTagsAreSame(aOffset, bOffset);
|
|
18
|
+
memory.checkTagsAreSame(aOffset, bOffset); // Brillig semantic enforces that tags match.
|
|
16
19
|
|
|
17
20
|
const a = memory.get(aOffset);
|
|
18
21
|
const b = memory.get(bOffset);
|