@aztec/pxe 0.87.5 → 0.87.7
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/config/package_info.js +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +37 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -0
- package/dest/contract_function_simulator/contract_function_simulator.js +117 -0
- package/dest/contract_function_simulator/execution_data_provider.d.ts +301 -0
- package/dest/contract_function_simulator/execution_data_provider.d.ts.map +1 -0
- package/dest/contract_function_simulator/execution_data_provider.js +14 -0
- package/dest/contract_function_simulator/execution_note_cache.d.ts +93 -0
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/execution_note_cache.js +180 -0
- package/dest/contract_function_simulator/hashed_values_cache.d.ts +28 -0
- package/dest/contract_function_simulator/hashed_values_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/hashed_values_cache.js +36 -0
- package/dest/contract_function_simulator/index.d.ts +10 -0
- package/dest/contract_function_simulator/index.d.ts.map +1 -0
- package/dest/contract_function_simulator/index.js +8 -0
- package/dest/contract_function_simulator/oracle/index.d.ts +14 -0
- package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/index.js +2 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +19 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +24 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts +53 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/oracle.js +317 -0
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +24 -0
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/private_execution.js +100 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +187 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +325 -0
- package/dest/contract_function_simulator/oracle/typed_oracle.d.ts +83 -0
- package/dest/contract_function_simulator/oracle/typed_oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/typed_oracle.js +138 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +163 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +257 -0
- package/dest/contract_function_simulator/pick_notes.d.ts +85 -0
- package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -0
- package/dest/contract_function_simulator/pick_notes.js +51 -0
- package/dest/contract_function_simulator/proxied_node.d.ts +9 -0
- package/dest/contract_function_simulator/proxied_node.d.ts.map +1 -0
- package/dest/contract_function_simulator/proxied_node.js +27 -0
- package/dest/{pxe_oracle_interface → contract_function_simulator}/pxe_oracle_interface.d.ts +5 -4
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +1 -0
- package/dest/{pxe_oracle_interface → contract_function_simulator}/pxe_oracle_interface.js +16 -15
- package/dest/contract_function_simulator/tagging_utils.d.ts.map +1 -0
- package/dest/entrypoints/client/bundle/index.d.ts +1 -1
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +10 -4
- package/dest/entrypoints/client/lazy/index.d.ts +1 -1
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +1 -1
- package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +10 -4
- package/dest/entrypoints/{client/pxe_creation_options.d.ts → pxe_creation_options.d.ts} +4 -1
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -0
- package/dest/entrypoints/server/index.d.ts +1 -1
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +1 -1
- package/dest/entrypoints/server/utils.d.ts +6 -6
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +26 -18
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +6 -5
- package/dest/pxe_service/pxe_service.d.ts +2 -2
- package/dest/pxe_service/pxe_service.d.ts.map +1 -1
- package/dest/pxe_service/pxe_service.js +58 -28
- package/dest/storage/note_data_provider/note_dao.d.ts +1 -1
- package/dest/storage/note_data_provider/note_dao.d.ts.map +1 -1
- package/package.json +17 -15
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +193 -0
- package/src/contract_function_simulator/execution_data_provider.ts +391 -0
- package/src/contract_function_simulator/execution_note_cache.ts +217 -0
- package/src/contract_function_simulator/hashed_values_cache.ts +47 -0
- package/src/contract_function_simulator/index.ts +9 -0
- package/src/contract_function_simulator/oracle/index.ts +16 -0
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +23 -0
- package/src/contract_function_simulator/oracle/oracle.ts +541 -0
- package/src/contract_function_simulator/oracle/private_execution.ts +171 -0
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +518 -0
- package/src/contract_function_simulator/oracle/typed_oracle.ts +273 -0
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +384 -0
- package/src/contract_function_simulator/pick_notes.ts +141 -0
- package/src/contract_function_simulator/proxied_node.ts +33 -0
- package/src/{pxe_oracle_interface → contract_function_simulator}/pxe_oracle_interface.ts +18 -21
- package/src/entrypoints/client/bundle/index.ts +1 -1
- package/src/entrypoints/client/bundle/utils.ts +24 -16
- package/src/entrypoints/client/lazy/index.ts +1 -1
- package/src/entrypoints/client/lazy/utils.ts +25 -12
- package/src/entrypoints/{client/pxe_creation_options.ts → pxe_creation_options.ts} +4 -1
- package/src/entrypoints/server/index.ts +1 -1
- package/src/entrypoints/server/utils.ts +44 -26
- package/src/private_kernel/private_kernel_execution_prover.ts +6 -4
- package/src/pxe_service/pxe_service.ts +86 -45
- package/src/storage/note_data_provider/note_dao.ts +2 -1
- package/dest/entrypoints/client/pxe_creation_options.d.ts.map +0 -1
- package/dest/pxe_oracle_interface/pxe_oracle_interface.d.ts.map +0 -1
- package/dest/pxe_oracle_interface/tagging_utils.d.ts.map +0 -1
- /package/dest/{pxe_oracle_interface → contract_function_simulator}/tagging_utils.d.ts +0 -0
- /package/dest/{pxe_oracle_interface → contract_function_simulator}/tagging_utils.js +0 -0
- /package/dest/entrypoints/{client/pxe_creation_options.js → pxe_creation_options.js} +0 -0
- /package/src/{pxe_oracle_interface → contract_function_simulator}/tagging_utils.ts +0 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH, PRIVATE_CONTEXT_INPUTS_LENGTH } from '@aztec/constants';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
4
|
+
import { Timer } from '@aztec/foundation/timer';
|
|
5
|
+
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
6
|
+
import {
|
|
7
|
+
type ACVMWitness,
|
|
8
|
+
type CircuitSimulator,
|
|
9
|
+
ExecutionError,
|
|
10
|
+
extractCallStack,
|
|
11
|
+
resolveAssertionMessageFromError,
|
|
12
|
+
witnessMapToFields,
|
|
13
|
+
} from '@aztec/simulator/client';
|
|
14
|
+
import {
|
|
15
|
+
type FunctionArtifact,
|
|
16
|
+
type FunctionArtifactWithContractName,
|
|
17
|
+
type FunctionSelector,
|
|
18
|
+
countArgumentsSize,
|
|
19
|
+
} from '@aztec/stdlib/abi';
|
|
20
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
21
|
+
import type { ContractInstance } from '@aztec/stdlib/contract';
|
|
22
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
23
|
+
import { PrivateCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
24
|
+
import { SharedMutableValues, SharedMutableValuesWithHash } from '@aztec/stdlib/shared-mutable';
|
|
25
|
+
import type { CircuitWitnessGenerationStats } from '@aztec/stdlib/stats';
|
|
26
|
+
import { PrivateCallExecutionResult } from '@aztec/stdlib/tx';
|
|
27
|
+
|
|
28
|
+
import type { ExecutionDataProvider } from '../execution_data_provider.js';
|
|
29
|
+
import { Oracle } from './oracle.js';
|
|
30
|
+
import type { PrivateExecutionOracle } from './private_execution_oracle.js';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Execute a private function and return the execution result.
|
|
34
|
+
*/
|
|
35
|
+
export async function executePrivateFunction(
|
|
36
|
+
simulator: CircuitSimulator,
|
|
37
|
+
privateExecutionOracle: PrivateExecutionOracle,
|
|
38
|
+
artifact: FunctionArtifactWithContractName,
|
|
39
|
+
contractAddress: AztecAddress,
|
|
40
|
+
functionSelector: FunctionSelector,
|
|
41
|
+
log = createLogger('simulator:private_execution'),
|
|
42
|
+
): Promise<PrivateCallExecutionResult> {
|
|
43
|
+
const functionName = await privateExecutionOracle.getDebugFunctionName();
|
|
44
|
+
log.verbose(`Executing private function ${functionName}`, { contract: contractAddress });
|
|
45
|
+
const initialWitness = privateExecutionOracle.getInitialWitness(artifact);
|
|
46
|
+
const acvmCallback = new Oracle(privateExecutionOracle);
|
|
47
|
+
const timer = new Timer();
|
|
48
|
+
const acirExecutionResult = await simulator
|
|
49
|
+
.executeUserCircuit(initialWitness, artifact, acvmCallback.toACIRCallback())
|
|
50
|
+
.catch((err: Error) => {
|
|
51
|
+
err.message = resolveAssertionMessageFromError(err, artifact);
|
|
52
|
+
throw new ExecutionError(
|
|
53
|
+
err.message,
|
|
54
|
+
{
|
|
55
|
+
contractAddress,
|
|
56
|
+
functionSelector,
|
|
57
|
+
},
|
|
58
|
+
extractCallStack(err, artifact.debug),
|
|
59
|
+
{ cause: err },
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
const duration = timer.ms();
|
|
63
|
+
const partialWitness = acirExecutionResult.partialWitness;
|
|
64
|
+
const publicInputs = extractPrivateCircuitPublicInputs(artifact, partialWitness);
|
|
65
|
+
|
|
66
|
+
// TODO (alexg) estimate this size
|
|
67
|
+
const initialWitnessSize = witnessMapToFields(initialWitness).length * Fr.SIZE_IN_BYTES;
|
|
68
|
+
log.debug(`Ran external function ${contractAddress.toString()}:${functionSelector}`, {
|
|
69
|
+
circuitName: 'app-circuit',
|
|
70
|
+
duration,
|
|
71
|
+
eventName: 'circuit-witness-generation',
|
|
72
|
+
inputSize: initialWitnessSize,
|
|
73
|
+
outputSize: publicInputs.toBuffer().length,
|
|
74
|
+
appCircuitName: functionName,
|
|
75
|
+
} satisfies CircuitWitnessGenerationStats);
|
|
76
|
+
|
|
77
|
+
const contractClassLogs = privateExecutionOracle.getContractClassLogs();
|
|
78
|
+
|
|
79
|
+
const rawReturnValues = await privateExecutionOracle.loadFromExecutionCache(publicInputs.returnsHash);
|
|
80
|
+
|
|
81
|
+
const noteHashLeafIndexMap = privateExecutionOracle.getNoteHashLeafIndexMap();
|
|
82
|
+
const newNotes = privateExecutionOracle.getNewNotes();
|
|
83
|
+
const noteHashNullifierCounterMap = privateExecutionOracle.getNoteHashNullifierCounterMap();
|
|
84
|
+
const nestedExecutions = privateExecutionOracle.getNestedExecutions();
|
|
85
|
+
|
|
86
|
+
let timerSubtractionList = nestedExecutions;
|
|
87
|
+
let witgenTime = duration;
|
|
88
|
+
|
|
89
|
+
// Due to the recursive nature of execution, we have to subtract the time taken by nested calls
|
|
90
|
+
while (timerSubtractionList.length > 0) {
|
|
91
|
+
witgenTime -= timerSubtractionList.reduce((acc, nested) => acc + (nested.profileResult?.timings.witgen ?? 0), 0);
|
|
92
|
+
timerSubtractionList = timerSubtractionList.flatMap(nested => nested.nestedExecutions ?? []);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
log.debug(`Returning from call to ${contractAddress.toString()}:${functionSelector}`);
|
|
96
|
+
|
|
97
|
+
return new PrivateCallExecutionResult(
|
|
98
|
+
artifact.bytecode,
|
|
99
|
+
Buffer.from(artifact.verificationKey!, 'base64'),
|
|
100
|
+
partialWitness,
|
|
101
|
+
publicInputs,
|
|
102
|
+
noteHashLeafIndexMap,
|
|
103
|
+
newNotes,
|
|
104
|
+
noteHashNullifierCounterMap,
|
|
105
|
+
rawReturnValues,
|
|
106
|
+
nestedExecutions,
|
|
107
|
+
contractClassLogs,
|
|
108
|
+
{
|
|
109
|
+
timings: {
|
|
110
|
+
witgen: witgenTime,
|
|
111
|
+
oracles: acirExecutionResult.oracles,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Get the private circuit public inputs from the partial witness.
|
|
119
|
+
* @param artifact - The function artifact
|
|
120
|
+
* @param partialWitness - The partial witness, result of simulating the function.
|
|
121
|
+
* @returns - The public inputs.
|
|
122
|
+
*/
|
|
123
|
+
export function extractPrivateCircuitPublicInputs(
|
|
124
|
+
artifact: FunctionArtifact,
|
|
125
|
+
partialWitness: ACVMWitness,
|
|
126
|
+
): PrivateCircuitPublicInputs {
|
|
127
|
+
const parametersSize = countArgumentsSize(artifact) + PRIVATE_CONTEXT_INPUTS_LENGTH;
|
|
128
|
+
const returnsSize = PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH;
|
|
129
|
+
const returnData = [];
|
|
130
|
+
// Return values always appear in the witness after arguments.
|
|
131
|
+
for (let i = parametersSize; i < parametersSize + returnsSize; i++) {
|
|
132
|
+
const returnedField = partialWitness.get(i);
|
|
133
|
+
if (returnedField === undefined) {
|
|
134
|
+
throw new Error(`Missing return value for index ${i}`);
|
|
135
|
+
}
|
|
136
|
+
returnData.push(Fr.fromString(returnedField));
|
|
137
|
+
}
|
|
138
|
+
return PrivateCircuitPublicInputs.fromFields(returnData);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export async function readCurrentClassId(
|
|
142
|
+
contractAddress: AztecAddress,
|
|
143
|
+
instance: ContractInstance,
|
|
144
|
+
executionDataProvider: ExecutionDataProvider | AztecNode,
|
|
145
|
+
blockNumber: number,
|
|
146
|
+
) {
|
|
147
|
+
const { sharedMutableSlot } = await SharedMutableValuesWithHash.getContractUpdateSlots(contractAddress);
|
|
148
|
+
const sharedMutableValues = await SharedMutableValues.readFromTree(sharedMutableSlot, slot =>
|
|
149
|
+
executionDataProvider.getPublicStorageAt(blockNumber, ProtocolContractAddress.ContractInstanceDeployer, slot),
|
|
150
|
+
);
|
|
151
|
+
let currentClassId = sharedMutableValues.svc.getCurrentAt(blockNumber)[0];
|
|
152
|
+
if (currentClassId.isZero()) {
|
|
153
|
+
currentClassId = instance.originalContractClassId;
|
|
154
|
+
}
|
|
155
|
+
return currentClassId;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export async function verifyCurrentClassId(
|
|
159
|
+
contractAddress: AztecAddress,
|
|
160
|
+
executionDataProvider: ExecutionDataProvider,
|
|
161
|
+
blockNumber?: number,
|
|
162
|
+
) {
|
|
163
|
+
const instance = await executionDataProvider.getContractInstance(contractAddress);
|
|
164
|
+
blockNumber = blockNumber ?? (await executionDataProvider.getBlockNumber());
|
|
165
|
+
const currentClassId = await readCurrentClassId(contractAddress, instance, executionDataProvider, blockNumber);
|
|
166
|
+
if (!instance.currentContractClassId.equals(currentClassId)) {
|
|
167
|
+
throw new Error(
|
|
168
|
+
`Contract ${contractAddress} is outdated, current class id is ${currentClassId}, local class id is ${instance.currentContractClassId}`,
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
import { MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS, PRIVATE_CONTEXT_INPUTS_LENGTH } from '@aztec/constants';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
4
|
+
import { Timer } from '@aztec/foundation/timer';
|
|
5
|
+
import { type CircuitSimulator, toACVMWitness } from '@aztec/simulator/client';
|
|
6
|
+
import {
|
|
7
|
+
type FunctionAbi,
|
|
8
|
+
type FunctionArtifact,
|
|
9
|
+
FunctionSelector,
|
|
10
|
+
type NoteSelector,
|
|
11
|
+
countArgumentsSize,
|
|
12
|
+
} from '@aztec/stdlib/abi';
|
|
13
|
+
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
14
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
15
|
+
import { computeUniqueNoteHash, siloNoteHash } from '@aztec/stdlib/hash';
|
|
16
|
+
import { PrivateContextInputs } from '@aztec/stdlib/kernel';
|
|
17
|
+
import type { ContractClassLog } from '@aztec/stdlib/logs';
|
|
18
|
+
import { Note, type NoteStatus } from '@aztec/stdlib/note';
|
|
19
|
+
import {
|
|
20
|
+
type BlockHeader,
|
|
21
|
+
CallContext,
|
|
22
|
+
Capsule,
|
|
23
|
+
CountedContractClassLog,
|
|
24
|
+
NoteAndSlot,
|
|
25
|
+
PrivateCallExecutionResult,
|
|
26
|
+
type TxContext,
|
|
27
|
+
} from '@aztec/stdlib/tx';
|
|
28
|
+
|
|
29
|
+
import type { ExecutionDataProvider } from '../execution_data_provider.js';
|
|
30
|
+
import type { ExecutionNoteCache } from '../execution_note_cache.js';
|
|
31
|
+
import type { HashedValuesCache } from '../hashed_values_cache.js';
|
|
32
|
+
import { pickNotes } from '../pick_notes.js';
|
|
33
|
+
import { executePrivateFunction, verifyCurrentClassId } from './private_execution.js';
|
|
34
|
+
import type { NoteData } from './typed_oracle.js';
|
|
35
|
+
import { UtilityExecutionOracle } from './utility_execution_oracle.js';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The execution oracle for the private part of a transaction.
|
|
39
|
+
*/
|
|
40
|
+
export class PrivateExecutionOracle extends UtilityExecutionOracle {
|
|
41
|
+
/**
|
|
42
|
+
* New notes created during this execution.
|
|
43
|
+
* It's possible that a note in this list has been nullified (in the same or other executions) and doesn't exist in the ExecutionNoteCache and the final proof data.
|
|
44
|
+
* But we still include those notes in the execution result because their commitments are still in the public inputs of this execution.
|
|
45
|
+
* This information is only for references (currently used for tests), and is not used for any sort of constrains.
|
|
46
|
+
* Users can also use this to get a clearer idea of what's happened during a simulation.
|
|
47
|
+
*/
|
|
48
|
+
private newNotes: NoteAndSlot[] = [];
|
|
49
|
+
/**
|
|
50
|
+
* Notes from previous transactions that are returned to the oracle call `getNotes` during this execution.
|
|
51
|
+
* The mapping maps from the unique siloed note hash to the index for notes created in private executions.
|
|
52
|
+
* It maps from siloed note hash to the index for notes created by public functions.
|
|
53
|
+
*
|
|
54
|
+
* They are not part of the ExecutionNoteCache and being forwarded to nested contexts via `extend()`
|
|
55
|
+
* because these notes are meant to be maintained on a per-call basis
|
|
56
|
+
* They should act as references for the read requests output by an app circuit via public inputs.
|
|
57
|
+
*/
|
|
58
|
+
private noteHashLeafIndexMap: Map<bigint, bigint> = new Map();
|
|
59
|
+
private noteHashNullifierCounterMap: Map<number, number> = new Map();
|
|
60
|
+
private contractClassLogs: CountedContractClassLog[] = [];
|
|
61
|
+
private nestedExecutions: PrivateCallExecutionResult[] = [];
|
|
62
|
+
|
|
63
|
+
constructor(
|
|
64
|
+
private readonly argsHash: Fr,
|
|
65
|
+
private readonly txContext: TxContext,
|
|
66
|
+
private readonly callContext: CallContext,
|
|
67
|
+
/** Header of a block whose state is used during private execution (not the block the transaction is included in). */
|
|
68
|
+
protected readonly historicalHeader: BlockHeader,
|
|
69
|
+
/** List of transient auth witnesses to be used during this simulation */
|
|
70
|
+
authWitnesses: AuthWitness[],
|
|
71
|
+
capsules: Capsule[],
|
|
72
|
+
private readonly executionCache: HashedValuesCache,
|
|
73
|
+
private readonly noteCache: ExecutionNoteCache,
|
|
74
|
+
executionDataProvider: ExecutionDataProvider,
|
|
75
|
+
private simulator: CircuitSimulator,
|
|
76
|
+
private totalPublicCalldataCount: number,
|
|
77
|
+
protected sideEffectCounter: number = 0,
|
|
78
|
+
log = createLogger('simulator:client_execution_context'),
|
|
79
|
+
scopes?: AztecAddress[],
|
|
80
|
+
) {
|
|
81
|
+
super(callContext.contractAddress, authWitnesses, capsules, executionDataProvider, log, scopes);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// We still need this function until we can get user-defined ordering of structs for fn arguments
|
|
85
|
+
// TODO When that is sorted out on noir side, we can use instead the utilities in serialize.ts
|
|
86
|
+
/**
|
|
87
|
+
* Writes the function inputs to the initial witness.
|
|
88
|
+
* @param abi - The function ABI.
|
|
89
|
+
* @returns The initial witness.
|
|
90
|
+
*/
|
|
91
|
+
public getInitialWitness(abi: FunctionAbi) {
|
|
92
|
+
const argumentsSize = countArgumentsSize(abi);
|
|
93
|
+
|
|
94
|
+
const args = this.executionCache.getPreimage(this.argsHash);
|
|
95
|
+
|
|
96
|
+
if (args?.length !== argumentsSize) {
|
|
97
|
+
throw new Error(`Invalid arguments size: expected ${argumentsSize}, got ${args?.length}`);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const privateContextInputs = new PrivateContextInputs(
|
|
101
|
+
this.callContext,
|
|
102
|
+
this.historicalHeader,
|
|
103
|
+
this.txContext,
|
|
104
|
+
this.sideEffectCounter,
|
|
105
|
+
);
|
|
106
|
+
const privateContextInputsAsFields = privateContextInputs.toFields();
|
|
107
|
+
if (privateContextInputsAsFields.length !== PRIVATE_CONTEXT_INPUTS_LENGTH) {
|
|
108
|
+
throw new Error('Invalid private context inputs size');
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const fields = [...privateContextInputsAsFields, ...args];
|
|
112
|
+
return toACVMWitness(0, fields);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The KernelProver will use this to fully populate witnesses and provide hints to the kernel circuit
|
|
117
|
+
* regarding which note hash each settled read request corresponds to.
|
|
118
|
+
*/
|
|
119
|
+
public getNoteHashLeafIndexMap() {
|
|
120
|
+
return this.noteHashLeafIndexMap;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Get the data for the newly created notes.
|
|
125
|
+
*/
|
|
126
|
+
public getNewNotes(): NoteAndSlot[] {
|
|
127
|
+
return this.newNotes;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
public getNoteHashNullifierCounterMap() {
|
|
131
|
+
return this.noteHashNullifierCounterMap;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Return the contract class logs emitted during this execution.
|
|
136
|
+
*/
|
|
137
|
+
public getContractClassLogs() {
|
|
138
|
+
return this.contractClassLogs;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Return the nested execution results during this execution.
|
|
143
|
+
*/
|
|
144
|
+
public getNestedExecutions() {
|
|
145
|
+
return this.nestedExecutions;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Store values in the execution cache.
|
|
150
|
+
* @param values - Values to store.
|
|
151
|
+
* @returns The hash of the values.
|
|
152
|
+
*/
|
|
153
|
+
public override storeInExecutionCache(values: Fr[], hash: Fr) {
|
|
154
|
+
return this.executionCache.store(values, hash);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Gets values from the execution cache.
|
|
159
|
+
* @param hash - Hash of the values.
|
|
160
|
+
* @returns The values.
|
|
161
|
+
*/
|
|
162
|
+
public override loadFromExecutionCache(hash: Fr): Promise<Fr[]> {
|
|
163
|
+
const preimage = this.executionCache.getPreimage(hash);
|
|
164
|
+
if (!preimage) {
|
|
165
|
+
throw new Error(`Preimage for hash ${hash.toString()} not found in cache`);
|
|
166
|
+
}
|
|
167
|
+
return Promise.resolve(preimage);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Gets some notes for a storage slot.
|
|
172
|
+
*
|
|
173
|
+
* @remarks
|
|
174
|
+
* Check for pending notes with matching slot.
|
|
175
|
+
* Real notes coming from DB will have a leafIndex which
|
|
176
|
+
* represents their index in the note hash tree.
|
|
177
|
+
*
|
|
178
|
+
* @param storageSlot - The storage slot.
|
|
179
|
+
* @param numSelects - The number of valid selects in selectBy and selectValues.
|
|
180
|
+
* @param selectBy - An array of indices of the fields to selects.
|
|
181
|
+
* @param selectValues - The values to match.
|
|
182
|
+
* @param selectComparators - The comparators to match by.
|
|
183
|
+
* @param sortBy - An array of indices of the fields to sort.
|
|
184
|
+
* @param sortOrder - The order of the corresponding index in sortBy. (1: DESC, 2: ASC, 0: Do nothing)
|
|
185
|
+
* @param limit - The number of notes to retrieve per query.
|
|
186
|
+
* @param offset - The starting index for pagination.
|
|
187
|
+
* @param status - The status of notes to fetch.
|
|
188
|
+
* @returns Array of note data.
|
|
189
|
+
*/
|
|
190
|
+
public override async getNotes(
|
|
191
|
+
storageSlot: Fr,
|
|
192
|
+
numSelects: number,
|
|
193
|
+
selectByIndexes: number[],
|
|
194
|
+
selectByOffsets: number[],
|
|
195
|
+
selectByLengths: number[],
|
|
196
|
+
selectValues: Fr[],
|
|
197
|
+
selectComparators: number[],
|
|
198
|
+
sortByIndexes: number[],
|
|
199
|
+
sortByOffsets: number[],
|
|
200
|
+
sortByLengths: number[],
|
|
201
|
+
sortOrder: number[],
|
|
202
|
+
limit: number,
|
|
203
|
+
offset: number,
|
|
204
|
+
status: NoteStatus,
|
|
205
|
+
): Promise<NoteData[]> {
|
|
206
|
+
// Nullified pending notes are already removed from the list.
|
|
207
|
+
const pendingNotes = this.noteCache.getNotes(this.callContext.contractAddress, storageSlot);
|
|
208
|
+
|
|
209
|
+
const pendingNullifiers = this.noteCache.getNullifiers(this.callContext.contractAddress);
|
|
210
|
+
const dbNotes = await this.executionDataProvider.getNotes(
|
|
211
|
+
this.callContext.contractAddress,
|
|
212
|
+
storageSlot,
|
|
213
|
+
status,
|
|
214
|
+
this.scopes,
|
|
215
|
+
);
|
|
216
|
+
const dbNotesFiltered = dbNotes.filter(n => !pendingNullifiers.has((n.siloedNullifier as Fr).value));
|
|
217
|
+
|
|
218
|
+
const notes = pickNotes<NoteData>([...dbNotesFiltered, ...pendingNotes], {
|
|
219
|
+
selects: selectByIndexes.slice(0, numSelects).map((index, i) => ({
|
|
220
|
+
selector: { index, offset: selectByOffsets[i], length: selectByLengths[i] },
|
|
221
|
+
value: selectValues[i],
|
|
222
|
+
comparator: selectComparators[i],
|
|
223
|
+
})),
|
|
224
|
+
sorts: sortByIndexes.map((index, i) => ({
|
|
225
|
+
selector: { index, offset: sortByOffsets[i], length: sortByLengths[i] },
|
|
226
|
+
order: sortOrder[i],
|
|
227
|
+
})),
|
|
228
|
+
limit,
|
|
229
|
+
offset,
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
this.log.debug(
|
|
233
|
+
`Returning ${notes.length} notes for ${this.callContext.contractAddress} at ${storageSlot}: ${notes
|
|
234
|
+
.map(n => `${n.nonce.toString()}:[${n.note.items.map(i => i.toString()).join(',')}]`)
|
|
235
|
+
.join(', ')}`,
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
const noteHashesAndIndexes = await Promise.all(
|
|
239
|
+
notes.map(async n => {
|
|
240
|
+
if (n.index !== undefined) {
|
|
241
|
+
const siloedNoteHash = await siloNoteHash(n.contractAddress, n.noteHash);
|
|
242
|
+
const uniqueNoteHash = await computeUniqueNoteHash(n.nonce, siloedNoteHash);
|
|
243
|
+
|
|
244
|
+
return { hash: uniqueNoteHash, index: n.index };
|
|
245
|
+
}
|
|
246
|
+
}),
|
|
247
|
+
);
|
|
248
|
+
|
|
249
|
+
noteHashesAndIndexes
|
|
250
|
+
.filter(n => n !== undefined)
|
|
251
|
+
.forEach(n => {
|
|
252
|
+
this.noteHashLeafIndexMap.set(n!.hash.toBigInt(), n!.index);
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
return notes;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Keep track of the new note created during execution.
|
|
260
|
+
* It can be used in subsequent calls (or transactions when chaining txs is possible).
|
|
261
|
+
* @param contractAddress - The contract address.
|
|
262
|
+
* @param storageSlot - The storage slot.
|
|
263
|
+
* @param noteTypeId - The type ID of the note.
|
|
264
|
+
* @param noteItems - The items to be included in a Note.
|
|
265
|
+
* @param noteHash - A hash of the new note.
|
|
266
|
+
* @returns
|
|
267
|
+
*/
|
|
268
|
+
public override notifyCreatedNote(
|
|
269
|
+
storageSlot: Fr,
|
|
270
|
+
noteTypeId: NoteSelector,
|
|
271
|
+
noteItems: Fr[],
|
|
272
|
+
noteHash: Fr,
|
|
273
|
+
counter: number,
|
|
274
|
+
) {
|
|
275
|
+
this.log.debug(`Notified of new note with inner hash ${noteHash}`, {
|
|
276
|
+
contractAddress: this.callContext.contractAddress,
|
|
277
|
+
storageSlot,
|
|
278
|
+
noteTypeId,
|
|
279
|
+
counter,
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
const note = new Note(noteItems);
|
|
283
|
+
this.noteCache.addNewNote(
|
|
284
|
+
{
|
|
285
|
+
contractAddress: this.callContext.contractAddress,
|
|
286
|
+
storageSlot,
|
|
287
|
+
nonce: Fr.ZERO, // Nonce cannot be known during private execution.
|
|
288
|
+
note,
|
|
289
|
+
siloedNullifier: undefined, // Siloed nullifier cannot be known for newly created note.
|
|
290
|
+
noteHash,
|
|
291
|
+
},
|
|
292
|
+
counter,
|
|
293
|
+
);
|
|
294
|
+
this.newNotes.push(new NoteAndSlot(note, storageSlot, noteTypeId));
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Adding a siloed nullifier into the current set of all pending nullifiers created
|
|
299
|
+
* within the current transaction/execution.
|
|
300
|
+
* @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
|
|
301
|
+
* @param noteHash - A hash of the new note.
|
|
302
|
+
*/
|
|
303
|
+
public override async notifyNullifiedNote(innerNullifier: Fr, noteHash: Fr, counter: number) {
|
|
304
|
+
const nullifiedNoteHashCounter = await this.noteCache.nullifyNote(
|
|
305
|
+
this.callContext.contractAddress,
|
|
306
|
+
innerNullifier,
|
|
307
|
+
noteHash,
|
|
308
|
+
);
|
|
309
|
+
if (nullifiedNoteHashCounter !== undefined) {
|
|
310
|
+
this.noteHashNullifierCounterMap.set(nullifiedNoteHashCounter, counter);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Adding a siloed nullifier into the current set of all pending nullifiers created
|
|
316
|
+
* within the current transaction/execution.
|
|
317
|
+
* @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
|
|
318
|
+
* @param noteHash - A hash of the new note.
|
|
319
|
+
*/
|
|
320
|
+
public override notifyCreatedNullifier(innerNullifier: Fr) {
|
|
321
|
+
return this.noteCache.nullifierCreated(this.callContext.contractAddress, innerNullifier);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Emit a contract class log.
|
|
326
|
+
* This fn exists because we only carry a poseidon hash through the kernels, and need to
|
|
327
|
+
* keep the preimage in ts for later.
|
|
328
|
+
* @param log - The contract class log to be emitted.
|
|
329
|
+
* @param counter - The contract class log's counter.
|
|
330
|
+
*/
|
|
331
|
+
public override notifyCreatedContractClassLog(log: ContractClassLog, counter: number) {
|
|
332
|
+
this.contractClassLogs.push(new CountedContractClassLog(log, counter));
|
|
333
|
+
const text = log.toBuffer().toString('hex');
|
|
334
|
+
this.log.verbose(
|
|
335
|
+
`Emitted log from ContractClassRegisterer: "${text.length > 100 ? text.slice(0, 100) + '...' : text}"`,
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
#checkValidStaticCall(childExecutionResult: PrivateCallExecutionResult) {
|
|
340
|
+
if (
|
|
341
|
+
childExecutionResult.publicInputs.noteHashes.some(item => !item.isEmpty()) ||
|
|
342
|
+
childExecutionResult.publicInputs.nullifiers.some(item => !item.isEmpty()) ||
|
|
343
|
+
childExecutionResult.publicInputs.l2ToL1Msgs.some(item => !item.isEmpty()) ||
|
|
344
|
+
childExecutionResult.publicInputs.privateLogs.some(item => !item.isEmpty()) ||
|
|
345
|
+
childExecutionResult.publicInputs.contractClassLogsHashes.some(item => !item.isEmpty())
|
|
346
|
+
) {
|
|
347
|
+
throw new Error(`Static call cannot update the state, emit L2->L1 messages or generate logs`);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Calls a private function as a nested execution.
|
|
353
|
+
* @param targetContractAddress - The address of the contract to call.
|
|
354
|
+
* @param functionSelector - The function selector of the function to call.
|
|
355
|
+
* @param argsHash - The arguments hash to pass to the function.
|
|
356
|
+
* @param sideEffectCounter - The side effect counter at the start of the call.
|
|
357
|
+
* @param isStaticCall - Whether the call is a static call.
|
|
358
|
+
* @returns The execution result.
|
|
359
|
+
*/
|
|
360
|
+
override async callPrivateFunction(
|
|
361
|
+
targetContractAddress: AztecAddress,
|
|
362
|
+
functionSelector: FunctionSelector,
|
|
363
|
+
argsHash: Fr,
|
|
364
|
+
sideEffectCounter: number,
|
|
365
|
+
isStaticCall: boolean,
|
|
366
|
+
) {
|
|
367
|
+
const simulatorSetupTimer = new Timer();
|
|
368
|
+
this.log.debug(
|
|
369
|
+
`Calling private function ${targetContractAddress}:${functionSelector} from ${this.callContext.contractAddress}`,
|
|
370
|
+
);
|
|
371
|
+
|
|
372
|
+
isStaticCall = isStaticCall || this.callContext.isStaticCall;
|
|
373
|
+
|
|
374
|
+
await verifyCurrentClassId(
|
|
375
|
+
targetContractAddress,
|
|
376
|
+
this.executionDataProvider,
|
|
377
|
+
this.historicalHeader.globalVariables.blockNumber.toNumber(),
|
|
378
|
+
);
|
|
379
|
+
|
|
380
|
+
const targetArtifact = await this.executionDataProvider.getFunctionArtifact(
|
|
381
|
+
targetContractAddress,
|
|
382
|
+
functionSelector,
|
|
383
|
+
);
|
|
384
|
+
|
|
385
|
+
const derivedTxContext = this.txContext.clone();
|
|
386
|
+
|
|
387
|
+
const derivedCallContext = await this.deriveCallContext(targetContractAddress, targetArtifact, isStaticCall);
|
|
388
|
+
|
|
389
|
+
const context = new PrivateExecutionOracle(
|
|
390
|
+
argsHash,
|
|
391
|
+
derivedTxContext,
|
|
392
|
+
derivedCallContext,
|
|
393
|
+
this.historicalHeader,
|
|
394
|
+
this.authWitnesses,
|
|
395
|
+
this.capsules,
|
|
396
|
+
this.executionCache,
|
|
397
|
+
this.noteCache,
|
|
398
|
+
this.executionDataProvider,
|
|
399
|
+
this.simulator,
|
|
400
|
+
this.totalPublicCalldataCount,
|
|
401
|
+
sideEffectCounter,
|
|
402
|
+
this.log,
|
|
403
|
+
this.scopes,
|
|
404
|
+
);
|
|
405
|
+
|
|
406
|
+
const setupTime = simulatorSetupTimer.ms();
|
|
407
|
+
|
|
408
|
+
const childExecutionResult = await executePrivateFunction(
|
|
409
|
+
this.simulator,
|
|
410
|
+
context,
|
|
411
|
+
targetArtifact,
|
|
412
|
+
targetContractAddress,
|
|
413
|
+
functionSelector,
|
|
414
|
+
);
|
|
415
|
+
|
|
416
|
+
if (isStaticCall) {
|
|
417
|
+
this.#checkValidStaticCall(childExecutionResult);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
this.nestedExecutions.push(childExecutionResult);
|
|
421
|
+
|
|
422
|
+
const publicInputs = childExecutionResult.publicInputs;
|
|
423
|
+
|
|
424
|
+
// Add simulator overhead to this call
|
|
425
|
+
if (childExecutionResult.profileResult) {
|
|
426
|
+
childExecutionResult.profileResult.timings.witgen += setupTime;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
return {
|
|
430
|
+
endSideEffectCounter: publicInputs.endSideEffectCounter,
|
|
431
|
+
returnsHash: publicInputs.returnsHash,
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
#onNewPublicFunctionCall(calldataHash: Fr) {
|
|
436
|
+
const calldata = this.executionCache.getPreimage(calldataHash);
|
|
437
|
+
if (!calldata) {
|
|
438
|
+
throw new Error('Calldata for public call not found in cache');
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
this.totalPublicCalldataCount += calldata.length;
|
|
442
|
+
if (this.totalPublicCalldataCount > MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS) {
|
|
443
|
+
throw new Error(`Too many total args to all enqueued public calls! (> ${MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS})`);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Verify relevant information when a public function is enqueued.
|
|
449
|
+
* @param targetContractAddress - The address of the contract to call.
|
|
450
|
+
* @param calldataHash - The hash of the function selector and arguments.
|
|
451
|
+
* @param sideEffectCounter - The side effect counter at the start of the call.
|
|
452
|
+
* @param isStaticCall - Whether the call is a static call.
|
|
453
|
+
*/
|
|
454
|
+
public override notifyEnqueuedPublicFunctionCall(
|
|
455
|
+
_targetContractAddress: AztecAddress,
|
|
456
|
+
calldataHash: Fr,
|
|
457
|
+
_sideEffectCounter: number,
|
|
458
|
+
_isStaticCall: boolean,
|
|
459
|
+
) {
|
|
460
|
+
this.#onNewPublicFunctionCall(calldataHash);
|
|
461
|
+
return Promise.resolve();
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Verify relevant information when a public teardown function is set.
|
|
466
|
+
* @param targetContractAddress - The address of the contract to call.
|
|
467
|
+
* @param argsHash - The arguments hash to pass to the function.
|
|
468
|
+
* @param sideEffectCounter - The side effect counter at the start of the call.
|
|
469
|
+
* @param isStaticCall - Whether the call is a static call.
|
|
470
|
+
*/
|
|
471
|
+
public override notifySetPublicTeardownFunctionCall(
|
|
472
|
+
_targetContractAddress: AztecAddress,
|
|
473
|
+
calldataHash: Fr,
|
|
474
|
+
_sideEffectCounter: number,
|
|
475
|
+
_isStaticCall: boolean,
|
|
476
|
+
) {
|
|
477
|
+
this.#onNewPublicFunctionCall(calldataHash);
|
|
478
|
+
return Promise.resolve();
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
public override notifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter: number): Promise<void> {
|
|
482
|
+
return this.noteCache.setMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Derives the call context for a nested execution.
|
|
487
|
+
* @param targetContractAddress - The address of the contract being called.
|
|
488
|
+
* @param targetArtifact - The artifact of the function being called.
|
|
489
|
+
* @param isStaticCall - Whether the call is a static call.
|
|
490
|
+
* @returns The derived call context.
|
|
491
|
+
*/
|
|
492
|
+
private async deriveCallContext(
|
|
493
|
+
targetContractAddress: AztecAddress,
|
|
494
|
+
targetArtifact: FunctionArtifact,
|
|
495
|
+
isStaticCall = false,
|
|
496
|
+
) {
|
|
497
|
+
return new CallContext(
|
|
498
|
+
this.contractAddress,
|
|
499
|
+
targetContractAddress,
|
|
500
|
+
await FunctionSelector.fromNameAndParameters(targetArtifact.name, targetArtifact.parameters),
|
|
501
|
+
isStaticCall,
|
|
502
|
+
);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
public getDebugFunctionName() {
|
|
506
|
+
return this.executionDataProvider.getDebugFunctionName(this.contractAddress, this.callContext.functionSelector);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
public override async incrementAppTaggingSecretIndexAsSender(sender: AztecAddress, recipient: AztecAddress) {
|
|
510
|
+
await this.executionDataProvider.incrementAppTaggingSecretIndexAsSender(this.contractAddress, sender, recipient);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
public override async fetchTaggedLogs(pendingTaggedLogArrayBaseSlot: Fr) {
|
|
514
|
+
await this.executionDataProvider.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes);
|
|
515
|
+
|
|
516
|
+
await this.executionDataProvider.removeNullifiedNotes(this.contractAddress);
|
|
517
|
+
}
|
|
518
|
+
}
|