@aztec/simulator 0.32.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dest/acvm/acvm.d.ts +5 -5
- package/dest/acvm/acvm.d.ts.map +1 -1
- package/dest/acvm/acvm_types.d.ts +1 -1
- package/dest/acvm/acvm_types.d.ts.map +1 -1
- package/dest/acvm/deserialize.d.ts +1 -1
- package/dest/acvm/deserialize.d.ts.map +1 -1
- package/dest/acvm/oracle/index.d.ts +1 -2
- package/dest/acvm/oracle/index.d.ts.map +1 -1
- package/dest/acvm/oracle/index.js +1 -2
- package/dest/acvm/oracle/oracle.d.ts +2 -2
- package/dest/acvm/oracle/oracle.d.ts.map +1 -1
- package/dest/acvm/oracle/oracle.js +2 -3
- package/dest/acvm/oracle/typed_oracle.d.ts +6 -6
- package/dest/acvm/oracle/typed_oracle.d.ts.map +1 -1
- package/dest/acvm/serialize.d.ts +4 -4
- package/dest/acvm/serialize.d.ts.map +1 -1
- package/dest/acvm/serialize.js +1 -1
- package/dest/avm/avm_context.d.ts +8 -18
- package/dest/avm/avm_context.d.ts.map +1 -1
- package/dest/avm/avm_context.js +10 -22
- package/dest/avm/avm_execution_environment.d.ts +4 -4
- package/dest/avm/avm_execution_environment.d.ts.map +1 -1
- package/dest/avm/avm_execution_environment.js +1 -1
- package/dest/avm/avm_gas.d.ts +71 -0
- package/dest/avm/avm_gas.d.ts.map +1 -0
- package/dest/avm/avm_gas.js +161 -0
- package/dest/avm/avm_machine_state.d.ts +5 -3
- package/dest/avm/avm_machine_state.d.ts.map +1 -1
- package/dest/avm/avm_machine_state.js +8 -2
- package/dest/avm/avm_memory_types.d.ts +54 -2
- package/dest/avm/avm_memory_types.d.ts.map +1 -1
- package/dest/avm/avm_memory_types.js +95 -2
- package/dest/avm/avm_message_call_result.d.ts +1 -1
- package/dest/avm/avm_message_call_result.d.ts.map +1 -1
- package/dest/avm/avm_simulator.d.ts.map +1 -1
- package/dest/avm/avm_simulator.js +10 -8
- package/dest/avm/errors.d.ts +1 -1
- package/dest/avm/errors.d.ts.map +1 -1
- package/dest/avm/fixtures/index.d.ts +1 -1
- package/dest/avm/fixtures/index.d.ts.map +1 -1
- package/dest/avm/fixtures/index.js +2 -2
- package/dest/avm/journal/host_storage.d.ts +1 -1
- package/dest/avm/journal/host_storage.d.ts.map +1 -1
- package/dest/avm/journal/journal.d.ts +2 -2
- package/dest/avm/journal/journal.d.ts.map +1 -1
- package/dest/avm/journal/trace.d.ts +1 -1
- package/dest/avm/journal/trace.d.ts.map +1 -1
- package/dest/avm/journal/trace_types.d.ts +1 -1
- package/dest/avm/journal/trace_types.d.ts.map +1 -1
- package/dest/avm/opcodes/accrued_substate.d.ts.map +1 -1
- package/dest/avm/opcodes/accrued_substate.js +44 -16
- package/dest/avm/opcodes/addressing_mode.d.ts +5 -3
- package/dest/avm/opcodes/addressing_mode.d.ts.map +1 -1
- package/dest/avm/opcodes/addressing_mode.js +5 -1
- package/dest/avm/opcodes/arithmetic.d.ts +7 -3
- package/dest/avm/opcodes/arithmetic.d.ts.map +1 -1
- package/dest/avm/opcodes/arithmetic.js +27 -16
- package/dest/avm/opcodes/bitwise.d.ts +21 -20
- package/dest/avm/opcodes/bitwise.d.ts.map +1 -1
- package/dest/avm/opcodes/bitwise.js +43 -65
- package/dest/avm/opcodes/comparators.d.ts +12 -9
- package/dest/avm/opcodes/comparators.d.ts.map +1 -1
- package/dest/avm/opcodes/comparators.js +22 -32
- package/dest/avm/opcodes/context_getters.d.ts +20 -0
- package/dest/avm/opcodes/context_getters.d.ts.map +1 -0
- package/dest/avm/opcodes/context_getters.js +26 -0
- package/dest/avm/opcodes/contract.d.ts +14 -0
- package/dest/avm/opcodes/contract.d.ts.map +1 -0
- package/dest/avm/opcodes/contract.js +49 -0
- package/dest/avm/opcodes/control_flow.d.ts.map +1 -1
- package/dest/avm/opcodes/control_flow.js +12 -2
- package/dest/avm/opcodes/environment_getters.d.ts +31 -34
- package/dest/avm/opcodes/environment_getters.d.ts.map +1 -1
- package/dest/avm/opcodes/environment_getters.js +34 -43
- package/dest/avm/opcodes/external_calls.d.ts +13 -19
- package/dest/avm/opcodes/external_calls.d.ts.map +1 -1
- package/dest/avm/opcodes/external_calls.js +50 -68
- package/dest/avm/opcodes/hashing.d.ts +3 -2
- package/dest/avm/opcodes/hashing.d.ts.map +1 -1
- package/dest/avm/opcodes/hashing.js +37 -18
- package/dest/avm/opcodes/index.d.ts +1 -0
- package/dest/avm/opcodes/index.d.ts.map +1 -1
- package/dest/avm/opcodes/index.js +2 -1
- package/dest/avm/opcodes/instruction.d.ts +12 -17
- package/dest/avm/opcodes/instruction.d.ts.map +1 -1
- package/dest/avm/opcodes/instruction.js +12 -22
- package/dest/avm/opcodes/instruction_impl.d.ts +14 -0
- package/dest/avm/opcodes/instruction_impl.d.ts.map +1 -1
- package/dest/avm/opcodes/instruction_impl.js +37 -16
- package/dest/avm/opcodes/memory.d.ts +4 -3
- package/dest/avm/opcodes/memory.d.ts.map +1 -1
- package/dest/avm/opcodes/memory.js +38 -19
- package/dest/avm/opcodes/storage.d.ts +5 -0
- package/dest/avm/opcodes/storage.d.ts.map +1 -1
- package/dest/avm/opcodes/storage.js +21 -7
- package/dest/avm/serialization/bytecode_serialization.d.ts.map +1 -1
- package/dest/avm/serialization/bytecode_serialization.js +7 -5
- package/dest/avm/serialization/instruction_serialization.d.ts +12 -11
- package/dest/avm/serialization/instruction_serialization.d.ts.map +1 -1
- package/dest/avm/serialization/instruction_serialization.js +13 -12
- package/dest/avm/temporary_executor_migration.d.ts +6 -4
- package/dest/avm/temporary_executor_migration.d.ts.map +1 -1
- package/dest/avm/temporary_executor_migration.js +14 -3
- package/dest/client/client_execution_context.d.ts +11 -11
- package/dest/client/client_execution_context.d.ts.map +1 -1
- package/dest/client/client_execution_context.js +1 -1
- package/dest/client/db_oracle.d.ts +9 -9
- package/dest/client/db_oracle.d.ts.map +1 -1
- package/dest/client/db_oracle.js +1 -1
- package/dest/client/execution_note_cache.d.ts +2 -2
- package/dest/client/execution_note_cache.d.ts.map +1 -1
- package/dest/client/execution_result.d.ts +5 -5
- package/dest/client/execution_result.d.ts.map +1 -1
- package/dest/client/execution_result.js +1 -1
- package/dest/client/pick_notes.d.ts +1 -1
- package/dest/client/pick_notes.d.ts.map +1 -1
- package/dest/client/pick_notes.js +1 -1
- package/dest/client/private_execution.d.ts +5 -5
- package/dest/client/private_execution.d.ts.map +1 -1
- package/dest/client/private_execution.js +6 -2
- package/dest/client/simulator.d.ts +6 -6
- package/dest/client/simulator.d.ts.map +1 -1
- package/dest/client/simulator.js +1 -1
- package/dest/client/unconstrained_execution.d.ts +5 -5
- package/dest/client/unconstrained_execution.d.ts.map +1 -1
- package/dest/client/unconstrained_execution.js +1 -1
- package/dest/client/view_data_oracle.d.ts +6 -6
- package/dest/client/view_data_oracle.d.ts.map +1 -1
- package/dest/client/view_data_oracle.js +1 -1
- package/dest/common/errors.d.ts +1 -1
- package/dest/common/errors.d.ts.map +1 -1
- package/dest/common/errors.js +1 -1
- package/dest/public/db.d.ts +6 -6
- package/dest/public/db.d.ts.map +1 -1
- package/dest/public/execution.d.ts +2 -2
- package/dest/public/execution.d.ts.map +1 -1
- package/dest/public/executor.d.ts +13 -5
- package/dest/public/executor.d.ts.map +1 -1
- package/dest/public/executor.js +59 -20
- package/dest/public/index.d.ts +1 -1
- package/dest/public/index.d.ts.map +1 -1
- package/dest/public/public_execution_context.d.ts +7 -7
- package/dest/public/public_execution_context.d.ts.map +1 -1
- package/dest/public/public_execution_context.js +3 -3
- package/dest/public/state_actions.d.ts +2 -2
- package/dest/public/state_actions.d.ts.map +1 -1
- package/dest/simulator/acvm_native.d.ts +3 -3
- package/dest/simulator/acvm_native.d.ts.map +1 -1
- package/dest/simulator/acvm_wasm.d.ts +3 -3
- package/dest/simulator/acvm_wasm.d.ts.map +1 -1
- package/dest/simulator/acvm_wasm.js +2 -2
- package/dest/simulator/simulation_provider.d.ts +2 -2
- package/dest/simulator/simulation_provider.d.ts.map +1 -1
- package/dest/test/utils.d.ts +1 -1
- package/dest/test/utils.d.ts.map +1 -1
- package/dest/test/utils.js +1 -1
- package/dest/utils.d.ts +1 -1
- package/dest/utils.d.ts.map +1 -1
- package/package.json +15 -9
- package/src/acvm/acvm.ts +8 -8
- package/src/acvm/acvm_types.ts +1 -1
- package/src/acvm/deserialize.ts +1 -1
- package/src/acvm/oracle/index.ts +1 -2
- package/src/acvm/oracle/oracle.ts +3 -4
- package/src/acvm/oracle/typed_oracle.ts +18 -18
- package/src/acvm/serialize.ts +4 -4
- package/src/avm/avm_context.ts +15 -37
- package/src/avm/avm_execution_environment.ts +4 -4
- package/src/avm/{avm_gas_cost.ts → avm_gas.ts} +75 -21
- package/src/avm/avm_machine_state.ts +10 -3
- package/src/avm/avm_memory_types.ts +131 -3
- package/src/avm/avm_message_call_result.ts +1 -1
- package/src/avm/avm_simulator.ts +10 -8
- package/src/avm/errors.ts +1 -1
- package/src/avm/fixtures/index.ts +6 -1
- package/src/avm/journal/host_storage.ts +1 -1
- package/src/avm/journal/journal.ts +2 -2
- package/src/avm/journal/trace.ts +1 -1
- package/src/avm/journal/trace_types.ts +1 -1
- package/src/avm/opcodes/accrued_substate.ts +57 -22
- package/src/avm/opcodes/addressing_mode.ts +8 -3
- package/src/avm/opcodes/arithmetic.ts +32 -22
- package/src/avm/opcodes/bitwise.ts +50 -84
- package/src/avm/opcodes/comparators.ts +28 -43
- package/src/avm/opcodes/context_getters.ts +32 -0
- package/src/avm/opcodes/contract.ts +58 -0
- package/src/avm/opcodes/control_flow.ts +24 -6
- package/src/avm/opcodes/environment_getters.ts +36 -45
- package/src/avm/opcodes/external_calls.ts +65 -84
- package/src/avm/opcodes/hashing.ts +46 -23
- package/src/avm/opcodes/index.ts +1 -0
- package/src/avm/opcodes/instruction.ts +16 -28
- package/src/avm/opcodes/instruction_impl.ts +45 -15
- package/src/avm/opcodes/memory.ts +48 -28
- package/src/avm/opcodes/storage.ts +26 -12
- package/src/avm/serialization/bytecode_serialization.ts +6 -3
- package/src/avm/serialization/instruction_serialization.ts +1 -0
- package/src/avm/temporary_executor_migration.ts +20 -6
- package/src/client/client_execution_context.ts +15 -15
- package/src/client/db_oracle.ts +16 -10
- package/src/client/execution_note_cache.ts +2 -2
- package/src/client/execution_result.ts +9 -5
- package/src/client/pick_notes.ts +1 -1
- package/src/client/private_execution.ts +12 -6
- package/src/client/simulator.ts +8 -8
- package/src/client/unconstrained_execution.ts +5 -5
- package/src/client/view_data_oracle.ts +11 -11
- package/src/common/errors.ts +1 -1
- package/src/public/db.ts +6 -6
- package/src/public/execution.ts +10 -10
- package/src/public/executor.ts +78 -25
- package/src/public/index.ts +2 -2
- package/src/public/public_execution_context.ts +17 -7
- package/src/public/state_actions.ts +2 -2
- package/src/simulator/acvm_native.ts +3 -3
- package/src/simulator/acvm_wasm.ts +8 -4
- package/src/simulator/simulation_provider.ts +2 -2
- package/src/test/utils.ts +1 -1
- package/src/utils.ts +1 -1
- package/dest/acvm/oracle/debug.d.ts +0 -19
- package/dest/acvm/oracle/debug.d.ts.map +0 -1
- package/dest/acvm/oracle/debug.js +0 -95
- package/dest/avm/avm_gas_cost.d.ts +0 -322
- package/dest/avm/avm_gas_cost.d.ts.map +0 -1
- package/dest/avm/avm_gas_cost.js +0 -118
- package/src/acvm/oracle/debug.ts +0 -109
|
@@ -1,19 +1,34 @@
|
|
|
1
|
+
import { type AvmContext } from '../avm_context.js';
|
|
2
|
+
import { type MemoryValue } from '../avm_memory_types.js';
|
|
1
3
|
import { OperandType } from '../serialization/instruction_serialization.js';
|
|
2
4
|
import { Instruction } from './instruction.js';
|
|
3
5
|
|
|
6
|
+
/** Wire format that informs deserialization for instructions with two operands. */
|
|
7
|
+
export const TwoOperandWireFormat = [
|
|
8
|
+
OperandType.UINT8,
|
|
9
|
+
OperandType.UINT8,
|
|
10
|
+
OperandType.UINT8,
|
|
11
|
+
OperandType.UINT32,
|
|
12
|
+
OperandType.UINT32,
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
/** Wire format that informs deserialization for instructions with three operands. */
|
|
16
|
+
export const ThreeOperandWireFormat = [
|
|
17
|
+
OperandType.UINT8,
|
|
18
|
+
OperandType.UINT8,
|
|
19
|
+
OperandType.UINT8,
|
|
20
|
+
OperandType.UINT32,
|
|
21
|
+
OperandType.UINT32,
|
|
22
|
+
OperandType.UINT32,
|
|
23
|
+
];
|
|
24
|
+
|
|
4
25
|
/**
|
|
5
26
|
* Covers (de)serialization for an instruction with:
|
|
6
27
|
* indirect, inTag, and two UINT32s.
|
|
7
28
|
*/
|
|
8
29
|
export abstract class TwoOperandInstruction extends Instruction {
|
|
9
30
|
// Informs (de)serialization. See Instruction.deserialize.
|
|
10
|
-
static readonly wireFormat: OperandType[] =
|
|
11
|
-
OperandType.UINT8,
|
|
12
|
-
OperandType.UINT8,
|
|
13
|
-
OperandType.UINT8,
|
|
14
|
-
OperandType.UINT32,
|
|
15
|
-
OperandType.UINT32,
|
|
16
|
-
];
|
|
31
|
+
static readonly wireFormat: OperandType[] = TwoOperandWireFormat;
|
|
17
32
|
|
|
18
33
|
constructor(
|
|
19
34
|
protected indirect: number,
|
|
@@ -31,14 +46,7 @@ export abstract class TwoOperandInstruction extends Instruction {
|
|
|
31
46
|
*/
|
|
32
47
|
export abstract class ThreeOperandInstruction extends Instruction {
|
|
33
48
|
// Informs (de)serialization. See Instruction.deserialize.
|
|
34
|
-
static readonly wireFormat: OperandType[] =
|
|
35
|
-
OperandType.UINT8,
|
|
36
|
-
OperandType.UINT8,
|
|
37
|
-
OperandType.UINT8,
|
|
38
|
-
OperandType.UINT32,
|
|
39
|
-
OperandType.UINT32,
|
|
40
|
-
OperandType.UINT32,
|
|
41
|
-
];
|
|
49
|
+
static readonly wireFormat: OperandType[] = ThreeOperandWireFormat;
|
|
42
50
|
|
|
43
51
|
constructor(
|
|
44
52
|
protected indirect: number,
|
|
@@ -50,3 +58,25 @@ export abstract class ThreeOperandInstruction extends Instruction {
|
|
|
50
58
|
super();
|
|
51
59
|
}
|
|
52
60
|
}
|
|
61
|
+
|
|
62
|
+
export abstract class GetterInstruction extends Instruction {
|
|
63
|
+
// Informs (de)serialization. See Instruction.deserialize.
|
|
64
|
+
static readonly wireFormat: OperandType[] = [OperandType.UINT8, OperandType.UINT8, OperandType.UINT32];
|
|
65
|
+
|
|
66
|
+
constructor(protected indirect: number, protected dstOffset: number) {
|
|
67
|
+
super();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public async execute(context: AvmContext): Promise<void> {
|
|
71
|
+
const memoryOperations = { writes: 1, indirect: this.indirect };
|
|
72
|
+
const memory = context.machineState.memory.track(this.type);
|
|
73
|
+
context.machineState.consumeGas(this.gasCost(memoryOperations));
|
|
74
|
+
|
|
75
|
+
memory.set(this.dstOffset, this.getValue(context));
|
|
76
|
+
|
|
77
|
+
memory.assert(memoryOperations);
|
|
78
|
+
context.machineState.incrementPc();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
protected abstract getValue(env: AvmContext): MemoryValue;
|
|
82
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AvmContext } from '../avm_context.js';
|
|
2
|
-
import {
|
|
3
|
-
import { Field, TaggedMemory, TypeTag } from '../avm_memory_types.js';
|
|
2
|
+
import { getBaseGasCost, getMemoryGasCost, mulGas, sumGas } from '../avm_gas.js';
|
|
3
|
+
import { Field, type MemoryOperations, TaggedMemory, TypeTag } from '../avm_memory_types.js';
|
|
4
4
|
import { InstructionExecutionError } from '../errors.js';
|
|
5
5
|
import { BufferCursor } from '../serialization/buffer_cursor.js';
|
|
6
6
|
import { Opcode, OperandType, deserialize, serialize } from '../serialization/instruction_serialization.js';
|
|
@@ -69,21 +69,22 @@ export class Set extends Instruction {
|
|
|
69
69
|
return new this(...args);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
async execute(context: AvmContext): Promise<void> {
|
|
72
|
+
public async execute(context: AvmContext): Promise<void> {
|
|
73
|
+
const memoryOperations = { writes: 1, indirect: this.indirect };
|
|
74
|
+
const memory = context.machineState.memory.track(this.type);
|
|
75
|
+
context.machineState.consumeGas(this.gasCost(memoryOperations));
|
|
76
|
+
|
|
73
77
|
// Per the YP, the tag cannot be a field.
|
|
74
78
|
if ([TypeTag.FIELD, TypeTag.UNINITIALIZED, TypeTag.INVALID].includes(this.inTag)) {
|
|
75
79
|
throw new InstructionExecutionError(`Invalid tag ${TypeTag[this.inTag]} for SET.`);
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
const res = TaggedMemory.integralFromTag(this.value, this.inTag);
|
|
79
|
-
|
|
83
|
+
memory.set(this.dstOffset, res);
|
|
80
84
|
|
|
85
|
+
memory.assert(memoryOperations);
|
|
81
86
|
context.machineState.incrementPc();
|
|
82
87
|
}
|
|
83
|
-
|
|
84
|
-
protected gasCost(): GasCost {
|
|
85
|
-
return makeGasCost({ l2Gas: GasCostConstants.SET_COST_PER_BYTE * getGasCostMultiplierFromTypeTag(this.inTag) });
|
|
86
|
-
}
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
export class CMov extends Instruction {
|
|
@@ -109,14 +110,19 @@ export class CMov extends Instruction {
|
|
|
109
110
|
super();
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
async execute(context: AvmContext): Promise<void> {
|
|
113
|
-
const
|
|
114
|
-
const
|
|
115
|
-
|
|
113
|
+
public async execute(context: AvmContext): Promise<void> {
|
|
114
|
+
const memoryOperations = { reads: 3, writes: 1, indirect: this.indirect };
|
|
115
|
+
const memory = context.machineState.memory.track(this.type);
|
|
116
|
+
context.machineState.consumeGas(this.gasCost(memoryOperations));
|
|
117
|
+
|
|
118
|
+
const a = memory.get(this.aOffset);
|
|
119
|
+
const b = memory.get(this.bOffset);
|
|
120
|
+
const cond = memory.get(this.condOffset);
|
|
116
121
|
|
|
117
122
|
// TODO: reconsider toBigInt() here
|
|
118
|
-
|
|
123
|
+
memory.set(this.dstOffset, cond.toBigInt() > 0 ? a : b);
|
|
119
124
|
|
|
125
|
+
memory.assert(memoryOperations);
|
|
120
126
|
context.machineState.incrementPc();
|
|
121
127
|
}
|
|
122
128
|
}
|
|
@@ -129,15 +135,20 @@ export class Cast extends TwoOperandInstruction {
|
|
|
129
135
|
super(indirect, dstTag, aOffset, dstOffset);
|
|
130
136
|
}
|
|
131
137
|
|
|
132
|
-
async execute(context: AvmContext): Promise<void> {
|
|
133
|
-
const
|
|
138
|
+
public async execute(context: AvmContext): Promise<void> {
|
|
139
|
+
const memoryOperations = { reads: 1, writes: 1, indirect: this.indirect };
|
|
140
|
+
const memory = context.machineState.memory.track(this.type);
|
|
141
|
+
context.machineState.consumeGas(this.gasCost(memoryOperations));
|
|
142
|
+
|
|
143
|
+
const a = memory.get(this.aOffset);
|
|
134
144
|
|
|
135
145
|
// TODO: consider not using toBigInt()
|
|
136
146
|
const casted =
|
|
137
147
|
this.inTag == TypeTag.FIELD ? new Field(a.toBigInt()) : TaggedMemory.integralFromTag(a.toBigInt(), this.inTag);
|
|
138
148
|
|
|
139
|
-
|
|
149
|
+
memory.set(this.dstOffset, casted);
|
|
140
150
|
|
|
151
|
+
memory.assert(memoryOperations);
|
|
141
152
|
context.machineState.incrementPc();
|
|
142
153
|
}
|
|
143
154
|
}
|
|
@@ -157,16 +168,18 @@ export class Mov extends Instruction {
|
|
|
157
168
|
super();
|
|
158
169
|
}
|
|
159
170
|
|
|
160
|
-
async execute(context: AvmContext): Promise<void> {
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
171
|
+
public async execute(context: AvmContext): Promise<void> {
|
|
172
|
+
const memoryOperations = { reads: 1, writes: 1, indirect: this.indirect };
|
|
173
|
+
const memory = context.machineState.memory.track(this.type);
|
|
174
|
+
context.machineState.consumeGas(this.gasCost(memoryOperations));
|
|
175
|
+
|
|
176
|
+
const [srcOffset, dstOffset] = Addressing.fromWire(this.indirect).resolve([this.srcOffset, this.dstOffset], memory);
|
|
165
177
|
|
|
166
|
-
const a =
|
|
178
|
+
const a = memory.get(srcOffset);
|
|
167
179
|
|
|
168
|
-
|
|
180
|
+
memory.set(dstOffset, a);
|
|
169
181
|
|
|
182
|
+
memory.assert(memoryOperations);
|
|
170
183
|
context.machineState.incrementPc();
|
|
171
184
|
}
|
|
172
185
|
}
|
|
@@ -187,19 +200,26 @@ export class CalldataCopy extends Instruction {
|
|
|
187
200
|
super();
|
|
188
201
|
}
|
|
189
202
|
|
|
190
|
-
async execute(context: AvmContext): Promise<void> {
|
|
191
|
-
const
|
|
203
|
+
public async execute(context: AvmContext): Promise<void> {
|
|
204
|
+
const memoryOperations = { writes: this.copySize, indirect: this.indirect };
|
|
205
|
+
const memory = context.machineState.memory.track(this.type);
|
|
206
|
+
context.machineState.consumeGas(this.gasCost(memoryOperations));
|
|
207
|
+
|
|
208
|
+
const [dstOffset] = Addressing.fromWire(this.indirect).resolve([this.dstOffset], memory);
|
|
192
209
|
|
|
193
210
|
const transformedData = context.environment.calldata
|
|
194
211
|
.slice(this.cdOffset, this.cdOffset + this.copySize)
|
|
195
212
|
.map(f => new Field(f));
|
|
196
213
|
|
|
197
|
-
|
|
214
|
+
memory.setSlice(dstOffset, transformedData);
|
|
198
215
|
|
|
216
|
+
memory.assert(memoryOperations);
|
|
199
217
|
context.machineState.incrementPc();
|
|
200
218
|
}
|
|
201
219
|
|
|
202
|
-
protected gasCost(
|
|
203
|
-
|
|
220
|
+
protected gasCost(memoryOps: Partial<MemoryOperations & { indirect: number }> = {}) {
|
|
221
|
+
const baseGasCost = mulGas(getBaseGasCost(this.opcode), this.copySize);
|
|
222
|
+
const memoryGasCost = getMemoryGasCost(memoryOps);
|
|
223
|
+
return sumGas(baseGasCost, memoryGasCost);
|
|
204
224
|
}
|
|
205
225
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
2
|
|
|
3
3
|
import type { AvmContext } from '../avm_context.js';
|
|
4
|
-
import {
|
|
4
|
+
import { type Gas, getBaseGasCost, getMemoryGasCost, mulGas, sumGas } from '../avm_gas.js';
|
|
5
|
+
import { Field, type MemoryOperations } from '../avm_memory_types.js';
|
|
5
6
|
import { InstructionExecutionError } from '../errors.js';
|
|
6
7
|
import { Opcode, OperandType } from '../serialization/instruction_serialization.js';
|
|
7
8
|
import { Addressing } from './addressing_mode.js';
|
|
@@ -25,6 +26,12 @@ abstract class BaseStorageInstruction extends Instruction {
|
|
|
25
26
|
) {
|
|
26
27
|
super();
|
|
27
28
|
}
|
|
29
|
+
|
|
30
|
+
protected gasCost(memoryOps: Partial<MemoryOperations & { indirect: number }>): Gas {
|
|
31
|
+
const baseGasCost = mulGas(getBaseGasCost(this.opcode), this.size);
|
|
32
|
+
const memoryGasCost = getMemoryGasCost(memoryOps);
|
|
33
|
+
return sumGas(baseGasCost, memoryGasCost);
|
|
34
|
+
}
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
export class SStore extends BaseStorageInstruction {
|
|
@@ -35,24 +42,26 @@ export class SStore extends BaseStorageInstruction {
|
|
|
35
42
|
super(indirect, srcOffset, srcSize, slotOffset);
|
|
36
43
|
}
|
|
37
44
|
|
|
38
|
-
async execute(context: AvmContext): Promise<void> {
|
|
45
|
+
public async execute(context: AvmContext): Promise<void> {
|
|
39
46
|
if (context.environment.isStaticCall) {
|
|
40
47
|
throw new StaticCallStorageAlterError();
|
|
41
48
|
}
|
|
42
49
|
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
);
|
|
50
|
+
const memoryOperations = { reads: this.size + 1, indirect: this.indirect };
|
|
51
|
+
const memory = context.machineState.memory.track(this.type);
|
|
52
|
+
context.machineState.consumeGas(this.gasCost(memoryOperations));
|
|
47
53
|
|
|
48
|
-
const
|
|
49
|
-
|
|
54
|
+
const [srcOffset, slotOffset] = Addressing.fromWire(this.indirect).resolve([this.aOffset, this.bOffset], memory);
|
|
55
|
+
|
|
56
|
+
const slot = memory.get(slotOffset).toFr();
|
|
57
|
+
const data = memory.getSlice(srcOffset, this.size).map(field => field.toFr());
|
|
50
58
|
|
|
51
59
|
for (const [index, value] of Object.entries(data)) {
|
|
52
60
|
const adjustedSlot = slot.add(new Fr(BigInt(index)));
|
|
53
61
|
context.persistableState.writeStorage(context.environment.storageAddress, adjustedSlot, value);
|
|
54
62
|
}
|
|
55
63
|
|
|
64
|
+
memory.assert(memoryOperations);
|
|
56
65
|
context.machineState.incrementPc();
|
|
57
66
|
}
|
|
58
67
|
}
|
|
@@ -65,13 +74,17 @@ export class SLoad extends BaseStorageInstruction {
|
|
|
65
74
|
super(indirect, slotOffset, size, dstOffset);
|
|
66
75
|
}
|
|
67
76
|
|
|
68
|
-
async execute(context: AvmContext): Promise<void> {
|
|
77
|
+
public async execute(context: AvmContext): Promise<void> {
|
|
78
|
+
const memoryOperations = { writes: this.size, reads: 1, indirect: this.indirect };
|
|
79
|
+
const memory = context.machineState.memory.track(this.type);
|
|
80
|
+
context.machineState.consumeGas(this.gasCost(memoryOperations));
|
|
81
|
+
|
|
69
82
|
const [aOffset, size, bOffset] = Addressing.fromWire(this.indirect).resolve(
|
|
70
83
|
[this.aOffset, this.size, this.bOffset],
|
|
71
|
-
|
|
84
|
+
memory,
|
|
72
85
|
);
|
|
73
86
|
|
|
74
|
-
const slot =
|
|
87
|
+
const slot = memory.get(aOffset);
|
|
75
88
|
|
|
76
89
|
// Write each read value from storage into memory
|
|
77
90
|
for (let i = 0; i < size; i++) {
|
|
@@ -80,10 +93,11 @@ export class SLoad extends BaseStorageInstruction {
|
|
|
80
93
|
new Fr(slot.toBigInt() + BigInt(i)),
|
|
81
94
|
);
|
|
82
95
|
|
|
83
|
-
|
|
96
|
+
memory.set(bOffset + i, new Field(data));
|
|
84
97
|
}
|
|
85
98
|
|
|
86
99
|
context.machineState.incrementPc();
|
|
100
|
+
memory.assert(memoryOperations);
|
|
87
101
|
}
|
|
88
102
|
}
|
|
89
103
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DAGasLeft, L1GasLeft, L2GasLeft } from '../opcodes/context_getters.js';
|
|
1
2
|
import { Keccak, Pedersen, Poseidon2, Sha256 } from '../opcodes/hashing.js';
|
|
2
3
|
import {
|
|
3
4
|
Add,
|
|
@@ -18,6 +19,7 @@ import {
|
|
|
18
19
|
FeePerL1Gas,
|
|
19
20
|
FeePerL2Gas,
|
|
20
21
|
FieldDiv,
|
|
22
|
+
GetContractInstance,
|
|
21
23
|
InternalCall,
|
|
22
24
|
InternalReturn,
|
|
23
25
|
Jump,
|
|
@@ -101,9 +103,9 @@ const INSTRUCTION_SET = () =>
|
|
|
101
103
|
|
|
102
104
|
// Machine State
|
|
103
105
|
// Machine State - Gas
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
[L1GasLeft.opcode, L1GasLeft],
|
|
107
|
+
[L2GasLeft.opcode, L2GasLeft],
|
|
108
|
+
[DAGasLeft.opcode, DAGasLeft],
|
|
107
109
|
// Machine State - Internal Control Flow
|
|
108
110
|
[Jump.opcode, Jump],
|
|
109
111
|
[JumpI.opcode, JumpI],
|
|
@@ -126,6 +128,7 @@ const INSTRUCTION_SET = () =>
|
|
|
126
128
|
// Accrued Substate
|
|
127
129
|
[EmitUnencryptedLog.opcode, EmitUnencryptedLog],
|
|
128
130
|
[SendL2ToL1Message.opcode, SendL2ToL1Message],
|
|
131
|
+
[GetContractInstance.opcode, GetContractInstance],
|
|
129
132
|
|
|
130
133
|
// Control Flow - Contract Calls
|
|
131
134
|
[Call.opcode, Call],
|
|
@@ -3,19 +3,20 @@ import { UnencryptedFunctionL2Logs } from '@aztec/circuit-types';
|
|
|
3
3
|
import {
|
|
4
4
|
ContractStorageRead,
|
|
5
5
|
ContractStorageUpdateRequest,
|
|
6
|
-
GlobalVariables,
|
|
6
|
+
type GlobalVariables,
|
|
7
7
|
L2ToL1Message,
|
|
8
|
-
ReadRequest,
|
|
8
|
+
type ReadRequest,
|
|
9
9
|
SideEffect,
|
|
10
10
|
SideEffectLinkedToNoteHash,
|
|
11
11
|
} from '@aztec/circuits.js';
|
|
12
12
|
import { Fr } from '@aztec/foundation/fields';
|
|
13
13
|
|
|
14
14
|
import { createSimulationError } from '../common/errors.js';
|
|
15
|
-
import { PublicExecution, PublicExecutionResult } from '../public/execution.js';
|
|
15
|
+
import { type PublicExecution, type PublicExecutionResult } from '../public/execution.js';
|
|
16
16
|
import { AvmExecutionEnvironment } from './avm_execution_environment.js';
|
|
17
|
-
import { AvmContractCallResults } from './avm_message_call_result.js';
|
|
18
|
-
import { JournalData } from './journal/journal.js';
|
|
17
|
+
import { type AvmContractCallResults } from './avm_message_call_result.js';
|
|
18
|
+
import { type JournalData } from './journal/journal.js';
|
|
19
|
+
import { Mov } from './opcodes/memory.js';
|
|
19
20
|
|
|
20
21
|
/** Temporary Method
|
|
21
22
|
*
|
|
@@ -95,7 +96,9 @@ export function temporaryConvertAvmResults(
|
|
|
95
96
|
const nestedExecutions: PublicExecutionResult[] = [];
|
|
96
97
|
const nullifierReadRequests: ReadRequest[] = [];
|
|
97
98
|
const nullifierNonExistentReadRequests: ReadRequest[] = [];
|
|
98
|
-
const newNullifiers: SideEffectLinkedToNoteHash[] =
|
|
99
|
+
const newNullifiers: SideEffectLinkedToNoteHash[] = newWorldState.newNullifiers.map(
|
|
100
|
+
(nullifier, i) => new SideEffectLinkedToNoteHash(nullifier.toField(), Fr.zero(), new Fr(i + 1)),
|
|
101
|
+
);
|
|
99
102
|
const unencryptedLogs = UnencryptedFunctionL2Logs.empty();
|
|
100
103
|
const newL2ToL1Messages = newWorldState.newL1Messages.map(() => L2ToL1Message.empty());
|
|
101
104
|
// TODO keep track of side effect counters
|
|
@@ -120,3 +123,14 @@ export function temporaryConvertAvmResults(
|
|
|
120
123
|
revertReason: result.revertReason ? createSimulationError(result.revertReason) : undefined,
|
|
121
124
|
};
|
|
122
125
|
}
|
|
126
|
+
|
|
127
|
+
export function isAvmBytecode(bytecode: Buffer): boolean {
|
|
128
|
+
const magicBuf = Buffer.from([
|
|
129
|
+
Mov.opcode, // opcode
|
|
130
|
+
0x00, // indirect
|
|
131
|
+
...Buffer.from('000018ca', 'hex'), // srcOffset
|
|
132
|
+
...Buffer.from('000018ca', 'hex'), // dstOffset
|
|
133
|
+
]);
|
|
134
|
+
const magicSize = magicBuf.length;
|
|
135
|
+
return bytecode.subarray(-magicSize).equals(magicBuf);
|
|
136
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import {
|
|
2
|
-
AuthWitness,
|
|
3
|
-
AztecNode,
|
|
2
|
+
type AuthWitness,
|
|
3
|
+
type AztecNode,
|
|
4
4
|
EncryptedFunctionL2Logs,
|
|
5
5
|
EncryptedL2Log,
|
|
6
6
|
L1NotePayload,
|
|
7
7
|
Note,
|
|
8
|
-
NoteStatus,
|
|
8
|
+
type NoteStatus,
|
|
9
9
|
TaggedNote,
|
|
10
10
|
UnencryptedFunctionL2Logs,
|
|
11
|
-
UnencryptedL2Log,
|
|
11
|
+
type UnencryptedL2Log,
|
|
12
12
|
} from '@aztec/circuit-types';
|
|
13
13
|
import {
|
|
14
14
|
CallContext,
|
|
15
15
|
FunctionData,
|
|
16
16
|
FunctionSelector,
|
|
17
|
-
Header,
|
|
17
|
+
type Header,
|
|
18
18
|
NoteHashReadRequestMembershipWitness,
|
|
19
19
|
PublicCallRequest,
|
|
20
|
-
SideEffect,
|
|
20
|
+
type SideEffect,
|
|
21
21
|
TxContext,
|
|
22
22
|
} from '@aztec/circuits.js';
|
|
23
|
-
import { Grumpkin } from '@aztec/circuits.js/barretenberg';
|
|
23
|
+
import { type Grumpkin } from '@aztec/circuits.js/barretenberg';
|
|
24
24
|
import { computePublicDataTreeLeafSlot, computeUniqueCommitment, siloNoteHash } from '@aztec/circuits.js/hash';
|
|
25
|
-
import { FunctionAbi, FunctionArtifact, countArgumentsSize } from '@aztec/foundation/abi';
|
|
26
|
-
import { AztecAddress } from '@aztec/foundation/aztec-address';
|
|
27
|
-
import { Fr, Point } from '@aztec/foundation/fields';
|
|
25
|
+
import { type FunctionAbi, type FunctionArtifact, countArgumentsSize } from '@aztec/foundation/abi';
|
|
26
|
+
import { type AztecAddress } from '@aztec/foundation/aztec-address';
|
|
27
|
+
import { Fr, type Point } from '@aztec/foundation/fields';
|
|
28
28
|
import { createDebugLogger } from '@aztec/foundation/log';
|
|
29
29
|
|
|
30
|
-
import { NoteData, toACVMWitness } from '../acvm/index.js';
|
|
31
|
-
import { PackedArgsCache } from '../common/packed_args_cache.js';
|
|
32
|
-
import { DBOracle } from './db_oracle.js';
|
|
33
|
-
import { ExecutionNoteCache } from './execution_note_cache.js';
|
|
34
|
-
import { ExecutionResult, NoteAndSlot } from './execution_result.js';
|
|
30
|
+
import { type NoteData, toACVMWitness } from '../acvm/index.js';
|
|
31
|
+
import { type PackedArgsCache } from '../common/packed_args_cache.js';
|
|
32
|
+
import { type DBOracle } from './db_oracle.js';
|
|
33
|
+
import { type ExecutionNoteCache } from './execution_note_cache.js';
|
|
34
|
+
import { type ExecutionResult, type NoteAndSlot } from './execution_result.js';
|
|
35
35
|
import { pickNotes } from './pick_notes.js';
|
|
36
36
|
import { executePrivateFunction } from './private_execution.js';
|
|
37
37
|
import { ViewDataOracle } from './view_data_oracle.js';
|
package/src/client/db_oracle.ts
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type L2Block,
|
|
3
|
+
type MerkleTreeId,
|
|
4
|
+
type NoteStatus,
|
|
5
|
+
type NullifierMembershipWitness,
|
|
6
|
+
type PublicDataWitness,
|
|
7
|
+
} from '@aztec/circuit-types';
|
|
8
|
+
import { type CompleteAddress, type Header } from '@aztec/circuits.js';
|
|
9
|
+
import { type FunctionArtifactWithDebugMetadata, type FunctionSelector } from '@aztec/foundation/abi';
|
|
10
|
+
import { type AztecAddress } from '@aztec/foundation/aztec-address';
|
|
11
|
+
import { type EthAddress } from '@aztec/foundation/eth-address';
|
|
12
|
+
import { type Fr } from '@aztec/foundation/fields';
|
|
13
|
+
import { type ContractInstance } from '@aztec/types/contracts';
|
|
14
|
+
|
|
15
|
+
import { type KeyPair, type NoteData } from '../acvm/index.js';
|
|
16
|
+
import { type CommitmentsDB } from '../public/db.js';
|
|
11
17
|
|
|
12
18
|
/**
|
|
13
19
|
* Error thrown when a contract is not found in the database.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { siloNullifier } from '@aztec/circuits.js/hash';
|
|
2
|
-
import { AztecAddress } from '@aztec/foundation/aztec-address';
|
|
2
|
+
import { type AztecAddress } from '@aztec/foundation/aztec-address';
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
|
|
5
|
-
import { NoteData } from '../acvm/index.js';
|
|
5
|
+
import { type NoteData } from '../acvm/index.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Data that's accessible by all the function calls in an execution.
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { EncryptedFunctionL2Logs, Note, UnencryptedFunctionL2Logs } from '@aztec/circuit-types';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { type EncryptedFunctionL2Logs, type Note, type UnencryptedFunctionL2Logs } from '@aztec/circuit-types';
|
|
2
|
+
import {
|
|
3
|
+
type NoteHashReadRequestMembershipWitness,
|
|
4
|
+
type PrivateCallStackItem,
|
|
5
|
+
type PublicCallRequest,
|
|
6
|
+
} from '@aztec/circuits.js';
|
|
7
|
+
import { type DecodedReturn } from '@aztec/foundation/abi';
|
|
8
|
+
import { type Fr } from '@aztec/foundation/fields';
|
|
5
9
|
|
|
6
|
-
import { ACVMField } from '../acvm/index.js';
|
|
10
|
+
import { type ACVMField } from '../acvm/index.js';
|
|
7
11
|
|
|
8
12
|
/**
|
|
9
13
|
* The contents of a new note.
|
package/src/client/pick_notes.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { FunctionData, PrivateCallStackItem, PrivateCircuitPublicInputs } from '@aztec/circuits.js';
|
|
2
|
-
import { FunctionArtifactWithDebugMetadata, decodeReturnValues } from '@aztec/foundation/abi';
|
|
3
|
-
import { AztecAddress } from '@aztec/foundation/aztec-address';
|
|
1
|
+
import { type FunctionData, PrivateCallStackItem, PrivateCircuitPublicInputs } from '@aztec/circuits.js';
|
|
2
|
+
import { type AbiType, type FunctionArtifactWithDebugMetadata, decodeReturnValues } from '@aztec/foundation/abi';
|
|
3
|
+
import { type AztecAddress } from '@aztec/foundation/aztec-address';
|
|
4
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
5
5
|
import { createDebugLogger } from '@aztec/foundation/log';
|
|
6
6
|
|
|
7
7
|
import { extractReturnWitness } from '../acvm/deserialize.js';
|
|
8
8
|
import { Oracle, acvm, extractCallStack } from '../acvm/index.js';
|
|
9
9
|
import { ExecutionError } from '../common/errors.js';
|
|
10
|
-
import { ClientExecutionContext } from './client_execution_context.js';
|
|
11
|
-
import { ExecutionResult } from './execution_result.js';
|
|
10
|
+
import { type ClientExecutionContext } from './client_execution_context.js';
|
|
11
|
+
import { type ExecutionResult } from './execution_result.js';
|
|
12
12
|
import { AcirSimulator } from './simulator.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -52,7 +52,13 @@ export async function executePrivateFunction(
|
|
|
52
52
|
publicInputs.unencryptedLogPreimagesLength = new Fr(unencryptedLogs.getSerializedLength());
|
|
53
53
|
|
|
54
54
|
const callStackItem = new PrivateCallStackItem(contractAddress, functionData, publicInputs);
|
|
55
|
-
|
|
55
|
+
|
|
56
|
+
// Mocking the return type to be an array of 4 fields
|
|
57
|
+
// TODO: @LHerskind must be updated as we are progressing with the macros to get the information
|
|
58
|
+
const returnTypes: AbiType[] = [{ kind: 'array', length: 4, type: { kind: 'field' } }];
|
|
59
|
+
const mockArtifact = { ...artifact, returnTypes };
|
|
60
|
+
const returnValues = decodeReturnValues(mockArtifact, publicInputs.returnValues);
|
|
61
|
+
|
|
56
62
|
const noteHashReadRequestPartialWitnesses = context.getNoteHashReadRequestPartialWitnesses(
|
|
57
63
|
publicInputs.noteHashReadRequests,
|
|
58
64
|
);
|
package/src/client/simulator.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { AztecNode, FunctionCall, Note, TxExecutionRequest } from '@aztec/circuit-types';
|
|
1
|
+
import { type AztecNode, type FunctionCall, type Note, type TxExecutionRequest } from '@aztec/circuit-types';
|
|
2
2
|
import { CallContext, FunctionData } from '@aztec/circuits.js';
|
|
3
3
|
import { Grumpkin } from '@aztec/circuits.js/barretenberg';
|
|
4
4
|
import {
|
|
5
|
-
ArrayType,
|
|
6
|
-
FunctionArtifactWithDebugMetadata,
|
|
5
|
+
type ArrayType,
|
|
6
|
+
type FunctionArtifactWithDebugMetadata,
|
|
7
7
|
FunctionSelector,
|
|
8
8
|
FunctionType,
|
|
9
9
|
encodeArguments,
|
|
10
10
|
} from '@aztec/foundation/abi';
|
|
11
11
|
import { AztecAddress } from '@aztec/foundation/aztec-address';
|
|
12
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
12
|
+
import { type EthAddress } from '@aztec/foundation/eth-address';
|
|
13
13
|
import { Fr } from '@aztec/foundation/fields';
|
|
14
|
-
import { DebugLogger, createDebugLogger } from '@aztec/foundation/log';
|
|
14
|
+
import { type DebugLogger, createDebugLogger } from '@aztec/foundation/log';
|
|
15
15
|
|
|
16
|
-
import { WasmBlackBoxFunctionSolver, createBlackBoxSolver } from '@noir-lang/acvm_js';
|
|
16
|
+
import { type WasmBlackBoxFunctionSolver, createBlackBoxSolver } from '@noir-lang/acvm_js';
|
|
17
17
|
|
|
18
18
|
import { createSimulationError } from '../common/errors.js';
|
|
19
19
|
import { PackedArgsCache } from '../common/packed_args_cache.js';
|
|
20
20
|
import { ClientExecutionContext } from './client_execution_context.js';
|
|
21
|
-
import { DBOracle } from './db_oracle.js';
|
|
21
|
+
import { type DBOracle } from './db_oracle.js';
|
|
22
22
|
import { ExecutionNoteCache } from './execution_note_cache.js';
|
|
23
|
-
import { ExecutionResult } from './execution_result.js';
|
|
23
|
+
import { type ExecutionResult } from './execution_result.js';
|
|
24
24
|
import { executePrivateFunction } from './private_execution.js';
|
|
25
25
|
import { executeUnconstrainedFunction } from './unconstrained_execution.js';
|
|
26
26
|
import { ViewDataOracle } from './view_data_oracle.js';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { FunctionData } from '@aztec/circuits.js';
|
|
2
|
-
import { DecodedReturn, FunctionArtifactWithDebugMetadata, decodeReturnValues } from '@aztec/foundation/abi';
|
|
3
|
-
import { AztecAddress } from '@aztec/foundation/aztec-address';
|
|
4
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
1
|
+
import { type FunctionData } from '@aztec/circuits.js';
|
|
2
|
+
import { type DecodedReturn, type FunctionArtifactWithDebugMetadata, decodeReturnValues } from '@aztec/foundation/abi';
|
|
3
|
+
import { type AztecAddress } from '@aztec/foundation/aztec-address';
|
|
4
|
+
import { type Fr } from '@aztec/foundation/fields';
|
|
5
5
|
import { createDebugLogger } from '@aztec/foundation/log';
|
|
6
6
|
|
|
7
7
|
import { extractReturnWitness } from '../acvm/deserialize.js';
|
|
8
8
|
import { Oracle, acvm, extractCallStack, toACVMWitness } from '../acvm/index.js';
|
|
9
9
|
import { ExecutionError } from '../common/errors.js';
|
|
10
10
|
import { AcirSimulator } from './simulator.js';
|
|
11
|
-
import { ViewDataOracle } from './view_data_oracle.js';
|
|
11
|
+
import { type ViewDataOracle } from './view_data_oracle.js';
|
|
12
12
|
|
|
13
13
|
// docs:start:execute_unconstrained_function
|
|
14
14
|
/**
|