@aztec/simulator 0.74.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 +18 -17
- package/dest/avm/fixtures/base_avm_simulation_tester.js +21 -16
- package/dest/avm/fixtures/index.js +27 -26
- 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 +13 -17
- 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 -71
- 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/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/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 -67
- 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 -126
- package/dest/public/side_effect_trace.d.ts.map +0 -1
- package/dest/public/side_effect_trace_interface.d.ts +0 -32
- 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/errors.d.ts
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { type FailingFunction, type NoirCallStack } from '@aztec/circuit-types';
|
|
2
|
-
import { type AztecAddress, type Fr, type Point } from '@aztec/circuits.js';
|
|
3
|
-
import { ExecutionError } from '../common/errors.js';
|
|
4
|
-
import { type AvmContext } from './avm_context.js';
|
|
5
|
-
/**
|
|
6
|
-
* Avm-specific errors should derive from this
|
|
7
|
-
*/
|
|
8
|
-
export declare abstract class AvmExecutionError extends Error {
|
|
9
|
-
constructor(message: string);
|
|
10
|
-
}
|
|
11
|
-
export declare class NoBytecodeForContractError extends AvmExecutionError {
|
|
12
|
-
constructor(contractAddress: AztecAddress);
|
|
13
|
-
}
|
|
14
|
-
export declare class ArithmeticError extends AvmExecutionError {
|
|
15
|
-
constructor(message: string);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Error is thrown when the program counter goes to an invalid location.
|
|
19
|
-
* There is no instruction at the provided pc
|
|
20
|
-
*/
|
|
21
|
-
export declare class InvalidProgramCounterError extends AvmExecutionError {
|
|
22
|
-
constructor(pc: number, max: number);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Error is thrown when the program counter points to a byte
|
|
26
|
-
* of an invalid opcode.
|
|
27
|
-
*/
|
|
28
|
-
export declare class InvalidOpcodeError extends AvmExecutionError {
|
|
29
|
-
constructor(str: string);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Error is thrown during parsing.
|
|
33
|
-
*/
|
|
34
|
-
export declare class AvmParsingError extends AvmExecutionError {
|
|
35
|
-
constructor(str: string);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Error is thrown when the tag has an invalid value.
|
|
39
|
-
*/
|
|
40
|
-
export declare class InvalidTagValueError extends AvmExecutionError {
|
|
41
|
-
constructor(tagValue: number);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Error thrown during an instruction's execution (during its execute()).
|
|
45
|
-
*/
|
|
46
|
-
export declare class InstructionExecutionError extends AvmExecutionError {
|
|
47
|
-
constructor(message: string);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Error thrown on failed AVM memory tag check.
|
|
51
|
-
*/
|
|
52
|
-
export declare class TagCheckError extends AvmExecutionError {
|
|
53
|
-
static forOffset(offset: number, gotTag: string, expectedTag: string): TagCheckError;
|
|
54
|
-
static forTag(gotTag: string, expectedTag: string): TagCheckError;
|
|
55
|
-
constructor(message: string);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Error is thrown when a relative memory address resolved to an offset which
|
|
59
|
-
* is out of range, i.e, greater than maxUint32.
|
|
60
|
-
*/
|
|
61
|
-
export declare class RelativeAddressOutOfRangeError extends AvmExecutionError {
|
|
62
|
-
constructor(baseAddr: number, relOffset: number);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Error is thrown when a memory slice contains addresses which are
|
|
66
|
-
* out of range, i.e, greater than maxUint32.
|
|
67
|
-
*/
|
|
68
|
-
export declare class MemorySliceOutOfRangeError extends AvmExecutionError {
|
|
69
|
-
constructor(baseAddr: number, size: number);
|
|
70
|
-
}
|
|
71
|
-
/** Error thrown when out of gas. */
|
|
72
|
-
export declare class OutOfGasError extends AvmExecutionError {
|
|
73
|
-
constructor(dimensions: string[]);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Error is thrown when the supplied points length is not a multiple of 3. Specific for MSM opcode.
|
|
77
|
-
*/
|
|
78
|
-
export declare class MSMPointsLengthError extends AvmExecutionError {
|
|
79
|
-
constructor(pointsReadLength: number);
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Error is thrown when one of the supplied points does not lie on the Grumpkin curve. Specific for MSM opcode.
|
|
83
|
-
*/
|
|
84
|
-
export declare class MSMPointNotOnCurveError extends AvmExecutionError {
|
|
85
|
-
constructor(point: Point);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Error is thrown when some inputs of ToRadixBE are not valid.
|
|
89
|
-
*/
|
|
90
|
-
export declare class InvalidToRadixInputsError extends AvmExecutionError {
|
|
91
|
-
constructor(errorString: string);
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Error is thrown when a static call attempts to alter some state
|
|
95
|
-
*/
|
|
96
|
-
export declare class StaticCallAlterationError extends InstructionExecutionError {
|
|
97
|
-
constructor();
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Meaningfully named alias for ExecutionError when used in the context of the AVM.
|
|
101
|
-
* Maintains a recursive structure reflecting the AVM's external callstack/errorstack, where
|
|
102
|
-
* options.cause is the error that caused this error (if this is not the root-cause itself).
|
|
103
|
-
*/
|
|
104
|
-
export declare class AvmRevertReason extends ExecutionError {
|
|
105
|
-
constructor(message: string, failingFunction: FailingFunction, noirCallStack: NoirCallStack, options?: ErrorOptions);
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Create a "revert reason" error for an exceptional halt.
|
|
109
|
-
*
|
|
110
|
-
* @param haltingError - the lower-level error causing the exceptional halt
|
|
111
|
-
* @param context - the context of the AVM execution used to extract the failingFunction and noirCallStack
|
|
112
|
-
*/
|
|
113
|
-
export declare function revertReasonFromExceptionalHalt(haltingError: AvmExecutionError, context: AvmContext): Promise<AvmRevertReason>;
|
|
114
|
-
/**
|
|
115
|
-
* Create a "revert reason" error for an explicit revert (a root cause).
|
|
116
|
-
*
|
|
117
|
-
* @param revertData - output data of the explicit REVERT instruction
|
|
118
|
-
* @param context - the context of the AVM execution used to extract the failingFunction and noirCallStack
|
|
119
|
-
*/
|
|
120
|
-
export declare function revertReasonFromExplicitRevert(revertData: Fr[], context: AvmContext): Promise<AvmRevertReason>;
|
|
121
|
-
//# sourceMappingURL=errors.d.ts.map
|
package/dest/avm/errors.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/avm/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM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qBAAa,oBAAqB,SAAQ,iBAAiB;gBAC7C,gBAAgB,EAAE,MAAM;CAIrC;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,iBAAiB;gBAChD,KAAK,EAAE,KAAK;CAIzB;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,iBAAiB;gBAClD,WAAW,EAAE,MAAM;CAIhC;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,yBAAyB;;CAKvE;AAED;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,cAAc;gBACrC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,YAAY;CAGpH;AA8BD;;;;;GAKG;AACH,wBAAsB,+BAA+B,CACnD,YAAY,EAAE,iBAAiB,EAC/B,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,eAAe,CAAC,CAE1B;AAED;;;;;GAKG;AACH,wBAAsB,8BAA8B,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,eAAe,CAAC,CAEpH"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type MerkleTreeWriteOperations } from '@aztec/circuit-types';
|
|
2
|
-
import { type AztecAddress } from '@aztec/foundation/aztec-address';
|
|
3
|
-
import { type AvmContractCallResult } from '../../avm/avm_contract_call_result.js';
|
|
4
|
-
import { AvmPersistableStateManager } from '../../server.js';
|
|
5
|
-
import { BaseAvmSimulationTester } from './base_avm_simulation_tester.js';
|
|
6
|
-
import { SimpleContractDataSource } from './simple_contract_data_source.js';
|
|
7
|
-
/**
|
|
8
|
-
* A test class that extends the BaseAvmSimulationTester to enable real-app testing of the core AvmSimulator.
|
|
9
|
-
* It provides an interface for simulating one top-level call at a time and maintains state between
|
|
10
|
-
* subsequent top-level calls.
|
|
11
|
-
*/
|
|
12
|
-
export declare class AvmSimulationTester extends BaseAvmSimulationTester {
|
|
13
|
-
private stateManager;
|
|
14
|
-
constructor(contractDataSource: SimpleContractDataSource, merkleTrees: MerkleTreeWriteOperations, skipContractDeployments: boolean | undefined, stateManager: AvmPersistableStateManager);
|
|
15
|
-
static create(skipContractDeployments?: boolean): Promise<AvmSimulationTester>;
|
|
16
|
-
/**
|
|
17
|
-
* Simulate a top-level contract call.
|
|
18
|
-
*/
|
|
19
|
-
simulateCall(sender: AztecAddress, address: AztecAddress, fnName: string, args: any[], isStaticCall?: boolean): Promise<AvmContractCallResult>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=avm_simulation_tester.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"avm_simulation_tester.d.ts","sourceRoot":"","sources":["../../../src/avm/fixtures/avm_simulation_tester.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAGtE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAIpE,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAUnF,OAAO,EAAE,0BAA0B,EAAgB,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAK5E;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,uBAAuB;IAK5D,OAAO,CAAC,YAAY;gBAHpB,kBAAkB,EAAE,wBAAwB,EAC5C,WAAW,EAAE,yBAAyB,EACtC,uBAAuB,qBAAQ,EACvB,YAAY,EAAE,0BAA0B;WAKrC,MAAM,CAAC,uBAAuB,UAAQ,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAiBlF;;OAEG;IACG,YAAY,CAChB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,GAAG,EAAE,EACX,YAAY,UAAQ,GACnB,OAAO,CAAC,qBAAqB,CAAC;CAsClC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { type MerkleTreeWriteOperations } from '@aztec/circuit-types';
|
|
2
|
-
import { type ContractClassPublic, type ContractInstanceWithAddress } from '@aztec/circuits.js';
|
|
3
|
-
import { type ContractArtifact } from '@aztec/foundation/abi';
|
|
4
|
-
import { AztecAddress } from '@aztec/foundation/aztec-address';
|
|
5
|
-
import { type Fr } from '@aztec/foundation/fields';
|
|
6
|
-
import { type SimpleContractDataSource } from './simple_contract_data_source.js';
|
|
7
|
-
/**
|
|
8
|
-
* An abstract test class that enables tests of real apps in the AVM without requiring e2e tests.
|
|
9
|
-
* It enables this by letting us (1) perform pseudo-contract-deployments (and registrations)
|
|
10
|
-
* that trigger merkle tree operations and (2) maintain a contract data source to store
|
|
11
|
-
* and retrieve contract classes and instances.
|
|
12
|
-
*
|
|
13
|
-
* This class is meant to be extended when writing tests for a specific simulation interface.
|
|
14
|
-
* For example, has been extended for testing of the core AvmSimulator, and again for the PublicTxSimulator,
|
|
15
|
-
* both of which benefit from such pseudo-deployments by populating merkle trees and a contract data source
|
|
16
|
-
* with contract information.
|
|
17
|
-
*/
|
|
18
|
-
export declare abstract class BaseAvmSimulationTester {
|
|
19
|
-
contractDataSource: SimpleContractDataSource;
|
|
20
|
-
merkleTrees: MerkleTreeWriteOperations;
|
|
21
|
-
private skipContractDeployments;
|
|
22
|
-
logger: import("@aztec/foundation/log").Logger;
|
|
23
|
-
constructor(contractDataSource: SimpleContractDataSource, merkleTrees: MerkleTreeWriteOperations, skipContractDeployments?: boolean);
|
|
24
|
-
setFeePayerBalance(feePayer: AztecAddress, balance: Fr): Promise<void>;
|
|
25
|
-
setPublicStorage(address: AztecAddress, slot: Fr, value: Fr): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Derive the contract class and instance with some seed.
|
|
28
|
-
* Add both to the contract data source along with the contract artifact.
|
|
29
|
-
*/
|
|
30
|
-
registerAndDeployContract(constructorArgs: any[], deployer: AztecAddress, contractArtifact: ContractArtifact, seed?: number): Promise<ContractInstanceWithAddress>;
|
|
31
|
-
getFirstContractInstance(): ContractInstanceWithAddress;
|
|
32
|
-
addContractClass(contractClass: ContractClassPublic, contractArtifact: ContractArtifact): Promise<void>;
|
|
33
|
-
addContractInstance(contractInstance: ContractInstanceWithAddress): Promise<void>;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=base_avm_simulation_tester.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base_avm_simulation_tester.d.ts","sourceRoot":"","sources":["../../../src/avm/fixtures/base_avm_simulation_tester.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAKjC,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAMnD,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAEjF;;;;;;;;;;GAUG;AACH,8BAAsB,uBAAuB;IAIlC,kBAAkB,EAAE,wBAAwB;IAC5C,WAAW,EAAE,yBAAyB;IAE7C,OAAO,CAAC,uBAAuB;IAN1B,MAAM,yCAAyC;gBAG7C,kBAAkB,EAAE,wBAAwB,EAC5C,WAAW,EAAE,yBAAyB,EAErC,uBAAuB,UAAQ;IAGnC,kBAAkB,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE;IAMtD,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE;IAOjE;;;OAGG;IACG,yBAAyB,CAC7B,eAAe,EAAE,GAAG,EAAE,EACtB,QAAQ,EAAE,YAAY,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,SAAI,GACP,OAAO,CAAC,2BAA2B,CAAC;IAmBvC,wBAAwB,IAAI,2BAA2B;IAIvD,gBAAgB,CAAC,aAAa,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAMjG,mBAAmB,CAAC,gBAAgB,EAAE,2BAA2B;CAUxE"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { GlobalVariables } from '@aztec/circuits.js';
|
|
4
|
-
import { type ContractArtifact, type FunctionArtifact, FunctionSelector } from '@aztec/foundation/abi';
|
|
5
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
6
|
-
import { type PublicSideEffectTraceInterface } from '../../public/side_effect_trace_interface.js';
|
|
7
|
-
import { type WorldStateDB } from '../../server.js';
|
|
8
|
-
import { AvmContext } from '../avm_context.js';
|
|
9
|
-
import { AvmExecutionEnvironment } from '../avm_execution_environment.js';
|
|
10
|
-
import { AvmMachineState } from '../avm_machine_state.js';
|
|
11
|
-
import { Field, Uint8, Uint32, Uint64 } from '../avm_memory_types.js';
|
|
12
|
-
import { type AvmEphemeralForest } from '../avm_tree.js';
|
|
13
|
-
import { type AvmRevertReason } from '../errors.js';
|
|
14
|
-
import { AvmPersistableStateManager } from '../journal/journal.js';
|
|
15
|
-
import { NullifierManager } from '../journal/nullifiers.js';
|
|
16
|
-
import { PublicStorage } from '../journal/public_storage.js';
|
|
17
|
-
export declare const PUBLIC_DISPATCH_FN_NAME = "public_dispatch";
|
|
18
|
-
/**
|
|
19
|
-
* Create a new AVM context with default values.
|
|
20
|
-
*/
|
|
21
|
-
export declare function initContext(overrides?: {
|
|
22
|
-
persistableState?: AvmPersistableStateManager;
|
|
23
|
-
env?: AvmExecutionEnvironment;
|
|
24
|
-
machineState?: AvmMachineState;
|
|
25
|
-
}): AvmContext;
|
|
26
|
-
/** Creates an empty state manager with mocked host storage. */
|
|
27
|
-
export declare function initPersistableStateManager(overrides?: {
|
|
28
|
-
worldStateDB?: WorldStateDB;
|
|
29
|
-
trace?: PublicSideEffectTraceInterface;
|
|
30
|
-
publicStorage?: PublicStorage;
|
|
31
|
-
nullifiers?: NullifierManager;
|
|
32
|
-
doMerkleOperations?: boolean;
|
|
33
|
-
merkleTrees?: AvmEphemeralForest;
|
|
34
|
-
firstNullifier?: Fr;
|
|
35
|
-
}): AvmPersistableStateManager;
|
|
36
|
-
/**
|
|
37
|
-
* Create an empty instance of the Execution Environment where all values are zero, unless overridden in the overrides object
|
|
38
|
-
*/
|
|
39
|
-
export declare function initExecutionEnvironment(overrides?: Partial<AvmExecutionEnvironment>): AvmExecutionEnvironment;
|
|
40
|
-
/**
|
|
41
|
-
* Create an empty instance of the Execution Environment where all values are zero, unless overridden in the overrides object
|
|
42
|
-
*/
|
|
43
|
-
export declare function initGlobalVariables(overrides?: Partial<GlobalVariables>): GlobalVariables;
|
|
44
|
-
/**
|
|
45
|
-
* Create an empty instance of the Machine State where all values are set to a large enough amount, unless overridden in the overrides object
|
|
46
|
-
*/
|
|
47
|
-
export declare function initMachineState(overrides?: Partial<AvmMachineState>): AvmMachineState;
|
|
48
|
-
/**
|
|
49
|
-
* Create a new object with all the same properties as the original, except for the ones in the overrides object.
|
|
50
|
-
*/
|
|
51
|
-
export declare function allSameExcept(original: any, overrides: any): any;
|
|
52
|
-
export declare function randomMemoryBytes(length: number): Uint8[];
|
|
53
|
-
export declare function randomMemoryUint32s(length: number): Uint32[];
|
|
54
|
-
export declare function randomMemoryUint64s(length: number): Uint64[];
|
|
55
|
-
export declare function randomMemoryFields(length: number): Field[];
|
|
56
|
-
export declare function getFunctionSelector(functionName: string, contractArtifact: ContractArtifact): Promise<FunctionSelector>;
|
|
57
|
-
export declare function getContractFunctionArtifact(functionName: string, contractArtifact: ContractArtifact): FunctionArtifact | undefined;
|
|
58
|
-
export declare function resolveContractAssertionMessage(functionName: string, revertReason: AvmRevertReason, output: Fr[], contractArtifact: ContractArtifact): string | undefined;
|
|
59
|
-
export declare function getAvmTestContractFunctionSelector(functionName: string): Promise<FunctionSelector>;
|
|
60
|
-
export declare function getAvmGadgetsTestContractFunctionSelector(functionName: string): Promise<FunctionSelector>;
|
|
61
|
-
export declare function getAvmTestContractArtifact(functionName: string): FunctionArtifact;
|
|
62
|
-
export declare function getAvmGadgetsTestContractArtifact(functionName: string): FunctionArtifact;
|
|
63
|
-
export declare function getAvmTestContractBytecode(functionName: string): Buffer;
|
|
64
|
-
export declare function getAvmGadgetsTestContractBytecode(functionName: string): Buffer;
|
|
65
|
-
export declare function resolveAvmTestContractAssertionMessage(functionName: string, revertReason: AvmRevertReason, output: Fr[]): string | undefined;
|
|
66
|
-
export declare function resolveAvmGadgetsTestContractAssertionMessage(functionName: string, revertReason: AvmRevertReason, output: Fr[]): string | undefined;
|
|
67
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/avm/fixtures/index.ts"],"names":[],"mappings":";;AACA,OAAO,EAAW,eAAe,EAAoC,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGvG,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAS9C,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAClG,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE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MAAM,GAAG,MAAM,CAG9E;AAED,wBAAgB,sCAAsC,CACpD,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,eAAe,EAC7B,MAAM,EAAE,EAAE,EAAE,GACX,MAAM,GAAG,SAAS,CAEpB;AAED,wBAAgB,6CAA6C,CAC3D,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,eAAe,EAC7B,MAAM,EAAE,EAAE,EAAE,GACX,MAAM,GAAG,SAAS,CAWpB"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type ContractClassPublic, type ContractDataSource, type ContractInstanceWithAddress, type FunctionSelector, type PublicFunction } from '@aztec/circuits.js';
|
|
2
|
-
import { type ContractArtifact } from '@aztec/foundation/abi';
|
|
3
|
-
import { type AztecAddress } from '@aztec/foundation/aztec-address';
|
|
4
|
-
import { type Fr } from '@aztec/foundation/fields';
|
|
5
|
-
/**
|
|
6
|
-
* This class is used during public/avm testing to function as a database of
|
|
7
|
-
* contract contract classes and instances. Tests can populate it with classes
|
|
8
|
-
* and instances and then probe it via the ContractDataSource interface.
|
|
9
|
-
*
|
|
10
|
-
* This class does not include any real merkle trees & merkle operations.
|
|
11
|
-
*/
|
|
12
|
-
export declare class SimpleContractDataSource implements ContractDataSource {
|
|
13
|
-
logger: import("@aztec/foundation/log").Logger;
|
|
14
|
-
private contractClasses;
|
|
15
|
-
private contractInstances;
|
|
16
|
-
private contractArtifacts;
|
|
17
|
-
getFirstContractInstance(): ContractInstanceWithAddress;
|
|
18
|
-
addContractArtifact(classId: Fr, artifact: ContractArtifact): void;
|
|
19
|
-
getPublicFunction(_address: AztecAddress, _selector: FunctionSelector): Promise<PublicFunction>;
|
|
20
|
-
getBlockNumber(): Promise<number>;
|
|
21
|
-
getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
|
|
22
|
-
getBytecodeCommitment(id: Fr): Promise<Fr | undefined>;
|
|
23
|
-
getContract(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
|
|
24
|
-
getContractClassIds(): Promise<Fr[]>;
|
|
25
|
-
getContractArtifact(address: AztecAddress): Promise<ContractArtifact | undefined>;
|
|
26
|
-
getContractFunctionName(_address: AztecAddress, _selector: FunctionSelector): Promise<string>;
|
|
27
|
-
registerContractFunctionSignatures(_address: AztecAddress, _signatures: string[]): Promise<void>;
|
|
28
|
-
addContractClass(contractClass: ContractClassPublic): Promise<void>;
|
|
29
|
-
addContractInstance(contractInstance: ContractInstanceWithAddress): Promise<void>;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=simple_contract_data_source.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simple_contract_data_source.d.ts","sourceRoot":"","sources":["../../../src/avm/fixtures/simple_contract_data_source.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAEpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAKnD;;;;;;GAMG;AACH,qBAAa,wBAAyB,YAAW,kBAAkB;IAC1D,MAAM,yCAA+C;IAG5D,OAAO,CAAC,eAAe,CAA+C;IAEtE,OAAO,CAAC,iBAAiB,CAAuD;IAEhF,OAAO,CAAC,iBAAiB,CAA4C;IAIrE,wBAAwB,IAAI,2BAA2B;IAIvD,mBAAmB,CAAC,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAMlE,iBAAiB,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC;IAI/F,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;IAIjC,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAI5D,qBAAqB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC;IAK5D,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC;IAIpF,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;IAI9B,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAWvF,uBAAuB,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;IAI7F,kCAAkC,CAAC,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhG,gBAAgB,CAAC,aAAa,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKnE,mBAAmB,CAAC,gBAAgB,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;CAIlF"}
|
package/dest/avm/index.d.ts
DELETED
package/dest/avm/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/avm/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/avm/journal/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { AztecAddress, type PublicCallRequest, SerializableContractInstance } from '@aztec/circuits.js';
|
|
4
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
5
|
-
import { type WorldStateDB } from '../../public/public_db_sources.js';
|
|
6
|
-
import { type PublicSideEffectTraceInterface } from '../../public/side_effect_trace_interface.js';
|
|
7
|
-
import { type AvmExecutionEnvironment } from '../avm_execution_environment.js';
|
|
8
|
-
import { AvmEphemeralForest } from '../avm_tree.js';
|
|
9
|
-
import { NullifierManager } from './nullifiers.js';
|
|
10
|
-
import { PublicStorage } from './public_storage.js';
|
|
11
|
-
/**
|
|
12
|
-
* A class to manage persistable AVM state for contract calls.
|
|
13
|
-
* Maintains a cache of the current world state,
|
|
14
|
-
* a trace of all side effects.
|
|
15
|
-
*
|
|
16
|
-
* The simulator should make any world state / tree queries through this object.
|
|
17
|
-
*
|
|
18
|
-
* Manages merging of successful/reverted child state into current state.
|
|
19
|
-
*/
|
|
20
|
-
export declare class AvmPersistableStateManager {
|
|
21
|
-
/** Reference to node storage */
|
|
22
|
-
private readonly worldStateDB;
|
|
23
|
-
/** Side effect trace */
|
|
24
|
-
readonly trace: PublicSideEffectTraceInterface;
|
|
25
|
-
/** Public storage, including cached writes */
|
|
26
|
-
private readonly publicStorage;
|
|
27
|
-
/** Nullifier set, including cached/recently-emitted nullifiers */
|
|
28
|
-
private readonly nullifiers;
|
|
29
|
-
private readonly doMerkleOperations;
|
|
30
|
-
/** Ephmeral forest for merkle tree operations */
|
|
31
|
-
merkleTrees: AvmEphemeralForest;
|
|
32
|
-
readonly firstNullifier: Fr;
|
|
33
|
-
private readonly log;
|
|
34
|
-
/** Make sure a forked state is never merged twice. */
|
|
35
|
-
private alreadyMergedIntoParent;
|
|
36
|
-
constructor(
|
|
37
|
-
/** Reference to node storage */
|
|
38
|
-
worldStateDB: WorldStateDB,
|
|
39
|
-
/** Side effect trace */
|
|
40
|
-
trace: PublicSideEffectTraceInterface,
|
|
41
|
-
/** Public storage, including cached writes */
|
|
42
|
-
publicStorage: PublicStorage,
|
|
43
|
-
/** Nullifier set, including cached/recently-emitted nullifiers */
|
|
44
|
-
nullifiers: NullifierManager, doMerkleOperations: boolean,
|
|
45
|
-
/** Ephmeral forest for merkle tree operations */
|
|
46
|
-
merkleTrees: AvmEphemeralForest, firstNullifier: Fr);
|
|
47
|
-
/**
|
|
48
|
-
* Create a new state manager
|
|
49
|
-
*/
|
|
50
|
-
static create(worldStateDB: WorldStateDB, trace: PublicSideEffectTraceInterface, doMerkleOperations: boolean | undefined, firstNullifier: Fr): Promise<AvmPersistableStateManager>;
|
|
51
|
-
/**
|
|
52
|
-
* Create a new state manager forked from this one
|
|
53
|
-
*/
|
|
54
|
-
fork(): AvmPersistableStateManager;
|
|
55
|
-
/**
|
|
56
|
-
* Accept forked world state modifications & traced side effects / hints
|
|
57
|
-
*/
|
|
58
|
-
merge(forkedState: AvmPersistableStateManager): void;
|
|
59
|
-
/**
|
|
60
|
-
* Reject forked world state modifications & traced side effects, keep traced hints
|
|
61
|
-
*/
|
|
62
|
-
reject(forkedState: AvmPersistableStateManager): void;
|
|
63
|
-
private _merge;
|
|
64
|
-
/**
|
|
65
|
-
* Write to public storage, journal/trace the write.
|
|
66
|
-
*
|
|
67
|
-
* @param contractAddress - the address of the contract whose storage is being written to
|
|
68
|
-
* @param slot - the slot in the contract's storage being written to
|
|
69
|
-
* @param value - the value being written to the slot
|
|
70
|
-
*/
|
|
71
|
-
writeStorage(contractAddress: AztecAddress, slot: Fr, value: Fr, protocolWrite?: boolean): Promise<void>;
|
|
72
|
-
/**
|
|
73
|
-
* Read from public storage, trace the read.
|
|
74
|
-
*
|
|
75
|
-
* @param contractAddress - the address of the contract whose storage is being read from
|
|
76
|
-
* @param slot - the slot in the contract's storage being read from
|
|
77
|
-
* @returns the latest value written to slot, or 0 if never written to before
|
|
78
|
-
*/
|
|
79
|
-
readStorage(contractAddress: AztecAddress, slot: Fr): Promise<Fr>;
|
|
80
|
-
/**
|
|
81
|
-
* Read from public storage, don't trace the read.
|
|
82
|
-
*
|
|
83
|
-
* @param contractAddress - the address of the contract whose storage is being read from
|
|
84
|
-
* @param slot - the slot in the contract's storage being read from
|
|
85
|
-
* @returns the latest value written to slot, or 0 if never written to before
|
|
86
|
-
*/
|
|
87
|
-
peekStorage(contractAddress: AztecAddress, slot: Fr): Promise<Fr>;
|
|
88
|
-
/**
|
|
89
|
-
* Check if a note hash exists at the given leaf index, trace the check.
|
|
90
|
-
*
|
|
91
|
-
* @param contractAddress - the address of the contract whose storage is being read from
|
|
92
|
-
* @param noteHash - the unsiloed note hash being checked
|
|
93
|
-
* @param leafIndex - the leaf index being checked
|
|
94
|
-
* @returns true if the note hash exists at the given leaf index, false otherwise
|
|
95
|
-
*/
|
|
96
|
-
checkNoteHashExists(contractAddress: AztecAddress, noteHash: Fr, leafIndex: Fr): Promise<boolean>;
|
|
97
|
-
/**
|
|
98
|
-
* Write a raw note hash, silo it and make it unique, then trace the write.
|
|
99
|
-
* @param noteHash - the unsiloed note hash to write
|
|
100
|
-
*/
|
|
101
|
-
writeNoteHash(contractAddress: AztecAddress, noteHash: Fr): Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
* Write a note hash, make it unique, trace the write.
|
|
104
|
-
* @param noteHash - the non unique note hash to write
|
|
105
|
-
*/
|
|
106
|
-
writeSiloedNoteHash(noteHash: Fr): Promise<void>;
|
|
107
|
-
/**
|
|
108
|
-
* Write a note hash, trace the write.
|
|
109
|
-
* @param noteHash - the siloed unique hash to write
|
|
110
|
-
*/
|
|
111
|
-
writeUniqueNoteHash(noteHash: Fr): Promise<void>;
|
|
112
|
-
/**
|
|
113
|
-
* Check if a nullifier exists, trace the check.
|
|
114
|
-
* @param contractAddress - address of the contract that the nullifier is associated with
|
|
115
|
-
* @param nullifier - the unsiloed nullifier to check
|
|
116
|
-
* @returns exists - whether the nullifier exists in the nullifier set
|
|
117
|
-
*/
|
|
118
|
-
checkNullifierExists(contractAddress: AztecAddress, nullifier: Fr): Promise<boolean>;
|
|
119
|
-
/**
|
|
120
|
-
* Helper to get membership information for a siloed nullifier when checking its existence.
|
|
121
|
-
* Optionally trace the nullifier check.
|
|
122
|
-
*
|
|
123
|
-
* @param siloedNullifier - the siloed nullifier to get membership information for
|
|
124
|
-
* @returns
|
|
125
|
-
* - exists - whether the nullifier exists in the nullifier set
|
|
126
|
-
* - leafOrLowLeafPreimage - the preimage of the nullifier leaf or its low-leaf if it doesn't exist
|
|
127
|
-
* - leafOrLowLeafIndex - the leaf index of the nullifier leaf or its low-leaf if it doesn't exist
|
|
128
|
-
* - leafOrLowLeafPath - the sibling path of the nullifier leaf or its low-leaf if it doesn't exist
|
|
129
|
-
*/
|
|
130
|
-
private getNullifierMembership;
|
|
131
|
-
/**
|
|
132
|
-
* Write a nullifier to the nullifier set, trace the write.
|
|
133
|
-
* @param contractAddress - address of the contract that the nullifier is associated with
|
|
134
|
-
* @param nullifier - the unsiloed nullifier to write
|
|
135
|
-
*/
|
|
136
|
-
writeNullifier(contractAddress: AztecAddress, nullifier: Fr): Promise<void>;
|
|
137
|
-
/**
|
|
138
|
-
* Write a nullifier to the nullifier set, trace the write.
|
|
139
|
-
* @param siloedNullifier - the siloed nullifier to write
|
|
140
|
-
*/
|
|
141
|
-
writeSiloedNullifier(siloedNullifier: Fr): Promise<void>;
|
|
142
|
-
writeSiloedNullifiersFromPrivate(siloedNullifiers: Fr[]): Promise<void>;
|
|
143
|
-
/**
|
|
144
|
-
* Check if an L1 to L2 message exists, trace the check.
|
|
145
|
-
* @param msgHash - the message hash to check existence of
|
|
146
|
-
* @param msgLeafIndex - the message leaf index to use in the check
|
|
147
|
-
* @returns exists - whether the message exists in the L1 to L2 Messages tree
|
|
148
|
-
*/
|
|
149
|
-
checkL1ToL2MessageExists(contractAddress: AztecAddress, msgHash: Fr, msgLeafIndex: Fr): Promise<boolean>;
|
|
150
|
-
/**
|
|
151
|
-
* Write an L2 to L1 message.
|
|
152
|
-
* @param contractAddress - L2 contract address that created this message
|
|
153
|
-
* @param recipient - L1 contract address to send the message to.
|
|
154
|
-
* @param content - Message content.
|
|
155
|
-
*/
|
|
156
|
-
writeL2ToL1Message(contractAddress: AztecAddress, recipient: Fr, content: Fr): void;
|
|
157
|
-
/**
|
|
158
|
-
* Write a public log
|
|
159
|
-
* @param contractAddress - address of the contract that emitted the log
|
|
160
|
-
* @param log - log contents
|
|
161
|
-
*/
|
|
162
|
-
writePublicLog(contractAddress: AztecAddress, log: Fr[]): void;
|
|
163
|
-
/**
|
|
164
|
-
* Get a contract instance.
|
|
165
|
-
* @param contractAddress - address of the contract instance to retrieve.
|
|
166
|
-
* @returns the contract instance or undefined if it does not exist.
|
|
167
|
-
*/
|
|
168
|
-
getContractInstance(contractAddress: AztecAddress): Promise<SerializableContractInstance | undefined>;
|
|
169
|
-
/**
|
|
170
|
-
* Get a contract's bytecode from the contracts DB, also trace the contract class and instance
|
|
171
|
-
*/
|
|
172
|
-
getBytecode(contractAddress: AztecAddress): Promise<Buffer | undefined>;
|
|
173
|
-
traceEnqueuedCall(publicCallRequest: PublicCallRequest, calldata: Fr[], reverted: boolean): void;
|
|
174
|
-
getPublicFunctionDebugName(avmEnvironment: AvmExecutionEnvironment): Promise<string>;
|
|
175
|
-
}
|
|
176
|
-
//# sourceMappingURL=journal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"journal.d.ts","sourceRoot":"","sources":["../../../src/avm/journal/journal.ts"],"names":[],"mappings":";;AACA,OAAO,EACL,YAAY,EAMZ,KAAK,iBAAiB,EAItB,4BAA4B,EAC7B,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAO9C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAClG,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MA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AAO,EAAE,EAAE;IAKnF;;;;OAIG;IACI,cAAc,CAAC,eAAe,EAAE,YAAY,EAAE,GAAG,EAAE,EAAE,EAAE;IAK9D;;;;OAIG;IACU,mBAAmB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,4BAA4B,GAAG,SAAS,CAAC;IA8DlH;;OAEG;IACU,WAAW,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IA0F7E,iBAAiB,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO;IAInF,0BAA0B,CAAC,cAAc,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC;CAGlG"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { CommitmentsDB } from '../../server.js';
|
|
3
|
-
/**
|
|
4
|
-
* A class to manage new nullifier staging and existence checks during a contract call's AVM simulation.
|
|
5
|
-
* Maintains a siloed nullifier cache, and ensures that existence checks fall back to the correct source.
|
|
6
|
-
* When a contract call completes, its cached nullifier set can be merged into its parent's.
|
|
7
|
-
*/
|
|
8
|
-
export declare class NullifierManager {
|
|
9
|
-
/** Reference to node storage. Checked on parent cache-miss. */
|
|
10
|
-
private readonly hostNullifiers;
|
|
11
|
-
/** Cache of siloed nullifiers. */
|
|
12
|
-
private cache;
|
|
13
|
-
/** Parent nullifier manager to fall back on */
|
|
14
|
-
private readonly parent?;
|
|
15
|
-
constructor(
|
|
16
|
-
/** Reference to node storage. Checked on parent cache-miss. */
|
|
17
|
-
hostNullifiers: CommitmentsDB,
|
|
18
|
-
/** Cache of siloed nullifiers. */
|
|
19
|
-
cache?: Set<bigint>,
|
|
20
|
-
/** Parent nullifier manager to fall back on */
|
|
21
|
-
parent?: NullifierManager | undefined);
|
|
22
|
-
/**
|
|
23
|
-
* Create a new nullifiers manager forked from this one
|
|
24
|
-
*/
|
|
25
|
-
fork(): NullifierManager;
|
|
26
|
-
/**
|
|
27
|
-
* Get a nullifier's existence in this' cache or parent's (recursively).
|
|
28
|
-
* DOES NOT CHECK HOST STORAGE!
|
|
29
|
-
* @param siloedNullifier - the nullifier to check for
|
|
30
|
-
* @returns exists: whether the nullifier exists in cache here or in parent's
|
|
31
|
-
*/
|
|
32
|
-
private checkExistsHereOrParent;
|
|
33
|
-
/**
|
|
34
|
-
* Get a nullifier's existence status.
|
|
35
|
-
* 1. Check cache.
|
|
36
|
-
* 2. Check parent cache.
|
|
37
|
-
* 3. Fall back to the host state.
|
|
38
|
-
* 4. Not found! Nullifier does not exist.
|
|
39
|
-
*
|
|
40
|
-
* @param siloedNullifier - the nullifier to check for
|
|
41
|
-
* @returns exists: whether the nullifier exists at all,
|
|
42
|
-
* isPending: whether the nullifier was found in a cache,
|
|
43
|
-
* leafIndex: the nullifier's leaf index if it exists and is not pending (comes from host state).
|
|
44
|
-
*/
|
|
45
|
-
checkExists(siloedNullifier: Fr): Promise<[/*exists=*/ boolean, /*isPending=*/ boolean, /*leafIndex=*/ Fr]>;
|
|
46
|
-
/**
|
|
47
|
-
* Stage a new nullifier (append it to the cache).
|
|
48
|
-
*
|
|
49
|
-
* @param siloedNullifier - the nullifier to stage
|
|
50
|
-
*/
|
|
51
|
-
append(siloedNullifier: Fr): Promise<void>;
|
|
52
|
-
/**
|
|
53
|
-
* Merges another nullifier cache into this one.
|
|
54
|
-
*
|
|
55
|
-
* @param incomingNullifiers - the incoming cached nullifiers to merge into this instance's
|
|
56
|
-
*/
|
|
57
|
-
acceptAndMerge(incomingNullifiers: NullifierManager): void;
|
|
58
|
-
}
|
|
59
|
-
export declare class NullifierCollisionError extends Error {
|
|
60
|
-
constructor(message: string, ...rest: any[]);
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=nullifiers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nullifiers.d.ts","sourceRoot":"","sources":["../../../src/avm/journal/nullifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;GAIG;AACH,qBAAa,gBAAgB;IAEzB,+DAA+D;IAC/D,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,kCAAkC;IAClC,OAAO,CAAC,KAAK;IACb,+CAA+C;IAC/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;;IALxB,+DAA+D;IAC9C,cAAc,EAAE,aAAa;IAC9C,kCAAkC;IAC1B,KAAK,GAAE,GAAG,CAAC,MAAM,CAAa;IACtC,+CAA+C;IAC9B,MAAM,CAAC,8BAAkB;IAG5C;;OAEG;IACI,IAAI;IAIX;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;IAW/B;;;;;;;;;;;OAWG;IACU,WAAW,CACtB,eAAe,EAAE,EAAE,GAClB,OAAO,CAAC,CAAC,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC;IAe5E;;;;OAIG;IACU,MAAM,CAAC,eAAe,EAAE,EAAE;IAQvC;;;;OAIG;IACI,cAAc,CAAC,kBAAkB,EAAE,gBAAgB;CAU3D;AAED,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;CAI5C"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { type AztecAddress } from '@aztec/circuits.js';
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import type { PublicStateDB } from '../../server.js';
|
|
4
|
-
type PublicStorageReadResult = {
|
|
5
|
-
value: Fr;
|
|
6
|
-
cached: boolean;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* A class to manage public storage reads and writes during a contract call's AVM simulation.
|
|
10
|
-
* Maintains a storage write cache, and ensures that reads fall back to the correct source.
|
|
11
|
-
* When a contract call completes, its storage cache can be merged into its parent's.
|
|
12
|
-
*/
|
|
13
|
-
export declare class PublicStorage {
|
|
14
|
-
/** Reference to node storage. Checked on parent cache-miss. */
|
|
15
|
-
private readonly hostPublicStorage;
|
|
16
|
-
/** Parent's storage. Checked on this' cache-miss. */
|
|
17
|
-
private readonly parent?;
|
|
18
|
-
/** Cached storage writes. */
|
|
19
|
-
private readonly cache;
|
|
20
|
-
constructor(
|
|
21
|
-
/** Reference to node storage. Checked on parent cache-miss. */
|
|
22
|
-
hostPublicStorage: PublicStateDB,
|
|
23
|
-
/** Parent's storage. Checked on this' cache-miss. */
|
|
24
|
-
parent?: PublicStorage | undefined);
|
|
25
|
-
/**
|
|
26
|
-
* Create a new public storage manager forked from this one
|
|
27
|
-
*/
|
|
28
|
-
fork(): PublicStorage;
|
|
29
|
-
/**
|
|
30
|
-
* Read a storage value from this' cache or parent's (recursively).
|
|
31
|
-
* DOES NOT CHECK HOST STORAGE!
|
|
32
|
-
*
|
|
33
|
-
* @param contractAddress - the address of the contract whose storage is being read from
|
|
34
|
-
* @param slot - the slot in the contract's storage being read from
|
|
35
|
-
* @returns value: the latest value written according to this cache or the parent's. undefined on cache miss.
|
|
36
|
-
*/
|
|
37
|
-
readHereOrParent(contractAddress: AztecAddress, slot: Fr): Fr | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* Read a value from storage.
|
|
40
|
-
* 1. Check cache.
|
|
41
|
-
* 2. Check parent cache.
|
|
42
|
-
* 3. Fall back to the host state.
|
|
43
|
-
* 4. Not found! Value has never been written to before. Flag it as non-existent and return value zero.
|
|
44
|
-
*
|
|
45
|
-
* @param contractAddress - the address of the contract whose storage is being read from
|
|
46
|
-
* @param slot - the slot in the contract's storage being read from
|
|
47
|
-
* @returns exists: whether the slot has EVER been written to before, value: the latest value written to slot, or 0 if never written to before
|
|
48
|
-
*/
|
|
49
|
-
read(contractAddress: AztecAddress, slot: Fr): Promise<PublicStorageReadResult>;
|
|
50
|
-
/**
|
|
51
|
-
* Stage a storage write.
|
|
52
|
-
*
|
|
53
|
-
* @param contractAddress - the address of the contract whose storage is being written to
|
|
54
|
-
* @param slot - the slot in the contract's storage being written to
|
|
55
|
-
* @param value - the value being written to the slot
|
|
56
|
-
*/
|
|
57
|
-
write(contractAddress: AztecAddress, slot: Fr, value: Fr): void;
|
|
58
|
-
/**
|
|
59
|
-
* Merges another PublicStorage's cache (pending writes) into this one.
|
|
60
|
-
*
|
|
61
|
-
* @param incomingPublicStorage - the incoming public storage to merge into this instance's
|
|
62
|
-
*/
|
|
63
|
-
acceptAndMerge(incomingPublicStorage: PublicStorage): void;
|
|
64
|
-
}
|
|
65
|
-
export {};
|
|
66
|
-
//# sourceMappingURL=public_storage.d.ts.map
|