@aztec/pxe 0.87.4 → 0.87.6

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.
Files changed (99) hide show
  1. package/dest/config/package_info.js +1 -1
  2. package/dest/contract_function_simulator/contract_function_simulator.d.ts +37 -0
  3. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -0
  4. package/dest/contract_function_simulator/contract_function_simulator.js +117 -0
  5. package/dest/contract_function_simulator/execution_data_provider.d.ts +301 -0
  6. package/dest/contract_function_simulator/execution_data_provider.d.ts.map +1 -0
  7. package/dest/contract_function_simulator/execution_data_provider.js +14 -0
  8. package/dest/contract_function_simulator/execution_note_cache.d.ts +93 -0
  9. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -0
  10. package/dest/contract_function_simulator/execution_note_cache.js +180 -0
  11. package/dest/contract_function_simulator/hashed_values_cache.d.ts +28 -0
  12. package/dest/contract_function_simulator/hashed_values_cache.d.ts.map +1 -0
  13. package/dest/contract_function_simulator/hashed_values_cache.js +36 -0
  14. package/dest/contract_function_simulator/index.d.ts +10 -0
  15. package/dest/contract_function_simulator/index.d.ts.map +1 -0
  16. package/dest/contract_function_simulator/index.js +8 -0
  17. package/dest/contract_function_simulator/oracle/index.d.ts +14 -0
  18. package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -0
  19. package/dest/contract_function_simulator/oracle/index.js +2 -0
  20. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +19 -0
  21. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -0
  22. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +24 -0
  23. package/dest/contract_function_simulator/oracle/oracle.d.ts +53 -0
  24. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -0
  25. package/dest/contract_function_simulator/oracle/oracle.js +317 -0
  26. package/dest/contract_function_simulator/oracle/private_execution.d.ts +24 -0
  27. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -0
  28. package/dest/contract_function_simulator/oracle/private_execution.js +100 -0
  29. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +187 -0
  30. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -0
  31. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +325 -0
  32. package/dest/contract_function_simulator/oracle/typed_oracle.d.ts +83 -0
  33. package/dest/contract_function_simulator/oracle/typed_oracle.d.ts.map +1 -0
  34. package/dest/contract_function_simulator/oracle/typed_oracle.js +138 -0
  35. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +163 -0
  36. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -0
  37. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +257 -0
  38. package/dest/contract_function_simulator/pick_notes.d.ts +85 -0
  39. package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -0
  40. package/dest/contract_function_simulator/pick_notes.js +51 -0
  41. package/dest/contract_function_simulator/proxied_node.d.ts +9 -0
  42. package/dest/contract_function_simulator/proxied_node.d.ts.map +1 -0
  43. package/dest/contract_function_simulator/proxied_node.js +27 -0
  44. package/dest/{pxe_oracle_interface → contract_function_simulator}/pxe_oracle_interface.d.ts +5 -4
  45. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +1 -0
  46. package/dest/{pxe_oracle_interface → contract_function_simulator}/pxe_oracle_interface.js +16 -15
  47. package/dest/contract_function_simulator/tagging_utils.d.ts.map +1 -0
  48. package/dest/entrypoints/client/bundle/index.d.ts +1 -1
  49. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  50. package/dest/entrypoints/client/bundle/index.js +1 -1
  51. package/dest/entrypoints/client/bundle/utils.js +3 -3
  52. package/dest/entrypoints/client/lazy/index.d.ts +1 -1
  53. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  54. package/dest/entrypoints/client/lazy/index.js +1 -1
  55. package/dest/entrypoints/client/lazy/utils.js +3 -3
  56. package/dest/entrypoints/server/index.d.ts +1 -1
  57. package/dest/entrypoints/server/index.d.ts.map +1 -1
  58. package/dest/entrypoints/server/index.js +1 -1
  59. package/dest/entrypoints/server/utils.d.ts +4 -4
  60. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  61. package/dest/entrypoints/server/utils.js +12 -12
  62. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  63. package/dest/private_kernel/private_kernel_execution_prover.js +4 -4
  64. package/dest/pxe_service/pxe_service.d.ts +2 -2
  65. package/dest/pxe_service/pxe_service.d.ts.map +1 -1
  66. package/dest/pxe_service/pxe_service.js +46 -21
  67. package/dest/storage/note_data_provider/note_dao.d.ts +1 -1
  68. package/dest/storage/note_data_provider/note_dao.d.ts.map +1 -1
  69. package/package.json +17 -15
  70. package/src/config/package_info.ts +1 -1
  71. package/src/contract_function_simulator/contract_function_simulator.ts +193 -0
  72. package/src/contract_function_simulator/execution_data_provider.ts +391 -0
  73. package/src/contract_function_simulator/execution_note_cache.ts +217 -0
  74. package/src/contract_function_simulator/hashed_values_cache.ts +47 -0
  75. package/src/contract_function_simulator/index.ts +9 -0
  76. package/src/contract_function_simulator/oracle/index.ts +16 -0
  77. package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +23 -0
  78. package/src/contract_function_simulator/oracle/oracle.ts +541 -0
  79. package/src/contract_function_simulator/oracle/private_execution.ts +171 -0
  80. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +518 -0
  81. package/src/contract_function_simulator/oracle/typed_oracle.ts +273 -0
  82. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +384 -0
  83. package/src/contract_function_simulator/pick_notes.ts +141 -0
  84. package/src/contract_function_simulator/proxied_node.ts +33 -0
  85. package/src/{pxe_oracle_interface → contract_function_simulator}/pxe_oracle_interface.ts +18 -21
  86. package/src/entrypoints/client/bundle/index.ts +1 -1
  87. package/src/entrypoints/client/bundle/utils.ts +3 -3
  88. package/src/entrypoints/client/lazy/index.ts +1 -1
  89. package/src/entrypoints/client/lazy/utils.ts +3 -3
  90. package/src/entrypoints/server/index.ts +1 -1
  91. package/src/entrypoints/server/utils.ts +14 -14
  92. package/src/private_kernel/private_kernel_execution_prover.ts +5 -4
  93. package/src/pxe_service/pxe_service.ts +75 -39
  94. package/src/storage/note_data_provider/note_dao.ts +2 -1
  95. package/dest/pxe_oracle_interface/pxe_oracle_interface.d.ts.map +0 -1
  96. package/dest/pxe_oracle_interface/tagging_utils.d.ts.map +0 -1
  97. /package/dest/{pxe_oracle_interface → contract_function_simulator}/tagging_utils.d.ts +0 -0
  98. /package/dest/{pxe_oracle_interface → contract_function_simulator}/tagging_utils.js +0 -0
  99. /package/src/{pxe_oracle_interface → contract_function_simulator}/tagging_utils.ts +0 -0
@@ -0,0 +1,325 @@
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 { toACVMWitness } from '@aztec/simulator/client';
6
+ import { FunctionSelector, countArgumentsSize } from '@aztec/stdlib/abi';
7
+ import { computeUniqueNoteHash, siloNoteHash } from '@aztec/stdlib/hash';
8
+ import { PrivateContextInputs } from '@aztec/stdlib/kernel';
9
+ import { Note } from '@aztec/stdlib/note';
10
+ import { CallContext, CountedContractClassLog, NoteAndSlot } from '@aztec/stdlib/tx';
11
+ import { pickNotes } from '../pick_notes.js';
12
+ import { executePrivateFunction, verifyCurrentClassId } from './private_execution.js';
13
+ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
14
+ /**
15
+ * The execution oracle for the private part of a transaction.
16
+ */ export class PrivateExecutionOracle extends UtilityExecutionOracle {
17
+ argsHash;
18
+ txContext;
19
+ callContext;
20
+ historicalHeader;
21
+ executionCache;
22
+ noteCache;
23
+ simulator;
24
+ totalPublicCalldataCount;
25
+ sideEffectCounter;
26
+ /**
27
+ * New notes created during this execution.
28
+ * 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.
29
+ * But we still include those notes in the execution result because their commitments are still in the public inputs of this execution.
30
+ * This information is only for references (currently used for tests), and is not used for any sort of constrains.
31
+ * Users can also use this to get a clearer idea of what's happened during a simulation.
32
+ */ newNotes;
33
+ /**
34
+ * Notes from previous transactions that are returned to the oracle call `getNotes` during this execution.
35
+ * The mapping maps from the unique siloed note hash to the index for notes created in private executions.
36
+ * It maps from siloed note hash to the index for notes created by public functions.
37
+ *
38
+ * They are not part of the ExecutionNoteCache and being forwarded to nested contexts via `extend()`
39
+ * because these notes are meant to be maintained on a per-call basis
40
+ * They should act as references for the read requests output by an app circuit via public inputs.
41
+ */ noteHashLeafIndexMap;
42
+ noteHashNullifierCounterMap;
43
+ contractClassLogs;
44
+ nestedExecutions;
45
+ constructor(argsHash, txContext, callContext, /** Header of a block whose state is used during private execution (not the block the transaction is included in). */ historicalHeader, /** List of transient auth witnesses to be used during this simulation */ authWitnesses, capsules, executionCache, noteCache, executionDataProvider, simulator, totalPublicCalldataCount, sideEffectCounter = 0, log = createLogger('simulator:client_execution_context'), scopes){
46
+ super(callContext.contractAddress, authWitnesses, capsules, executionDataProvider, log, scopes), this.argsHash = argsHash, this.txContext = txContext, this.callContext = callContext, this.historicalHeader = historicalHeader, this.executionCache = executionCache, this.noteCache = noteCache, this.simulator = simulator, this.totalPublicCalldataCount = totalPublicCalldataCount, this.sideEffectCounter = sideEffectCounter, this.newNotes = [], this.noteHashLeafIndexMap = new Map(), this.noteHashNullifierCounterMap = new Map(), this.contractClassLogs = [], this.nestedExecutions = [];
47
+ }
48
+ // We still need this function until we can get user-defined ordering of structs for fn arguments
49
+ // TODO When that is sorted out on noir side, we can use instead the utilities in serialize.ts
50
+ /**
51
+ * Writes the function inputs to the initial witness.
52
+ * @param abi - The function ABI.
53
+ * @returns The initial witness.
54
+ */ getInitialWitness(abi) {
55
+ const argumentsSize = countArgumentsSize(abi);
56
+ const args = this.executionCache.getPreimage(this.argsHash);
57
+ if (args?.length !== argumentsSize) {
58
+ throw new Error(`Invalid arguments size: expected ${argumentsSize}, got ${args?.length}`);
59
+ }
60
+ const privateContextInputs = new PrivateContextInputs(this.callContext, this.historicalHeader, this.txContext, this.sideEffectCounter);
61
+ const privateContextInputsAsFields = privateContextInputs.toFields();
62
+ if (privateContextInputsAsFields.length !== PRIVATE_CONTEXT_INPUTS_LENGTH) {
63
+ throw new Error('Invalid private context inputs size');
64
+ }
65
+ const fields = [
66
+ ...privateContextInputsAsFields,
67
+ ...args
68
+ ];
69
+ return toACVMWitness(0, fields);
70
+ }
71
+ /**
72
+ * The KernelProver will use this to fully populate witnesses and provide hints to the kernel circuit
73
+ * regarding which note hash each settled read request corresponds to.
74
+ */ getNoteHashLeafIndexMap() {
75
+ return this.noteHashLeafIndexMap;
76
+ }
77
+ /**
78
+ * Get the data for the newly created notes.
79
+ */ getNewNotes() {
80
+ return this.newNotes;
81
+ }
82
+ getNoteHashNullifierCounterMap() {
83
+ return this.noteHashNullifierCounterMap;
84
+ }
85
+ /**
86
+ * Return the contract class logs emitted during this execution.
87
+ */ getContractClassLogs() {
88
+ return this.contractClassLogs;
89
+ }
90
+ /**
91
+ * Return the nested execution results during this execution.
92
+ */ getNestedExecutions() {
93
+ return this.nestedExecutions;
94
+ }
95
+ /**
96
+ * Store values in the execution cache.
97
+ * @param values - Values to store.
98
+ * @returns The hash of the values.
99
+ */ storeInExecutionCache(values, hash) {
100
+ return this.executionCache.store(values, hash);
101
+ }
102
+ /**
103
+ * Gets values from the execution cache.
104
+ * @param hash - Hash of the values.
105
+ * @returns The values.
106
+ */ loadFromExecutionCache(hash) {
107
+ const preimage = this.executionCache.getPreimage(hash);
108
+ if (!preimage) {
109
+ throw new Error(`Preimage for hash ${hash.toString()} not found in cache`);
110
+ }
111
+ return Promise.resolve(preimage);
112
+ }
113
+ /**
114
+ * Gets some notes for a storage slot.
115
+ *
116
+ * @remarks
117
+ * Check for pending notes with matching slot.
118
+ * Real notes coming from DB will have a leafIndex which
119
+ * represents their index in the note hash tree.
120
+ *
121
+ * @param storageSlot - The storage slot.
122
+ * @param numSelects - The number of valid selects in selectBy and selectValues.
123
+ * @param selectBy - An array of indices of the fields to selects.
124
+ * @param selectValues - The values to match.
125
+ * @param selectComparators - The comparators to match by.
126
+ * @param sortBy - An array of indices of the fields to sort.
127
+ * @param sortOrder - The order of the corresponding index in sortBy. (1: DESC, 2: ASC, 0: Do nothing)
128
+ * @param limit - The number of notes to retrieve per query.
129
+ * @param offset - The starting index for pagination.
130
+ * @param status - The status of notes to fetch.
131
+ * @returns Array of note data.
132
+ */ async getNotes(storageSlot, numSelects, selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, limit, offset, status) {
133
+ // Nullified pending notes are already removed from the list.
134
+ const pendingNotes = this.noteCache.getNotes(this.callContext.contractAddress, storageSlot);
135
+ const pendingNullifiers = this.noteCache.getNullifiers(this.callContext.contractAddress);
136
+ const dbNotes = await this.executionDataProvider.getNotes(this.callContext.contractAddress, storageSlot, status, this.scopes);
137
+ const dbNotesFiltered = dbNotes.filter((n)=>!pendingNullifiers.has(n.siloedNullifier.value));
138
+ const notes = pickNotes([
139
+ ...dbNotesFiltered,
140
+ ...pendingNotes
141
+ ], {
142
+ selects: selectByIndexes.slice(0, numSelects).map((index, i)=>({
143
+ selector: {
144
+ index,
145
+ offset: selectByOffsets[i],
146
+ length: selectByLengths[i]
147
+ },
148
+ value: selectValues[i],
149
+ comparator: selectComparators[i]
150
+ })),
151
+ sorts: sortByIndexes.map((index, i)=>({
152
+ selector: {
153
+ index,
154
+ offset: sortByOffsets[i],
155
+ length: sortByLengths[i]
156
+ },
157
+ order: sortOrder[i]
158
+ })),
159
+ limit,
160
+ offset
161
+ });
162
+ this.log.debug(`Returning ${notes.length} notes for ${this.callContext.contractAddress} at ${storageSlot}: ${notes.map((n)=>`${n.nonce.toString()}:[${n.note.items.map((i)=>i.toString()).join(',')}]`).join(', ')}`);
163
+ const noteHashesAndIndexes = await Promise.all(notes.map(async (n)=>{
164
+ if (n.index !== undefined) {
165
+ const siloedNoteHash = await siloNoteHash(n.contractAddress, n.noteHash);
166
+ const uniqueNoteHash = await computeUniqueNoteHash(n.nonce, siloedNoteHash);
167
+ return {
168
+ hash: uniqueNoteHash,
169
+ index: n.index
170
+ };
171
+ }
172
+ }));
173
+ noteHashesAndIndexes.filter((n)=>n !== undefined).forEach((n)=>{
174
+ this.noteHashLeafIndexMap.set(n.hash.toBigInt(), n.index);
175
+ });
176
+ return notes;
177
+ }
178
+ /**
179
+ * Keep track of the new note created during execution.
180
+ * It can be used in subsequent calls (or transactions when chaining txs is possible).
181
+ * @param contractAddress - The contract address.
182
+ * @param storageSlot - The storage slot.
183
+ * @param noteTypeId - The type ID of the note.
184
+ * @param noteItems - The items to be included in a Note.
185
+ * @param noteHash - A hash of the new note.
186
+ * @returns
187
+ */ notifyCreatedNote(storageSlot, noteTypeId, noteItems, noteHash, counter) {
188
+ this.log.debug(`Notified of new note with inner hash ${noteHash}`, {
189
+ contractAddress: this.callContext.contractAddress,
190
+ storageSlot,
191
+ noteTypeId,
192
+ counter
193
+ });
194
+ const note = new Note(noteItems);
195
+ this.noteCache.addNewNote({
196
+ contractAddress: this.callContext.contractAddress,
197
+ storageSlot,
198
+ nonce: Fr.ZERO,
199
+ note,
200
+ siloedNullifier: undefined,
201
+ noteHash
202
+ }, counter);
203
+ this.newNotes.push(new NoteAndSlot(note, storageSlot, noteTypeId));
204
+ }
205
+ /**
206
+ * Adding a siloed nullifier into the current set of all pending nullifiers created
207
+ * within the current transaction/execution.
208
+ * @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
209
+ * @param noteHash - A hash of the new note.
210
+ */ async notifyNullifiedNote(innerNullifier, noteHash, counter) {
211
+ const nullifiedNoteHashCounter = await this.noteCache.nullifyNote(this.callContext.contractAddress, innerNullifier, noteHash);
212
+ if (nullifiedNoteHashCounter !== undefined) {
213
+ this.noteHashNullifierCounterMap.set(nullifiedNoteHashCounter, counter);
214
+ }
215
+ }
216
+ /**
217
+ * Adding a siloed nullifier into the current set of all pending nullifiers created
218
+ * within the current transaction/execution.
219
+ * @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
220
+ * @param noteHash - A hash of the new note.
221
+ */ notifyCreatedNullifier(innerNullifier) {
222
+ return this.noteCache.nullifierCreated(this.callContext.contractAddress, innerNullifier);
223
+ }
224
+ /**
225
+ * Emit a contract class log.
226
+ * This fn exists because we only carry a poseidon hash through the kernels, and need to
227
+ * keep the preimage in ts for later.
228
+ * @param log - The contract class log to be emitted.
229
+ * @param counter - The contract class log's counter.
230
+ */ notifyCreatedContractClassLog(log, counter) {
231
+ this.contractClassLogs.push(new CountedContractClassLog(log, counter));
232
+ const text = log.toBuffer().toString('hex');
233
+ this.log.verbose(`Emitted log from ContractClassRegisterer: "${text.length > 100 ? text.slice(0, 100) + '...' : text}"`);
234
+ }
235
+ #checkValidStaticCall(childExecutionResult) {
236
+ if (childExecutionResult.publicInputs.noteHashes.some((item)=>!item.isEmpty()) || childExecutionResult.publicInputs.nullifiers.some((item)=>!item.isEmpty()) || childExecutionResult.publicInputs.l2ToL1Msgs.some((item)=>!item.isEmpty()) || childExecutionResult.publicInputs.privateLogs.some((item)=>!item.isEmpty()) || childExecutionResult.publicInputs.contractClassLogsHashes.some((item)=>!item.isEmpty())) {
237
+ throw new Error(`Static call cannot update the state, emit L2->L1 messages or generate logs`);
238
+ }
239
+ }
240
+ /**
241
+ * Calls a private function as a nested execution.
242
+ * @param targetContractAddress - The address of the contract to call.
243
+ * @param functionSelector - The function selector of the function to call.
244
+ * @param argsHash - The arguments hash to pass to the function.
245
+ * @param sideEffectCounter - The side effect counter at the start of the call.
246
+ * @param isStaticCall - Whether the call is a static call.
247
+ * @returns The execution result.
248
+ */ async callPrivateFunction(targetContractAddress, functionSelector, argsHash, sideEffectCounter, isStaticCall) {
249
+ const simulatorSetupTimer = new Timer();
250
+ this.log.debug(`Calling private function ${targetContractAddress}:${functionSelector} from ${this.callContext.contractAddress}`);
251
+ isStaticCall = isStaticCall || this.callContext.isStaticCall;
252
+ await verifyCurrentClassId(targetContractAddress, this.executionDataProvider, this.historicalHeader.globalVariables.blockNumber.toNumber());
253
+ const targetArtifact = await this.executionDataProvider.getFunctionArtifact(targetContractAddress, functionSelector);
254
+ const derivedTxContext = this.txContext.clone();
255
+ const derivedCallContext = await this.deriveCallContext(targetContractAddress, targetArtifact, isStaticCall);
256
+ const context = new PrivateExecutionOracle(argsHash, derivedTxContext, derivedCallContext, this.historicalHeader, this.authWitnesses, this.capsules, this.executionCache, this.noteCache, this.executionDataProvider, this.simulator, this.totalPublicCalldataCount, sideEffectCounter, this.log, this.scopes);
257
+ const setupTime = simulatorSetupTimer.ms();
258
+ const childExecutionResult = await executePrivateFunction(this.simulator, context, targetArtifact, targetContractAddress, functionSelector);
259
+ if (isStaticCall) {
260
+ this.#checkValidStaticCall(childExecutionResult);
261
+ }
262
+ this.nestedExecutions.push(childExecutionResult);
263
+ const publicInputs = childExecutionResult.publicInputs;
264
+ // Add simulator overhead to this call
265
+ if (childExecutionResult.profileResult) {
266
+ childExecutionResult.profileResult.timings.witgen += setupTime;
267
+ }
268
+ return {
269
+ endSideEffectCounter: publicInputs.endSideEffectCounter,
270
+ returnsHash: publicInputs.returnsHash
271
+ };
272
+ }
273
+ #onNewPublicFunctionCall(calldataHash) {
274
+ const calldata = this.executionCache.getPreimage(calldataHash);
275
+ if (!calldata) {
276
+ throw new Error('Calldata for public call not found in cache');
277
+ }
278
+ this.totalPublicCalldataCount += calldata.length;
279
+ if (this.totalPublicCalldataCount > MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS) {
280
+ throw new Error(`Too many total args to all enqueued public calls! (> ${MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS})`);
281
+ }
282
+ }
283
+ /**
284
+ * Verify relevant information when a public function is enqueued.
285
+ * @param targetContractAddress - The address of the contract to call.
286
+ * @param calldataHash - The hash of the function selector and arguments.
287
+ * @param sideEffectCounter - The side effect counter at the start of the call.
288
+ * @param isStaticCall - Whether the call is a static call.
289
+ */ notifyEnqueuedPublicFunctionCall(_targetContractAddress, calldataHash, _sideEffectCounter, _isStaticCall) {
290
+ this.#onNewPublicFunctionCall(calldataHash);
291
+ return Promise.resolve();
292
+ }
293
+ /**
294
+ * Verify relevant information when a public teardown function is set.
295
+ * @param targetContractAddress - The address of the contract to call.
296
+ * @param argsHash - The arguments hash to pass to the function.
297
+ * @param sideEffectCounter - The side effect counter at the start of the call.
298
+ * @param isStaticCall - Whether the call is a static call.
299
+ */ notifySetPublicTeardownFunctionCall(_targetContractAddress, calldataHash, _sideEffectCounter, _isStaticCall) {
300
+ this.#onNewPublicFunctionCall(calldataHash);
301
+ return Promise.resolve();
302
+ }
303
+ notifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter) {
304
+ return this.noteCache.setMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter);
305
+ }
306
+ /**
307
+ * Derives the call context for a nested execution.
308
+ * @param targetContractAddress - The address of the contract being called.
309
+ * @param targetArtifact - The artifact of the function being called.
310
+ * @param isStaticCall - Whether the call is a static call.
311
+ * @returns The derived call context.
312
+ */ async deriveCallContext(targetContractAddress, targetArtifact, isStaticCall = false) {
313
+ return new CallContext(this.contractAddress, targetContractAddress, await FunctionSelector.fromNameAndParameters(targetArtifact.name, targetArtifact.parameters), isStaticCall);
314
+ }
315
+ getDebugFunctionName() {
316
+ return this.executionDataProvider.getDebugFunctionName(this.contractAddress, this.callContext.functionSelector);
317
+ }
318
+ async incrementAppTaggingSecretIndexAsSender(sender, recipient) {
319
+ await this.executionDataProvider.incrementAppTaggingSecretIndexAsSender(this.contractAddress, sender, recipient);
320
+ }
321
+ async fetchTaggedLogs(pendingTaggedLogArrayBaseSlot) {
322
+ await this.executionDataProvider.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes);
323
+ await this.executionDataProvider.removeNullifiedNotes(this.contractAddress);
324
+ }
325
+ }
@@ -0,0 +1,83 @@
1
+ import type { L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants';
2
+ import { Fr, Point } from '@aztec/foundation/fields';
3
+ import type { EventSelector, FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
4
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
+ import type { CompleteAddress, ContractInstance } from '@aztec/stdlib/contract';
6
+ import type { KeyValidationRequest } from '@aztec/stdlib/kernel';
7
+ import type { ContractClassLog, IndexedTaggingSecret, LogWithTxData } from '@aztec/stdlib/logs';
8
+ import type { Note, NoteStatus } from '@aztec/stdlib/note';
9
+ import { type MerkleTreeId, type NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees';
10
+ import type { BlockHeader, TxHash } from '@aztec/stdlib/tx';
11
+ import type { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
12
+ /**
13
+ * Information about a note needed during execution.
14
+ */
15
+ export interface NoteData {
16
+ /** The note. */
17
+ note: Note;
18
+ /** The contract address of the note. */
19
+ contractAddress: AztecAddress;
20
+ /** The storage slot of the note. */
21
+ storageSlot: Fr;
22
+ /** The nonce of the note. */
23
+ nonce: Fr;
24
+ /** A hash of the note. */
25
+ noteHash: Fr;
26
+ /** The corresponding nullifier of the note. Undefined for pending notes. */
27
+ siloedNullifier?: Fr;
28
+ /** The note's leaf index in the note hash tree. Undefined for pending notes. */
29
+ index?: bigint;
30
+ }
31
+ /**
32
+ * Oracle with typed parameters and typed return values.
33
+ * Methods that require read and/or write will have to be implemented based on the context (public, private, or view)
34
+ * and are unavailable by default.
35
+ */
36
+ export declare abstract class TypedOracle {
37
+ getRandomField(): Fr;
38
+ storeInExecutionCache(_values: Fr[], _hash: Fr): void;
39
+ loadFromExecutionCache(_hash: Fr): Promise<Fr[]>;
40
+ getBlockNumber(): Promise<number>;
41
+ getContractAddress(): Promise<AztecAddress>;
42
+ getChainId(): Promise<Fr>;
43
+ getVersion(): Promise<Fr>;
44
+ getKeyValidationRequest(_pkMHash: Fr): Promise<KeyValidationRequest>;
45
+ getContractInstance(_address: AztecAddress): Promise<ContractInstance>;
46
+ getMembershipWitness(_blockNumber: number, _treeId: MerkleTreeId, _leafValue: Fr): Promise<Fr[] | undefined>;
47
+ getNullifierMembershipWitness(_blockNumber: number, _nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
48
+ getPublicDataWitness(_blockNumber: number, _leafSlot: Fr): Promise<PublicDataWitness | undefined>;
49
+ getLowNullifierMembershipWitness(_blockNumber: number, _nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
50
+ getBlockHeader(_blockNumber: number): Promise<BlockHeader | undefined>;
51
+ getCompleteAddress(_account: AztecAddress): Promise<CompleteAddress>;
52
+ getAuthWitness(_messageHash: Fr): Promise<Fr[] | undefined>;
53
+ getNotes(_storageSlot: Fr, _numSelects: number, _selectByIndexes: number[], _selectByOffsets: number[], _selectByLengths: number[], _selectValues: Fr[], _selectComparators: number[], _sortByIndexes: number[], _sortByOffsets: number[], _sortByLengths: number[], _sortOrder: number[], _limit: number, _offset: number, _status: NoteStatus): Promise<NoteData[]>;
54
+ notifyCreatedNote(_storageSlot: Fr, _noteTypeId: NoteSelector, _note: Fr[], _noteHash: Fr, _counter: number): void;
55
+ notifyNullifiedNote(_innerNullifier: Fr, _noteHash: Fr, _counter: number): Promise<void>;
56
+ notifyCreatedNullifier(_innerNullifier: Fr): Promise<void>;
57
+ checkNullifierExists(_innerNullifier: Fr): Promise<boolean>;
58
+ getL1ToL2MembershipWitness(_contractAddress: AztecAddress, _messageHash: Fr, _secret: Fr): Promise<MessageLoadOracleInputs<typeof L1_TO_L2_MSG_TREE_HEIGHT>>;
59
+ storageRead(_contractAddress: AztecAddress, _startStorageSlot: Fr, _blockNumber: number, _numberOfElements: number): Promise<Fr[]>;
60
+ storageWrite(_startStorageSlot: Fr, _values: Fr[]): Promise<Fr[]>;
61
+ notifyCreatedContractClassLog(_log: ContractClassLog, _counter: number): void;
62
+ callPrivateFunction(_targetContractAddress: AztecAddress, _functionSelector: FunctionSelector, _argsHash: Fr, _sideEffectCounter: number, _isStaticCall: boolean): Promise<{
63
+ endSideEffectCounter: Fr;
64
+ returnsHash: Fr;
65
+ }>;
66
+ notifyEnqueuedPublicFunctionCall(_targetContractAddress: AztecAddress, _calldataHash: Fr, _sideEffectCounter: number, _isStaticCall: boolean): Promise<void>;
67
+ notifySetPublicTeardownFunctionCall(_targetContractAddress: AztecAddress, _calldataHash: Fr, _sideEffectCounter: number, _isStaticCall: boolean): Promise<void>;
68
+ notifySetMinRevertibleSideEffectCounter(_minRevertibleSideEffectCounter: number): Promise<void>;
69
+ debugLog(_message: string, _fields: Fr[]): void;
70
+ getIndexedTaggingSecretAsSender(_sender: AztecAddress, _recipient: AztecAddress): Promise<IndexedTaggingSecret>;
71
+ incrementAppTaggingSecretIndexAsSender(_sender: AztecAddress, _recipient: AztecAddress): Promise<void>;
72
+ fetchTaggedLogs(_pendingTaggedLogArrayBaseSlot: Fr): Promise<void>;
73
+ deliverNote(_contractAddress: AztecAddress, _storageSlot: Fr, _nonce: Fr, _content: Fr[], _noteHash: Fr, _nullifier: Fr, _txHash: TxHash, _recipient: AztecAddress): Promise<void>;
74
+ getLogByTag(_tag: Fr): Promise<LogWithTxData | null>;
75
+ storeCapsule(_contractAddress: AztecAddress, _key: Fr, _capsule: Fr[]): Promise<void>;
76
+ loadCapsule(_contractAddress: AztecAddress, _key: Fr): Promise<Fr[] | null>;
77
+ deleteCapsule(_contractAddress: AztecAddress, _key: Fr): Promise<void>;
78
+ copyCapsule(_contractAddress: AztecAddress, _srcKey: Fr, _dstKey: Fr, _numEntries: number): Promise<void>;
79
+ aes128Decrypt(_ciphertext: Buffer, _iv: Buffer, _symKey: Buffer): Promise<Buffer>;
80
+ getSharedSecret(_address: AztecAddress, _ephPk: Point): Promise<Point>;
81
+ storePrivateEventLog(_contractAddress: AztecAddress, _recipient: AztecAddress, _eventSelector: EventSelector, _logContent: Fr[], _txHash: TxHash, _logIndexInTx: number, _txIndexInBlock: number): Promise<void>;
82
+ }
83
+ //# sourceMappingURL=typed_oracle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typed_oracle.d.ts","sourceRoot":"","sources":["../../../src/contract_function_simulator/oracle/typed_oracle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC5G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,gBAAgB;IAChB,IAAI,EAAE,IAAI,CAAC;IACX,wCAAwC;IACxC,eAAe,EAAE,YAAY,CAAC;IAC9B,oCAAoC;IACpC,WAAW,EAAE,EAAE,CAAC;IAChB,6BAA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AAC,IAAI,CAAC;CAGjB"}
@@ -0,0 +1,138 @@
1
+ import { Fr } from '@aztec/foundation/fields';
2
+ class OracleMethodNotAvailableError extends Error {
3
+ constructor(methodName){
4
+ super(`Oracle method ${methodName} is not available.`);
5
+ }
6
+ }
7
+ /**
8
+ * Oracle with typed parameters and typed return values.
9
+ * Methods that require read and/or write will have to be implemented based on the context (public, private, or view)
10
+ * and are unavailable by default.
11
+ */ export class TypedOracle {
12
+ getRandomField() {
13
+ return Fr.random();
14
+ }
15
+ storeInExecutionCache(_values, _hash) {
16
+ throw new OracleMethodNotAvailableError('storeInExecutionCache');
17
+ }
18
+ loadFromExecutionCache(_hash) {
19
+ return Promise.reject(new OracleMethodNotAvailableError('loadFromExecutionCache'));
20
+ }
21
+ getBlockNumber() {
22
+ return Promise.reject(new OracleMethodNotAvailableError('getBlockNumber'));
23
+ }
24
+ getContractAddress() {
25
+ return Promise.reject(new OracleMethodNotAvailableError('getContractAddress'));
26
+ }
27
+ getChainId() {
28
+ return Promise.reject(new OracleMethodNotAvailableError('getChainId'));
29
+ }
30
+ getVersion() {
31
+ return Promise.reject(new OracleMethodNotAvailableError('getVersion'));
32
+ }
33
+ getKeyValidationRequest(_pkMHash) {
34
+ return Promise.reject(new OracleMethodNotAvailableError('getKeyValidationRequest'));
35
+ }
36
+ getContractInstance(_address) {
37
+ return Promise.reject(new OracleMethodNotAvailableError('getContractInstance'));
38
+ }
39
+ getMembershipWitness(_blockNumber, _treeId, _leafValue) {
40
+ return Promise.reject(new OracleMethodNotAvailableError('getMembershipWitness'));
41
+ }
42
+ getNullifierMembershipWitness(_blockNumber, _nullifier) {
43
+ return Promise.reject(new OracleMethodNotAvailableError('getNullifierMembershipWitness'));
44
+ }
45
+ getPublicDataWitness(_blockNumber, _leafSlot) {
46
+ return Promise.reject(new OracleMethodNotAvailableError('getPublicDataWitness'));
47
+ }
48
+ getLowNullifierMembershipWitness(_blockNumber, _nullifier) {
49
+ return Promise.reject(new OracleMethodNotAvailableError('getLowNullifierMembershipWitness'));
50
+ }
51
+ getBlockHeader(_blockNumber) {
52
+ return Promise.reject(new OracleMethodNotAvailableError('getBlockHeader'));
53
+ }
54
+ getCompleteAddress(_account) {
55
+ return Promise.reject(new OracleMethodNotAvailableError('getCompleteAddress'));
56
+ }
57
+ getAuthWitness(_messageHash) {
58
+ return Promise.reject(new OracleMethodNotAvailableError('getAuthWitness'));
59
+ }
60
+ getNotes(_storageSlot, _numSelects, _selectByIndexes, _selectByOffsets, _selectByLengths, _selectValues, _selectComparators, _sortByIndexes, _sortByOffsets, _sortByLengths, _sortOrder, _limit, _offset, _status) {
61
+ return Promise.reject(new OracleMethodNotAvailableError('getNotes'));
62
+ }
63
+ notifyCreatedNote(_storageSlot, _noteTypeId, _note, _noteHash, _counter) {
64
+ throw new OracleMethodNotAvailableError('notifyCreatedNote');
65
+ }
66
+ notifyNullifiedNote(_innerNullifier, _noteHash, _counter) {
67
+ return Promise.reject(new OracleMethodNotAvailableError('notifyNullifiedNote'));
68
+ }
69
+ notifyCreatedNullifier(_innerNullifier) {
70
+ return Promise.reject(new OracleMethodNotAvailableError('notifyCreatedNullifier'));
71
+ }
72
+ checkNullifierExists(_innerNullifier) {
73
+ return Promise.reject(new OracleMethodNotAvailableError('checkNullifierExists'));
74
+ }
75
+ getL1ToL2MembershipWitness(_contractAddress, _messageHash, _secret) {
76
+ return Promise.reject(new OracleMethodNotAvailableError('getL1ToL2MembershipWitness'));
77
+ }
78
+ storageRead(_contractAddress, _startStorageSlot, _blockNumber, _numberOfElements) {
79
+ return Promise.reject(new OracleMethodNotAvailableError('storageRead'));
80
+ }
81
+ storageWrite(_startStorageSlot, _values) {
82
+ return Promise.reject(new OracleMethodNotAvailableError('storageWrite'));
83
+ }
84
+ notifyCreatedContractClassLog(_log, _counter) {
85
+ throw new OracleMethodNotAvailableError('notifyCreatedContractClassLog');
86
+ }
87
+ callPrivateFunction(_targetContractAddress, _functionSelector, _argsHash, _sideEffectCounter, _isStaticCall) {
88
+ return Promise.reject(new OracleMethodNotAvailableError('callPrivateFunction'));
89
+ }
90
+ notifyEnqueuedPublicFunctionCall(_targetContractAddress, _calldataHash, _sideEffectCounter, _isStaticCall) {
91
+ return Promise.reject(new OracleMethodNotAvailableError('notifyEnqueuedPublicFunctionCall'));
92
+ }
93
+ notifySetPublicTeardownFunctionCall(_targetContractAddress, _calldataHash, _sideEffectCounter, _isStaticCall) {
94
+ return Promise.reject(new OracleMethodNotAvailableError('notifySetPublicTeardownFunctionCall'));
95
+ }
96
+ notifySetMinRevertibleSideEffectCounter(_minRevertibleSideEffectCounter) {
97
+ throw new OracleMethodNotAvailableError('notifySetMinRevertibleSideEffectCounter');
98
+ }
99
+ debugLog(_message, _fields) {
100
+ throw new OracleMethodNotAvailableError('debugLog');
101
+ }
102
+ getIndexedTaggingSecretAsSender(_sender, _recipient) {
103
+ return Promise.reject(new OracleMethodNotAvailableError('getIndexedTaggingSecretAsSender'));
104
+ }
105
+ incrementAppTaggingSecretIndexAsSender(_sender, _recipient) {
106
+ return Promise.reject(new OracleMethodNotAvailableError('incrementAppTaggingSecretIndexAsSender'));
107
+ }
108
+ fetchTaggedLogs(_pendingTaggedLogArrayBaseSlot) {
109
+ return Promise.reject(new OracleMethodNotAvailableError('fetchTaggedLogs'));
110
+ }
111
+ deliverNote(_contractAddress, _storageSlot, _nonce, _content, _noteHash, _nullifier, _txHash, _recipient) {
112
+ return Promise.reject(new OracleMethodNotAvailableError('deliverNote'));
113
+ }
114
+ getLogByTag(_tag) {
115
+ throw new OracleMethodNotAvailableError('getLogByTag');
116
+ }
117
+ storeCapsule(_contractAddress, _key, _capsule) {
118
+ return Promise.reject(new OracleMethodNotAvailableError('storeCapsule'));
119
+ }
120
+ loadCapsule(_contractAddress, _key) {
121
+ return Promise.reject(new OracleMethodNotAvailableError('loadCapsule'));
122
+ }
123
+ deleteCapsule(_contractAddress, _key) {
124
+ return Promise.reject(new OracleMethodNotAvailableError('deleteCapsule'));
125
+ }
126
+ copyCapsule(_contractAddress, _srcKey, _dstKey, _numEntries) {
127
+ return Promise.reject(new OracleMethodNotAvailableError('copyCapsule'));
128
+ }
129
+ aes128Decrypt(_ciphertext, _iv, _symKey) {
130
+ return Promise.reject(new OracleMethodNotAvailableError('aes128Decrypt'));
131
+ }
132
+ getSharedSecret(_address, _ephPk) {
133
+ return Promise.reject(new OracleMethodNotAvailableError('getSharedSecret'));
134
+ }
135
+ storePrivateEventLog(_contractAddress, _recipient, _eventSelector, _logContent, _txHash, _logIndexInTx, _txIndexInBlock) {
136
+ return Promise.reject(new OracleMethodNotAvailableError('storePrivateEventLog'));
137
+ }
138
+ }