@aztec/simulator 0.59.0 → 0.61.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/dest/acvm/acvm.d.ts +1 -0
- package/dest/acvm/acvm.d.ts.map +1 -1
- package/dest/acvm/oracle/oracle.d.ts +5 -3
- package/dest/acvm/oracle/oracle.d.ts.map +1 -1
- package/dest/acvm/oracle/oracle.js +15 -7
- package/dest/acvm/oracle/typed_oracle.d.ts +7 -4
- package/dest/acvm/oracle/typed_oracle.d.ts.map +1 -1
- package/dest/acvm/oracle/typed_oracle.js +10 -4
- package/dest/acvm/serialize.d.ts +1 -0
- package/dest/acvm/serialize.d.ts.map +1 -1
- package/dest/avm/avm_context.d.ts +1 -1
- package/dest/avm/avm_context.js +1 -1
- package/dest/avm/avm_execution_environment.d.ts +2 -5
- package/dest/avm/avm_execution_environment.d.ts.map +1 -1
- package/dest/avm/avm_execution_environment.js +7 -15
- package/dest/avm/avm_gas.d.ts.map +1 -1
- package/dest/avm/avm_gas.js +6 -10
- package/dest/avm/avm_machine_state.d.ts +2 -0
- package/dest/avm/avm_machine_state.d.ts.map +1 -1
- package/dest/avm/avm_machine_state.js +3 -1
- package/dest/avm/avm_memory_types.d.ts +1 -0
- package/dest/avm/avm_memory_types.d.ts.map +1 -1
- package/dest/avm/avm_simulator.d.ts +16 -0
- package/dest/avm/avm_simulator.d.ts.map +1 -1
- package/dest/avm/avm_simulator.js +45 -4
- package/dest/avm/bytecode_utils.d.ts +1 -0
- package/dest/avm/bytecode_utils.d.ts.map +1 -1
- package/dest/avm/fixtures/index.d.ts +3 -0
- package/dest/avm/fixtures/index.d.ts.map +1 -1
- package/dest/avm/fixtures/index.js +8 -2
- package/dest/avm/journal/journal.d.ts +19 -19
- package/dest/avm/journal/journal.d.ts.map +1 -1
- package/dest/avm/journal/journal.js +73 -48
- package/dest/avm/journal/nullifiers.d.ts +9 -9
- package/dest/avm/journal/nullifiers.d.ts.map +1 -1
- package/dest/avm/journal/nullifiers.js +24 -24
- package/dest/avm/journal/public_storage.d.ts +10 -10
- package/dest/avm/journal/public_storage.d.ts.map +1 -1
- package/dest/avm/journal/public_storage.js +21 -21
- package/dest/avm/opcodes/accrued_substate.d.ts.map +1 -1
- package/dest/avm/opcodes/accrued_substate.js +5 -5
- package/dest/avm/opcodes/contract.d.ts +8 -1
- package/dest/avm/opcodes/contract.d.ts.map +1 -1
- package/dest/avm/opcodes/contract.js +41 -21
- package/dest/avm/opcodes/conversion.d.ts +1 -1
- package/dest/avm/opcodes/conversion.d.ts.map +1 -1
- package/dest/avm/opcodes/conversion.js +12 -9
- package/dest/avm/opcodes/environment_getters.d.ts +13 -14
- package/dest/avm/opcodes/environment_getters.d.ts.map +1 -1
- package/dest/avm/opcodes/environment_getters.js +17 -16
- package/dest/avm/opcodes/external_calls.d.ts +3 -6
- package/dest/avm/opcodes/external_calls.d.ts.map +1 -1
- package/dest/avm/opcodes/external_calls.js +23 -43
- package/dest/avm/opcodes/hashing.d.ts +2 -26
- package/dest/avm/opcodes/hashing.d.ts.map +1 -1
- package/dest/avm/opcodes/hashing.js +11 -95
- package/dest/avm/opcodes/index.d.ts +0 -1
- package/dest/avm/opcodes/index.d.ts.map +1 -1
- package/dest/avm/opcodes/index.js +1 -2
- package/dest/avm/opcodes/instruction.d.ts +1 -0
- package/dest/avm/opcodes/instruction.d.ts.map +1 -1
- package/dest/avm/opcodes/memory.d.ts +20 -0
- package/dest/avm/opcodes/memory.d.ts.map +1 -1
- package/dest/avm/opcodes/memory.js +59 -3
- package/dest/avm/opcodes/storage.js +3 -3
- package/dest/avm/serialization/buffer_cursor.d.ts +1 -0
- package/dest/avm/serialization/buffer_cursor.d.ts.map +1 -1
- package/dest/avm/serialization/bytecode_serialization.d.ts +1 -0
- package/dest/avm/serialization/bytecode_serialization.d.ts.map +1 -1
- package/dest/avm/serialization/bytecode_serialization.js +5 -7
- package/dest/avm/serialization/instruction_serialization.d.ts +34 -35
- package/dest/avm/serialization/instruction_serialization.d.ts.map +1 -1
- package/dest/avm/serialization/instruction_serialization.js +34 -36
- package/dest/avm/test_utils.d.ts +3 -1
- package/dest/avm/test_utils.d.ts.map +1 -1
- package/dest/avm/test_utils.js +4 -1
- package/dest/client/client_execution_context.d.ts +9 -18
- package/dest/client/client_execution_context.d.ts.map +1 -1
- package/dest/client/client_execution_context.js +30 -50
- package/dest/client/db_oracle.d.ts +17 -1
- package/dest/client/db_oracle.d.ts.map +1 -1
- package/dest/client/db_oracle.js +1 -1
- package/dest/client/private_execution.d.ts.map +1 -1
- package/dest/client/private_execution.js +3 -4
- package/dest/client/simulator.d.ts.map +1 -1
- package/dest/client/simulator.js +3 -3
- package/dest/client/view_data_oracle.d.ts +17 -1
- package/dest/client/view_data_oracle.d.ts.map +1 -1
- package/dest/client/view_data_oracle.js +21 -1
- package/dest/common/index.d.ts +0 -1
- package/dest/common/index.d.ts.map +1 -1
- package/dest/common/index.js +1 -2
- package/dest/mocks/fixtures.js +2 -2
- package/dest/providers/acvm_native.d.ts +1 -0
- package/dest/providers/acvm_native.d.ts.map +1 -1
- package/dest/public/db_interfaces.d.ts +1 -0
- package/dest/public/db_interfaces.d.ts.map +1 -1
- package/dest/public/dual_side_effect_trace.d.ts +10 -11
- package/dest/public/dual_side_effect_trace.d.ts.map +1 -1
- package/dest/public/dual_side_effect_trace.js +26 -22
- package/dest/public/enqueued_call_side_effect_trace.d.ts +11 -12
- package/dest/public/enqueued_call_side_effect_trace.d.ts.map +1 -1
- package/dest/public/enqueued_call_side_effect_trace.js +33 -23
- package/dest/public/enqueued_call_simulator.d.ts +3 -3
- package/dest/public/enqueued_call_simulator.d.ts.map +1 -1
- package/dest/public/enqueued_call_simulator.js +30 -39
- package/dest/public/enqueued_calls_processor.d.ts +2 -3
- package/dest/public/enqueued_calls_processor.d.ts.map +1 -1
- package/dest/public/enqueued_calls_processor.js +19 -26
- package/dest/public/execution.d.ts +1 -0
- package/dest/public/execution.d.ts.map +1 -1
- package/dest/public/execution.js +2 -2
- package/dest/public/executor.d.ts.map +1 -1
- package/dest/public/executor.js +6 -5
- package/dest/public/public_db_sources.d.ts +1 -0
- package/dest/public/public_db_sources.d.ts.map +1 -1
- package/dest/public/public_kernel.d.ts +0 -1
- package/dest/public/public_kernel.d.ts.map +1 -1
- package/dest/public/public_kernel.js +5 -8
- package/dest/public/public_kernel_tail_simulator.d.ts +1 -5
- package/dest/public/public_kernel_tail_simulator.d.ts.map +1 -1
- package/dest/public/public_kernel_tail_simulator.js +6 -12
- package/dest/public/public_processor.js +4 -4
- package/dest/public/side_effect_trace.d.ts +11 -9
- package/dest/public/side_effect_trace.d.ts.map +1 -1
- package/dest/public/side_effect_trace.js +40 -30
- package/dest/public/side_effect_trace_interface.d.ts +10 -9
- package/dest/public/side_effect_trace_interface.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/acvm/oracle/oracle.ts +13 -6
- package/src/acvm/oracle/typed_oracle.ts +9 -3
- package/src/avm/avm_context.ts +1 -1
- package/src/avm/avm_execution_environment.ts +0 -15
- package/src/avm/avm_gas.ts +5 -9
- package/src/avm/avm_machine_state.ts +2 -0
- package/src/avm/avm_simulator.ts +69 -6
- package/src/avm/fixtures/index.ts +7 -2
- package/src/avm/journal/journal.ts +93 -50
- package/src/avm/journal/nullifiers.ts +23 -23
- package/src/avm/journal/public_storage.ts +20 -20
- package/src/avm/opcodes/accrued_substate.ts +4 -8
- package/src/avm/opcodes/contract.ts +45 -21
- package/src/avm/opcodes/conversion.ts +9 -6
- package/src/avm/opcodes/environment_getters.ts +7 -5
- package/src/avm/opcodes/external_calls.ts +21 -45
- package/src/avm/opcodes/hashing.ts +9 -122
- package/src/avm/opcodes/index.ts +0 -1
- package/src/avm/opcodes/memory.ts +69 -2
- package/src/avm/opcodes/storage.ts +2 -2
- package/src/avm/serialization/bytecode_serialization.ts +6 -9
- package/src/avm/serialization/instruction_serialization.ts +3 -5
- package/src/avm/test_utils.ts +5 -1
- package/src/client/client_execution_context.ts +21 -71
- package/src/client/db_oracle.ts +26 -0
- package/src/client/private_execution.ts +1 -9
- package/src/client/simulator.ts +0 -2
- package/src/client/view_data_oracle.ts +31 -1
- package/src/common/index.ts +0 -1
- package/src/mocks/fixtures.ts +1 -1
- package/src/public/dual_side_effect_trace.ts +38 -24
- package/src/public/enqueued_call_side_effect_trace.ts +60 -28
- package/src/public/enqueued_call_simulator.ts +52 -49
- package/src/public/enqueued_calls_processor.ts +27 -41
- package/src/public/execution.ts +1 -1
- package/src/public/executor.ts +11 -5
- package/src/public/public_kernel.ts +9 -12
- package/src/public/public_kernel_tail_simulator.ts +6 -15
- package/src/public/public_processor.ts +3 -3
- package/src/public/side_effect_trace.ts +73 -29
- package/src/public/side_effect_trace_interface.ts +15 -10
- package/dest/avm/opcodes/commitment.d.ts +0 -16
- package/dest/avm/opcodes/commitment.d.ts.map +0 -1
- package/dest/avm/opcodes/commitment.js +0 -51
- package/dest/client/test_utils.d.ts +0 -9
- package/dest/client/test_utils.d.ts.map +0 -1
- package/dest/client/test_utils.js +0 -27
- package/dest/common/side_effect_counter.d.ts +0 -10
- package/dest/common/side_effect_counter.d.ts.map +0 -1
- package/dest/common/side_effect_counter.js +0 -18
- package/dest/rollup/index.d.ts +0 -2
- package/dest/rollup/index.d.ts.map +0 -1
- package/dest/rollup/index.js +0 -2
- package/dest/rollup/rollup.d.ts +0 -101
- package/dest/rollup/rollup.d.ts.map +0 -1
- package/dest/rollup/rollup.js +0 -100
- package/src/avm/opcodes/commitment.ts +0 -65
- package/src/client/test_utils.ts +0 -57
- package/src/common/side_effect_counter.ts +0 -17
- package/src/rollup/index.ts +0 -1
- package/src/rollup/rollup.ts +0 -228
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
InternalReturn,
|
|
20
20
|
Jump,
|
|
21
21
|
JumpI,
|
|
22
|
-
Keccak,
|
|
23
22
|
KeccakF1600,
|
|
24
23
|
L1ToL2MessageExists,
|
|
25
24
|
Lt,
|
|
@@ -30,10 +29,10 @@ import {
|
|
|
30
29
|
NoteHashExists,
|
|
31
30
|
NullifierExists,
|
|
32
31
|
Or,
|
|
33
|
-
Pedersen,
|
|
34
|
-
PedersenCommitment,
|
|
35
32
|
Poseidon2,
|
|
36
33
|
Return,
|
|
34
|
+
ReturndataCopy,
|
|
35
|
+
ReturndataSize,
|
|
37
36
|
Revert,
|
|
38
37
|
SLoad,
|
|
39
38
|
SStore,
|
|
@@ -44,7 +43,7 @@ import {
|
|
|
44
43
|
Shr,
|
|
45
44
|
StaticCall,
|
|
46
45
|
Sub,
|
|
47
|
-
|
|
46
|
+
ToRadixBE,
|
|
48
47
|
Xor,
|
|
49
48
|
} from '../opcodes/index.js';
|
|
50
49
|
import { MultiScalarMul } from '../opcodes/multi_scalar_mul.js';
|
|
@@ -99,6 +98,8 @@ const INSTRUCTION_SET = () =>
|
|
|
99
98
|
// Execution Environment
|
|
100
99
|
[Opcode.GETENVVAR_16, GetEnvVar.as(GetEnvVar.wireFormat16).deserialize],
|
|
101
100
|
[CalldataCopy.opcode, Instruction.deserialize.bind(CalldataCopy)],
|
|
101
|
+
[Opcode.RETURNDATASIZE, Instruction.deserialize.bind(ReturndataSize)],
|
|
102
|
+
[Opcode.RETURNDATACOPY, Instruction.deserialize.bind(ReturndataCopy)],
|
|
102
103
|
|
|
103
104
|
// Machine State - Internal Control Flow
|
|
104
105
|
[Jump.opcode, Instruction.deserialize.bind(Jump)],
|
|
@@ -131,7 +132,6 @@ const INSTRUCTION_SET = () =>
|
|
|
131
132
|
// Control Flow - Contract Calls
|
|
132
133
|
[Call.opcode, Instruction.deserialize.bind(Call)],
|
|
133
134
|
[StaticCall.opcode, Instruction.deserialize.bind(StaticCall)],
|
|
134
|
-
//[DelegateCall.opcode, Instruction.deserialize.bind(DelegateCall)],
|
|
135
135
|
[Return.opcode, Instruction.deserialize.bind(Return)],
|
|
136
136
|
[Opcode.REVERT_8, Revert.as(Revert.wireFormat8).deserialize],
|
|
137
137
|
[Opcode.REVERT_16, Revert.as(Revert.wireFormat16).deserialize],
|
|
@@ -141,14 +141,11 @@ const INSTRUCTION_SET = () =>
|
|
|
141
141
|
|
|
142
142
|
// Gadgets
|
|
143
143
|
[EcAdd.opcode, Instruction.deserialize.bind(EcAdd)],
|
|
144
|
-
[Keccak.opcode, Instruction.deserialize.bind(Keccak)],
|
|
145
144
|
[Poseidon2.opcode, Instruction.deserialize.bind(Poseidon2)],
|
|
146
145
|
[Sha256Compression.opcode, Instruction.deserialize.bind(Sha256Compression)],
|
|
147
|
-
[Pedersen.opcode, Instruction.deserialize.bind(Pedersen)],
|
|
148
146
|
[MultiScalarMul.opcode, Instruction.deserialize.bind(MultiScalarMul)],
|
|
149
|
-
[PedersenCommitment.opcode, Instruction.deserialize.bind(PedersenCommitment)],
|
|
150
147
|
// Conversions
|
|
151
|
-
[
|
|
148
|
+
[ToRadixBE.opcode, Instruction.deserialize.bind(ToRadixBE)],
|
|
152
149
|
// Future Gadgets -- pending changes in noir
|
|
153
150
|
// SHA256COMPRESSION,
|
|
154
151
|
[KeccakF1600.opcode, Instruction.deserialize.bind(KeccakF1600)],
|
|
@@ -41,6 +41,8 @@ export enum Opcode {
|
|
|
41
41
|
// Execution environment
|
|
42
42
|
GETENVVAR_16,
|
|
43
43
|
CALLDATACOPY,
|
|
44
|
+
RETURNDATASIZE,
|
|
45
|
+
RETURNDATACOPY,
|
|
44
46
|
// Control flow
|
|
45
47
|
JUMP_16,
|
|
46
48
|
JUMPI_16,
|
|
@@ -69,23 +71,19 @@ export enum Opcode {
|
|
|
69
71
|
// External calls
|
|
70
72
|
CALL,
|
|
71
73
|
STATICCALL,
|
|
72
|
-
DELEGATECALL,
|
|
73
74
|
RETURN,
|
|
74
75
|
REVERT_8,
|
|
75
76
|
REVERT_16,
|
|
76
77
|
// Misc
|
|
77
78
|
DEBUGLOG,
|
|
78
79
|
// Gadgets
|
|
79
|
-
KECCAK,
|
|
80
80
|
POSEIDON2,
|
|
81
81
|
SHA256COMPRESSION,
|
|
82
82
|
KECCAKF1600,
|
|
83
|
-
PEDERSEN, // temp - may be removed, but alot of contracts rely on it
|
|
84
83
|
ECADD,
|
|
85
84
|
MSM,
|
|
86
|
-
PEDERSENCOMMITMENT,
|
|
87
85
|
// Conversion
|
|
88
|
-
|
|
86
|
+
TORADIXBE,
|
|
89
87
|
}
|
|
90
88
|
|
|
91
89
|
// Possible types for an instruction's operand in its wire format. (Keep in sync with CPP code.
|
package/src/avm/test_utils.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ContractInstanceWithAddress, Fr } from '@aztec/circuits.js';
|
|
1
|
+
import { type ContractClassPublic, type ContractInstanceWithAddress, Fr } from '@aztec/circuits.js';
|
|
2
2
|
|
|
3
3
|
import { type jest } from '@jest/globals';
|
|
4
4
|
import { mock } from 'jest-mock-extended';
|
|
@@ -61,3 +61,7 @@ export function mockL1ToL2MessageExists(
|
|
|
61
61
|
export function mockGetContractInstance(worldStateDB: WorldStateDB, contractInstance: ContractInstanceWithAddress) {
|
|
62
62
|
(worldStateDB as jest.Mocked<WorldStateDB>).getContractInstance.mockResolvedValue(contractInstance);
|
|
63
63
|
}
|
|
64
|
+
|
|
65
|
+
export function mockGetContractClass(worldStateDB: WorldStateDB, contractClass: ContractClassPublic) {
|
|
66
|
+
(worldStateDB as jest.Mocked<WorldStateDB>).getContractClass.mockResolvedValue(contractClass);
|
|
67
|
+
}
|
|
@@ -68,7 +68,6 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
68
68
|
private publicTeardownFunctionCall: PublicExecutionRequest = PublicExecutionRequest.empty();
|
|
69
69
|
|
|
70
70
|
constructor(
|
|
71
|
-
contractAddress: AztecAddress,
|
|
72
71
|
private readonly argsHash: Fr,
|
|
73
72
|
private readonly txContext: TxContext,
|
|
74
73
|
private readonly callContext: CallContext,
|
|
@@ -84,7 +83,7 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
84
83
|
log = createDebugLogger('aztec:simulator:client_execution_context'),
|
|
85
84
|
scopes?: AztecAddress[],
|
|
86
85
|
) {
|
|
87
|
-
super(contractAddress, authWitnesses, db, node, log, scopes);
|
|
86
|
+
super(callContext.contractAddress, authWitnesses, db, node, log, scopes);
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
// We still need this function until we can get user-defined ordering of structs for fn arguments
|
|
@@ -240,10 +239,10 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
240
239
|
status: NoteStatus,
|
|
241
240
|
): Promise<NoteData[]> {
|
|
242
241
|
// Nullified pending notes are already removed from the list.
|
|
243
|
-
const pendingNotes = this.noteCache.getNotes(this.callContext.
|
|
242
|
+
const pendingNotes = this.noteCache.getNotes(this.callContext.contractAddress, storageSlot);
|
|
244
243
|
|
|
245
|
-
const pendingNullifiers = this.noteCache.getNullifiers(this.callContext.
|
|
246
|
-
const dbNotes = await this.db.getNotes(this.callContext.
|
|
244
|
+
const pendingNullifiers = this.noteCache.getNullifiers(this.callContext.contractAddress);
|
|
245
|
+
const dbNotes = await this.db.getNotes(this.callContext.contractAddress, storageSlot, status, this.scopes);
|
|
247
246
|
const dbNotesFiltered = dbNotes.filter(n => !pendingNullifiers.has((n.siloedNullifier as Fr).value));
|
|
248
247
|
|
|
249
248
|
const notes = pickNotes<NoteData>([...dbNotesFiltered, ...pendingNotes], {
|
|
@@ -261,7 +260,7 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
261
260
|
});
|
|
262
261
|
|
|
263
262
|
this.log.debug(
|
|
264
|
-
`Returning ${notes.length} notes for ${this.callContext.
|
|
263
|
+
`Returning ${notes.length} notes for ${this.callContext.contractAddress} at ${storageSlot}: ${notes
|
|
265
264
|
.map(n => `${n.nonce.toString()}:[${n.note.items.map(i => i.toString()).join(',')}]`)
|
|
266
265
|
.join(', ')}`,
|
|
267
266
|
);
|
|
@@ -297,7 +296,7 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
297
296
|
const note = new Note(noteItems);
|
|
298
297
|
this.noteCache.addNewNote(
|
|
299
298
|
{
|
|
300
|
-
contractAddress: this.callContext.
|
|
299
|
+
contractAddress: this.callContext.contractAddress,
|
|
301
300
|
storageSlot,
|
|
302
301
|
nonce: Fr.ZERO, // Nonce cannot be known during private execution.
|
|
303
302
|
note,
|
|
@@ -317,7 +316,7 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
317
316
|
*/
|
|
318
317
|
public override notifyNullifiedNote(innerNullifier: Fr, noteHash: Fr, counter: number) {
|
|
319
318
|
const nullifiedNoteHashCounter = this.noteCache.nullifyNote(
|
|
320
|
-
this.callContext.
|
|
319
|
+
this.callContext.contractAddress,
|
|
321
320
|
innerNullifier,
|
|
322
321
|
noteHash,
|
|
323
322
|
);
|
|
@@ -391,11 +390,11 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
391
390
|
|
|
392
391
|
#checkValidStaticCall(childExecutionResult: PrivateExecutionResult) {
|
|
393
392
|
if (
|
|
394
|
-
childExecutionResult.
|
|
395
|
-
childExecutionResult.
|
|
396
|
-
childExecutionResult.
|
|
397
|
-
childExecutionResult.
|
|
398
|
-
childExecutionResult.
|
|
393
|
+
childExecutionResult.publicInputs.noteHashes.some(item => !item.isEmpty()) ||
|
|
394
|
+
childExecutionResult.publicInputs.nullifiers.some(item => !item.isEmpty()) ||
|
|
395
|
+
childExecutionResult.publicInputs.l2ToL1Msgs.some(item => !item.isEmpty()) ||
|
|
396
|
+
childExecutionResult.publicInputs.encryptedLogsHashes.some(item => !item.isEmpty()) ||
|
|
397
|
+
childExecutionResult.publicInputs.unencryptedLogsHashes.some(item => !item.isEmpty())
|
|
399
398
|
) {
|
|
400
399
|
throw new Error(`Static call cannot update the state, emit L2->L1 messages or generate logs`);
|
|
401
400
|
}
|
|
@@ -408,7 +407,6 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
408
407
|
* @param argsHash - The packed arguments to pass to the function.
|
|
409
408
|
* @param sideEffectCounter - The side effect counter at the start of the call.
|
|
410
409
|
* @param isStaticCall - Whether the call is a static call.
|
|
411
|
-
* @param isDelegateCall - Whether the call is a delegate call.
|
|
412
410
|
* @returns The execution result.
|
|
413
411
|
*/
|
|
414
412
|
override async callPrivateFunction(
|
|
@@ -417,10 +415,9 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
417
415
|
argsHash: Fr,
|
|
418
416
|
sideEffectCounter: number,
|
|
419
417
|
isStaticCall: boolean,
|
|
420
|
-
isDelegateCall: boolean,
|
|
421
418
|
) {
|
|
422
419
|
this.log.debug(
|
|
423
|
-
`Calling private function ${this.contractAddress}:${functionSelector} from ${this.callContext.
|
|
420
|
+
`Calling private function ${this.contractAddress}:${functionSelector} from ${this.callContext.contractAddress}`,
|
|
424
421
|
);
|
|
425
422
|
|
|
426
423
|
isStaticCall = isStaticCall || this.callContext.isStaticCall;
|
|
@@ -429,15 +426,9 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
429
426
|
|
|
430
427
|
const derivedTxContext = this.txContext.clone();
|
|
431
428
|
|
|
432
|
-
const derivedCallContext = this.deriveCallContext(
|
|
433
|
-
targetContractAddress,
|
|
434
|
-
targetArtifact,
|
|
435
|
-
isDelegateCall,
|
|
436
|
-
isStaticCall,
|
|
437
|
-
);
|
|
429
|
+
const derivedCallContext = this.deriveCallContext(targetContractAddress, targetArtifact, isStaticCall);
|
|
438
430
|
|
|
439
431
|
const context = new ClientExecutionContext(
|
|
440
|
-
targetContractAddress,
|
|
441
432
|
argsHash,
|
|
442
433
|
derivedTxContext,
|
|
443
434
|
derivedCallContext,
|
|
@@ -465,7 +456,7 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
465
456
|
|
|
466
457
|
this.nestedExecutions.push(childExecutionResult);
|
|
467
458
|
|
|
468
|
-
const publicInputs = childExecutionResult.
|
|
459
|
+
const publicInputs = childExecutionResult.publicInputs;
|
|
469
460
|
return {
|
|
470
461
|
endSideEffectCounter: publicInputs.endSideEffectCounter,
|
|
471
462
|
returnsHash: publicInputs.returnsHash,
|
|
@@ -473,7 +464,7 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
473
464
|
}
|
|
474
465
|
|
|
475
466
|
/**
|
|
476
|
-
* Creates a
|
|
467
|
+
* Creates a PublicExecutionRequest object representing the request to call a public function.
|
|
477
468
|
* @param targetContractAddress - The address of the contract to call.
|
|
478
469
|
* @param functionSelector - The function selector of the function to call.
|
|
479
470
|
* @param argsHash - The packed arguments to pass to the function.
|
|
@@ -488,15 +479,9 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
488
479
|
argsHash: Fr,
|
|
489
480
|
sideEffectCounter: number,
|
|
490
481
|
isStaticCall: boolean,
|
|
491
|
-
isDelegateCall: boolean,
|
|
492
482
|
) {
|
|
493
483
|
const targetArtifact = await this.db.getFunctionArtifact(targetContractAddress, functionSelector);
|
|
494
|
-
const derivedCallContext = this.deriveCallContext(
|
|
495
|
-
targetContractAddress,
|
|
496
|
-
targetArtifact,
|
|
497
|
-
isDelegateCall,
|
|
498
|
-
isStaticCall,
|
|
499
|
-
);
|
|
484
|
+
const derivedCallContext = this.deriveCallContext(targetContractAddress, targetArtifact, isStaticCall);
|
|
500
485
|
const args = this.packedValuesCache.unpack(argsHash);
|
|
501
486
|
|
|
502
487
|
this.log.verbose(
|
|
@@ -506,7 +491,6 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
506
491
|
const request = PublicExecutionRequest.from({
|
|
507
492
|
args,
|
|
508
493
|
callContext: derivedCallContext,
|
|
509
|
-
contractAddress: targetContractAddress,
|
|
510
494
|
});
|
|
511
495
|
|
|
512
496
|
if (callType === 'enqueued') {
|
|
@@ -517,7 +501,7 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
517
501
|
}
|
|
518
502
|
|
|
519
503
|
/**
|
|
520
|
-
* Creates and enqueues a
|
|
504
|
+
* Creates and enqueues a PublicExecutionRequest object representing the request to call a public function. No function
|
|
521
505
|
* is actually called, since that must happen on the sequencer side. All the fields related to the result
|
|
522
506
|
* of the execution are empty.
|
|
523
507
|
* @param targetContractAddress - The address of the contract to call.
|
|
@@ -533,7 +517,6 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
533
517
|
argsHash: Fr,
|
|
534
518
|
sideEffectCounter: number,
|
|
535
519
|
isStaticCall: boolean,
|
|
536
|
-
isDelegateCall: boolean,
|
|
537
520
|
): Promise<Fr> {
|
|
538
521
|
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/8985): Fix this.
|
|
539
522
|
// WARNING: This is insecure and should be temporary!
|
|
@@ -552,13 +535,12 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
552
535
|
newArgsHash,
|
|
553
536
|
sideEffectCounter,
|
|
554
537
|
isStaticCall,
|
|
555
|
-
isDelegateCall,
|
|
556
538
|
);
|
|
557
539
|
return newArgsHash;
|
|
558
540
|
}
|
|
559
541
|
|
|
560
542
|
/**
|
|
561
|
-
* Creates a
|
|
543
|
+
* Creates a PublicExecutionRequest and sets it as the public teardown function. No function
|
|
562
544
|
* is actually called, since that must happen on the sequencer side. All the fields related to the result
|
|
563
545
|
* of the execution are empty.
|
|
564
546
|
* @param targetContractAddress - The address of the contract to call.
|
|
@@ -574,7 +556,6 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
574
556
|
argsHash: Fr,
|
|
575
557
|
sideEffectCounter: number,
|
|
576
558
|
isStaticCall: boolean,
|
|
577
|
-
isDelegateCall: boolean,
|
|
578
559
|
): Promise<Fr> {
|
|
579
560
|
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/8985): Fix this.
|
|
580
561
|
// WARNING: This is insecure and should be temporary!
|
|
@@ -593,7 +574,6 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
593
574
|
newArgsHash,
|
|
594
575
|
sideEffectCounter,
|
|
595
576
|
isStaticCall,
|
|
596
|
-
isDelegateCall,
|
|
597
577
|
);
|
|
598
578
|
return newArgsHash;
|
|
599
579
|
}
|
|
@@ -606,52 +586,22 @@ export class ClientExecutionContext extends ViewDataOracle {
|
|
|
606
586
|
* Derives the call context for a nested execution.
|
|
607
587
|
* @param targetContractAddress - The address of the contract being called.
|
|
608
588
|
* @param targetArtifact - The artifact of the function being called.
|
|
609
|
-
* @param isDelegateCall - Whether the call is a delegate call.
|
|
610
589
|
* @param isStaticCall - Whether the call is a static call.
|
|
611
590
|
* @returns The derived call context.
|
|
612
591
|
*/
|
|
613
592
|
private deriveCallContext(
|
|
614
593
|
targetContractAddress: AztecAddress,
|
|
615
594
|
targetArtifact: FunctionArtifact,
|
|
616
|
-
isDelegateCall = false,
|
|
617
595
|
isStaticCall = false,
|
|
618
596
|
) {
|
|
619
597
|
return new CallContext(
|
|
620
|
-
|
|
621
|
-
|
|
598
|
+
this.contractAddress,
|
|
599
|
+
targetContractAddress,
|
|
622
600
|
FunctionSelector.fromNameAndParameters(targetArtifact.name, targetArtifact.parameters),
|
|
623
|
-
isDelegateCall,
|
|
624
601
|
isStaticCall,
|
|
625
602
|
);
|
|
626
603
|
}
|
|
627
604
|
|
|
628
|
-
/**
|
|
629
|
-
* Read the public storage data.
|
|
630
|
-
* @param contractAddress - The address to read storage from.
|
|
631
|
-
* @param startStorageSlot - The starting storage slot.
|
|
632
|
-
* @param blockNumber - The block number to read storage at.
|
|
633
|
-
* @param numberOfElements - Number of elements to read from the starting storage slot.
|
|
634
|
-
*/
|
|
635
|
-
public override async storageRead(
|
|
636
|
-
contractAddress: Fr,
|
|
637
|
-
startStorageSlot: Fr,
|
|
638
|
-
blockNumber: number,
|
|
639
|
-
numberOfElements: number,
|
|
640
|
-
): Promise<Fr[]> {
|
|
641
|
-
const values = [];
|
|
642
|
-
for (let i = 0n; i < numberOfElements; i++) {
|
|
643
|
-
const storageSlot = new Fr(startStorageSlot.value + i);
|
|
644
|
-
|
|
645
|
-
const value = await this.aztecNode.getPublicStorageAt(contractAddress, storageSlot, blockNumber);
|
|
646
|
-
this.log.debug(
|
|
647
|
-
`Oracle storage read: slot=${storageSlot.toString()} address-${contractAddress.toString()} value=${value}`,
|
|
648
|
-
);
|
|
649
|
-
|
|
650
|
-
values.push(value);
|
|
651
|
-
}
|
|
652
|
-
return values;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
605
|
public override debugLog(message: string, fields: Fr[]) {
|
|
656
606
|
this.log.verbose(`debug_log ${applyStringFormatting(message, fields)}`);
|
|
657
607
|
}
|
package/src/client/db_oracle.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
type CompleteAddress,
|
|
10
10
|
type ContractInstance,
|
|
11
11
|
type Header,
|
|
12
|
+
type IndexedTaggingSecret,
|
|
12
13
|
type KeyValidationRequest,
|
|
13
14
|
} from '@aztec/circuits.js';
|
|
14
15
|
import { type FunctionArtifact, type FunctionSelector } from '@aztec/foundation/abi';
|
|
@@ -193,4 +194,29 @@ export interface DBOracle extends CommitmentsDB {
|
|
|
193
194
|
* @returns The block number.
|
|
194
195
|
*/
|
|
195
196
|
getBlockNumber(): Promise<number>;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Returns the tagging secret for a given sender and recipient pair. For this to work, the ivpsk_m of the sender must be known.
|
|
200
|
+
* Includes the last known index used for tagging with this secret.
|
|
201
|
+
* @param contractAddress - The contract address to silo the secret for
|
|
202
|
+
* @param sender - The address sending the note
|
|
203
|
+
* @param recipient - The address receiving the note
|
|
204
|
+
* @returns A tagging secret that can be used to tag notes.
|
|
205
|
+
*/
|
|
206
|
+
getAppTaggingSecret(
|
|
207
|
+
contractAddress: AztecAddress,
|
|
208
|
+
sender: AztecAddress,
|
|
209
|
+
recipient: AztecAddress,
|
|
210
|
+
): Promise<IndexedTaggingSecret>;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Returns the siloed tagging secrets for a given recipient and all the senders in the address book
|
|
214
|
+
* @param contractAddress - The contract address to silo the secret for
|
|
215
|
+
* @param recipient - The address receiving the notes
|
|
216
|
+
* @returns A list of siloed tagging secrets
|
|
217
|
+
*/
|
|
218
|
+
getAppTaggingSecretsForSenders(
|
|
219
|
+
contractAddress: AztecAddress,
|
|
220
|
+
recipient: AztecAddress,
|
|
221
|
+
): Promise<IndexedTaggingSecret[]>;
|
|
196
222
|
}
|
|
@@ -2,10 +2,8 @@ import { PrivateExecutionResult } from '@aztec/circuit-types';
|
|
|
2
2
|
import { type CircuitWitnessGenerationStats } from '@aztec/circuit-types/stats';
|
|
3
3
|
import {
|
|
4
4
|
Fr,
|
|
5
|
-
FunctionData,
|
|
6
5
|
PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH,
|
|
7
6
|
PRIVATE_CONTEXT_INPUTS_LENGTH,
|
|
8
|
-
PrivateCallStackItem,
|
|
9
7
|
PrivateCircuitPublicInputs,
|
|
10
8
|
} from '@aztec/circuits.js';
|
|
11
9
|
import { type FunctionArtifact, type FunctionSelector, countArgumentsSize } from '@aztec/foundation/abi';
|
|
@@ -64,12 +62,6 @@ export async function executePrivateFunction(
|
|
|
64
62
|
const encryptedLogs = context.getEncryptedLogs();
|
|
65
63
|
const unencryptedLogs = context.getUnencryptedLogs();
|
|
66
64
|
|
|
67
|
-
const callStackItem = new PrivateCallStackItem(
|
|
68
|
-
contractAddress,
|
|
69
|
-
new FunctionData(functionSelector, true),
|
|
70
|
-
publicInputs,
|
|
71
|
-
);
|
|
72
|
-
|
|
73
65
|
const rawReturnValues = await context.unpackReturns(publicInputs.returnsHash);
|
|
74
66
|
|
|
75
67
|
const noteHashLeafIndexMap = context.getNoteHashLeafIndexMap();
|
|
@@ -85,7 +77,7 @@ export async function executePrivateFunction(
|
|
|
85
77
|
acir,
|
|
86
78
|
Buffer.from(artifact.verificationKey!, 'hex'),
|
|
87
79
|
partialWitness,
|
|
88
|
-
|
|
80
|
+
publicInputs,
|
|
89
81
|
noteHashLeafIndexMap,
|
|
90
82
|
newNotes,
|
|
91
83
|
noteHashNullifierCounterMap,
|
package/src/client/simulator.ts
CHANGED
|
@@ -66,14 +66,12 @@ export class AcirSimulator {
|
|
|
66
66
|
msgSender,
|
|
67
67
|
contractAddress,
|
|
68
68
|
FunctionSelector.fromNameAndParameters(entryPointArtifact.name, entryPointArtifact.parameters),
|
|
69
|
-
false,
|
|
70
69
|
entryPointArtifact.isStatic,
|
|
71
70
|
);
|
|
72
71
|
|
|
73
72
|
const txHash = request.toTxRequest().hash();
|
|
74
73
|
|
|
75
74
|
const context = new ClientExecutionContext(
|
|
76
|
-
contractAddress,
|
|
77
75
|
request.firstCallArgsHash,
|
|
78
76
|
request.txContext,
|
|
79
77
|
callContext,
|
|
@@ -7,7 +7,12 @@ import {
|
|
|
7
7
|
type NullifierMembershipWitness,
|
|
8
8
|
type PublicDataWitness,
|
|
9
9
|
} from '@aztec/circuit-types';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
type ContractInstance,
|
|
12
|
+
type Header,
|
|
13
|
+
type IndexedTaggingSecret,
|
|
14
|
+
type KeyValidationRequest,
|
|
15
|
+
} from '@aztec/circuits.js';
|
|
11
16
|
import { siloNullifier } from '@aztec/circuits.js/hash';
|
|
12
17
|
import { type AztecAddress } from '@aztec/foundation/aztec-address';
|
|
13
18
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -288,4 +293,29 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
288
293
|
const formattedStr = applyStringFormatting(message, fields);
|
|
289
294
|
this.log.verbose(`debug_log ${formattedStr}`);
|
|
290
295
|
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Returns the tagging secret for a given sender and recipient pair, siloed to the current contract address.
|
|
299
|
+
* Includes the last known index used for tagging with this secret.
|
|
300
|
+
* For this to work, the ivpsk_m of the sender must be known.
|
|
301
|
+
* @param sender - The address sending the note
|
|
302
|
+
* @param recipient - The address receiving the note
|
|
303
|
+
* @returns A tagging secret that can be used to tag notes.
|
|
304
|
+
*/
|
|
305
|
+
public override async getAppTaggingSecret(
|
|
306
|
+
sender: AztecAddress,
|
|
307
|
+
recipient: AztecAddress,
|
|
308
|
+
): Promise<IndexedTaggingSecret> {
|
|
309
|
+
return await this.db.getAppTaggingSecret(this.contractAddress, sender, recipient);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Returns the siloed tagging secrets for a given recipient and all the senders in the address book
|
|
314
|
+
* @param contractAddress - The contract address to silo the secret for
|
|
315
|
+
* @param recipient - The address receiving the notes
|
|
316
|
+
* @returns A list of siloed tagging secrets
|
|
317
|
+
*/
|
|
318
|
+
public override async getAppTaggingSecretsForSenders(recipient: AztecAddress): Promise<IndexedTaggingSecret[]> {
|
|
319
|
+
return await this.db.getAppTaggingSecretsForSenders(this.contractAddress, recipient);
|
|
320
|
+
}
|
|
291
321
|
}
|
package/src/common/index.ts
CHANGED
package/src/mocks/fixtures.ts
CHANGED
|
@@ -79,7 +79,7 @@ export class PublicExecutionResultBuilder {
|
|
|
79
79
|
revertReason?: SimulationError;
|
|
80
80
|
}) {
|
|
81
81
|
const builder = new PublicExecutionResultBuilder(
|
|
82
|
-
new PublicExecutionRequest(
|
|
82
|
+
new PublicExecutionRequest(new CallContext(from, tx.to, tx.selector, false), tx.args),
|
|
83
83
|
);
|
|
84
84
|
|
|
85
85
|
builder.withNestedExecutions(...nestedExecutions);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type CombinedConstantData,
|
|
3
|
-
type
|
|
3
|
+
type ContractClassIdPreimage,
|
|
4
4
|
type Gas,
|
|
5
|
+
type SerializableContractInstance,
|
|
5
6
|
type VMCircuitPublicInputs,
|
|
6
7
|
} from '@aztec/circuits.js';
|
|
7
8
|
import { type Fr } from '@aztec/foundation/fields';
|
|
@@ -15,8 +16,6 @@ import { type PublicExecutionResult } from './execution.js';
|
|
|
15
16
|
import { type PublicSideEffectTrace } from './side_effect_trace.js';
|
|
16
17
|
import { type PublicSideEffectTraceInterface } from './side_effect_trace_interface.js';
|
|
17
18
|
|
|
18
|
-
export type TracedContractInstance = { exists: boolean } & ContractInstanceWithAddress;
|
|
19
|
-
|
|
20
19
|
export class DualSideEffectTrace implements PublicSideEffectTraceInterface {
|
|
21
20
|
constructor(
|
|
22
21
|
public readonly innerCallTrace: PublicSideEffectTrace,
|
|
@@ -32,35 +31,35 @@ export class DualSideEffectTrace implements PublicSideEffectTraceInterface {
|
|
|
32
31
|
return this.innerCallTrace.getCounter();
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
public tracePublicStorageRead(
|
|
36
|
-
this.innerCallTrace.tracePublicStorageRead(
|
|
37
|
-
this.enqueuedCallTrace.tracePublicStorageRead(
|
|
34
|
+
public tracePublicStorageRead(contractAddress: Fr, slot: Fr, value: Fr, exists: boolean, cached: boolean) {
|
|
35
|
+
this.innerCallTrace.tracePublicStorageRead(contractAddress, slot, value, exists, cached);
|
|
36
|
+
this.enqueuedCallTrace.tracePublicStorageRead(contractAddress, slot, value, exists, cached);
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
public tracePublicStorageWrite(
|
|
41
|
-
this.innerCallTrace.tracePublicStorageWrite(
|
|
42
|
-
this.enqueuedCallTrace.tracePublicStorageWrite(
|
|
39
|
+
public tracePublicStorageWrite(contractAddress: Fr, slot: Fr, value: Fr) {
|
|
40
|
+
this.innerCallTrace.tracePublicStorageWrite(contractAddress, slot, value);
|
|
41
|
+
this.enqueuedCallTrace.tracePublicStorageWrite(contractAddress, slot, value);
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
// TODO(8287): _exists can be removed once we have the vm properly handling the equality check
|
|
46
|
-
public traceNoteHashCheck(
|
|
47
|
-
this.innerCallTrace.traceNoteHashCheck(
|
|
48
|
-
this.enqueuedCallTrace.traceNoteHashCheck(
|
|
45
|
+
public traceNoteHashCheck(_contractAddress: Fr, noteHash: Fr, leafIndex: Fr, exists: boolean) {
|
|
46
|
+
this.innerCallTrace.traceNoteHashCheck(_contractAddress, noteHash, leafIndex, exists);
|
|
47
|
+
this.enqueuedCallTrace.traceNoteHashCheck(_contractAddress, noteHash, leafIndex, exists);
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
public traceNewNoteHash(
|
|
52
|
-
this.innerCallTrace.traceNewNoteHash(
|
|
53
|
-
this.enqueuedCallTrace.traceNewNoteHash(
|
|
50
|
+
public traceNewNoteHash(_contractAddress: Fr, noteHash: Fr) {
|
|
51
|
+
this.innerCallTrace.traceNewNoteHash(_contractAddress, noteHash);
|
|
52
|
+
this.enqueuedCallTrace.traceNewNoteHash(_contractAddress, noteHash);
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
public traceNullifierCheck(
|
|
57
|
-
this.innerCallTrace.traceNullifierCheck(
|
|
58
|
-
this.enqueuedCallTrace.traceNullifierCheck(
|
|
55
|
+
public traceNullifierCheck(contractAddress: Fr, nullifier: Fr, leafIndex: Fr, exists: boolean, isPending: boolean) {
|
|
56
|
+
this.innerCallTrace.traceNullifierCheck(contractAddress, nullifier, leafIndex, exists, isPending);
|
|
57
|
+
this.enqueuedCallTrace.traceNullifierCheck(contractAddress, nullifier, leafIndex, exists, isPending);
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
public traceNewNullifier(
|
|
62
|
-
this.innerCallTrace.traceNewNullifier(
|
|
63
|
-
this.enqueuedCallTrace.traceNewNullifier(
|
|
60
|
+
public traceNewNullifier(contractAddress: Fr, nullifier: Fr) {
|
|
61
|
+
this.innerCallTrace.traceNewNullifier(contractAddress, nullifier);
|
|
62
|
+
this.enqueuedCallTrace.traceNewNullifier(contractAddress, nullifier);
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
public traceL1ToL2MessageCheck(contractAddress: Fr, msgHash: Fr, msgLeafIndex: Fr, exists: boolean) {
|
|
@@ -78,9 +77,24 @@ export class DualSideEffectTrace implements PublicSideEffectTraceInterface {
|
|
|
78
77
|
this.enqueuedCallTrace.traceUnencryptedLog(contractAddress, log);
|
|
79
78
|
}
|
|
80
79
|
|
|
81
|
-
public traceGetContractInstance(
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
public traceGetContractInstance(
|
|
81
|
+
contractAddress: Fr,
|
|
82
|
+
exists: boolean,
|
|
83
|
+
instance: SerializableContractInstance | undefined,
|
|
84
|
+
) {
|
|
85
|
+
this.innerCallTrace.traceGetContractInstance(contractAddress, exists, instance);
|
|
86
|
+
this.enqueuedCallTrace.traceGetContractInstance(contractAddress, exists, instance);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public traceGetBytecode(
|
|
90
|
+
contractAddress: Fr,
|
|
91
|
+
exists: boolean,
|
|
92
|
+
bytecode: Buffer,
|
|
93
|
+
contractInstance: SerializableContractInstance | undefined,
|
|
94
|
+
contractClass: ContractClassIdPreimage | undefined,
|
|
95
|
+
) {
|
|
96
|
+
this.innerCallTrace.traceGetBytecode(contractAddress, exists, bytecode, contractInstance, contractClass);
|
|
97
|
+
this.enqueuedCallTrace.traceGetBytecode(contractAddress, exists, bytecode, contractInstance, contractClass);
|
|
84
98
|
}
|
|
85
99
|
|
|
86
100
|
/**
|