@aztec/simulator 0.76.4 → 0.77.0-testnet-ignition.17
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 +3 -3
- package/dest/client.d.ts +5 -0
- package/dest/client.d.ts.map +1 -0
- package/dest/client.js +3 -0
- package/dest/{public → common}/db_interfaces.d.ts +8 -33
- package/dest/common/db_interfaces.d.ts.map +1 -0
- package/dest/common/db_interfaces.js +1 -0
- package/dest/common/debug_fn_name.d.ts +3 -2
- package/dest/common/debug_fn_name.d.ts.map +1 -1
- package/dest/common/debug_fn_name.js +2 -5
- package/dest/common/errors.d.ts +4 -4
- package/dest/common/errors.d.ts.map +1 -1
- package/dest/common/errors.js +30 -39
- package/dest/common/index.d.ts +2 -1
- package/dest/common/index.d.ts.map +1 -1
- package/dest/common/index.js +2 -2
- package/dest/common/message_load_oracle_inputs.d.ts +2 -2
- package/dest/common/message_load_oracle_inputs.d.ts.map +1 -1
- package/dest/common/message_load_oracle_inputs.js +8 -8
- package/dest/common/stats/index.d.ts.map +1 -0
- package/dest/{stats → common/stats}/stats.d.ts +2 -2
- package/dest/common/stats/stats.d.ts.map +1 -0
- package/dest/common/stats/stats.js +10 -0
- package/dest/{acvm → private/acvm}/acvm.d.ts +4 -4
- package/dest/private/acvm/acvm.d.ts.map +1 -0
- package/dest/private/acvm/acvm.js +70 -0
- package/dest/{acvm → private/acvm}/acvm_types.d.ts +1 -1
- package/dest/private/acvm/acvm_types.d.ts.map +1 -0
- package/dest/private/acvm/acvm_types.js +3 -0
- package/dest/{acvm → private/acvm}/deserialize.d.ts +2 -2
- package/dest/private/acvm/deserialize.d.ts.map +1 -0
- package/dest/private/acvm/deserialize.js +42 -0
- package/dest/private/acvm/index.d.ts.map +1 -0
- package/dest/private/acvm/index.js +5 -0
- package/dest/{acvm → private/acvm}/oracle/index.d.ts +1 -1
- package/dest/private/acvm/oracle/index.d.ts.map +1 -0
- package/dest/private/acvm/oracle/index.js +2 -0
- package/dest/{acvm → private/acvm}/oracle/oracle.d.ts +4 -3
- package/dest/private/acvm/oracle/oracle.d.ts.map +1 -0
- package/dest/private/acvm/oracle/oracle.js +263 -0
- package/dest/{acvm → private/acvm}/oracle/typed_oracle.d.ts +12 -6
- package/dest/private/acvm/oracle/typed_oracle.d.ts.map +1 -0
- package/dest/private/acvm/oracle/typed_oracle.js +132 -0
- package/dest/{acvm → private/acvm}/serialize.d.ts +7 -3
- package/dest/private/acvm/serialize.d.ts.map +1 -0
- package/dest/private/acvm/serialize.js +46 -0
- package/dest/{client → private}/client_execution_context.d.ts +20 -17
- package/dest/private/client_execution_context.d.ts.map +1 -0
- package/dest/private/client_execution_context.js +378 -0
- package/dest/{client → private}/db_oracle.d.ts +19 -7
- package/dest/private/db_oracle.d.ts.map +1 -0
- package/dest/private/db_oracle.js +14 -0
- package/dest/{client → private}/execution_note_cache.d.ts +2 -2
- package/dest/private/execution_note_cache.d.ts.map +1 -0
- package/dest/private/execution_note_cache.js +180 -0
- package/dest/{common → private}/hashed_values_cache.d.ts +2 -2
- package/dest/private/hashed_values_cache.d.ts.map +1 -0
- package/dest/private/hashed_values_cache.js +46 -0
- package/dest/private/index.d.ts +13 -0
- package/dest/private/index.d.ts.map +1 -0
- package/dest/private/index.js +12 -0
- package/dest/{client → private}/pick_notes.d.ts +1 -1
- package/dest/private/pick_notes.d.ts.map +1 -0
- package/dest/private/pick_notes.js +51 -0
- package/dest/private/private_execution.d.ts +24 -0
- package/dest/private/private_execution.d.ts.map +1 -0
- package/dest/private/private_execution.js +90 -0
- package/dest/{providers → private/providers}/acvm_native.d.ts +5 -5
- package/dest/private/providers/acvm_native.d.ts.map +1 -0
- package/dest/private/providers/acvm_native.js +139 -0
- package/dest/{providers → private/providers}/acvm_wasm.d.ts +4 -4
- package/dest/private/providers/acvm_wasm.d.ts.map +1 -0
- package/dest/private/providers/acvm_wasm.js +62 -0
- package/dest/{providers → private/providers}/acvm_wasm_with_blobs.d.ts +5 -5
- package/dest/private/providers/acvm_wasm_with_blobs.d.ts.map +1 -0
- package/dest/{providers → private/providers}/acvm_wasm_with_blobs.js +3 -6
- package/dest/{providers → private/providers}/factory.d.ts +1 -1
- package/dest/private/providers/factory.d.ts.map +1 -0
- package/dest/private/providers/factory.js +27 -0
- package/dest/{common → private/providers}/simulation_provider.d.ts +5 -5
- package/dest/private/providers/simulation_provider.d.ts.map +1 -0
- package/dest/private/providers/simulation_provider.js +24 -0
- package/dest/private/simulator.d.ts +36 -0
- package/dest/private/simulator.d.ts.map +1 -0
- package/dest/private/simulator.js +78 -0
- package/dest/{client → private}/unconstrained_execution.d.ts +5 -5
- package/dest/private/unconstrained_execution.d.ts.map +1 -0
- package/dest/private/unconstrained_execution.js +27 -0
- package/dest/{client → private}/view_data_oracle.d.ts +15 -7
- package/dest/private/view_data_oracle.d.ts.map +1 -0
- package/dest/private/view_data_oracle.js +260 -0
- package/dest/{avm → public/avm}/avm_context.d.ts +7 -5
- package/dest/public/avm/avm_context.d.ts.map +1 -0
- package/dest/public/avm/avm_context.js +44 -0
- package/dest/{avm → public/avm}/avm_contract_call_result.d.ts +5 -5
- package/dest/public/avm/avm_contract_call_result.d.ts.map +1 -0
- package/dest/public/avm/avm_contract_call_result.js +50 -0
- package/dest/{avm → public/avm}/avm_execution_environment.d.ts +2 -2
- package/dest/public/avm/avm_execution_environment.d.ts.map +1 -0
- package/dest/public/avm/avm_execution_environment.js +31 -0
- package/dest/public/avm/avm_gas.d.ts.map +1 -0
- package/dest/public/avm/avm_gas.js +202 -0
- package/dest/{avm → public/avm}/avm_machine_state.d.ts +2 -2
- package/dest/public/avm/avm_machine_state.d.ts.map +1 -0
- package/dest/public/avm/avm_machine_state.js +106 -0
- package/dest/{avm → public/avm}/avm_memory_types.d.ts +2 -2
- package/dest/public/avm/avm_memory_types.d.ts.map +1 -0
- package/dest/public/avm/avm_memory_types.js +340 -0
- package/dest/{avm → public/avm}/avm_simulator.d.ts +5 -3
- package/dest/public/avm/avm_simulator.d.ts.map +1 -0
- package/dest/public/avm/avm_simulator.js +202 -0
- package/dest/public/avm/bytecode_utils.d.ts.map +1 -0
- package/dest/public/avm/bytecode_utils.js +17 -0
- package/dest/{avm → public/avm}/errors.d.ts +5 -4
- package/dest/public/avm/errors.d.ts.map +1 -0
- package/dest/public/avm/errors.js +179 -0
- package/dest/{avm → public/avm}/fixtures/avm_simulation_tester.d.ts +6 -6
- package/dest/public/avm/fixtures/avm_simulation_tester.d.ts.map +1 -0
- package/dest/public/avm/fixtures/avm_simulation_tester.js +76 -0
- package/dest/{avm → public/avm}/fixtures/base_avm_simulation_tester.d.ts +13 -11
- package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts.map +1 -0
- package/dest/public/avm/fixtures/base_avm_simulation_tester.js +77 -0
- package/dest/{avm → public/avm}/fixtures/index.d.ts +7 -7
- package/dest/public/avm/fixtures/index.d.ts.map +1 -0
- package/dest/public/avm/fixtures/index.js +140 -0
- package/dest/{avm → public/avm}/fixtures/simple_contract_data_source.d.ts +10 -4
- package/dest/public/avm/fixtures/simple_contract_data_source.d.ts.map +1 -0
- package/dest/public/avm/fixtures/simple_contract_data_source.js +112 -0
- package/dest/public/avm/index.d.ts +4 -0
- package/dest/public/avm/index.d.ts.map +1 -0
- package/dest/{avm/index.d.ts → public/avm/index.js} +1 -2
- package/dest/public/avm/journal/index.d.ts.map +1 -0
- package/dest/{avm → public/avm}/journal/journal.d.ts +51 -18
- package/dest/public/avm/journal/journal.d.ts.map +1 -0
- package/dest/public/avm/journal/journal.js +488 -0
- package/dest/{avm → public/avm}/journal/nullifiers.d.ts +8 -6
- package/dest/public/avm/journal/nullifiers.d.ts.map +1 -0
- package/dest/public/avm/journal/nullifiers.js +97 -0
- package/dest/{avm → public/avm}/journal/public_storage.d.ts +2 -2
- package/dest/public/avm/journal/public_storage.d.ts.map +1 -0
- package/dest/public/avm/journal/public_storage.js +145 -0
- package/dest/public/avm/opcodes/accrued_substate.d.ts.map +1 -0
- package/dest/public/avm/opcodes/accrued_substate.js +252 -0
- package/dest/public/avm/opcodes/addressing_mode.d.ts.map +1 -0
- package/dest/public/avm/opcodes/addressing_mode.js +74 -0
- package/dest/public/avm/opcodes/arithmetic.d.ts.map +1 -0
- package/dest/public/avm/opcodes/arithmetic.js +73 -0
- package/dest/public/avm/opcodes/bitwise.d.ts.map +1 -0
- package/dest/public/avm/opcodes/bitwise.js +106 -0
- package/dest/public/avm/opcodes/comparators.d.ts.map +1 -0
- package/dest/public/avm/opcodes/comparators.js +43 -0
- package/dest/public/avm/opcodes/contract.d.ts.map +1 -0
- package/dest/public/avm/opcodes/contract.js +66 -0
- package/dest/public/avm/opcodes/control_flow.d.ts.map +1 -0
- package/dest/public/avm/opcodes/control_flow.js +105 -0
- package/dest/{avm → public/avm}/opcodes/conversion.d.ts +1 -1
- package/dest/public/avm/opcodes/conversion.d.ts.map +1 -0
- package/dest/public/avm/opcodes/conversion.js +69 -0
- package/dest/{avm → public/avm}/opcodes/ec_add.d.ts +1 -1
- package/dest/public/avm/opcodes/ec_add.d.ts.map +1 -0
- package/dest/public/avm/opcodes/ec_add.js +84 -0
- package/dest/public/avm/opcodes/environment_getters.d.ts.map +1 -0
- package/dest/public/avm/opcodes/environment_getters.js +79 -0
- package/dest/public/avm/opcodes/external_calls.d.ts.map +1 -0
- package/dest/public/avm/opcodes/external_calls.js +180 -0
- package/dest/{avm → public/avm}/opcodes/hashing.d.ts +1 -1
- package/dest/public/avm/opcodes/hashing.d.ts.map +1 -0
- package/dest/public/avm/opcodes/hashing.js +114 -0
- package/dest/public/avm/opcodes/index.d.ts.map +1 -0
- package/dest/{avm → public/avm}/opcodes/instruction.d.ts +2 -2
- package/dest/public/avm/opcodes/instruction.d.ts.map +1 -0
- package/dest/public/avm/opcodes/instruction.js +91 -0
- package/dest/public/avm/opcodes/instruction_impl.d.ts.map +1 -0
- package/dest/public/avm/opcodes/instruction_impl.js +30 -0
- package/dest/public/avm/opcodes/memory.d.ts.map +1 -0
- package/dest/public/avm/opcodes/memory.js +253 -0
- package/dest/{avm → public/avm}/opcodes/misc.d.ts +1 -1
- package/dest/public/avm/opcodes/misc.d.ts.map +1 -0
- package/dest/public/avm/opcodes/misc.js +48 -0
- package/dest/public/avm/opcodes/storage.d.ts.map +1 -0
- package/dest/public/avm/opcodes/storage.js +66 -0
- package/dest/public/avm/serialization/buffer_cursor.d.ts.map +1 -0
- package/dest/public/avm/serialization/buffer_cursor.js +99 -0
- package/dest/{avm → public/avm}/serialization/bytecode_serialization.d.ts +1 -1
- package/dest/public/avm/serialization/bytecode_serialization.d.ts.map +1 -0
- package/dest/public/avm/serialization/bytecode_serialization.js +328 -0
- package/dest/{avm → public/avm}/serialization/instruction_serialization.d.ts +1 -2
- package/dest/public/avm/serialization/instruction_serialization.d.ts.map +1 -0
- package/dest/public/avm/serialization/instruction_serialization.js +225 -0
- package/dest/{avm → public/avm}/test_utils.d.ts +6 -4
- package/dest/public/avm/test_utils.d.ts.map +1 -0
- package/dest/public/avm/test_utils.js +52 -0
- package/dest/public/bytecode_errors.js +1 -2
- package/dest/public/execution.d.ts +8 -2
- package/dest/public/execution.d.ts.map +1 -1
- package/dest/public/execution.js +4 -5
- package/dest/public/executor_metrics.js +16 -12
- package/dest/public/fixtures/index.js +0 -1
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts +12 -8
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +1 -1
- package/dest/public/fixtures/public_tx_simulation_tester.js +37 -44
- package/dest/public/fixtures/utils.d.ts +3 -11
- package/dest/public/fixtures/utils.d.ts.map +1 -1
- package/dest/public/fixtures/utils.js +15 -35
- package/dest/public/index.d.ts +3 -2
- package/dest/public/index.d.ts.map +1 -1
- package/dest/public/index.js +3 -3
- package/dest/public/public_db_sources.d.ts +22 -28
- package/dest/public/public_db_sources.d.ts.map +1 -1
- package/dest/public/public_db_sources.js +75 -181
- package/dest/public/public_processor.d.ts +8 -6
- package/dest/public/public_processor.d.ts.map +1 -1
- package/dest/public/public_processor.js +329 -308
- package/dest/public/public_processor_metrics.d.ts +3 -3
- package/dest/public/public_processor_metrics.d.ts.map +1 -1
- package/dest/public/public_processor_metrics.js +46 -27
- package/dest/public/public_tx_context.d.ts +14 -8
- package/dest/public/public_tx_context.d.ts.map +1 -1
- package/dest/public/public_tx_context.js +122 -143
- package/dest/public/public_tx_simulator.d.ts +8 -5
- package/dest/public/public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator.js +306 -317
- package/dest/public/side_effect_errors.js +1 -2
- package/dest/public/side_effect_trace.d.ts +16 -10
- package/dest/public/side_effect_trace.d.ts.map +1 -1
- package/dest/public/side_effect_trace.js +65 -132
- package/dest/public/side_effect_trace_interface.d.ts +9 -7
- package/dest/public/side_effect_trace_interface.d.ts.map +1 -1
- package/dest/public/side_effect_trace_interface.js +1 -2
- package/dest/public/unique_class_ids.js +23 -28
- package/dest/public/utils.d.ts +2 -2
- package/dest/public/utils.d.ts.map +1 -1
- package/dest/public/utils.js +17 -12
- package/dest/server.d.ts +4 -4
- package/dest/server.d.ts.map +1 -1
- package/dest/server.js +3 -5
- package/dest/test/utils.d.ts +3 -2
- package/dest/test/utils.d.ts.map +1 -1
- package/dest/test/utils.js +9 -7
- package/package.json +16 -18
- package/src/client.ts +4 -0
- package/src/{public → common}/db_interfaces.ts +8 -40
- package/src/common/debug_fn_name.ts +4 -2
- package/src/common/errors.ts +5 -5
- package/src/common/index.ts +2 -1
- package/src/common/message_load_oracle_inputs.ts +2 -2
- package/src/common/stats/index.ts +1 -0
- package/src/{stats → common/stats}/stats.ts +2 -2
- package/src/{acvm → private/acvm}/acvm.ts +5 -5
- package/src/{acvm → private/acvm}/acvm_types.ts +1 -1
- package/src/{acvm → private/acvm}/deserialize.ts +2 -2
- package/src/{acvm → private/acvm}/oracle/index.ts +1 -1
- package/src/{acvm → private/acvm}/oracle/oracle.ts +22 -12
- package/src/{acvm → private/acvm}/oracle/typed_oracle.ts +50 -55
- package/src/{acvm → private/acvm}/serialize.ts +10 -3
- package/src/{client → private}/client_execution_context.ts +54 -37
- package/src/{client → private}/db_oracle.ts +20 -20
- package/src/{client → private}/execution_note_cache.ts +3 -3
- package/src/{common → private}/hashed_values_cache.ts +2 -2
- package/src/private/index.ts +12 -0
- package/src/{client → private}/pick_notes.ts +1 -1
- package/src/{client → private}/private_execution.ts +46 -14
- package/src/{providers → private/providers}/acvm_native.ts +6 -6
- package/src/{providers → private/providers}/acvm_wasm.ts +4 -4
- package/src/{providers → private/providers}/acvm_wasm_with_blobs.ts +5 -5
- package/src/{providers → private/providers}/factory.ts +1 -1
- package/src/{common → private/providers}/simulation_provider.ts +5 -5
- package/src/{client → private}/simulator.ts +31 -123
- package/src/{client → private}/unconstrained_execution.ts +7 -7
- package/src/{client → private}/view_data_oracle.ts +25 -28
- package/src/{avm → public/avm}/avm_context.ts +12 -7
- package/src/{avm → public/avm}/avm_contract_call_result.ts +6 -6
- package/src/{avm → public/avm}/avm_execution_environment.ts +2 -2
- package/src/{avm → public/avm}/avm_gas.ts +1 -3
- package/src/{avm → public/avm}/avm_machine_state.ts +2 -2
- package/src/{avm → public/avm}/avm_memory_types.ts +4 -4
- package/src/{avm → public/avm}/avm_simulator.ts +12 -6
- package/src/{avm → public/avm}/errors.ts +5 -4
- package/src/{avm → public/avm}/fixtures/avm_simulation_tester.ts +16 -15
- package/src/{avm → public/avm}/fixtures/base_avm_simulation_tester.ts +38 -40
- package/src/{avm → public/avm}/fixtures/index.ts +17 -12
- package/src/{avm → public/avm}/fixtures/simple_contract_data_source.ts +64 -9
- package/src/{avm → public/avm}/index.ts +1 -1
- package/src/public/avm/journal/index.ts +1 -0
- package/src/{avm → public/avm}/journal/journal.ts +332 -305
- package/src/{avm → public/avm}/journal/nullifiers.ts +20 -19
- package/src/{avm → public/avm}/journal/public_storage.ts +2 -2
- package/src/{avm → public/avm}/opcodes/contract.ts +1 -1
- package/src/{avm → public/avm}/opcodes/control_flow.ts +1 -1
- package/src/{avm → public/avm}/opcodes/conversion.ts +1 -1
- package/src/{avm → public/avm}/opcodes/ec_add.ts +2 -2
- package/src/{avm → public/avm}/opcodes/external_calls.ts +5 -6
- package/src/{avm → public/avm}/opcodes/hashing.ts +1 -1
- package/src/public/avm/opcodes/index.ts +15 -0
- package/src/{avm → public/avm}/opcodes/instruction.ts +2 -2
- package/src/{avm → public/avm}/opcodes/misc.ts +1 -1
- package/src/public/avm/serialization/bytecode_serialization.ts +204 -0
- package/src/{avm → public/avm}/serialization/instruction_serialization.ts +0 -1
- package/src/{avm → public/avm}/test_utils.ts +10 -7
- package/src/public/execution.ts +9 -12
- package/src/public/fixtures/public_tx_simulation_tester.ts +45 -63
- package/src/public/fixtures/utils.ts +8 -43
- package/src/public/index.ts +3 -2
- package/src/public/public_db_sources.ts +55 -188
- package/src/public/public_processor.ts +66 -47
- package/src/public/public_processor_metrics.ts +3 -3
- package/src/public/public_tx_context.ts +69 -74
- package/src/public/public_tx_simulator.ts +35 -27
- package/src/public/side_effect_trace.ts +67 -140
- package/src/public/side_effect_trace_interface.ts +10 -23
- package/src/public/unique_class_ids.ts +1 -1
- package/src/public/utils.ts +2 -2
- package/src/server.ts +4 -4
- package/src/test/utils.ts +5 -3
- package/dest/acvm/acvm.d.ts.map +0 -1
- package/dest/acvm/acvm.js +0 -73
- package/dest/acvm/acvm_types.d.ts.map +0 -1
- package/dest/acvm/acvm_types.js +0 -2
- package/dest/acvm/deserialize.d.ts.map +0 -1
- package/dest/acvm/deserialize.js +0 -46
- package/dest/acvm/index.d.ts.map +0 -1
- package/dest/acvm/index.js +0 -6
- package/dest/acvm/oracle/index.d.ts.map +0 -1
- package/dest/acvm/oracle/index.js +0 -3
- package/dest/acvm/oracle/oracle.d.ts.map +0 -1
- package/dest/acvm/oracle/oracle.js +0 -230
- package/dest/acvm/oracle/typed_oracle.d.ts.map +0 -1
- package/dest/acvm/oracle/typed_oracle.js +0 -131
- package/dest/acvm/serialize.d.ts.map +0 -1
- package/dest/acvm/serialize.js +0 -48
- package/dest/avm/avm_context.d.ts.map +0 -1
- package/dest/avm/avm_context.js +0 -44
- package/dest/avm/avm_contract_call_result.d.ts.map +0 -1
- package/dest/avm/avm_contract_call_result.js +0 -45
- package/dest/avm/avm_execution_environment.d.ts.map +0 -1
- package/dest/avm/avm_execution_environment.js +0 -28
- package/dest/avm/avm_gas.d.ts.map +0 -1
- package/dest/avm/avm_gas.js +0 -170
- package/dest/avm/avm_machine_state.d.ts.map +0 -1
- package/dest/avm/avm_machine_state.js +0 -112
- package/dest/avm/avm_memory_types.d.ts.map +0 -1
- package/dest/avm/avm_memory_types.js +0 -327
- package/dest/avm/avm_simulator.d.ts.map +0 -1
- package/dest/avm/avm_simulator.js +0 -193
- package/dest/avm/avm_tree.d.ts +0 -282
- package/dest/avm/avm_tree.d.ts.map +0 -1
- package/dest/avm/avm_tree.js +0 -684
- package/dest/avm/bytecode_utils.d.ts.map +0 -1
- package/dest/avm/bytecode_utils.js +0 -15
- package/dest/avm/errors.d.ts.map +0 -1
- package/dest/avm/errors.js +0 -196
- package/dest/avm/fixtures/avm_simulation_tester.d.ts.map +0 -1
- package/dest/avm/fixtures/avm_simulation_tester.js +0 -73
- package/dest/avm/fixtures/base_avm_simulation_tester.d.ts.map +0 -1
- package/dest/avm/fixtures/base_avm_simulation_tester.js +0 -76
- package/dest/avm/fixtures/index.d.ts.map +0 -1
- package/dest/avm/fixtures/index.js +0 -134
- package/dest/avm/fixtures/simple_contract_data_source.d.ts.map +0 -1
- package/dest/avm/fixtures/simple_contract_data_source.js +0 -75
- package/dest/avm/index.d.ts.map +0 -1
- package/dest/avm/index.js +0 -4
- package/dest/avm/journal/index.d.ts.map +0 -1
- package/dest/avm/journal/index.js +0 -2
- package/dest/avm/journal/journal.d.ts.map +0 -1
- package/dest/avm/journal/journal.js +0 -499
- package/dest/avm/journal/nullifiers.d.ts.map +0 -1
- package/dest/avm/journal/nullifiers.js +0 -99
- package/dest/avm/journal/public_storage.d.ts.map +0 -1
- package/dest/avm/journal/public_storage.js +0 -159
- package/dest/avm/opcodes/accrued_substate.d.ts.map +0 -1
- package/dest/avm/opcodes/accrued_substate.js +0 -215
- package/dest/avm/opcodes/addressing_mode.d.ts.map +0 -1
- package/dest/avm/opcodes/addressing_mode.js +0 -81
- package/dest/avm/opcodes/arithmetic.d.ts.map +0 -1
- package/dest/avm/opcodes/arithmetic.js +0 -70
- package/dest/avm/opcodes/bitwise.d.ts.map +0 -1
- package/dest/avm/opcodes/bitwise.js +0 -90
- package/dest/avm/opcodes/comparators.d.ts.map +0 -1
- package/dest/avm/opcodes/comparators.js +0 -40
- package/dest/avm/opcodes/contract.d.ts.map +0 -1
- package/dest/avm/opcodes/contract.js +0 -63
- package/dest/avm/opcodes/control_flow.d.ts.map +0 -1
- package/dest/avm/opcodes/control_flow.js +0 -97
- package/dest/avm/opcodes/conversion.d.ts.map +0 -1
- package/dest/avm/opcodes/conversion.js +0 -64
- package/dest/avm/opcodes/ec_add.d.ts.map +0 -1
- package/dest/avm/opcodes/ec_add.js +0 -82
- package/dest/avm/opcodes/environment_getters.d.ts.map +0 -1
- package/dest/avm/opcodes/environment_getters.js +0 -78
- package/dest/avm/opcodes/external_calls.d.ts.map +0 -1
- package/dest/avm/opcodes/external_calls.js +0 -169
- package/dest/avm/opcodes/hashing.d.ts.map +0 -1
- package/dest/avm/opcodes/hashing.js +0 -103
- package/dest/avm/opcodes/index.d.ts.map +0 -1
- package/dest/avm/opcodes/index.js +0 -16
- package/dest/avm/opcodes/instruction.d.ts.map +0 -1
- package/dest/avm/opcodes/instruction.js +0 -100
- package/dest/avm/opcodes/instruction_impl.d.ts.map +0 -1
- package/dest/avm/opcodes/instruction_impl.js +0 -33
- package/dest/avm/opcodes/memory.d.ts.map +0 -1
- package/dest/avm/opcodes/memory.js +0 -226
- package/dest/avm/opcodes/misc.d.ts.map +0 -1
- package/dest/avm/opcodes/misc.js +0 -45
- package/dest/avm/opcodes/multi_scalar_mul.d.ts +0 -16
- package/dest/avm/opcodes/multi_scalar_mul.d.ts.map +0 -1
- package/dest/avm/opcodes/multi_scalar_mul.js +0 -112
- package/dest/avm/opcodes/storage.d.ts.map +0 -1
- package/dest/avm/opcodes/storage.js +0 -61
- package/dest/avm/serialization/buffer_cursor.d.ts.map +0 -1
- package/dest/avm/serialization/buffer_cursor.js +0 -99
- package/dest/avm/serialization/bytecode_serialization.d.ts.map +0 -1
- package/dest/avm/serialization/bytecode_serialization.js +0 -132
- package/dest/avm/serialization/instruction_serialization.d.ts.map +0 -1
- package/dest/avm/serialization/instruction_serialization.js +0 -187
- package/dest/avm/test_utils.d.ts.map +0 -1
- package/dest/avm/test_utils.js +0 -52
- package/dest/client/client_execution_context.d.ts.map +0 -1
- package/dest/client/client_execution_context.js +0 -392
- package/dest/client/db_oracle.d.ts.map +0 -1
- package/dest/client/db_oracle.js +0 -17
- package/dest/client/execution_note_cache.d.ts.map +0 -1
- package/dest/client/execution_note_cache.js +0 -181
- package/dest/client/index.d.ts +0 -16
- package/dest/client/index.d.ts.map +0 -1
- package/dest/client/index.js +0 -15
- package/dest/client/pick_notes.d.ts.map +0 -1
- package/dest/client/pick_notes.js +0 -54
- package/dest/client/private_execution.d.ts +0 -19
- package/dest/client/private_execution.d.ts.map +0 -1
- package/dest/client/private_execution.js +0 -72
- package/dest/client/simulator.d.ts +0 -60
- package/dest/client/simulator.d.ts.map +0 -1
- package/dest/client/simulator.js +0 -136
- package/dest/client/unconstrained_execution.d.ts.map +0 -1
- package/dest/client/unconstrained_execution.js +0 -30
- package/dest/client/view_data_oracle.d.ts.map +0 -1
- package/dest/client/view_data_oracle.js +0 -268
- package/dest/common/hashed_values_cache.d.ts.map +0 -1
- package/dest/common/hashed_values_cache.js +0 -50
- package/dest/common/simulation_provider.d.ts.map +0 -1
- package/dest/common/simulation_provider.js +0 -27
- package/dest/common.d.ts +0 -2
- package/dest/common.d.ts.map +0 -1
- package/dest/common.js +0 -2
- package/dest/providers/acvm_native.d.ts.map +0 -1
- package/dest/providers/acvm_native.js +0 -125
- package/dest/providers/acvm_wasm.d.ts.map +0 -1
- package/dest/providers/acvm_wasm.js +0 -54
- package/dest/providers/acvm_wasm_with_blobs.d.ts.map +0 -1
- package/dest/providers/factory.d.ts.map +0 -1
- package/dest/providers/factory.js +0 -27
- package/dest/providers/index.d.ts +0 -5
- package/dest/providers/index.d.ts.map +0 -1
- package/dest/providers/index.js +0 -5
- package/dest/public/db_interfaces.d.ts.map +0 -1
- package/dest/public/db_interfaces.js +0 -2
- package/dest/public/fee_payment.d.ts +0 -11
- package/dest/public/fee_payment.d.ts.map +0 -1
- package/dest/public/fee_payment.js +0 -21
- package/dest/stats/index.d.ts.map +0 -1
- package/dest/stats/index.js +0 -2
- package/dest/stats/stats.d.ts.map +0 -1
- package/dest/stats/stats.js +0 -11
- package/src/avm/avm_tree.ts +0 -887
- package/src/avm/opcodes/multi_scalar_mul.ts +0 -121
- package/src/avm/serialization/bytecode_serialization.ts +0 -212
- package/src/client/index.ts +0 -15
- package/src/common.ts +0 -1
- package/src/providers/index.ts +0 -4
- package/src/public/fee_payment.ts +0 -23
- /package/dest/{stats → common/stats}/index.d.ts +0 -0
- /package/{src/stats/index.ts → dest/common/stats/index.js} +0 -0
- /package/dest/{acvm → private/acvm}/index.d.ts +0 -0
- /package/dest/{avm → public/avm}/avm_gas.d.ts +0 -0
- /package/dest/{avm → public/avm}/bytecode_utils.d.ts +0 -0
- /package/dest/{avm → public/avm}/journal/index.d.ts +0 -0
- /package/{src/avm/journal/index.ts → dest/public/avm/journal/index.js} +0 -0
- /package/dest/{avm → public/avm}/opcodes/accrued_substate.d.ts +0 -0
- /package/dest/{avm → public/avm}/opcodes/addressing_mode.d.ts +0 -0
- /package/dest/{avm → public/avm}/opcodes/arithmetic.d.ts +0 -0
- /package/dest/{avm → public/avm}/opcodes/bitwise.d.ts +0 -0
- /package/dest/{avm → public/avm}/opcodes/comparators.d.ts +0 -0
- /package/dest/{avm → public/avm}/opcodes/contract.d.ts +0 -0
- /package/dest/{avm → public/avm}/opcodes/control_flow.d.ts +0 -0
- /package/dest/{avm → public/avm}/opcodes/environment_getters.d.ts +0 -0
- /package/dest/{avm → public/avm}/opcodes/external_calls.d.ts +0 -0
- /package/dest/{avm → public/avm}/opcodes/index.d.ts +0 -0
- /package/{src/avm/opcodes/index.ts → dest/public/avm/opcodes/index.js} +0 -0
- /package/dest/{avm → public/avm}/opcodes/instruction_impl.d.ts +0 -0
- /package/dest/{avm → public/avm}/opcodes/memory.d.ts +0 -0
- /package/dest/{avm → public/avm}/opcodes/storage.d.ts +0 -0
- /package/dest/{avm → public/avm}/serialization/buffer_cursor.d.ts +0 -0
- /package/src/{acvm → private/acvm}/index.ts +0 -0
- /package/src/{avm → public/avm}/bytecode_utils.ts +0 -0
- /package/src/{avm → public/avm}/opcodes/.eslintrc.cjs +0 -0
- /package/src/{avm → public/avm}/opcodes/accrued_substate.ts +0 -0
- /package/src/{avm → public/avm}/opcodes/addressing_mode.ts +0 -0
- /package/src/{avm → public/avm}/opcodes/arithmetic.ts +0 -0
- /package/src/{avm → public/avm}/opcodes/bitwise.ts +0 -0
- /package/src/{avm → public/avm}/opcodes/comparators.ts +0 -0
- /package/src/{avm → public/avm}/opcodes/environment_getters.ts +0 -0
- /package/src/{avm → public/avm}/opcodes/instruction_impl.ts +0 -0
- /package/src/{avm → public/avm}/opcodes/memory.ts +0 -0
- /package/src/{avm → public/avm}/opcodes/storage.ts +0 -0
- /package/src/{avm → public/avm}/serialization/buffer_cursor.ts +0 -0
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DEFAULT_GAS_LIMIT, MAX_L2_GAS_PER_TX_PUBLIC_PORTION } from '@aztec/constants';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
import { Gas, GasFees, GasSettings } from '@aztec/stdlib/gas';
|
|
2
5
|
import {
|
|
3
|
-
BlockHeader,
|
|
4
|
-
DEFAULT_GAS_LIMIT,
|
|
5
|
-
FunctionSelector,
|
|
6
|
-
Gas,
|
|
7
|
-
GasFees,
|
|
8
|
-
GasSettings,
|
|
9
|
-
MAX_L2_GAS_PER_TX_PUBLIC_PORTION,
|
|
10
6
|
PartialPrivateTailPublicInputsForPublic,
|
|
11
7
|
PrivateKernelTailCircuitPublicInputs,
|
|
12
8
|
RollupValidationRequests,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from '@aztec/
|
|
16
|
-
import { type FunctionArtifact } from '@aztec/foundation/abi';
|
|
17
|
-
import { AztecAddress } from '@aztec/foundation/aztec-address';
|
|
18
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
19
|
-
import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest';
|
|
9
|
+
} from '@aztec/stdlib/kernel';
|
|
10
|
+
import { type PublicExecutionRequest, Tx } from '@aztec/stdlib/tx';
|
|
11
|
+
import { BlockHeader, TxConstantData, TxContext } from '@aztec/stdlib/tx';
|
|
20
12
|
|
|
21
13
|
import { strict as assert } from 'assert';
|
|
22
14
|
|
|
23
|
-
export const PUBLIC_DISPATCH_FN_NAME = 'public_dispatch';
|
|
24
|
-
|
|
25
15
|
/**
|
|
26
16
|
* Craft a carrier transaction for some public calls for simulation by PublicTxSimulator.
|
|
27
17
|
*/
|
|
@@ -44,7 +34,7 @@ export async function createTxForPublicCalls(
|
|
|
44
34
|
|
|
45
35
|
const forPublic = PartialPrivateTailPublicInputsForPublic.empty();
|
|
46
36
|
// TODO(#9269): Remove this fake nullifier method as we move away from 1st nullifier as hash.
|
|
47
|
-
forPublic.nonRevertibleAccumulatedData.nullifiers[0] = firstNullifier;
|
|
37
|
+
forPublic.nonRevertibleAccumulatedData.nullifiers[0] = firstNullifier;
|
|
48
38
|
|
|
49
39
|
// We reverse order because the simulator expects it to be like a "stack" of calls to pop from
|
|
50
40
|
for (let i = setupCallRequests.length - 1; i >= 0; i--) {
|
|
@@ -83,28 +73,3 @@ export async function createTxForPublicCalls(
|
|
|
83
73
|
|
|
84
74
|
return tx;
|
|
85
75
|
}
|
|
86
|
-
|
|
87
|
-
export function getAvmTestContractFunctionSelector(functionName: string): Promise<FunctionSelector> {
|
|
88
|
-
const artifact = AvmTestContractArtifact.functions.find(f => f.name === functionName)!;
|
|
89
|
-
assert(!!artifact, `Function ${functionName} not found in AvmTestContractArtifact`);
|
|
90
|
-
const params = artifact.parameters;
|
|
91
|
-
return FunctionSelector.fromNameAndParameters(artifact.name, params);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export function getAvmTestContractArtifact(functionName: string): FunctionArtifact {
|
|
95
|
-
const artifact = AvmTestContractArtifact.functions.find(f => f.name === functionName)!;
|
|
96
|
-
assert(
|
|
97
|
-
!!artifact?.bytecode,
|
|
98
|
-
`No bytecode found for function ${functionName}. Try re-running bootstrap.sh on the repository root.`,
|
|
99
|
-
);
|
|
100
|
-
return artifact;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export function getAvmTestContractBytecode(functionName: string): Buffer {
|
|
104
|
-
const artifact = getAvmTestContractArtifact(functionName);
|
|
105
|
-
return artifact.bytecode;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function getAvmTestContractPublicDispatchBytecode(): Buffer {
|
|
109
|
-
return getAvmTestContractBytecode(PUBLIC_DISPATCH_FN_NAME);
|
|
110
|
-
}
|
package/src/public/index.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '../common/db_interfaces.js';
|
|
2
2
|
export * from './public_tx_simulator.js';
|
|
3
3
|
export { type EnqueuedPublicCallExecutionResult, type PublicFunctionCallResult } from './execution.js';
|
|
4
|
-
export * from './fee_payment.js';
|
|
5
4
|
export * from './public_db_sources.js';
|
|
6
5
|
export { PublicProcessor, PublicProcessorFactory } from './public_processor.js';
|
|
7
6
|
export { SideEffectTrace } from './side_effect_trace.js';
|
|
8
7
|
export { getExecutionRequestsByPhase } from './utils.js';
|
|
8
|
+
export { PublicTxSimulationTester } from './fixtures/index.js';
|
|
9
|
+
export * from './avm/index.js';
|
|
@@ -1,33 +1,28 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
+
import { Timer } from '@aztec/foundation/timer';
|
|
4
|
+
import { ContractClassRegisteredEvent } from '@aztec/protocol-contracts/class-registerer';
|
|
5
|
+
import { ContractInstanceDeployedEvent } from '@aztec/protocol-contracts/instance-deployer';
|
|
6
|
+
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
7
|
+
import { PublicDataWrite } from '@aztec/stdlib/avm';
|
|
8
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
1
9
|
import {
|
|
2
|
-
ContractClassTxL2Logs,
|
|
3
|
-
MerkleTreeId,
|
|
4
|
-
type MerkleTreeReadOperations,
|
|
5
|
-
type MerkleTreeWriteOperations,
|
|
6
|
-
NullifierMembershipWitness,
|
|
7
|
-
type Tx,
|
|
8
|
-
} from '@aztec/circuit-types';
|
|
9
|
-
import { type PublicDBAccessStats } from '@aztec/circuit-types/stats';
|
|
10
|
-
import {
|
|
11
|
-
type AztecAddress,
|
|
12
10
|
type ContractClassPublic,
|
|
13
11
|
type ContractDataSource,
|
|
14
12
|
type ContractInstanceWithAddress,
|
|
15
|
-
Fr,
|
|
16
|
-
type FunctionSelector,
|
|
17
|
-
type L1_TO_L2_MSG_TREE_HEIGHT,
|
|
18
|
-
type NULLIFIER_TREE_HEIGHT,
|
|
19
|
-
type NullifierLeafPreimage,
|
|
20
|
-
type PublicDataTreeLeafPreimage,
|
|
21
13
|
computePublicBytecodeCommitment,
|
|
22
|
-
} from '@aztec/
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
14
|
+
} from '@aztec/stdlib/contract';
|
|
15
|
+
import { computePublicDataTreeLeafSlot } from '@aztec/stdlib/hash';
|
|
16
|
+
import type {
|
|
17
|
+
MerkleTreeCheckpointOperations,
|
|
18
|
+
MerkleTreeReadOperations,
|
|
19
|
+
MerkleTreeWriteOperations,
|
|
20
|
+
} from '@aztec/stdlib/interfaces/server';
|
|
21
|
+
import type { PublicDBAccessStats } from '@aztec/stdlib/stats';
|
|
22
|
+
import { MerkleTreeId, type PublicDataTreeLeafPreimage } from '@aztec/stdlib/trees';
|
|
23
|
+
import type { Tx } from '@aztec/stdlib/tx';
|
|
24
|
+
|
|
25
|
+
import type { PublicContractsDB, PublicStateDB } from '../common/db_interfaces.js';
|
|
31
26
|
|
|
32
27
|
/**
|
|
33
28
|
* Implements the PublicContractsDB using a ContractDataSource.
|
|
@@ -47,10 +42,10 @@ export class ContractsDataSourcePublicDB implements PublicContractsDB {
|
|
|
47
42
|
*/
|
|
48
43
|
public async addNewContracts(tx: Tx): Promise<void> {
|
|
49
44
|
// Extract contract class and instance data from logs and add to cache for this block
|
|
50
|
-
const
|
|
51
|
-
const contractClassRegisteredEvents =
|
|
52
|
-
.filter(log => ContractClassRegisteredEvent.isContractClassRegisteredEvent(log
|
|
53
|
-
.map(log => ContractClassRegisteredEvent.fromLog(log
|
|
45
|
+
const siloedLogs = await tx.filterContractClassLogs(tx.data.getNonEmptyContractClassLogsHashes(), true);
|
|
46
|
+
const contractClassRegisteredEvents = siloedLogs
|
|
47
|
+
.filter(log => ContractClassRegisteredEvent.isContractClassRegisteredEvent(log))
|
|
48
|
+
.map(log => ContractClassRegisteredEvent.fromLog(log));
|
|
54
49
|
await Promise.all(
|
|
55
50
|
contractClassRegisteredEvents.map(async event => {
|
|
56
51
|
this.log.debug(`Adding class ${event.contractClassId.toString()} to public execution contract cache`);
|
|
@@ -76,22 +71,15 @@ export class ContractsDataSourcePublicDB implements PublicContractsDB {
|
|
|
76
71
|
* @param tx - The tx's contracts to be removed
|
|
77
72
|
* @param onlyRevertible - Whether to only remove contracts added from revertible contract class logs
|
|
78
73
|
*/
|
|
79
|
-
public removeNewContracts(tx: Tx, onlyRevertible: boolean = false): Promise<void> {
|
|
74
|
+
public async removeNewContracts(tx: Tx, onlyRevertible: boolean = false): Promise<void> {
|
|
80
75
|
// TODO(@spalladino): Can this inadvertently delete a valid contract added by another tx?
|
|
81
76
|
// Let's say we have two txs adding the same contract on the same block. If the 2nd one reverts,
|
|
82
77
|
// wouldn't that accidentally remove the contract added on the first one?
|
|
83
|
-
const contractClassLogs = onlyRevertible
|
|
84
|
-
? tx.contractClassLogs
|
|
85
|
-
.filterScoped(
|
|
86
|
-
tx.data.forPublic!.revertibleAccumulatedData.contractClassLogsHashes,
|
|
87
|
-
ContractClassTxL2Logs.empty(),
|
|
88
|
-
)
|
|
89
|
-
.unrollLogs()
|
|
90
|
-
: tx.contractClassLogs.unrollLogs();
|
|
78
|
+
const contractClassLogs = onlyRevertible ? await tx.getSplitContractClassLogs(true, true) : tx.contractClassLogs;
|
|
91
79
|
contractClassLogs
|
|
92
|
-
.filter(log => ContractClassRegisteredEvent.isContractClassRegisteredEvent(log
|
|
80
|
+
.filter(log => ContractClassRegisteredEvent.isContractClassRegisteredEvent(log))
|
|
93
81
|
.forEach(log => {
|
|
94
|
-
const event = ContractClassRegisteredEvent.fromLog(log
|
|
82
|
+
const event = ContractClassRegisteredEvent.fromLog(log);
|
|
95
83
|
this.classCache.delete(event.contractClassId.toString());
|
|
96
84
|
});
|
|
97
85
|
|
|
@@ -140,18 +128,6 @@ export class ContractsDataSourcePublicDB implements PublicContractsDB {
|
|
|
140
128
|
return value;
|
|
141
129
|
}
|
|
142
130
|
|
|
143
|
-
async getBytecode(address: AztecAddress, selector: FunctionSelector): Promise<Buffer | undefined> {
|
|
144
|
-
const instance = await this.getContractInstance(address);
|
|
145
|
-
if (!instance) {
|
|
146
|
-
throw new Error(`Contract ${address.toString()} not found`);
|
|
147
|
-
}
|
|
148
|
-
const contractClass = await this.getContractClass(instance.contractClassId);
|
|
149
|
-
if (!contractClass) {
|
|
150
|
-
throw new Error(`Contract class ${instance.contractClassId.toString()} for ${address.toString()} not found`);
|
|
151
|
-
}
|
|
152
|
-
return contractClass.publicFunctions.find(f => f.selector.equals(selector))?.bytecode;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
131
|
public async getDebugFunctionName(address: AztecAddress, selector: FunctionSelector): Promise<string | undefined> {
|
|
156
132
|
return await this.dataSource.getContractFunctionName(address, selector);
|
|
157
133
|
}
|
|
@@ -160,17 +136,34 @@ export class ContractsDataSourcePublicDB implements PublicContractsDB {
|
|
|
160
136
|
/**
|
|
161
137
|
* A public state DB that reads and writes to the world state.
|
|
162
138
|
*/
|
|
163
|
-
export class WorldStateDB extends ContractsDataSourcePublicDB implements PublicStateDB,
|
|
139
|
+
export class WorldStateDB extends ContractsDataSourcePublicDB implements PublicStateDB, MerkleTreeCheckpointOperations {
|
|
164
140
|
private logger = createLogger('simulator:world-state-db');
|
|
165
141
|
|
|
166
|
-
|
|
167
|
-
private publicCheckpointedWriteCache: Map<bigint, Fr> = new Map();
|
|
168
|
-
private publicUncommittedWriteCache: Map<bigint, Fr> = new Map();
|
|
169
|
-
|
|
170
|
-
constructor(private db: MerkleTreeWriteOperations, dataSource: ContractDataSource) {
|
|
142
|
+
constructor(public db: MerkleTreeWriteOperations, dataSource: ContractDataSource) {
|
|
171
143
|
super(dataSource);
|
|
172
144
|
}
|
|
173
145
|
|
|
146
|
+
/**
|
|
147
|
+
* Checkpoints the current fork state
|
|
148
|
+
*/
|
|
149
|
+
public async createCheckpoint() {
|
|
150
|
+
await this.db.createCheckpoint();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Commits the current checkpoint
|
|
155
|
+
*/
|
|
156
|
+
public async commitCheckpoint() {
|
|
157
|
+
await this.db.commitCheckpoint();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Reverts the current checkpoint
|
|
162
|
+
*/
|
|
163
|
+
public async revertCheckpoint() {
|
|
164
|
+
await this.db.revertCheckpoint();
|
|
165
|
+
}
|
|
166
|
+
|
|
174
167
|
public getMerkleInterface(): MerkleTreeWriteOperations {
|
|
175
168
|
return this.db;
|
|
176
169
|
}
|
|
@@ -182,20 +175,6 @@ export class WorldStateDB extends ContractsDataSourcePublicDB implements PublicS
|
|
|
182
175
|
* @returns The current value in the storage slot.
|
|
183
176
|
*/
|
|
184
177
|
public async storageRead(contract: AztecAddress, slot: Fr): Promise<Fr> {
|
|
185
|
-
const leafSlot = (await computePublicDataTreeLeafSlot(contract, slot)).toBigInt();
|
|
186
|
-
const uncommitted = this.publicUncommittedWriteCache.get(leafSlot);
|
|
187
|
-
if (uncommitted !== undefined) {
|
|
188
|
-
return uncommitted;
|
|
189
|
-
}
|
|
190
|
-
const checkpointed = this.publicCheckpointedWriteCache.get(leafSlot);
|
|
191
|
-
if (checkpointed !== undefined) {
|
|
192
|
-
return checkpointed;
|
|
193
|
-
}
|
|
194
|
-
const committed = this.publicCommittedWriteCache.get(leafSlot);
|
|
195
|
-
if (committed !== undefined) {
|
|
196
|
-
return committed;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
178
|
return await readPublicState(this.db, contract, slot);
|
|
200
179
|
}
|
|
201
180
|
|
|
@@ -206,73 +185,10 @@ export class WorldStateDB extends ContractsDataSourcePublicDB implements PublicS
|
|
|
206
185
|
* @param newValue - The new value to store.
|
|
207
186
|
* @returns The slot of the written leaf in the public data tree.
|
|
208
187
|
*/
|
|
209
|
-
public async storageWrite(contract: AztecAddress, slot: Fr, newValue: Fr): Promise<
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
public async getNullifierMembershipWitnessAtLatestBlock(
|
|
216
|
-
nullifier: Fr,
|
|
217
|
-
): Promise<NullifierMembershipWitness | undefined> {
|
|
218
|
-
const timer = new Timer();
|
|
219
|
-
const index = (await this.db.findLeafIndices(MerkleTreeId.NULLIFIER_TREE, [nullifier.toBuffer()]))[0];
|
|
220
|
-
if (!index) {
|
|
221
|
-
return undefined;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
const leafPreimagePromise = this.db.getLeafPreimage(MerkleTreeId.NULLIFIER_TREE, index);
|
|
225
|
-
const siblingPathPromise = this.db.getSiblingPath<typeof NULLIFIER_TREE_HEIGHT>(
|
|
226
|
-
MerkleTreeId.NULLIFIER_TREE,
|
|
227
|
-
BigInt(index),
|
|
228
|
-
);
|
|
229
|
-
|
|
230
|
-
const [leafPreimage, siblingPath] = await Promise.all([leafPreimagePromise, siblingPathPromise]);
|
|
231
|
-
|
|
232
|
-
if (!leafPreimage) {
|
|
233
|
-
return undefined;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
this.logger.debug(`[DB] Fetched nullifier membership`, {
|
|
237
|
-
eventName: 'public-db-access',
|
|
238
|
-
duration: timer.ms(),
|
|
239
|
-
operation: 'get-nullifier-membership-witness-at-latest-block',
|
|
240
|
-
} satisfies PublicDBAccessStats);
|
|
241
|
-
|
|
242
|
-
return new NullifierMembershipWitness(BigInt(index), leafPreimage as NullifierLeafPreimage, siblingPath);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
public async getL1ToL2MembershipWitness(
|
|
246
|
-
contractAddress: AztecAddress,
|
|
247
|
-
messageHash: Fr,
|
|
248
|
-
secret: Fr,
|
|
249
|
-
): Promise<MessageLoadOracleInputs<typeof L1_TO_L2_MSG_TREE_HEIGHT>> {
|
|
250
|
-
const timer = new Timer();
|
|
251
|
-
|
|
252
|
-
const messageIndex = (await this.db.findLeafIndices(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, [messageHash]))[0];
|
|
253
|
-
if (messageIndex === undefined) {
|
|
254
|
-
throw new Error(`No L1 to L2 message found for message hash ${messageHash.toString()}`);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
const messageNullifier = await computeL1ToL2MessageNullifier(contractAddress, messageHash, secret);
|
|
258
|
-
const nullifierIndex = await this.getNullifierIndex(messageNullifier);
|
|
259
|
-
|
|
260
|
-
if (nullifierIndex !== undefined) {
|
|
261
|
-
throw new Error(`No non-nullified L1 to L2 message found for message hash ${messageHash.toString()}`);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
const siblingPath = await this.db.getSiblingPath<typeof L1_TO_L2_MSG_TREE_HEIGHT>(
|
|
265
|
-
MerkleTreeId.L1_TO_L2_MESSAGE_TREE,
|
|
266
|
-
messageIndex,
|
|
267
|
-
);
|
|
268
|
-
|
|
269
|
-
this.logger.debug(`[DB] Fetched L1 to L2 message membership`, {
|
|
270
|
-
eventName: 'public-db-access',
|
|
271
|
-
duration: timer.ms(),
|
|
272
|
-
operation: 'get-l1-to-l2-message-membership-witness',
|
|
273
|
-
} satisfies PublicDBAccessStats);
|
|
274
|
-
|
|
275
|
-
return new MessageLoadOracleInputs<typeof L1_TO_L2_MSG_TREE_HEIGHT>(messageIndex, siblingPath);
|
|
188
|
+
public async storageWrite(contract: AztecAddress, slot: Fr, newValue: Fr): Promise<void> {
|
|
189
|
+
const leafSlot = await computePublicDataTreeLeafSlot(contract, slot);
|
|
190
|
+
const publicDataWrite = new PublicDataWrite(leafSlot, newValue);
|
|
191
|
+
await this.db.sequentialInsert(MerkleTreeId.PUBLIC_DATA_TREE, [publicDataWrite.toBuffer()]);
|
|
276
192
|
}
|
|
277
193
|
|
|
278
194
|
public async getL1ToL2LeafValue(leafIndex: bigint): Promise<Fr | undefined> {
|
|
@@ -286,17 +202,6 @@ export class WorldStateDB extends ContractsDataSourcePublicDB implements PublicS
|
|
|
286
202
|
return leafValue;
|
|
287
203
|
}
|
|
288
204
|
|
|
289
|
-
public async getCommitmentIndex(commitment: Fr): Promise<bigint | undefined> {
|
|
290
|
-
const timer = new Timer();
|
|
291
|
-
const index = (await this.db.findLeafIndices(MerkleTreeId.NOTE_HASH_TREE, [commitment]))[0];
|
|
292
|
-
this.logger.debug(`[DB] Fetched commitment index`, {
|
|
293
|
-
eventName: 'public-db-access',
|
|
294
|
-
duration: timer.ms(),
|
|
295
|
-
operation: 'get-commitment-index',
|
|
296
|
-
} satisfies PublicDBAccessStats);
|
|
297
|
-
return index;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
205
|
public async getCommitmentValue(leafIndex: bigint): Promise<Fr | undefined> {
|
|
301
206
|
const timer = new Timer();
|
|
302
207
|
const leafValue = await this.db.getLeafValue(MerkleTreeId.NOTE_HASH_TREE, leafIndex);
|
|
@@ -318,44 +223,6 @@ export class WorldStateDB extends ContractsDataSourcePublicDB implements PublicS
|
|
|
318
223
|
} satisfies PublicDBAccessStats);
|
|
319
224
|
return index;
|
|
320
225
|
}
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Commit the pending public changes to the DB.
|
|
324
|
-
* @returns Nothing.
|
|
325
|
-
*/
|
|
326
|
-
commit(): Promise<void> {
|
|
327
|
-
for (const [k, v] of this.publicCheckpointedWriteCache) {
|
|
328
|
-
this.publicCommittedWriteCache.set(k, v);
|
|
329
|
-
}
|
|
330
|
-
// uncommitted writes take precedence over checkpointed writes
|
|
331
|
-
// since they are the most recent
|
|
332
|
-
for (const [k, v] of this.publicUncommittedWriteCache) {
|
|
333
|
-
this.publicCommittedWriteCache.set(k, v);
|
|
334
|
-
}
|
|
335
|
-
return this.rollbackToCommit();
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Rollback the pending public changes.
|
|
340
|
-
* @returns Nothing.
|
|
341
|
-
*/
|
|
342
|
-
async rollbackToCommit(): Promise<void> {
|
|
343
|
-
await this.rollbackToCheckpoint();
|
|
344
|
-
this.publicCheckpointedWriteCache = new Map<bigint, Fr>();
|
|
345
|
-
return Promise.resolve();
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
checkpoint(): Promise<void> {
|
|
349
|
-
for (const [k, v] of this.publicUncommittedWriteCache) {
|
|
350
|
-
this.publicCheckpointedWriteCache.set(k, v);
|
|
351
|
-
}
|
|
352
|
-
return this.rollbackToCheckpoint();
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
rollbackToCheckpoint(): Promise<void> {
|
|
356
|
-
this.publicUncommittedWriteCache = new Map<bigint, Fr>();
|
|
357
|
-
return Promise.resolve();
|
|
358
|
-
}
|
|
359
226
|
}
|
|
360
227
|
|
|
361
228
|
export async function readPublicState(db: MerkleTreeReadOperations, contract: AztecAddress, slot: Fr): Promise<Fr> {
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
+
import { MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, NULLIFIER_SUBTREE_HEIGHT } from '@aztec/constants';
|
|
2
|
+
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
3
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
5
|
+
import { type DateProvider, Timer, elapsed, executeTimeout } from '@aztec/foundation/timer';
|
|
6
|
+
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
7
|
+
import { ContractClassRegisteredEvent } from '@aztec/protocol-contracts/class-registerer';
|
|
8
|
+
import { computeFeePayerBalanceLeafSlot, computeFeePayerBalanceStorageSlot } from '@aztec/protocol-contracts/fee-juice';
|
|
9
|
+
import { PublicDataWrite } from '@aztec/stdlib/avm';
|
|
10
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
11
|
+
import type { ContractDataSource } from '@aztec/stdlib/contract';
|
|
12
|
+
import { Gas } from '@aztec/stdlib/gas';
|
|
13
|
+
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
|
|
14
|
+
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
1
15
|
import {
|
|
2
16
|
type FailedTx,
|
|
3
|
-
|
|
4
|
-
type MerkleTreeWriteOperations,
|
|
17
|
+
GlobalVariables,
|
|
5
18
|
NestedProcessReturnValues,
|
|
6
19
|
type ProcessedTx,
|
|
7
20
|
Tx,
|
|
@@ -9,23 +22,7 @@ import {
|
|
|
9
22
|
type TxValidator,
|
|
10
23
|
makeProcessedTxFromPrivateOnlyTx,
|
|
11
24
|
makeProcessedTxFromTxWithPublicCalls,
|
|
12
|
-
} from '@aztec/
|
|
13
|
-
import {
|
|
14
|
-
type AztecAddress,
|
|
15
|
-
type ContractDataSource,
|
|
16
|
-
Fr,
|
|
17
|
-
Gas,
|
|
18
|
-
type GlobalVariables,
|
|
19
|
-
MAX_NOTE_HASHES_PER_TX,
|
|
20
|
-
MAX_NULLIFIERS_PER_TX,
|
|
21
|
-
NULLIFIER_SUBTREE_HEIGHT,
|
|
22
|
-
PublicDataWrite,
|
|
23
|
-
} from '@aztec/circuits.js';
|
|
24
|
-
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
25
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
26
|
-
import { type DateProvider, Timer, elapsed, executeTimeout } from '@aztec/foundation/timer';
|
|
27
|
-
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
28
|
-
import { ContractClassRegisteredEvent } from '@aztec/protocol-contracts/class-registerer';
|
|
25
|
+
} from '@aztec/stdlib/tx';
|
|
29
26
|
import {
|
|
30
27
|
Attributes,
|
|
31
28
|
type TelemetryClient,
|
|
@@ -34,8 +31,8 @@ import {
|
|
|
34
31
|
getTelemetryClient,
|
|
35
32
|
trackSpan,
|
|
36
33
|
} from '@aztec/telemetry-client';
|
|
34
|
+
import { ForkCheckpoint } from '@aztec/world-state/native';
|
|
37
35
|
|
|
38
|
-
import { computeFeePayerBalanceLeafSlot, computeFeePayerBalanceStorageSlot } from './fee_payment.js';
|
|
39
36
|
import { WorldStateDB } from './public_db_sources.js';
|
|
40
37
|
import { PublicProcessorMetrics } from './public_processor_metrics.js';
|
|
41
38
|
import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
@@ -54,13 +51,13 @@ export class PublicProcessorFactory {
|
|
|
54
51
|
* Creates a new instance of a PublicProcessor.
|
|
55
52
|
* @param historicalHeader - The header of a block previous to the one in which the tx is included.
|
|
56
53
|
* @param globalVariables - The global variables for the block being processed.
|
|
57
|
-
* @param
|
|
54
|
+
* @param skipFeeEnforcement - Allows disabling balance checks for fee estimations.
|
|
58
55
|
* @returns A new instance of a PublicProcessor.
|
|
59
56
|
*/
|
|
60
57
|
public create(
|
|
61
58
|
merkleTree: MerkleTreeWriteOperations,
|
|
62
59
|
globalVariables: GlobalVariables,
|
|
63
|
-
|
|
60
|
+
skipFeeEnforcement: boolean,
|
|
64
61
|
): PublicProcessor {
|
|
65
62
|
const worldStateDB = new WorldStateDB(merkleTree, this.contractDataSource);
|
|
66
63
|
const publicTxSimulator = this.createPublicTxSimulator(
|
|
@@ -68,7 +65,7 @@ export class PublicProcessorFactory {
|
|
|
68
65
|
worldStateDB,
|
|
69
66
|
globalVariables,
|
|
70
67
|
/*doMerkleOperations=*/ true,
|
|
71
|
-
|
|
68
|
+
skipFeeEnforcement,
|
|
72
69
|
this.telemetryClient,
|
|
73
70
|
);
|
|
74
71
|
|
|
@@ -87,7 +84,7 @@ export class PublicProcessorFactory {
|
|
|
87
84
|
worldStateDB: WorldStateDB,
|
|
88
85
|
globalVariables: GlobalVariables,
|
|
89
86
|
doMerkleOperations: boolean,
|
|
90
|
-
|
|
87
|
+
skipFeeEnforcement: boolean,
|
|
91
88
|
telemetryClient: TelemetryClient,
|
|
92
89
|
) {
|
|
93
90
|
return new PublicTxSimulator(
|
|
@@ -95,7 +92,7 @@ export class PublicProcessorFactory {
|
|
|
95
92
|
worldStateDB,
|
|
96
93
|
globalVariables,
|
|
97
94
|
doMerkleOperations,
|
|
98
|
-
|
|
95
|
+
skipFeeEnforcement,
|
|
99
96
|
telemetryClient,
|
|
100
97
|
);
|
|
101
98
|
}
|
|
@@ -222,6 +219,11 @@ export class PublicProcessor implements Traceable {
|
|
|
222
219
|
}
|
|
223
220
|
}
|
|
224
221
|
|
|
222
|
+
// We checkpoint the transaction here, then within the try/catch we
|
|
223
|
+
// 1. Revert the checkpoint if the tx fails or needs to be discarded for any reason
|
|
224
|
+
// 2. Commit the transaction in the finally block. Note that by using the ForkCheckpoint lifecycle only the first commit/revert takes effect
|
|
225
|
+
const checkpoint = await ForkCheckpoint.new(this.worldStateDB);
|
|
226
|
+
|
|
225
227
|
try {
|
|
226
228
|
const [processedTx, returnValues] = await this.processTx(tx, deadline);
|
|
227
229
|
|
|
@@ -234,6 +236,8 @@ export class PublicProcessor implements Traceable {
|
|
|
234
236
|
totalSizeInBytes,
|
|
235
237
|
maxBlockSize,
|
|
236
238
|
});
|
|
239
|
+
// Need to revert the checkpoint here and don't go any further
|
|
240
|
+
await checkpoint.revert();
|
|
237
241
|
continue;
|
|
238
242
|
}
|
|
239
243
|
|
|
@@ -249,14 +253,20 @@ export class PublicProcessor implements Traceable {
|
|
|
249
253
|
const reason = result.reason.join(', ');
|
|
250
254
|
this.log.error(`Rejecting tx ${processedTx.hash} after processing: ${reason}.`);
|
|
251
255
|
failed.push({ tx, error: new Error(`Tx failed post-process validation: ${reason}`) });
|
|
256
|
+
// Need to revert the checkpoint here and don't go any further
|
|
257
|
+
await checkpoint.revert();
|
|
252
258
|
continue;
|
|
253
259
|
} else {
|
|
254
260
|
this.log.trace(`Tx ${(await tx.getTxHash()).toString()} is valid post processing.`);
|
|
255
261
|
}
|
|
256
262
|
}
|
|
257
263
|
|
|
258
|
-
|
|
259
|
-
|
|
264
|
+
if (!tx.hasPublicCalls()) {
|
|
265
|
+
// If there are no public calls, perform all tree insertions for side effects from private
|
|
266
|
+
// When there are public calls, the PublicTxSimulator & AVM handle tree insertions.
|
|
267
|
+
await this.doTreeInsertionsForPrivateOnlyTx(processedTx);
|
|
268
|
+
}
|
|
269
|
+
|
|
260
270
|
nullifierCache?.addNullifiers(processedTx.txEffect.nullifiers.map(n => n.toBuffer()));
|
|
261
271
|
result.push(processedTx);
|
|
262
272
|
returns = returns.concat(returnValues);
|
|
@@ -265,6 +275,8 @@ export class PublicProcessor implements Traceable {
|
|
|
265
275
|
totalBlockGas = totalBlockGas.add(processedTx.gasUsed.totalGas);
|
|
266
276
|
totalSizeInBytes += txSize;
|
|
267
277
|
} catch (err: any) {
|
|
278
|
+
// Roll back state to start of TX before proceeding to next TX
|
|
279
|
+
await checkpoint.revert();
|
|
268
280
|
if (err?.name === 'PublicProcessorTimeoutError') {
|
|
269
281
|
this.log.warn(`Stopping tx processing due to timeout.`);
|
|
270
282
|
break;
|
|
@@ -274,6 +286,9 @@ export class PublicProcessor implements Traceable {
|
|
|
274
286
|
|
|
275
287
|
failed.push({ tx, error: err instanceof Error ? err : new Error(errorMessage) });
|
|
276
288
|
returns.push(new NestedProcessReturnValues([]));
|
|
289
|
+
} finally {
|
|
290
|
+
// Base case is we always commit the checkpoint. Using the ForkCheckpoint means this has no effect if the tx was reverted
|
|
291
|
+
await checkpoint.commit();
|
|
277
292
|
}
|
|
278
293
|
}
|
|
279
294
|
|
|
@@ -309,7 +324,7 @@ export class PublicProcessor implements Traceable {
|
|
|
309
324
|
publicDataWriteCount: processedTx.txEffect.publicDataWrites.length,
|
|
310
325
|
nullifierCount: processedTx.txEffect.nullifiers.length,
|
|
311
326
|
noteHashCount: processedTx.txEffect.noteHashes.length,
|
|
312
|
-
contractClassLogCount: processedTx.txEffect.contractClassLogs.
|
|
327
|
+
contractClassLogCount: processedTx.txEffect.contractClassLogs.length,
|
|
313
328
|
publicLogCount: processedTx.txEffect.publicLogs.length,
|
|
314
329
|
privateLogCount: processedTx.txEffect.privateLogs.length,
|
|
315
330
|
l2ToL1MessageCount: processedTx.txEffect.l2ToL1Msgs.length,
|
|
@@ -320,10 +335,11 @@ export class PublicProcessor implements Traceable {
|
|
|
320
335
|
return [processedTx, returnValues ?? []];
|
|
321
336
|
}
|
|
322
337
|
|
|
323
|
-
private async
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
338
|
+
private async doTreeInsertionsForPrivateOnlyTx(
|
|
339
|
+
processedTx: ProcessedTx,
|
|
340
|
+
txValidator?: TxValidator<ProcessedTx>,
|
|
341
|
+
): Promise<void> {
|
|
342
|
+
const treeInsertionStart = process.hrtime.bigint();
|
|
327
343
|
|
|
328
344
|
// Update the state so that the next tx in the loop has the correct .startState
|
|
329
345
|
// NB: before this change, all .startStates were actually incorrect, but the issue was never caught because we either:
|
|
@@ -331,7 +347,6 @@ export class PublicProcessor implements Traceable {
|
|
|
331
347
|
// b) always had a txHandler with the same db passed to it as this.db, which updated the db in buildBaseRollupHints in this loop
|
|
332
348
|
// To see how this ^ happens, move back to one shared db in test_context and run orchestrator_multi_public_functions.test.ts
|
|
333
349
|
// The below is taken from buildBaseRollupHints:
|
|
334
|
-
const treeInsertionStart = process.hrtime.bigint();
|
|
335
350
|
await this.db.appendLeaves(
|
|
336
351
|
MerkleTreeId.NOTE_HASH_TREE,
|
|
337
352
|
padArrayEnd(processedTx.txEffect.noteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX),
|
|
@@ -352,6 +367,7 @@ export class PublicProcessor implements Traceable {
|
|
|
352
367
|
}
|
|
353
368
|
}
|
|
354
369
|
|
|
370
|
+
// The only public data write should be for fee payment
|
|
355
371
|
await this.db.sequentialInsert(
|
|
356
372
|
MerkleTreeId.PUBLIC_DATA_TREE,
|
|
357
373
|
processedTx.txEffect.publicDataWrites.map(x => x.toBuffer()),
|
|
@@ -397,12 +413,7 @@ export class PublicProcessor implements Traceable {
|
|
|
397
413
|
* This is used in private only txs, since for txs with public calls
|
|
398
414
|
* the avm handles the fee payment itself.
|
|
399
415
|
*/
|
|
400
|
-
private async getFeePaymentPublicDataWrite(txFee: Fr, feePayer: AztecAddress): Promise<PublicDataWrite
|
|
401
|
-
if (feePayer.isZero()) {
|
|
402
|
-
this.log.debug(`No one is paying the fee of ${txFee.toBigInt()}`);
|
|
403
|
-
return;
|
|
404
|
-
}
|
|
405
|
-
|
|
416
|
+
private async getFeePaymentPublicDataWrite(txFee: Fr, feePayer: AztecAddress): Promise<PublicDataWrite> {
|
|
406
417
|
const feeJuiceAddress = ProtocolContractAddress.FeeJuice;
|
|
407
418
|
const balanceSlot = await computeFeePayerBalanceStorageSlot(feePayer);
|
|
408
419
|
const leafSlot = await computeFeePayerBalanceLeafSlot(feePayer);
|
|
@@ -439,11 +450,15 @@ export class PublicProcessor implements Traceable {
|
|
|
439
450
|
this.globalVariables,
|
|
440
451
|
);
|
|
441
452
|
|
|
453
|
+
const siloedContractClassLogs = await tx.filterContractClassLogs(
|
|
454
|
+
tx.data.getNonEmptyContractClassLogsHashes(),
|
|
455
|
+
true,
|
|
456
|
+
);
|
|
457
|
+
|
|
442
458
|
this.metrics.recordClassRegistration(
|
|
443
|
-
...
|
|
444
|
-
.
|
|
445
|
-
.
|
|
446
|
-
.map(log => ContractClassRegisteredEvent.fromLog(log.data)),
|
|
459
|
+
...siloedContractClassLogs
|
|
460
|
+
.filter(log => ContractClassRegisteredEvent.isContractClassRegisteredEvent(log))
|
|
461
|
+
.map(log => ContractClassRegisteredEvent.fromLog(log)),
|
|
447
462
|
);
|
|
448
463
|
return [processedTx, undefined];
|
|
449
464
|
}
|
|
@@ -470,11 +485,15 @@ export class PublicProcessor implements Traceable {
|
|
|
470
485
|
}
|
|
471
486
|
});
|
|
472
487
|
|
|
488
|
+
const siloedContractClassLogs = await tx.filterContractClassLogs(
|
|
489
|
+
tx.data.getNonEmptyContractClassLogsHashes(),
|
|
490
|
+
true,
|
|
491
|
+
);
|
|
492
|
+
|
|
473
493
|
this.metrics.recordClassRegistration(
|
|
474
|
-
...
|
|
475
|
-
.
|
|
476
|
-
.
|
|
477
|
-
.map(log => ContractClassRegisteredEvent.fromLog(log.data)),
|
|
494
|
+
...siloedContractClassLogs
|
|
495
|
+
.filter(log => ContractClassRegisteredEvent.isContractClassRegisteredEvent(log))
|
|
496
|
+
.map(log => ContractClassRegisteredEvent.fromLog(log)),
|
|
478
497
|
);
|
|
479
498
|
|
|
480
499
|
const phaseCount = processedPhases.length;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { ContractClassRegisteredEvent } from '@aztec/protocol-contracts/class-registerer';
|
|
2
|
+
import type { Gas } from '@aztec/stdlib/gas';
|
|
3
|
+
import type { TxExecutionPhase } from '@aztec/stdlib/tx';
|
|
4
4
|
import {
|
|
5
5
|
Attributes,
|
|
6
6
|
type Gauge,
|