@aztec/simulator 0.73.0 → 0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/acvm/acvm.js +18 -21
- package/dest/acvm/acvm_types.js +3 -2
- package/dest/acvm/deserialize.js +9 -13
- package/dest/acvm/index.js +0 -1
- package/dest/acvm/oracle/index.js +0 -1
- package/dest/acvm/oracle/oracle.js +42 -23
- package/dest/acvm/oracle/typed_oracle.js +36 -38
- package/dest/acvm/serialize.js +7 -14
- package/dest/avm/avm_context.js +24 -27
- package/dest/avm/avm_contract_call_result.js +12 -7
- package/dest/avm/avm_execution_environment.js +10 -7
- package/dest/avm/avm_gas.js +93 -56
- package/dest/avm/avm_machine_state.js +60 -61
- package/dest/avm/avm_memory_types.js +166 -255
- package/dest/avm/avm_simulator.js +68 -47
- package/dest/avm/avm_tree.js +282 -276
- package/dest/avm/bytecode_utils.js +8 -6
- package/dest/avm/errors.js +46 -63
- package/dest/avm/fixtures/avm_simulation_tester.js +20 -20
- package/dest/avm/fixtures/base_avm_simulation_tester.js +21 -16
- package/dest/avm/fixtures/index.js +49 -22
- package/dest/avm/fixtures/simple_contract_data_source.js +9 -13
- package/dest/avm/index.js +0 -1
- package/dest/avm/journal/index.js +0 -1
- package/dest/avm/journal/journal.js +147 -200
- package/dest/avm/journal/nullifiers.js +43 -46
- package/dest/avm/journal/public_storage.js +73 -87
- package/dest/avm/opcodes/accrued_substate.js +140 -110
- package/dest/avm/opcodes/addressing_mode.js +29 -31
- package/dest/avm/opcodes/arithmetic.js +17 -15
- package/dest/avm/opcodes/bitwise.js +40 -26
- package/dest/avm/opcodes/comparators.js +12 -10
- package/dest/avm/opcodes/contract.js +31 -29
- package/dest/avm/opcodes/control_flow.js +47 -43
- package/dest/avm/opcodes/conversion.js +30 -26
- package/dest/avm/opcodes/ec_add.js +35 -34
- package/dest/avm/opcodes/environment_getters.js +33 -33
- package/dest/avm/opcodes/external_calls.js +83 -74
- package/dest/avm/opcodes/hashing.js +69 -61
- package/dest/avm/opcodes/index.js +0 -1
- package/dest/avm/opcodes/instruction.js +31 -40
- package/dest/avm/opcodes/instruction_impl.js +12 -15
- package/dest/avm/opcodes/memory.js +177 -156
- package/dest/avm/opcodes/misc.js +27 -25
- package/dest/avm/opcodes/multi_scalar_mul.js +43 -41
- package/dest/avm/opcodes/storage.js +28 -25
- package/dest/avm/serialization/buffer_cursor.js +4 -4
- package/dest/avm/serialization/bytecode_serialization.js +292 -89
- package/dest/avm/serialization/instruction_serialization.js +67 -28
- package/dest/avm/test_utils.js +6 -9
- package/dest/client/client_execution_context.js +197 -219
- package/dest/client/db_oracle.js +4 -7
- package/dest/client/execution_note_cache.js +80 -81
- package/dest/client/index.js +0 -1
- package/dest/client/pick_notes.js +27 -30
- package/dest/client/private_execution.js +13 -14
- package/dest/client/simulator.js +44 -48
- package/dest/client/unconstrained_execution.js +8 -11
- package/dest/client/view_data_oracle.js +130 -139
- package/dest/common/debug_fn_name.js +1 -4
- package/dest/common/errors.js +30 -39
- package/dest/common/hashed_values_cache.js +16 -20
- package/dest/common/index.js +0 -1
- package/dest/common/message_load_oracle_inputs.js +7 -7
- package/dest/common/simulation_provider.js +3 -6
- package/dest/common.js +0 -1
- package/dest/providers/acvm_native.js +46 -32
- package/dest/providers/acvm_wasm.js +18 -10
- package/dest/providers/acvm_wasm_with_blobs.js +2 -5
- package/dest/providers/factory.js +5 -5
- package/dest/providers/index.js +0 -1
- package/dest/public/bytecode_errors.js +1 -2
- package/dest/public/db_interfaces.js +1 -2
- package/dest/public/execution.js +2 -4
- package/dest/public/executor_metrics.js +16 -12
- package/dest/public/fee_payment.js +2 -5
- package/dest/public/fixtures/index.js +0 -1
- package/dest/public/fixtures/public_tx_simulation_tester.js +15 -20
- package/dest/public/fixtures/utils.js +11 -14
- package/dest/public/index.js +0 -1
- package/dest/public/public_db_sources.js +79 -87
- package/dest/public/public_processor.js +310 -306
- package/dest/public/public_processor_metrics.js +46 -27
- package/dest/public/public_tx_context.js +97 -118
- package/dest/public/public_tx_simulator.js +299 -314
- package/dest/public/side_effect_errors.js +1 -2
- package/dest/public/side_effect_trace.js +44 -105
- package/dest/public/side_effect_trace_interface.js +1 -2
- package/dest/public/unique_class_ids.js +22 -27
- package/dest/public/utils.js +16 -11
- package/dest/server.js +0 -1
- package/dest/stats/index.js +0 -1
- package/dest/stats/stats.js +1 -2
- package/dest/test/utils.js +5 -4
- package/package.json +11 -11
- package/src/acvm/oracle/typed_oracle.ts +34 -34
- package/src/avm/avm_machine_state.ts +18 -14
- package/src/avm/avm_memory_types.ts +43 -183
- package/src/avm/avm_simulator.ts +37 -11
- package/src/avm/fixtures/avm_simulation_tester.ts +2 -3
- package/src/avm/fixtures/index.ts +39 -0
- package/src/avm/opcodes/accrued_substate.ts +7 -21
- package/src/avm/opcodes/addressing_mode.ts +9 -2
- package/src/avm/opcodes/arithmetic.ts +1 -3
- package/src/avm/opcodes/bitwise.ts +2 -6
- package/src/avm/opcodes/comparators.ts +1 -3
- package/src/avm/opcodes/contract.ts +1 -3
- package/src/avm/opcodes/control_flow.ts +1 -9
- package/src/avm/opcodes/conversion.ts +1 -3
- package/src/avm/opcodes/ec_add.ts +1 -3
- package/src/avm/opcodes/environment_getters.ts +1 -3
- package/src/avm/opcodes/external_calls.ts +3 -6
- package/src/avm/opcodes/hashing.ts +3 -9
- package/src/avm/opcodes/memory.ts +6 -20
- package/src/avm/opcodes/misc.ts +1 -3
- package/src/avm/opcodes/multi_scalar_mul.ts +1 -7
- package/src/avm/opcodes/storage.ts +2 -6
- package/src/client/index.ts +2 -2
- package/src/public/fixtures/public_tx_simulation_tester.ts +2 -3
- package/src/public/side_effect_trace.ts +1 -42
- package/src/public/side_effect_trace_interface.ts +0 -21
- package/dest/acvm/acvm.d.ts +0 -35
- package/dest/acvm/acvm.d.ts.map +0 -1
- package/dest/acvm/acvm_types.d.ts +0 -10
- package/dest/acvm/acvm_types.d.ts.map +0 -1
- package/dest/acvm/deserialize.d.ts +0 -36
- package/dest/acvm/deserialize.d.ts.map +0 -1
- package/dest/acvm/index.d.ts +0 -6
- package/dest/acvm/index.d.ts.map +0 -1
- package/dest/acvm/oracle/index.d.ts +0 -14
- package/dest/acvm/oracle/index.d.ts.map +0 -1
- package/dest/acvm/oracle/oracle.d.ts +0 -49
- package/dest/acvm/oracle/oracle.d.ts.map +0 -1
- package/dest/acvm/oracle/typed_oracle.d.ts +0 -75
- package/dest/acvm/oracle/typed_oracle.d.ts.map +0 -1
- package/dest/acvm/serialize.d.ts +0 -20
- package/dest/acvm/serialize.d.ts.map +0 -1
- package/dest/avm/avm_context.d.ts +0 -39
- package/dest/avm/avm_context.d.ts.map +0 -1
- package/dest/avm/avm_contract_call_result.d.ts +0 -30
- package/dest/avm/avm_contract_call_result.d.ts.map +0 -1
- package/dest/avm/avm_execution_environment.d.ts +0 -21
- package/dest/avm/avm_execution_environment.d.ts.map +0 -1
- package/dest/avm/avm_gas.d.ts +0 -60
- package/dest/avm/avm_gas.d.ts.map +0 -1
- package/dest/avm/avm_machine_state.d.ts +0 -93
- package/dest/avm/avm_machine_state.d.ts.map +0 -1
- package/dest/avm/avm_memory_types.d.ts +0 -310
- package/dest/avm/avm_memory_types.d.ts.map +0 -1
- package/dest/avm/avm_simulator.d.ts +0 -37
- package/dest/avm/avm_simulator.d.ts.map +0 -1
- package/dest/avm/avm_tree.d.ts +0 -281
- package/dest/avm/avm_tree.d.ts.map +0 -1
- package/dest/avm/bytecode_utils.d.ts +0 -5
- package/dest/avm/bytecode_utils.d.ts.map +0 -1
- package/dest/avm/errors.d.ts +0 -121
- package/dest/avm/errors.d.ts.map +0 -1
- package/dest/avm/fixtures/avm_simulation_tester.d.ts +0 -21
- package/dest/avm/fixtures/avm_simulation_tester.d.ts.map +0 -1
- package/dest/avm/fixtures/base_avm_simulation_tester.d.ts +0 -35
- package/dest/avm/fixtures/base_avm_simulation_tester.d.ts.map +0 -1
- package/dest/avm/fixtures/index.d.ts +0 -63
- package/dest/avm/fixtures/index.d.ts.map +0 -1
- package/dest/avm/fixtures/simple_contract_data_source.d.ts +0 -31
- package/dest/avm/fixtures/simple_contract_data_source.d.ts.map +0 -1
- package/dest/avm/index.d.ts +0 -4
- package/dest/avm/index.d.ts.map +0 -1
- package/dest/avm/journal/index.d.ts +0 -2
- package/dest/avm/journal/index.d.ts.map +0 -1
- package/dest/avm/journal/journal.d.ts +0 -176
- package/dest/avm/journal/journal.d.ts.map +0 -1
- package/dest/avm/journal/nullifiers.d.ts +0 -62
- package/dest/avm/journal/nullifiers.d.ts.map +0 -1
- package/dest/avm/journal/public_storage.d.ts +0 -66
- package/dest/avm/journal/public_storage.d.ts.map +0 -1
- package/dest/avm/opcodes/accrued_substate.d.ts +0 -75
- package/dest/avm/opcodes/accrued_substate.d.ts.map +0 -1
- package/dest/avm/opcodes/addressing_mode.d.ts +0 -27
- package/dest/avm/opcodes/addressing_mode.d.ts.map +0 -1
- package/dest/avm/opcodes/arithmetic.d.ts +0 -37
- package/dest/avm/opcodes/arithmetic.d.ts.map +0 -1
- package/dest/avm/opcodes/bitwise.d.ts +0 -50
- package/dest/avm/opcodes/bitwise.d.ts.map +0 -1
- package/dest/avm/opcodes/comparators.d.ts +0 -25
- package/dest/avm/opcodes/comparators.d.ts.map +0 -1
- package/dest/avm/opcodes/contract.d.ts +0 -21
- package/dest/avm/opcodes/contract.d.ts.map +0 -1
- package/dest/avm/opcodes/control_flow.d.ts +0 -41
- package/dest/avm/opcodes/control_flow.d.ts.map +0 -1
- package/dest/avm/opcodes/conversion.d.ts +0 -17
- package/dest/avm/opcodes/conversion.d.ts.map +0 -1
- package/dest/avm/opcodes/ec_add.d.ts +0 -19
- package/dest/avm/opcodes/ec_add.d.ts.map +0 -1
- package/dest/avm/opcodes/environment_getters.d.ts +0 -28
- package/dest/avm/opcodes/environment_getters.d.ts.map +0 -1
- package/dest/avm/opcodes/external_calls.d.ts +0 -50
- package/dest/avm/opcodes/external_calls.d.ts.map +0 -1
- package/dest/avm/opcodes/hashing.d.ts +0 -36
- package/dest/avm/opcodes/hashing.d.ts.map +0 -1
- package/dest/avm/opcodes/index.d.ts +0 -16
- package/dest/avm/opcodes/index.d.ts.map +0 -1
- package/dest/avm/opcodes/instruction.d.ts +0 -70
- package/dest/avm/opcodes/instruction.d.ts.map +0 -1
- package/dest/avm/opcodes/instruction_impl.d.ts +0 -19
- package/dest/avm/opcodes/instruction_impl.d.ts.map +0 -1
- package/dest/avm/opcodes/memory.d.ts +0 -74
- package/dest/avm/opcodes/memory.d.ts.map +0 -1
- package/dest/avm/opcodes/misc.d.ts +0 -17
- package/dest/avm/opcodes/misc.d.ts.map +0 -1
- 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/storage.d.ts +0 -24
- package/dest/avm/opcodes/storage.d.ts.map +0 -1
- package/dest/avm/serialization/buffer_cursor.d.ts +0 -28
- package/dest/avm/serialization/buffer_cursor.d.ts.map +0 -1
- package/dest/avm/serialization/bytecode_serialization.d.ts +0 -21
- package/dest/avm/serialization/bytecode_serialization.d.ts.map +0 -1
- package/dest/avm/serialization/instruction_serialization.d.ts +0 -105
- package/dest/avm/serialization/instruction_serialization.d.ts.map +0 -1
- package/dest/avm/test_utils.d.ts +0 -16
- package/dest/avm/test_utils.d.ts.map +0 -1
- package/dest/client/client_execution_context.d.ts +0 -214
- package/dest/client/client_execution_context.d.ts.map +0 -1
- package/dest/client/db_oracle.d.ts +0 -229
- package/dest/client/db_oracle.d.ts.map +0 -1
- package/dest/client/execution_note_cache.d.ts +0 -93
- package/dest/client/execution_note_cache.d.ts.map +0 -1
- package/dest/client/index.d.ts +0 -15
- package/dest/client/index.d.ts.map +0 -1
- package/dest/client/pick_notes.d.ts +0 -85
- package/dest/client/pick_notes.d.ts.map +0 -1
- package/dest/client/private_execution.d.ts +0 -19
- package/dest/client/private_execution.d.ts.map +0 -1
- package/dest/client/simulator.d.ts +0 -60
- package/dest/client/simulator.d.ts.map +0 -1
- package/dest/client/unconstrained_execution.d.ts +0 -10
- package/dest/client/unconstrained_execution.d.ts.map +0 -1
- package/dest/client/view_data_oracle.d.ts +0 -159
- package/dest/client/view_data_oracle.d.ts.map +0 -1
- package/dest/common/debug_fn_name.d.ts +0 -4
- package/dest/common/debug_fn_name.d.ts.map +0 -1
- package/dest/common/errors.d.ts +0 -54
- package/dest/common/errors.d.ts.map +0 -1
- package/dest/common/hashed_values_cache.d.ts +0 -28
- package/dest/common/hashed_values_cache.d.ts.map +0 -1
- package/dest/common/index.d.ts +0 -3
- package/dest/common/index.d.ts.map +0 -1
- 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/simulation_provider.d.ts +0 -19
- package/dest/common/simulation_provider.d.ts.map +0 -1
- package/dest/common.d.ts +0 -2
- package/dest/common.d.ts.map +0 -1
- package/dest/providers/acvm_native.d.ts +0 -40
- package/dest/providers/acvm_native.d.ts.map +0 -1
- package/dest/providers/acvm_wasm.d.ts +0 -15
- package/dest/providers/acvm_wasm.d.ts.map +0 -1
- package/dest/providers/acvm_wasm_with_blobs.d.ts +0 -19
- package/dest/providers/acvm_wasm_with_blobs.d.ts.map +0 -1
- package/dest/providers/factory.d.ts +0 -12
- package/dest/providers/factory.d.ts.map +0 -1
- package/dest/providers/index.d.ts +0 -5
- package/dest/providers/index.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/db_interfaces.d.ts +0 -105
- package/dest/public/db_interfaces.d.ts.map +0 -1
- package/dest/public/execution.d.ts +0 -102
- package/dest/public/execution.d.ts.map +0 -1
- package/dest/public/executor_metrics.d.ts +0 -13
- package/dest/public/executor_metrics.d.ts.map +0 -1
- package/dest/public/fee_payment.d.ts +0 -11
- package/dest/public/fee_payment.d.ts.map +0 -1
- package/dest/public/fixtures/index.d.ts +0 -3
- package/dest/public/fixtures/index.d.ts.map +0 -1
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts +0 -21
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +0 -1
- package/dest/public/fixtures/utils.d.ts +0 -17
- package/dest/public/fixtures/utils.d.ts.map +0 -1
- package/dest/public/index.d.ts +0 -9
- package/dest/public/index.d.ts.map +0 -1
- package/dest/public/public_db_sources.d.ts +0 -81
- package/dest/public/public_db_sources.d.ts.map +0 -1
- package/dest/public/public_processor.d.ts +0 -72
- package/dest/public/public_processor.d.ts.map +0 -1
- package/dest/public/public_processor_metrics.d.ts +0 -27
- package/dest/public/public_processor_metrics.d.ts.map +0 -1
- package/dest/public/public_tx_context.d.ts +0 -131
- package/dest/public/public_tx_context.d.ts.map +0 -1
- package/dest/public/public_tx_simulator.d.ts +0 -99
- package/dest/public/public_tx_simulator.d.ts.map +0 -1
- package/dest/public/side_effect_errors.d.ts +0 -4
- package/dest/public/side_effect_errors.d.ts.map +0 -1
- package/dest/public/side_effect_trace.d.ts +0 -146
- package/dest/public/side_effect_trace.d.ts.map +0 -1
- package/dest/public/side_effect_trace_interface.d.ts +0 -49
- package/dest/public/side_effect_trace_interface.d.ts.map +0 -1
- package/dest/public/unique_class_ids.d.ts +0 -37
- package/dest/public/unique_class_ids.d.ts.map +0 -1
- package/dest/public/utils.d.ts +0 -5
- package/dest/public/utils.d.ts.map +0 -1
- package/dest/server.d.ts +0 -6
- package/dest/server.d.ts.map +0 -1
- package/dest/stats/index.d.ts +0 -2
- package/dest/stats/index.d.ts.map +0 -1
- package/dest/stats/stats.d.ts +0 -4
- package/dest/stats/stats.d.ts.map +0 -1
- package/dest/test/utils.d.ts +0 -12
- package/dest/test/utils.d.ts.map +0 -1
package/dest/avm/test_utils.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { type ContractClassPublic, type ContractInstanceWithAddress, Fr } from '@aztec/circuits.js';
|
|
4
|
-
import { type WorldStateDB } from '../public/public_db_sources.js';
|
|
5
|
-
import { type PublicSideEffectTraceInterface } from '../public/side_effect_trace_interface.js';
|
|
6
|
-
export declare function mockGetBytecode(worldStateDB: WorldStateDB, bytecode: Buffer): Promise<void>;
|
|
7
|
-
export declare function mockTraceFork(trace: PublicSideEffectTraceInterface, nestedTrace?: PublicSideEffectTraceInterface): void;
|
|
8
|
-
export declare function mockStorageRead(worldStateDB: WorldStateDB, value: Fr): void;
|
|
9
|
-
export declare function mockNoteHashCount(mockedTrace: PublicSideEffectTraceInterface, count: number): void;
|
|
10
|
-
export declare function mockStorageReadWithMap(worldStateDB: WorldStateDB, mockedStorage: Map<bigint, Fr>): void;
|
|
11
|
-
export declare function mockNoteHashExists(worldStateDB: WorldStateDB, _leafIndex: Fr, value?: Fr): void;
|
|
12
|
-
export declare function mockNullifierExists(worldStateDB: WorldStateDB, leafIndex: Fr, _value?: Fr): void;
|
|
13
|
-
export declare function mockL1ToL2MessageExists(worldStateDB: WorldStateDB, leafIndex: Fr, value: Fr, valueAtOtherIndices?: Fr): void;
|
|
14
|
-
export declare function mockGetContractInstance(worldStateDB: WorldStateDB, contractInstance: ContractInstanceWithAddress): void;
|
|
15
|
-
export declare function mockGetContractClass(worldStateDB: WorldStateDB, contractClass: ContractClassPublic): void;
|
|
16
|
-
//# sourceMappingURL=test_utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test_utils.d.ts","sourceRoot":"","sources":["../../src/avm/test_utils.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,EAAE,EAEH,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAE/F,wBAAsB,eAAe,CAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAIjF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,8BAA8B,EAAE,WAAW,CAAC,EAAE,8BAA8B,QAIhH;AAED,wBAAgB,eAAe,CAAC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,QAEpE;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,8BAA8B,EAAE,KAAK,EAAE,MAAM,QAE3F;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,QAIhG;AAED,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,QASxF;AAED,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,QAEzF;AAED,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,EAAE,EACb,KAAK,EAAE,EAAE,EACT,mBAAmB,CAAC,EAAE,EAAE,QAWzB;AAED,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,2BAA2B,QAEhH;AAED,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,QAElG"}
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import { type AuthWitness, type AztecNode, CountedContractClassLog, CountedPublicExecutionRequest, NoteAndSlot, type NoteStatus, type PrivateCallExecutionResult, PublicExecutionRequest, type UnencryptedL2Log } from '@aztec/circuit-types';
|
|
2
|
-
import { type BlockHeader, CallContext, FunctionSelector, type TxContext } from '@aztec/circuits.js';
|
|
3
|
-
import { type FunctionAbi, type NoteSelector } from '@aztec/foundation/abi';
|
|
4
|
-
import { AztecAddress } from '@aztec/foundation/aztec-address';
|
|
5
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
6
|
-
import { type NoteData } from '../acvm/index.js';
|
|
7
|
-
import { type HashedValuesCache } from '../common/hashed_values_cache.js';
|
|
8
|
-
import { type SimulationProvider } from '../server.js';
|
|
9
|
-
import { type DBOracle } from './db_oracle.js';
|
|
10
|
-
import { type ExecutionNoteCache } from './execution_note_cache.js';
|
|
11
|
-
import { ViewDataOracle } from './view_data_oracle.js';
|
|
12
|
-
/**
|
|
13
|
-
* The execution context for a client tx simulation.
|
|
14
|
-
*/
|
|
15
|
-
export declare class ClientExecutionContext extends ViewDataOracle {
|
|
16
|
-
#private;
|
|
17
|
-
private readonly argsHash;
|
|
18
|
-
private readonly txContext;
|
|
19
|
-
private readonly callContext;
|
|
20
|
-
/** Header of a block whose state is used during private execution (not the block the transaction is included in). */
|
|
21
|
-
protected readonly historicalHeader: BlockHeader;
|
|
22
|
-
private readonly executionCache;
|
|
23
|
-
private readonly noteCache;
|
|
24
|
-
private node;
|
|
25
|
-
private provider;
|
|
26
|
-
protected sideEffectCounter: number;
|
|
27
|
-
/**
|
|
28
|
-
* New notes created during this execution.
|
|
29
|
-
* It's possible that a note in this list has been nullified (in the same or other executions) and doesn't exist in the ExecutionNoteCache and the final proof data.
|
|
30
|
-
* But we still include those notes in the execution result because their commitments are still in the public inputs of this execution.
|
|
31
|
-
* This information is only for references (currently used for tests), and is not used for any sort of constrains.
|
|
32
|
-
* Users can also use this to get a clearer idea of what's happened during a simulation.
|
|
33
|
-
*/
|
|
34
|
-
private newNotes;
|
|
35
|
-
/**
|
|
36
|
-
* Notes from previous transactions that are returned to the oracle call `getNotes` during this execution.
|
|
37
|
-
* The mapping maps from the unique siloed note hash to the index for notes created in private executions.
|
|
38
|
-
* It maps from siloed note hash to the index for notes created by public functions.
|
|
39
|
-
*
|
|
40
|
-
* They are not part of the ExecutionNoteCache and being forwarded to nested contexts via `extend()`
|
|
41
|
-
* because these notes are meant to be maintained on a per-call basis
|
|
42
|
-
* They should act as references for the read requests output by an app circuit via public inputs.
|
|
43
|
-
*/
|
|
44
|
-
private noteHashLeafIndexMap;
|
|
45
|
-
private noteHashNullifierCounterMap;
|
|
46
|
-
private contractClassLogs;
|
|
47
|
-
private nestedExecutions;
|
|
48
|
-
private enqueuedPublicFunctionCalls;
|
|
49
|
-
private publicTeardownFunctionCall;
|
|
50
|
-
constructor(argsHash: Fr, txContext: TxContext, callContext: CallContext,
|
|
51
|
-
/** Header of a block whose state is used during private execution (not the block the transaction is included in). */
|
|
52
|
-
historicalHeader: BlockHeader,
|
|
53
|
-
/** List of transient auth witnesses to be used during this simulation */
|
|
54
|
-
authWitnesses: AuthWitness[], executionCache: HashedValuesCache, noteCache: ExecutionNoteCache, db: DBOracle, node: AztecNode, provider: SimulationProvider, sideEffectCounter?: number, log?: import("@aztec/foundation/log").Logger, scopes?: AztecAddress[]);
|
|
55
|
-
/**
|
|
56
|
-
* Writes the function inputs to the initial witness.
|
|
57
|
-
* @param abi - The function ABI.
|
|
58
|
-
* @returns The initial witness.
|
|
59
|
-
*/
|
|
60
|
-
getInitialWitness(abi: FunctionAbi): Map<number, string>;
|
|
61
|
-
/**
|
|
62
|
-
* The KernelProver will use this to fully populate witnesses and provide hints to the kernel circuit
|
|
63
|
-
* regarding which note hash each settled read request corresponds to.
|
|
64
|
-
*/
|
|
65
|
-
getNoteHashLeafIndexMap(): Map<bigint, bigint>;
|
|
66
|
-
/**
|
|
67
|
-
* Get the data for the newly created notes.
|
|
68
|
-
*/
|
|
69
|
-
getNewNotes(): NoteAndSlot[];
|
|
70
|
-
getNoteHashNullifierCounterMap(): Map<number, number>;
|
|
71
|
-
/**
|
|
72
|
-
* Return the contract class logs emitted during this execution.
|
|
73
|
-
*/
|
|
74
|
-
getContractClassLogs(): CountedContractClassLog[];
|
|
75
|
-
/**
|
|
76
|
-
* Return the nested execution results during this execution.
|
|
77
|
-
*/
|
|
78
|
-
getNestedExecutions(): PrivateCallExecutionResult[];
|
|
79
|
-
/**
|
|
80
|
-
* Return the enqueued public function calls during this execution.
|
|
81
|
-
*/
|
|
82
|
-
getEnqueuedPublicFunctionCalls(): CountedPublicExecutionRequest[];
|
|
83
|
-
/**
|
|
84
|
-
* Return the public teardown function call set during this execution.
|
|
85
|
-
*/
|
|
86
|
-
getPublicTeardownFunctionCall(): PublicExecutionRequest;
|
|
87
|
-
/**
|
|
88
|
-
* Store values in the execution cache.
|
|
89
|
-
* @param values - Values to store.
|
|
90
|
-
* @returns The hash of the values.
|
|
91
|
-
*/
|
|
92
|
-
storeInExecutionCache(values: Fr[]): Promise<Fr>;
|
|
93
|
-
/**
|
|
94
|
-
* Gets values from the execution cache.
|
|
95
|
-
* @param hash - Hash of the values.
|
|
96
|
-
* @returns The values.
|
|
97
|
-
*/
|
|
98
|
-
loadFromExecutionCache(hash: Fr): Promise<Fr[]>;
|
|
99
|
-
/**
|
|
100
|
-
* Gets some notes for a storage slot.
|
|
101
|
-
*
|
|
102
|
-
* @remarks
|
|
103
|
-
* Check for pending notes with matching slot.
|
|
104
|
-
* Real notes coming from DB will have a leafIndex which
|
|
105
|
-
* represents their index in the note hash tree.
|
|
106
|
-
*
|
|
107
|
-
* @param storageSlot - The storage slot.
|
|
108
|
-
* @param numSelects - The number of valid selects in selectBy and selectValues.
|
|
109
|
-
* @param selectBy - An array of indices of the fields to selects.
|
|
110
|
-
* @param selectValues - The values to match.
|
|
111
|
-
* @param selectComparators - The comparators to match by.
|
|
112
|
-
* @param sortBy - An array of indices of the fields to sort.
|
|
113
|
-
* @param sortOrder - The order of the corresponding index in sortBy. (1: DESC, 2: ASC, 0: Do nothing)
|
|
114
|
-
* @param limit - The number of notes to retrieve per query.
|
|
115
|
-
* @param offset - The starting index for pagination.
|
|
116
|
-
* @param status - The status of notes to fetch.
|
|
117
|
-
* @returns Array of note data.
|
|
118
|
-
*/
|
|
119
|
-
getNotes(storageSlot: Fr, numSelects: number, selectByIndexes: number[], selectByOffsets: number[], selectByLengths: number[], selectValues: Fr[], selectComparators: number[], sortByIndexes: number[], sortByOffsets: number[], sortByLengths: number[], sortOrder: number[], limit: number, offset: number, status: NoteStatus): Promise<NoteData[]>;
|
|
120
|
-
/**
|
|
121
|
-
* Keep track of the new note created during execution.
|
|
122
|
-
* It can be used in subsequent calls (or transactions when chaining txs is possible).
|
|
123
|
-
* @param contractAddress - The contract address.
|
|
124
|
-
* @param storageSlot - The storage slot.
|
|
125
|
-
* @param noteTypeId - The type ID of the note.
|
|
126
|
-
* @param noteItems - The items to be included in a Note.
|
|
127
|
-
* @param noteHash - A hash of the new note.
|
|
128
|
-
* @returns
|
|
129
|
-
*/
|
|
130
|
-
notifyCreatedNote(storageSlot: Fr, noteTypeId: NoteSelector, noteItems: Fr[], noteHash: Fr, counter: number): void;
|
|
131
|
-
/**
|
|
132
|
-
* Adding a siloed nullifier into the current set of all pending nullifiers created
|
|
133
|
-
* within the current transaction/execution.
|
|
134
|
-
* @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
|
|
135
|
-
* @param noteHash - A hash of the new note.
|
|
136
|
-
*/
|
|
137
|
-
notifyNullifiedNote(innerNullifier: Fr, noteHash: Fr, counter: number): Promise<void>;
|
|
138
|
-
/**
|
|
139
|
-
* Adding a siloed nullifier into the current set of all pending nullifiers created
|
|
140
|
-
* within the current transaction/execution.
|
|
141
|
-
* @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
|
|
142
|
-
* @param noteHash - A hash of the new note.
|
|
143
|
-
*/
|
|
144
|
-
notifyCreatedNullifier(innerNullifier: Fr): Promise<void>;
|
|
145
|
-
/**
|
|
146
|
-
* Emit a contract class unencrypted log.
|
|
147
|
-
* This fn exists because sha hashing the preimage
|
|
148
|
-
* is too large to compile (16,200 fields, 518,400 bytes) => the oracle hashes it.
|
|
149
|
-
* See private_context.nr
|
|
150
|
-
* TODO(#8945): Contract class logs are currently sha hashes. When these are fields, delete this.
|
|
151
|
-
* @param log - The unencrypted log to be emitted.
|
|
152
|
-
*/
|
|
153
|
-
emitContractClassLog(log: UnencryptedL2Log, counter: number): Fr;
|
|
154
|
-
/**
|
|
155
|
-
* Calls a private function as a nested execution.
|
|
156
|
-
* @param targetContractAddress - The address of the contract to call.
|
|
157
|
-
* @param functionSelector - The function selector of the function to call.
|
|
158
|
-
* @param argsHash - The arguments hash to pass to the function.
|
|
159
|
-
* @param sideEffectCounter - The side effect counter at the start of the call.
|
|
160
|
-
* @param isStaticCall - Whether the call is a static call.
|
|
161
|
-
* @returns The execution result.
|
|
162
|
-
*/
|
|
163
|
-
callPrivateFunction(targetContractAddress: AztecAddress, functionSelector: FunctionSelector, argsHash: Fr, sideEffectCounter: number, isStaticCall: boolean): Promise<{
|
|
164
|
-
endSideEffectCounter: Fr;
|
|
165
|
-
returnsHash: Fr;
|
|
166
|
-
}>;
|
|
167
|
-
/**
|
|
168
|
-
* Creates a PublicExecutionRequest object representing the request to call a public function.
|
|
169
|
-
* @param targetContractAddress - The address of the contract to call.
|
|
170
|
-
* @param functionSelector - The function selector of the function to call.
|
|
171
|
-
* @param argsHash - The arguments hash to pass to the function.
|
|
172
|
-
* @param sideEffectCounter - The side effect counter at the start of the call.
|
|
173
|
-
* @param isStaticCall - Whether the call is a static call.
|
|
174
|
-
* @returns The public call stack item with the request information.
|
|
175
|
-
*/
|
|
176
|
-
protected createPublicExecutionRequest(callType: 'enqueued' | 'teardown', targetContractAddress: AztecAddress, functionSelector: FunctionSelector, argsHash: Fr, sideEffectCounter: number, isStaticCall: boolean): Promise<void>;
|
|
177
|
-
/**
|
|
178
|
-
* Creates and enqueues a PublicExecutionRequest object representing the request to call a public function. No function
|
|
179
|
-
* is actually called, since that must happen on the sequencer side. All the fields related to the result
|
|
180
|
-
* of the execution are empty.
|
|
181
|
-
* @param targetContractAddress - The address of the contract to call.
|
|
182
|
-
* @param functionSelector - The function selector of the function to call.
|
|
183
|
-
* @param argsHash - The arguments hash to pass to the function.
|
|
184
|
-
* @param sideEffectCounter - The side effect counter at the start of the call.
|
|
185
|
-
* @param isStaticCall - Whether the call is a static call.
|
|
186
|
-
* @returns The public call stack item with the request information.
|
|
187
|
-
*/
|
|
188
|
-
enqueuePublicFunctionCall(targetContractAddress: AztecAddress, functionSelector: FunctionSelector, argsHash: Fr, sideEffectCounter: number, isStaticCall: boolean): Promise<Fr>;
|
|
189
|
-
/**
|
|
190
|
-
* Creates a PublicExecutionRequest and sets it as the public teardown function. No function
|
|
191
|
-
* is actually called, since that must happen on the sequencer side. All the fields related to the result
|
|
192
|
-
* of the execution are empty.
|
|
193
|
-
* @param targetContractAddress - The address of the contract to call.
|
|
194
|
-
* @param functionSelector - The function selector of the function to call.
|
|
195
|
-
* @param argsHash - The arguments hash to pass to the function.
|
|
196
|
-
* @param sideEffectCounter - The side effect counter at the start of the call.
|
|
197
|
-
* @param isStaticCall - Whether the call is a static call.
|
|
198
|
-
* @returns The public call stack item with the request information.
|
|
199
|
-
*/
|
|
200
|
-
setPublicTeardownFunctionCall(targetContractAddress: AztecAddress, functionSelector: FunctionSelector, argsHash: Fr, sideEffectCounter: number, isStaticCall: boolean): Promise<Fr>;
|
|
201
|
-
notifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter: number): Promise<void>;
|
|
202
|
-
/**
|
|
203
|
-
* Derives the call context for a nested execution.
|
|
204
|
-
* @param targetContractAddress - The address of the contract being called.
|
|
205
|
-
* @param targetArtifact - The artifact of the function being called.
|
|
206
|
-
* @param isStaticCall - Whether the call is a static call.
|
|
207
|
-
* @returns The derived call context.
|
|
208
|
-
*/
|
|
209
|
-
private deriveCallContext;
|
|
210
|
-
getDebugFunctionName(): Promise<string>;
|
|
211
|
-
incrementAppTaggingSecretIndexAsSender(sender: AztecAddress, recipient: AztecAddress): Promise<void>;
|
|
212
|
-
syncNotes(): Promise<void>;
|
|
213
|
-
}
|
|
214
|
-
//# sourceMappingURL=client_execution_context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
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BAAqB,EAAE,YAAY,EACnC,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,EAAE,EACZ,iBAAiB,EAAE,MAAM,EACzB,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,EAAE,CAAC;IAsBd;;;;;;;;;;OAUG;IACmB,6BAA6B,CACjD,qBAAqB,EAAE,YAAY,EACnC,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,EAAE,EACZ,iBAAiB,EAAE,MAAM,EACzB,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,EAAE,CAAC;IAsBE,uCAAuC,CAAC,8BAA8B,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9G;;;;;;OAMG;YACW,iBAAiB;IAaxB,oBAAoB;IAIL,sCAAsC,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY;IAIpF,SAAS;CAYhC"}
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import { type L2Block, type MerkleTreeId, type NoteStatus, type NullifierMembershipWitness, type PublicDataWitness, type TxScopedL2Log } from '@aztec/circuit-types';
|
|
2
|
-
import { type BlockHeader, type CompleteAddress, type ContractInstance, type IndexedTaggingSecret, type KeyValidationRequest } from '@aztec/circuits.js';
|
|
3
|
-
import { type FunctionArtifact, type FunctionSelector } from '@aztec/foundation/abi';
|
|
4
|
-
import { type AztecAddress } from '@aztec/foundation/aztec-address';
|
|
5
|
-
import { type Fr } from '@aztec/foundation/fields';
|
|
6
|
-
import { type NoteData } from '../acvm/index.js';
|
|
7
|
-
import { type CommitmentsDB } from '../public/db_interfaces.js';
|
|
8
|
-
/**
|
|
9
|
-
* Error thrown when a contract is not found in the database.
|
|
10
|
-
*/
|
|
11
|
-
export declare class ContractNotFoundError extends Error {
|
|
12
|
-
constructor(contractAddress: string);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Error thrown when a contract class is not found in the database.
|
|
16
|
-
*/
|
|
17
|
-
export declare class ContractClassNotFoundError extends Error {
|
|
18
|
-
constructor(contractClassId: string);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The database oracle interface.
|
|
22
|
-
*/
|
|
23
|
-
export interface DBOracle extends CommitmentsDB {
|
|
24
|
-
/**
|
|
25
|
-
* Returns a contract instance associated with an address, if available.
|
|
26
|
-
* @param address - Address.
|
|
27
|
-
* @returns A contract instance.
|
|
28
|
-
*/
|
|
29
|
-
getContractInstance(address: AztecAddress): Promise<ContractInstance>;
|
|
30
|
-
/**
|
|
31
|
-
* Retrieve the complete address associated to a given address.
|
|
32
|
-
* @param account - The account address.
|
|
33
|
-
* @returns A complete address associated with the input address.
|
|
34
|
-
* @throws An error if the account is not registered in the database.
|
|
35
|
-
*/
|
|
36
|
-
getCompleteAddress(account: AztecAddress): Promise<CompleteAddress>;
|
|
37
|
-
/**
|
|
38
|
-
* Retrieve the auth witness for a given message hash.
|
|
39
|
-
* @param messageHash - The message hash.
|
|
40
|
-
* @returns A Promise that resolves to an array of field elements representing the auth witness.
|
|
41
|
-
*/
|
|
42
|
-
getAuthWitness(messageHash: Fr): Promise<Fr[]>;
|
|
43
|
-
/**
|
|
44
|
-
* Retrieve a capsule from the capsule dispenser.
|
|
45
|
-
* @returns A promise that resolves to an array of field elements representing the capsule.
|
|
46
|
-
* @remarks A capsule is a "blob" of data that is passed to the contract through an oracle.
|
|
47
|
-
*/
|
|
48
|
-
popCapsule(): Promise<Fr[]>;
|
|
49
|
-
/**
|
|
50
|
-
* Retrieve keys associated with a specific master public key and app address.
|
|
51
|
-
* @param pkMHash - The master public key hash.
|
|
52
|
-
* @returns A Promise that resolves to nullifier keys.
|
|
53
|
-
* @throws If the keys are not registered in the key store.
|
|
54
|
-
*/
|
|
55
|
-
getKeyValidationRequest(pkMHash: Fr, contractAddress: AztecAddress): Promise<KeyValidationRequest>;
|
|
56
|
-
/**
|
|
57
|
-
* Retrieves a set of notes stored in the database for a given contract address and storage slot.
|
|
58
|
-
* The query result is paginated using 'limit' and 'offset' values.
|
|
59
|
-
* Returns an object containing an array of note data.
|
|
60
|
-
*
|
|
61
|
-
* @param contractAddress - The contract address of the notes.
|
|
62
|
-
* @param storageSlot - The storage slot of the notes.
|
|
63
|
-
* @param status - The status of notes to fetch.
|
|
64
|
-
* @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
|
|
65
|
-
* @returns A Promise that resolves to an array of note data.
|
|
66
|
-
*/
|
|
67
|
-
getNotes(contractAddress: AztecAddress, storageSlot: Fr, status: NoteStatus, scopes?: AztecAddress[]): Promise<NoteData[]>;
|
|
68
|
-
/**
|
|
69
|
-
* Retrieve the artifact information of a specific function within a contract.
|
|
70
|
-
* The function is identified by its selector, which is a unique identifier generated from the function signature.
|
|
71
|
-
*
|
|
72
|
-
* @param contractAddress - The contract address.
|
|
73
|
-
* @param selector - The corresponding function selector.
|
|
74
|
-
* @returns A Promise that resolves to a FunctionArtifact object.
|
|
75
|
-
*/
|
|
76
|
-
getFunctionArtifact(contractAddress: AztecAddress, selector: FunctionSelector): Promise<FunctionArtifact>;
|
|
77
|
-
/**
|
|
78
|
-
* Generates a stable function name for debug purposes.
|
|
79
|
-
* @param contractAddress - The contract address.
|
|
80
|
-
* @param selector - The corresponding function selector.
|
|
81
|
-
*/
|
|
82
|
-
getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string>;
|
|
83
|
-
/**
|
|
84
|
-
* Retrieves the artifact of a specified function within a given contract.
|
|
85
|
-
* The function is identified by its name, which is unique within a contract.
|
|
86
|
-
*
|
|
87
|
-
* @param contractAddress - The AztecAddress representing the contract containing the function.
|
|
88
|
-
* @param functionName - The name of the function.
|
|
89
|
-
* @returns The corresponding function's artifact as an object.
|
|
90
|
-
*/
|
|
91
|
-
getFunctionArtifactByName(contractAddress: AztecAddress, functionName: string): Promise<FunctionArtifact | undefined>;
|
|
92
|
-
/**
|
|
93
|
-
* Gets the index of a nullifier in the nullifier tree.
|
|
94
|
-
* @param nullifier - The nullifier.
|
|
95
|
-
* @returns - The index of the nullifier. Undefined if it does not exist in the tree.
|
|
96
|
-
*/
|
|
97
|
-
getNullifierIndex(nullifier: Fr): Promise<bigint | undefined>;
|
|
98
|
-
/**
|
|
99
|
-
* Retrieve the databases view of the Block Header object.
|
|
100
|
-
* This structure is fed into the circuits simulator and is used to prove against certain historical roots.
|
|
101
|
-
*
|
|
102
|
-
* @returns A Promise that resolves to a Header object.
|
|
103
|
-
*/
|
|
104
|
-
getBlockHeader(): Promise<BlockHeader>;
|
|
105
|
-
/**
|
|
106
|
-
* Fetches the index and sibling path of a leaf at a given block from a given tree.
|
|
107
|
-
* @param blockNumber - The block number at which to get the membership witness.
|
|
108
|
-
* @param treeId - Id of the tree to get the sibling path from.
|
|
109
|
-
* @param leafValue - The leaf value
|
|
110
|
-
* @returns The index and sibling path concatenated [index, sibling_path]
|
|
111
|
-
*/
|
|
112
|
-
getMembershipWitness(blockNumber: number, treeId: MerkleTreeId, leafValue: Fr): Promise<Fr[]>;
|
|
113
|
-
/**
|
|
114
|
-
* Returns a nullifier membership witness for a given nullifier at a given block.
|
|
115
|
-
* @param blockNumber - The block number at which to get the index.
|
|
116
|
-
* @param nullifier - Nullifier we try to find witness for.
|
|
117
|
-
* @returns The nullifier membership witness (if found).
|
|
118
|
-
*/
|
|
119
|
-
getNullifierMembershipWitness(blockNumber: number, nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
|
|
120
|
-
/**
|
|
121
|
-
* Returns a low nullifier membership witness for a given nullifier at a given block.
|
|
122
|
-
* @param blockNumber - The block number at which to get the index.
|
|
123
|
-
* @param nullifier - Nullifier we try to find the low nullifier witness for.
|
|
124
|
-
* @returns The low nullifier membership witness (if found).
|
|
125
|
-
* @remarks Low nullifier witness can be used to perform a nullifier non-inclusion proof by leveraging the "linked
|
|
126
|
-
* list structure" of leaves and proving that a lower nullifier is pointing to a bigger next value than the nullifier
|
|
127
|
-
* we are trying to prove non-inclusion for.
|
|
128
|
-
*/
|
|
129
|
-
getLowNullifierMembershipWitness(blockNumber: number, nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
|
|
130
|
-
/**
|
|
131
|
-
* Returns a witness for a given slot of the public data tree at a given block.
|
|
132
|
-
* @param blockNumber - The block number at which to get the witness.
|
|
133
|
-
* @param leafSlot - The slot of the public data in the public data tree.
|
|
134
|
-
*/
|
|
135
|
-
getPublicDataTreeWitness(blockNumber: number, leafSlot: Fr): Promise<PublicDataWitness | undefined>;
|
|
136
|
-
/**
|
|
137
|
-
* Fetch a block corresponding to the given block number.
|
|
138
|
-
* @param blockNumber - The block number of a block to fetch.
|
|
139
|
-
* @returns - The block corresponding to the given block number. Undefined if it does not exist.
|
|
140
|
-
*/
|
|
141
|
-
getBlock(blockNumber: number): Promise<L2Block | undefined>;
|
|
142
|
-
/**
|
|
143
|
-
* Fetches the current block number.
|
|
144
|
-
* @returns The block number.
|
|
145
|
-
*/
|
|
146
|
-
getBlockNumber(): Promise<number>;
|
|
147
|
-
/**
|
|
148
|
-
* Returns the tagging secret for a given sender and recipient pair. For this to work, the ivsk_m of the sender must be known.
|
|
149
|
-
* Includes the next index to be used used for tagging with this secret.
|
|
150
|
-
* @param contractAddress - The contract address to silo the secret for
|
|
151
|
-
* @param sender - The address sending the note
|
|
152
|
-
* @param recipient - The address receiving the note
|
|
153
|
-
* @returns A tagging secret that can be used to tag notes.
|
|
154
|
-
*/
|
|
155
|
-
getIndexedTaggingSecretAsSender(contractAddress: AztecAddress, sender: AztecAddress, recipient: AztecAddress): Promise<IndexedTaggingSecret>;
|
|
156
|
-
/**
|
|
157
|
-
* Increments the tagging secret for a given sender and recipient pair. For this to work, the ivsk_m of the sender must be known.
|
|
158
|
-
* @param contractAddress - The contract address to silo the secret for
|
|
159
|
-
* @param sender - The address sending the note
|
|
160
|
-
* @param recipient - The address receiving the note
|
|
161
|
-
*/
|
|
162
|
-
incrementAppTaggingSecretIndexAsSender(contractAddress: AztecAddress, sender: AztecAddress, recipient: AztecAddress): Promise<void>;
|
|
163
|
-
/**
|
|
164
|
-
* Synchronizes the logs tagged with the recipient's address and all the senders in the address book.
|
|
165
|
-
* Returns the unsynched logs and updates the indexes of the secrets used to tag them until there are no more logs to sync.
|
|
166
|
-
* @param contractAddress - The address of the contract that the logs are tagged for
|
|
167
|
-
* @param recipient - The address of the recipient
|
|
168
|
-
* @returns A list of encrypted logs tagged with the recipient's address
|
|
169
|
-
*/
|
|
170
|
-
syncTaggedLogs(contractAddress: AztecAddress, maxBlockNumber: number, scopes?: AztecAddress[]): Promise<Map<string, TxScopedL2Log[]>>;
|
|
171
|
-
/**
|
|
172
|
-
* Processes the tagged logs returned by syncTaggedLogs by decrypting them and storing them in the database.
|
|
173
|
-
* @param logs - The logs to process.
|
|
174
|
-
* @param recipient - The recipient of the logs.
|
|
175
|
-
*/
|
|
176
|
-
processTaggedLogs(logs: TxScopedL2Log[], recipient: AztecAddress): Promise<void>;
|
|
177
|
-
/**
|
|
178
|
-
* Delivers the preimage and metadata of a committed note so that it can be later requested via the `getNotes`
|
|
179
|
-
* oracle.
|
|
180
|
-
*
|
|
181
|
-
* @param contractAddress - The address of the contract that created the note (i.e. the siloing contract)
|
|
182
|
-
* @param storageSlot - The storage slot of the note - used for indexing in `getNotes`
|
|
183
|
-
* @param nonce - The nonce of the note used by the kernel to compute the unique note hash
|
|
184
|
-
* @param content - The note's content: this is the primary item to return in `getNotes`
|
|
185
|
-
* @param noteHash - The non-unique non-siloed note hash
|
|
186
|
-
* @param nullifier - The inner (non-siloed) note nullifier
|
|
187
|
-
* @param txHash - The transaction in which the note was added to the note hash tree
|
|
188
|
-
* @param recipient - The account that discovered the note
|
|
189
|
-
*/
|
|
190
|
-
deliverNote(contractAddress: AztecAddress, storageSlot: Fr, nonce: Fr, content: Fr[], noteHash: Fr, nullifier: Fr, txHash: Fr, recipient: AztecAddress): Promise<void>;
|
|
191
|
-
/**
|
|
192
|
-
* Removes all of a contract's notes that have been nullified from the note database.
|
|
193
|
-
*/
|
|
194
|
-
removeNullifiedNotes(contractAddress: AztecAddress): Promise<void>;
|
|
195
|
-
/**
|
|
196
|
-
* Stores arbitrary information in a per-contract non-volatile database, which can later be retrieved with `dbLoad`.
|
|
197
|
-
* * If data was already stored at this slot, it is overwrriten.
|
|
198
|
-
* @param contractAddress - The contract address to scope the data under.
|
|
199
|
-
* @param slot - The slot in the database in which to store the value. Slots need not be contiguous.
|
|
200
|
-
* @param values - The data to store.
|
|
201
|
-
*/
|
|
202
|
-
dbStore(contractAddress: AztecAddress, slot: Fr, values: Fr[]): Promise<void>;
|
|
203
|
-
/**
|
|
204
|
-
* Returns data previously stored via `dbStore` in the per-contract non-volatile database.
|
|
205
|
-
* @param contractAddress - The contract address under which the data is scoped.
|
|
206
|
-
* @param slot - The slot in the database to read.
|
|
207
|
-
* @returns The stored data or `null` if no data is stored under the slot.
|
|
208
|
-
*/
|
|
209
|
-
dbLoad(contractAddress: AztecAddress, slot: Fr): Promise<Fr[] | null>;
|
|
210
|
-
/**
|
|
211
|
-
* Deletes data in the per-contract non-volatile database. Does nothing if no data was present.
|
|
212
|
-
* @param contractAddress - The contract address under which the data is scoped.
|
|
213
|
-
* @param slot - The slot in the database to delete.
|
|
214
|
-
*/
|
|
215
|
-
dbDelete(contractAddress: AztecAddress, slot: Fr): Promise<void>;
|
|
216
|
-
/**
|
|
217
|
-
* Copies a number of contiguous entries in the per-contract non-volatile database. This allows for efficient data
|
|
218
|
-
* structures by avoiding repeated calls to `dbLoad` and `dbStore`.
|
|
219
|
-
* Supports overlapping source and destination regions (which will result in the overlapped source values being
|
|
220
|
-
* overwritten). All copied slots must exist in the database (i.e. have been stored and not deleted)
|
|
221
|
-
*
|
|
222
|
-
* @param contractAddress - The contract address under which the data is scoped.
|
|
223
|
-
* @param srcSlot - The first slot to copy from.
|
|
224
|
-
* @param dstSlot - The first slot to copy to.
|
|
225
|
-
* @param numEntries - The number of entries to copy.
|
|
226
|
-
*/
|
|
227
|
-
dbCopy(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number): Promise<void>;
|
|
228
|
-
}
|
|
229
|
-
//# sourceMappingURL=db_oracle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"db_oracle.d.ts","sourceRoot":"","sources":["../../src/client/db_oracle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,0BAA0B,EAC/B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,eAAe,EAAE,MAAM;CAGpC;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,eAAe,EAAE,MAAM;CAGpC;AAED;;GAEG;AACH,MAAM,WAAW,QAAS,SAAQ,aAAa;IAC7C;;;;OAIG;IACH,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEtE;;;;;OAKG;IACH,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAEpE;;;;OAIG;IACH,cAAc,CAAC,WAAW,EAAE,EAAE,G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ACV,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;OAEG;IACH,oBAAoB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnE;;;;;;OAMG;IACH,OAAO,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9E;;;;;OAKG;IACH,MAAM,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IAEtE;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjE;;;;;;;;;;OAUG;IACH,MAAM,CAAC,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpG"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { type AztecAddress } from '@aztec/foundation/aztec-address';
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import { type NoteData } from '../acvm/index.js';
|
|
4
|
-
interface PendingNote {
|
|
5
|
-
note: NoteData;
|
|
6
|
-
counter: number;
|
|
7
|
-
noteHashForConsumption: Fr;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Data that's accessible by all the function calls in an execution.
|
|
11
|
-
*/
|
|
12
|
-
export declare class ExecutionNoteCache {
|
|
13
|
-
#private;
|
|
14
|
-
private readonly txRequestHash;
|
|
15
|
-
/**
|
|
16
|
-
* New notes created in this transaction.
|
|
17
|
-
* They are pushed to this array in the same order as they are emitted.
|
|
18
|
-
*/
|
|
19
|
-
private notes;
|
|
20
|
-
/**
|
|
21
|
-
* This mapping maps from a contract address to the notes in the contract.
|
|
22
|
-
*/
|
|
23
|
-
private noteMap;
|
|
24
|
-
/**
|
|
25
|
-
* This maps from a contract address to the nullifiers emitted from the contract.
|
|
26
|
-
* The note which is nullified might be new or not (i.e., was generated in a previous transaction).
|
|
27
|
-
* Note that their value (bigint representation) is used because Frs cannot be looked up in Sets.
|
|
28
|
-
*/
|
|
29
|
-
private nullifierMap;
|
|
30
|
-
/**
|
|
31
|
-
* All nullifiers emitted in this transaction.
|
|
32
|
-
*/
|
|
33
|
-
private allNullifiers;
|
|
34
|
-
private minRevertibleSideEffectCounter;
|
|
35
|
-
private inRevertiblePhase;
|
|
36
|
-
/**
|
|
37
|
-
* We don't need to use the tx request hash for nonces if another non revertible nullifier is emitted.
|
|
38
|
-
* In that case we disable injecting the tx request hash as a nullifier.
|
|
39
|
-
*/
|
|
40
|
-
private usedTxRequestHashForNonces;
|
|
41
|
-
constructor(txRequestHash: Fr);
|
|
42
|
-
/**
|
|
43
|
-
* Enters the revertible phase of the transaction.
|
|
44
|
-
* @param minRevertibleSideEffectCounter - The counter at which the transaction enters the revertible phase.
|
|
45
|
-
*/
|
|
46
|
-
setMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter: number): Promise<void>;
|
|
47
|
-
finish(): {
|
|
48
|
-
usedTxRequestHashForNonces: boolean;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Add a new note to cache.
|
|
52
|
-
* @param note - New note created during execution.
|
|
53
|
-
*/
|
|
54
|
-
addNewNote(note: NoteData, counter: number): void;
|
|
55
|
-
/**
|
|
56
|
-
* Add a nullifier to cache. It could be for a db note or a new note created during execution.
|
|
57
|
-
* @param contractAddress - Contract address of the note.
|
|
58
|
-
* @param innerNullifier - Inner nullifier of the note.
|
|
59
|
-
* @param noteHash - A hash of the note. If this value equals 0, it means the note being nullified is from a previous
|
|
60
|
-
* transaction (and thus not a new note).
|
|
61
|
-
*/
|
|
62
|
-
nullifyNote(contractAddress: AztecAddress, innerNullifier: Fr, noteHash: Fr): Promise<number | undefined>;
|
|
63
|
-
/**
|
|
64
|
-
* Adds a nullifier to the cache. Note cache needs to track all nullifiers to decide which nullifier to use for note siloing.
|
|
65
|
-
* @param contractAddress - Contract address that emitted the nullifier.
|
|
66
|
-
* @param innerNullifier
|
|
67
|
-
*/
|
|
68
|
-
nullifierCreated(contractAddress: AztecAddress, innerNullifier: Fr): Promise<void>;
|
|
69
|
-
/**
|
|
70
|
-
* Return notes created up to current point in execution.
|
|
71
|
-
* If a nullifier for a note in this list is emitted, the note will be deleted.
|
|
72
|
-
* @param contractAddress - Contract address of the notes.
|
|
73
|
-
* @param storageSlot - Storage slot of the notes.
|
|
74
|
-
**/
|
|
75
|
-
getNotes(contractAddress: AztecAddress, storageSlot: Fr): NoteData[];
|
|
76
|
-
/**
|
|
77
|
-
* Check if a note exists in the newNotes array.
|
|
78
|
-
* @param contractAddress - Contract address of the note.
|
|
79
|
-
* @param storageSlot - Storage slot of the note.
|
|
80
|
-
* @param noteHash - A hash of the note.
|
|
81
|
-
**/
|
|
82
|
-
checkNoteExists(contractAddress: AztecAddress, noteHash: Fr): boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Return all nullifiers emitted from a contract.
|
|
85
|
-
* @param contractAddress - Address of the contract.
|
|
86
|
-
*/
|
|
87
|
-
getNullifiers(contractAddress: AztecAddress): Set<bigint>;
|
|
88
|
-
getAllNotes(): PendingNote[];
|
|
89
|
-
getAllNullifiers(): Fr[];
|
|
90
|
-
recordNullifier(contractAddress: AztecAddress, siloedNullifier: Fr): void;
|
|
91
|
-
}
|
|
92
|
-
export {};
|
|
93
|
-
//# sourceMappingURL=execution_note_cache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execution_note_cache.d.ts","sourceRoot":"","sources":["../../src/client/execution_note_cache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;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gB,IAAI,EAAE,EAAE;IAIxB,eAAe,CAAC,eAAe,EAAE,YAAY,EAAE,eAAe,EAAE,EAAE;CAMnE"}
|
package/dest/client/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { AcirSimulator } from './simulator.js';
|
|
2
|
-
export { DBOracle, ContractClassNotFoundError, ContractNotFoundError } from './db_oracle.js';
|
|
3
|
-
export * from './pick_notes.js';
|
|
4
|
-
export { ExecutionNoteCache } from './execution_note_cache.js';
|
|
5
|
-
export { extractPrivateCircuitPublicInputs } from './private_execution.js';
|
|
6
|
-
export { witnessMapToFields } from '../acvm/deserialize.js';
|
|
7
|
-
export { toACVMWitness } from '../acvm/serialize.js';
|
|
8
|
-
export { extractCallStack } from '../acvm/acvm.js';
|
|
9
|
-
export { WASMSimulator } from '../providers/acvm_wasm.js';
|
|
10
|
-
export { NoteData, TypedOracle } from '../acvm/oracle/typed_oracle.js';
|
|
11
|
-
export { Oracle } from '../acvm/oracle/oracle.js';
|
|
12
|
-
export { type SimulationProvider } from '../common/simulation_provider.js';
|
|
13
|
-
export { MessageLoadOracleInputs } from '../common/message_load_oracle_inputs.js';
|
|
14
|
-
export { resolveAssertionMessageFromRevertData, resolveOpcodeLocations } from '../common/errors.js';
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC7F,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,qCAAqC,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|