@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,317 @@
1
+ import { Fr, Point } from '@aztec/foundation/fields';
2
+ import { arrayOfArraysToBoundedVecOfArrays, bufferToBoundedVec, fromBoundedVec, fromUintArray, fromUintBoundedVec, toACVMField, toACVMFieldSingleOrArray } from '@aztec/simulator/client';
3
+ import { EventSelector, FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
4
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
+ import { ContractClassLog, ContractClassLogFields, LogWithTxData } from '@aztec/stdlib/logs';
6
+ import { MerkleTreeId } from '@aztec/stdlib/trees';
7
+ import { TxHash } from '@aztec/stdlib/tx';
8
+ /**
9
+ * A data source that has all the apis required by Aztec.nr.
10
+ */ export class Oracle {
11
+ typedOracle;
12
+ constructor(typedOracle){
13
+ this.typedOracle = typedOracle;
14
+ }
15
+ toACIRCallback() {
16
+ return Object.getOwnPropertyNames(Oracle.prototype).filter((name)=>name !== 'constructor' && name != 'toACIRCallback' && typeof this[name] === 'function').reduce((acc, name)=>{
17
+ acc[name] = this[name].bind(this);
18
+ return acc;
19
+ }, {});
20
+ }
21
+ getRandomField() {
22
+ const val = this.typedOracle.getRandomField();
23
+ return Promise.resolve([
24
+ toACVMField(val)
25
+ ]);
26
+ }
27
+ // Since the argument is a slice, noir automatically adds a length field to oracle call.
28
+ storeInExecutionCache(_length, values, [hash]) {
29
+ this.typedOracle.storeInExecutionCache(values.map(Fr.fromString), Fr.fromString(hash));
30
+ return Promise.resolve([]);
31
+ }
32
+ async loadFromExecutionCache([returnsHash]) {
33
+ const values = await this.typedOracle.loadFromExecutionCache(Fr.fromString(returnsHash));
34
+ return [
35
+ values.map(toACVMField)
36
+ ];
37
+ }
38
+ async getBlockNumber() {
39
+ return [
40
+ toACVMField(await this.typedOracle.getBlockNumber())
41
+ ];
42
+ }
43
+ async getContractAddress() {
44
+ return [
45
+ toACVMField(await this.typedOracle.getContractAddress())
46
+ ];
47
+ }
48
+ async getVersion() {
49
+ return [
50
+ toACVMField(await this.typedOracle.getVersion())
51
+ ];
52
+ }
53
+ async getChainId() {
54
+ return [
55
+ toACVMField(await this.typedOracle.getChainId())
56
+ ];
57
+ }
58
+ async getKeyValidationRequest([pkMHash]) {
59
+ const keyValidationRequest = await this.typedOracle.getKeyValidationRequest(Fr.fromString(pkMHash));
60
+ return keyValidationRequest.toFields().map(toACVMField);
61
+ }
62
+ async getContractInstance([address]) {
63
+ const instance = await this.typedOracle.getContractInstance(AztecAddress.fromField(Fr.fromString(address)));
64
+ return [
65
+ instance.salt,
66
+ instance.deployer,
67
+ instance.currentContractClassId,
68
+ instance.initializationHash,
69
+ ...instance.publicKeys.toFields()
70
+ ].map(toACVMField);
71
+ }
72
+ async getMembershipWitness([blockNumber], [treeId], [leafValue]) {
73
+ const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
74
+ const parsedTreeId = Fr.fromString(treeId).toNumber();
75
+ const parsedLeafValue = Fr.fromString(leafValue);
76
+ const witness = await this.typedOracle.getMembershipWitness(parsedBlockNumber, parsedTreeId, parsedLeafValue);
77
+ if (!witness) {
78
+ throw new Error(`Leaf ${leafValue} not found in the tree ${MerkleTreeId[parsedTreeId]} at block ${parsedBlockNumber}.`);
79
+ }
80
+ return [
81
+ toACVMField(witness[0]),
82
+ witness.slice(1).map(toACVMField)
83
+ ];
84
+ }
85
+ async getNullifierMembershipWitness([blockNumber], [nullifier]) {
86
+ const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
87
+ const parsedNullifier = Fr.fromString(nullifier);
88
+ const witness = await this.typedOracle.getNullifierMembershipWitness(parsedBlockNumber, parsedNullifier);
89
+ if (!witness) {
90
+ throw new Error(`Nullifier witness not found for nullifier ${parsedNullifier} at block ${parsedBlockNumber}.`);
91
+ }
92
+ return witness.toNoirRepresentation();
93
+ }
94
+ async getLowNullifierMembershipWitness([blockNumber], [nullifier]) {
95
+ const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
96
+ const parsedNullifier = Fr.fromString(nullifier);
97
+ const witness = await this.typedOracle.getLowNullifierMembershipWitness(parsedBlockNumber, parsedNullifier);
98
+ if (!witness) {
99
+ throw new Error(`Low nullifier witness not found for nullifier ${parsedNullifier} at block ${parsedBlockNumber}.`);
100
+ }
101
+ return witness.toNoirRepresentation();
102
+ }
103
+ async getPublicDataWitness([blockNumber], [leafSlot]) {
104
+ const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
105
+ const parsedLeafSlot = Fr.fromString(leafSlot);
106
+ const witness = await this.typedOracle.getPublicDataWitness(parsedBlockNumber, parsedLeafSlot);
107
+ if (!witness) {
108
+ throw new Error(`Public data witness not found for slot ${parsedLeafSlot} at block ${parsedBlockNumber}.`);
109
+ }
110
+ return witness.toNoirRepresentation();
111
+ }
112
+ async getBlockHeader([blockNumber]) {
113
+ const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
114
+ const header = await this.typedOracle.getBlockHeader(parsedBlockNumber);
115
+ if (!header) {
116
+ throw new Error(`Block header not found for block ${parsedBlockNumber}.`);
117
+ }
118
+ return header.toFields().map(toACVMField);
119
+ }
120
+ async getAuthWitness([messageHash]) {
121
+ const messageHashField = Fr.fromString(messageHash);
122
+ const witness = await this.typedOracle.getAuthWitness(messageHashField);
123
+ if (!witness) {
124
+ throw new Error(`Unknown auth witness for message hash ${messageHashField}`);
125
+ }
126
+ return [
127
+ witness.map(toACVMField)
128
+ ];
129
+ }
130
+ async getPublicKeysAndPartialAddress([address]) {
131
+ const parsedAddress = AztecAddress.fromField(Fr.fromString(address));
132
+ const { publicKeys, partialAddress } = await this.typedOracle.getCompleteAddress(parsedAddress);
133
+ return [
134
+ [
135
+ ...publicKeys.toFields(),
136
+ partialAddress
137
+ ].map(toACVMField)
138
+ ];
139
+ }
140
+ async getNotes([storageSlot], [numSelects], selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, [limit], [offset], [status], [maxNotes], [packedRetrievedNoteLength]) {
141
+ const noteDatas = await this.typedOracle.getNotes(Fr.fromString(storageSlot), +numSelects, selectByIndexes.map((s)=>+s), selectByOffsets.map((s)=>+s), selectByLengths.map((s)=>+s), selectValues.map(Fr.fromString), selectComparators.map((s)=>+s), sortByIndexes.map((s)=>+s), sortByOffsets.map((s)=>+s), sortByLengths.map((s)=>+s), sortOrder.map((s)=>+s), +limit, +offset, +status);
142
+ if (noteDatas.length > 0) {
143
+ const noteLength = noteDatas[0].note.items.length;
144
+ if (!noteDatas.every(({ note })=>noteLength === note.items.length)) {
145
+ throw new Error('Notes should all be the same length.');
146
+ }
147
+ }
148
+ // The expected return type is a BoundedVec<[Field; packedRetrievedNoteLength], maxNotes> where each
149
+ // array is structured as [contract_address, nonce, nonzero_note_hash_counter, ...packed_note].
150
+ const returnDataAsArrayOfArrays = noteDatas.map(({ contractAddress, nonce, index, note })=>{
151
+ // If index is undefined, the note is transient which implies that the nonzero_note_hash_counter has to be true
152
+ const noteIsTransient = index === undefined;
153
+ const nonzeroNoteHashCounter = noteIsTransient ? true : false;
154
+ // If you change the array on the next line you have to change the `unpack_retrieved_note` function in
155
+ // `aztec/src/note/retrieved_note.nr`
156
+ return [
157
+ contractAddress,
158
+ nonce,
159
+ nonzeroNoteHashCounter,
160
+ ...note.items
161
+ ];
162
+ });
163
+ // Now we convert each sub-array to an array of ACVMField
164
+ const returnDataAsArrayOfACVMFieldArrays = returnDataAsArrayOfArrays.map((subArray)=>subArray.map(toACVMField));
165
+ // At last we convert the array of arrays to a bounded vec of arrays
166
+ return arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfACVMFieldArrays, +maxNotes, +packedRetrievedNoteLength);
167
+ }
168
+ notifyCreatedNote([storageSlot], [noteTypeId], note, [noteHash], [counter]) {
169
+ this.typedOracle.notifyCreatedNote(Fr.fromString(storageSlot), NoteSelector.fromField(Fr.fromString(noteTypeId)), note.map(Fr.fromString), Fr.fromString(noteHash), +counter);
170
+ return Promise.resolve([]);
171
+ }
172
+ async notifyNullifiedNote([innerNullifier], [noteHash], [counter]) {
173
+ await this.typedOracle.notifyNullifiedNote(Fr.fromString(innerNullifier), Fr.fromString(noteHash), +counter);
174
+ return [];
175
+ }
176
+ async notifyCreatedNullifier([innerNullifier]) {
177
+ await this.typedOracle.notifyCreatedNullifier(Fr.fromString(innerNullifier));
178
+ return [];
179
+ }
180
+ async checkNullifierExists([innerNullifier]) {
181
+ const exists = await this.typedOracle.checkNullifierExists(Fr.fromString(innerNullifier));
182
+ return [
183
+ toACVMField(exists)
184
+ ];
185
+ }
186
+ async getL1ToL2MembershipWitness([contractAddress], [messageHash], [secret]) {
187
+ const message = await this.typedOracle.getL1ToL2MembershipWitness(AztecAddress.fromString(contractAddress), Fr.fromString(messageHash), Fr.fromString(secret));
188
+ return message.toNoirRepresentation();
189
+ }
190
+ async storageRead([contractAddress], [startStorageSlot], [blockNumber], [numberOfElements]) {
191
+ const values = await this.typedOracle.storageRead(new AztecAddress(Fr.fromString(contractAddress)), Fr.fromString(startStorageSlot), +blockNumber, +numberOfElements);
192
+ return [
193
+ values.map(toACVMField)
194
+ ];
195
+ }
196
+ async storageWrite([startStorageSlot], values) {
197
+ const newValues = await this.typedOracle.storageWrite(Fr.fromString(startStorageSlot), values.map(Fr.fromString));
198
+ return newValues.map(toACVMField);
199
+ }
200
+ notifyCreatedContractClassLog([contractAddress], message, [length], [counter]) {
201
+ const logFields = new ContractClassLogFields(message.map(Fr.fromString));
202
+ const log = new ContractClassLog(new AztecAddress(Fr.fromString(contractAddress)), logFields, +length);
203
+ this.typedOracle.notifyCreatedContractClassLog(log, +counter);
204
+ return Promise.resolve([]);
205
+ }
206
+ debugLog(message, _ignoredFieldsSize, fields) {
207
+ const messageStr = message.map((acvmField)=>String.fromCharCode(Fr.fromString(acvmField).toNumber())).join('');
208
+ const fieldsFr = fields.map(Fr.fromString);
209
+ this.typedOracle.debugLog(messageStr, fieldsFr);
210
+ return Promise.resolve([]);
211
+ }
212
+ async callPrivateFunction([contractAddress], [functionSelector], [argsHash], [sideEffectCounter], [isStaticCall]) {
213
+ const { endSideEffectCounter, returnsHash } = await this.typedOracle.callPrivateFunction(AztecAddress.fromField(Fr.fromString(contractAddress)), FunctionSelector.fromField(Fr.fromString(functionSelector)), Fr.fromString(argsHash), Fr.fromString(sideEffectCounter).toNumber(), Fr.fromString(isStaticCall).toBool());
214
+ return [
215
+ [
216
+ endSideEffectCounter,
217
+ returnsHash
218
+ ].map(toACVMField)
219
+ ];
220
+ }
221
+ async notifyEnqueuedPublicFunctionCall([contractAddress], [calldataHash], [sideEffectCounter], [isStaticCall]) {
222
+ await this.typedOracle.notifyEnqueuedPublicFunctionCall(AztecAddress.fromString(contractAddress), Fr.fromString(calldataHash), Fr.fromString(sideEffectCounter).toNumber(), Fr.fromString(isStaticCall).toBool());
223
+ return [];
224
+ }
225
+ async notifySetPublicTeardownFunctionCall([contractAddress], [calldataHash], [sideEffectCounter], [isStaticCall]) {
226
+ await this.typedOracle.notifySetPublicTeardownFunctionCall(AztecAddress.fromString(contractAddress), Fr.fromString(calldataHash), Fr.fromString(sideEffectCounter).toNumber(), Fr.fromString(isStaticCall).toBool());
227
+ return [];
228
+ }
229
+ async notifySetMinRevertibleSideEffectCounter([minRevertibleSideEffectCounter]) {
230
+ await this.typedOracle.notifySetMinRevertibleSideEffectCounter(Fr.fromString(minRevertibleSideEffectCounter).toNumber());
231
+ return Promise.resolve([]);
232
+ }
233
+ async getIndexedTaggingSecretAsSender([sender], [recipient]) {
234
+ const taggingSecret = await this.typedOracle.getIndexedTaggingSecretAsSender(AztecAddress.fromString(sender), AztecAddress.fromString(recipient));
235
+ return taggingSecret.toFields().map(toACVMField);
236
+ }
237
+ async incrementAppTaggingSecretIndexAsSender([sender], [recipient]) {
238
+ await this.typedOracle.incrementAppTaggingSecretIndexAsSender(AztecAddress.fromString(sender), AztecAddress.fromString(recipient));
239
+ return [];
240
+ }
241
+ async fetchTaggedLogs([pendingTaggedLogArrayBaseSlot]) {
242
+ await this.typedOracle.fetchTaggedLogs(Fr.fromString(pendingTaggedLogArrayBaseSlot));
243
+ return [];
244
+ }
245
+ async deliverNote([contractAddress], [storageSlot], [nonce], content, [contentLength], [noteHash], [nullifier], [txHash], [recipient]) {
246
+ // TODO(#10728): try-catch this block and return false if we get an exception so that the contract can decide what
247
+ // to do if a note fails delivery (e.g. not increment the tagging index, or add it to some pending work list).
248
+ // Delivery might fail due to temporary issues, such as poor node connectivity.
249
+ await this.typedOracle.deliverNote(AztecAddress.fromString(contractAddress), Fr.fromString(storageSlot), Fr.fromString(nonce), fromBoundedVec(content, contentLength), Fr.fromString(noteHash), Fr.fromString(nullifier), TxHash.fromString(txHash), AztecAddress.fromString(recipient));
250
+ return [
251
+ toACVMField(true)
252
+ ];
253
+ }
254
+ async getLogByTag([tag]) {
255
+ const log = await this.typedOracle.getLogByTag(Fr.fromString(tag));
256
+ if (log == null) {
257
+ return [
258
+ toACVMField(0),
259
+ ...LogWithTxData.noirSerializationOfEmpty().map(toACVMFieldSingleOrArray)
260
+ ];
261
+ } else {
262
+ return [
263
+ toACVMField(1),
264
+ ...log.toNoirSerialization().map(toACVMFieldSingleOrArray)
265
+ ];
266
+ }
267
+ }
268
+ async storeCapsule([contractAddress], [slot], capsule) {
269
+ await this.typedOracle.storeCapsule(AztecAddress.fromField(Fr.fromString(contractAddress)), Fr.fromString(slot), capsule.map(Fr.fromString));
270
+ return [];
271
+ }
272
+ async loadCapsule([contractAddress], [slot], [tSize]) {
273
+ const values = await this.typedOracle.loadCapsule(AztecAddress.fromField(Fr.fromString(contractAddress)), Fr.fromString(slot));
274
+ // We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
275
+ // with two fields: `some` (a boolean) and `value` (a field array in this case).
276
+ if (values === null) {
277
+ // No data was found so we set `some` to 0 and pad `value` with zeros get the correct return size.
278
+ return [
279
+ toACVMField(0),
280
+ Array(Fr.fromString(tSize).toNumber()).fill(toACVMField(0))
281
+ ];
282
+ } else {
283
+ // Data was found so we set `some` to 1 and return it along with `value`.
284
+ return [
285
+ toACVMField(1),
286
+ values.map(toACVMField)
287
+ ];
288
+ }
289
+ }
290
+ async deleteCapsule([contractAddress], [slot]) {
291
+ await this.typedOracle.deleteCapsule(AztecAddress.fromField(Fr.fromString(contractAddress)), Fr.fromString(slot));
292
+ return [];
293
+ }
294
+ async copyCapsule([contractAddress], [srcSlot], [dstSlot], [numEntries]) {
295
+ await this.typedOracle.copyCapsule(AztecAddress.fromField(Fr.fromString(contractAddress)), Fr.fromString(srcSlot), Fr.fromString(dstSlot), Fr.fromString(numEntries).toNumber());
296
+ return [];
297
+ }
298
+ async aes128Decrypt(ciphertextBVecStorage, [ciphertextLength], iv, symKey) {
299
+ const ciphertext = fromUintBoundedVec(ciphertextBVecStorage, ciphertextLength, 8);
300
+ const ivBuffer = fromUintArray(iv, 8);
301
+ const symKeyBuffer = fromUintArray(symKey, 8);
302
+ const plaintext = await this.typedOracle.aes128Decrypt(ciphertext, ivBuffer, symKeyBuffer);
303
+ return bufferToBoundedVec(plaintext, ciphertextBVecStorage.length);
304
+ }
305
+ async getSharedSecret([address], [ephPKField0], [ephPKField1], [ephPKField2]) {
306
+ const secret = await this.typedOracle.getSharedSecret(AztecAddress.fromField(Fr.fromString(address)), Point.fromFields([
307
+ ephPKField0,
308
+ ephPKField1,
309
+ ephPKField2
310
+ ].map(Fr.fromString)));
311
+ return secret.toFields().map(toACVMField);
312
+ }
313
+ async storePrivateEventLog([contractAddress], [recipient], [eventSelector], msgContentBVecStorage, [msgContentLength], [txHash], [logIndexInTx], [txIndexInBlock]) {
314
+ await this.typedOracle.storePrivateEventLog(AztecAddress.fromField(Fr.fromString(contractAddress)), AztecAddress.fromField(Fr.fromString(recipient)), EventSelector.fromField(Fr.fromString(eventSelector)), fromBoundedVec(msgContentBVecStorage, msgContentLength), new TxHash(Fr.fromString(txHash)), Fr.fromString(logIndexInTx).toNumber(), Fr.fromString(txIndexInBlock).toNumber());
315
+ return [];
316
+ }
317
+ }
@@ -0,0 +1,24 @@
1
+ import { Fr } from '@aztec/foundation/fields';
2
+ import { type ACVMWitness, type CircuitSimulator } from '@aztec/simulator/client';
3
+ import { type FunctionArtifact, type FunctionArtifactWithContractName, type FunctionSelector } from '@aztec/stdlib/abi';
4
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
+ import type { ContractInstance } from '@aztec/stdlib/contract';
6
+ import type { AztecNode } from '@aztec/stdlib/interfaces/client';
7
+ import { PrivateCircuitPublicInputs } from '@aztec/stdlib/kernel';
8
+ import { PrivateCallExecutionResult } from '@aztec/stdlib/tx';
9
+ import type { ExecutionDataProvider } from '../execution_data_provider.js';
10
+ import type { PrivateExecutionOracle } from './private_execution_oracle.js';
11
+ /**
12
+ * Execute a private function and return the execution result.
13
+ */
14
+ export declare function executePrivateFunction(simulator: CircuitSimulator, privateExecutionOracle: PrivateExecutionOracle, artifact: FunctionArtifactWithContractName, contractAddress: AztecAddress, functionSelector: FunctionSelector, log?: import("@aztec/foundation/log").Logger): Promise<PrivateCallExecutionResult>;
15
+ /**
16
+ * Get the private circuit public inputs from the partial witness.
17
+ * @param artifact - The function artifact
18
+ * @param partialWitness - The partial witness, result of simulating the function.
19
+ * @returns - The public inputs.
20
+ */
21
+ export declare function extractPrivateCircuitPublicInputs(artifact: FunctionArtifact, partialWitness: ACVMWitness): PrivateCircuitPublicInputs;
22
+ export declare function readCurrentClassId(contractAddress: AztecAddress, instance: ContractInstance, executionDataProvider: ExecutionDataProvider | AztecNode, blockNumber: number): Promise<Fr>;
23
+ export declare function verifyCurrentClassId(contractAddress: AztecAddress, executionDataProvider: ExecutionDataProvider, blockNumber?: number): Promise<void>;
24
+ //# sourceMappingURL=private_execution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private_execution.d.ts","sourceRoot":"","sources":["../../../src/contract_function_simulator/oracle/private_execution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAI9C,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EAKtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gCAAgC,EACrC,KAAK,gBAAgB,EAEtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAE5E;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,gBAAgB,EAC3B,sBAAsB,EAAE,sBAAsB,EAC9C,QAAQ,EAAE,gCAAgC,EAC1C,eAAe,EAAE,YAAY,EAC7B,gBAAgB,EAAE,gBAAgB,EAClC,GAAG,yCAA8C,GAChD,OAAO,CAAC,0BAA0B,CAAC,CAyErC;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,gBAAgB,EAC1B,cAAc,EAAE,WAAW,GAC1B,0BAA0B,CAa5B;AAED,wBAAsB,kBAAkB,CACtC,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,EAC1B,qBAAqB,EAAE,qBAAqB,GAAG,SAAS,EACxD,WAAW,EAAE,MAAM,eAWpB;AAED,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,YAAY,EAC7B,qBAAqB,EAAE,qBAAqB,EAC5C,WAAW,CAAC,EAAE,MAAM,iBAUrB"}
@@ -0,0 +1,100 @@
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 { ExecutionError, extractCallStack, resolveAssertionMessageFromError, witnessMapToFields } from '@aztec/simulator/client';
7
+ import { countArgumentsSize } from '@aztec/stdlib/abi';
8
+ import { PrivateCircuitPublicInputs } from '@aztec/stdlib/kernel';
9
+ import { SharedMutableValues, SharedMutableValuesWithHash } from '@aztec/stdlib/shared-mutable';
10
+ import { PrivateCallExecutionResult } from '@aztec/stdlib/tx';
11
+ import { Oracle } from './oracle.js';
12
+ /**
13
+ * Execute a private function and return the execution result.
14
+ */ export async function executePrivateFunction(simulator, privateExecutionOracle, artifact, contractAddress, functionSelector, log = createLogger('simulator:private_execution')) {
15
+ const functionName = await privateExecutionOracle.getDebugFunctionName();
16
+ log.verbose(`Executing private function ${functionName}`, {
17
+ contract: contractAddress
18
+ });
19
+ const initialWitness = privateExecutionOracle.getInitialWitness(artifact);
20
+ const acvmCallback = new Oracle(privateExecutionOracle);
21
+ const timer = new Timer();
22
+ const acirExecutionResult = await simulator.executeUserCircuit(initialWitness, artifact, acvmCallback.toACIRCallback()).catch((err)=>{
23
+ err.message = resolveAssertionMessageFromError(err, artifact);
24
+ throw new ExecutionError(err.message, {
25
+ contractAddress,
26
+ functionSelector
27
+ }, extractCallStack(err, artifact.debug), {
28
+ cause: err
29
+ });
30
+ });
31
+ const duration = timer.ms();
32
+ const partialWitness = acirExecutionResult.partialWitness;
33
+ const publicInputs = extractPrivateCircuitPublicInputs(artifact, partialWitness);
34
+ // TODO (alexg) estimate this size
35
+ const initialWitnessSize = witnessMapToFields(initialWitness).length * Fr.SIZE_IN_BYTES;
36
+ log.debug(`Ran external function ${contractAddress.toString()}:${functionSelector}`, {
37
+ circuitName: 'app-circuit',
38
+ duration,
39
+ eventName: 'circuit-witness-generation',
40
+ inputSize: initialWitnessSize,
41
+ outputSize: publicInputs.toBuffer().length,
42
+ appCircuitName: functionName
43
+ });
44
+ const contractClassLogs = privateExecutionOracle.getContractClassLogs();
45
+ const rawReturnValues = await privateExecutionOracle.loadFromExecutionCache(publicInputs.returnsHash);
46
+ const noteHashLeafIndexMap = privateExecutionOracle.getNoteHashLeafIndexMap();
47
+ const newNotes = privateExecutionOracle.getNewNotes();
48
+ const noteHashNullifierCounterMap = privateExecutionOracle.getNoteHashNullifierCounterMap();
49
+ const nestedExecutions = privateExecutionOracle.getNestedExecutions();
50
+ let timerSubtractionList = nestedExecutions;
51
+ let witgenTime = duration;
52
+ // Due to the recursive nature of execution, we have to subtract the time taken by nested calls
53
+ while(timerSubtractionList.length > 0){
54
+ witgenTime -= timerSubtractionList.reduce((acc, nested)=>acc + (nested.profileResult?.timings.witgen ?? 0), 0);
55
+ timerSubtractionList = timerSubtractionList.flatMap((nested)=>nested.nestedExecutions ?? []);
56
+ }
57
+ log.debug(`Returning from call to ${contractAddress.toString()}:${functionSelector}`);
58
+ return new PrivateCallExecutionResult(artifact.bytecode, Buffer.from(artifact.verificationKey, 'base64'), partialWitness, publicInputs, noteHashLeafIndexMap, newNotes, noteHashNullifierCounterMap, rawReturnValues, nestedExecutions, contractClassLogs, {
59
+ timings: {
60
+ witgen: witgenTime,
61
+ oracles: acirExecutionResult.oracles
62
+ }
63
+ });
64
+ }
65
+ /**
66
+ * Get the private circuit public inputs from the partial witness.
67
+ * @param artifact - The function artifact
68
+ * @param partialWitness - The partial witness, result of simulating the function.
69
+ * @returns - The public inputs.
70
+ */ export function extractPrivateCircuitPublicInputs(artifact, partialWitness) {
71
+ const parametersSize = countArgumentsSize(artifact) + PRIVATE_CONTEXT_INPUTS_LENGTH;
72
+ const returnsSize = PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH;
73
+ const returnData = [];
74
+ // Return values always appear in the witness after arguments.
75
+ for(let i = parametersSize; i < parametersSize + returnsSize; i++){
76
+ const returnedField = partialWitness.get(i);
77
+ if (returnedField === undefined) {
78
+ throw new Error(`Missing return value for index ${i}`);
79
+ }
80
+ returnData.push(Fr.fromString(returnedField));
81
+ }
82
+ return PrivateCircuitPublicInputs.fromFields(returnData);
83
+ }
84
+ export async function readCurrentClassId(contractAddress, instance, executionDataProvider, blockNumber) {
85
+ const { sharedMutableSlot } = await SharedMutableValuesWithHash.getContractUpdateSlots(contractAddress);
86
+ const sharedMutableValues = await SharedMutableValues.readFromTree(sharedMutableSlot, (slot)=>executionDataProvider.getPublicStorageAt(blockNumber, ProtocolContractAddress.ContractInstanceDeployer, slot));
87
+ let currentClassId = sharedMutableValues.svc.getCurrentAt(blockNumber)[0];
88
+ if (currentClassId.isZero()) {
89
+ currentClassId = instance.originalContractClassId;
90
+ }
91
+ return currentClassId;
92
+ }
93
+ export async function verifyCurrentClassId(contractAddress, executionDataProvider, blockNumber) {
94
+ const instance = await executionDataProvider.getContractInstance(contractAddress);
95
+ blockNumber = blockNumber ?? await executionDataProvider.getBlockNumber();
96
+ const currentClassId = await readCurrentClassId(contractAddress, instance, executionDataProvider, blockNumber);
97
+ if (!instance.currentContractClassId.equals(currentClassId)) {
98
+ throw new Error(`Contract ${contractAddress} is outdated, current class id is ${currentClassId}, local class id is ${instance.currentContractClassId}`);
99
+ }
100
+ }
@@ -0,0 +1,187 @@
1
+ import { Fr } from '@aztec/foundation/fields';
2
+ import { type CircuitSimulator } from '@aztec/simulator/client';
3
+ import { type FunctionAbi, FunctionSelector, type NoteSelector } from '@aztec/stdlib/abi';
4
+ import type { AuthWitness } from '@aztec/stdlib/auth-witness';
5
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
6
+ import type { ContractClassLog } from '@aztec/stdlib/logs';
7
+ import { type NoteStatus } from '@aztec/stdlib/note';
8
+ import { type BlockHeader, CallContext, Capsule, CountedContractClassLog, NoteAndSlot, PrivateCallExecutionResult, type TxContext } from '@aztec/stdlib/tx';
9
+ import type { ExecutionDataProvider } from '../execution_data_provider.js';
10
+ import type { ExecutionNoteCache } from '../execution_note_cache.js';
11
+ import type { HashedValuesCache } from '../hashed_values_cache.js';
12
+ import type { NoteData } from './typed_oracle.js';
13
+ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
14
+ /**
15
+ * The execution oracle for the private part of a transaction.
16
+ */
17
+ export declare class PrivateExecutionOracle extends UtilityExecutionOracle {
18
+ #private;
19
+ private readonly argsHash;
20
+ private readonly txContext;
21
+ private readonly callContext;
22
+ /** Header of a block whose state is used during private execution (not the block the transaction is included in). */
23
+ protected readonly historicalHeader: BlockHeader;
24
+ private readonly executionCache;
25
+ private readonly noteCache;
26
+ private simulator;
27
+ private totalPublicCalldataCount;
28
+ protected sideEffectCounter: number;
29
+ /**
30
+ * New notes created during this execution.
31
+ * 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.
32
+ * But we still include those notes in the execution result because their commitments are still in the public inputs of this execution.
33
+ * This information is only for references (currently used for tests), and is not used for any sort of constrains.
34
+ * Users can also use this to get a clearer idea of what's happened during a simulation.
35
+ */
36
+ private newNotes;
37
+ /**
38
+ * Notes from previous transactions that are returned to the oracle call `getNotes` during this execution.
39
+ * The mapping maps from the unique siloed note hash to the index for notes created in private executions.
40
+ * It maps from siloed note hash to the index for notes created by public functions.
41
+ *
42
+ * They are not part of the ExecutionNoteCache and being forwarded to nested contexts via `extend()`
43
+ * because these notes are meant to be maintained on a per-call basis
44
+ * They should act as references for the read requests output by an app circuit via public inputs.
45
+ */
46
+ private noteHashLeafIndexMap;
47
+ private noteHashNullifierCounterMap;
48
+ private contractClassLogs;
49
+ private nestedExecutions;
50
+ constructor(argsHash: Fr, txContext: TxContext, callContext: CallContext,
51
+ /** Header of a block whose state is used during private execution (not the block the transaction is included in). */
52
+ historicalHeader: BlockHeader,
53
+ /** List of transient auth witnesses to be used during this simulation */
54
+ authWitnesses: AuthWitness[], capsules: Capsule[], executionCache: HashedValuesCache, noteCache: ExecutionNoteCache, executionDataProvider: ExecutionDataProvider, simulator: CircuitSimulator, totalPublicCalldataCount: number, sideEffectCounter?: number, log?: import("@aztec/foundation/log").Logger, scopes?: AztecAddress[]);
55
+ /**
56
+ * Writes the function inputs to the initial witness.
57
+ * @param abi - The function ABI.
58
+ * @returns The initial witness.
59
+ */
60
+ getInitialWitness(abi: FunctionAbi): Map<number, string>;
61
+ /**
62
+ * The KernelProver will use this to fully populate witnesses and provide hints to the kernel circuit
63
+ * regarding which note hash each settled read request corresponds to.
64
+ */
65
+ getNoteHashLeafIndexMap(): Map<bigint, bigint>;
66
+ /**
67
+ * Get the data for the newly created notes.
68
+ */
69
+ getNewNotes(): NoteAndSlot[];
70
+ getNoteHashNullifierCounterMap(): Map<number, number>;
71
+ /**
72
+ * Return the contract class logs emitted during this execution.
73
+ */
74
+ getContractClassLogs(): CountedContractClassLog[];
75
+ /**
76
+ * Return the nested execution results during this execution.
77
+ */
78
+ getNestedExecutions(): PrivateCallExecutionResult[];
79
+ /**
80
+ * Store values in the execution cache.
81
+ * @param values - Values to store.
82
+ * @returns The hash of the values.
83
+ */
84
+ storeInExecutionCache(values: Fr[], hash: Fr): void;
85
+ /**
86
+ * Gets values from the execution cache.
87
+ * @param hash - Hash of the values.
88
+ * @returns The values.
89
+ */
90
+ loadFromExecutionCache(hash: Fr): Promise<Fr[]>;
91
+ /**
92
+ * Gets some notes for a storage slot.
93
+ *
94
+ * @remarks
95
+ * Check for pending notes with matching slot.
96
+ * Real notes coming from DB will have a leafIndex which
97
+ * represents their index in the note hash tree.
98
+ *
99
+ * @param storageSlot - The storage slot.
100
+ * @param numSelects - The number of valid selects in selectBy and selectValues.
101
+ * @param selectBy - An array of indices of the fields to selects.
102
+ * @param selectValues - The values to match.
103
+ * @param selectComparators - The comparators to match by.
104
+ * @param sortBy - An array of indices of the fields to sort.
105
+ * @param sortOrder - The order of the corresponding index in sortBy. (1: DESC, 2: ASC, 0: Do nothing)
106
+ * @param limit - The number of notes to retrieve per query.
107
+ * @param offset - The starting index for pagination.
108
+ * @param status - The status of notes to fetch.
109
+ * @returns Array of note data.
110
+ */
111
+ 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[]>;
112
+ /**
113
+ * Keep track of the new note created during execution.
114
+ * It can be used in subsequent calls (or transactions when chaining txs is possible).
115
+ * @param contractAddress - The contract address.
116
+ * @param storageSlot - The storage slot.
117
+ * @param noteTypeId - The type ID of the note.
118
+ * @param noteItems - The items to be included in a Note.
119
+ * @param noteHash - A hash of the new note.
120
+ * @returns
121
+ */
122
+ notifyCreatedNote(storageSlot: Fr, noteTypeId: NoteSelector, noteItems: Fr[], noteHash: Fr, counter: number): void;
123
+ /**
124
+ * Adding a siloed nullifier into the current set of all pending nullifiers created
125
+ * within the current transaction/execution.
126
+ * @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
127
+ * @param noteHash - A hash of the new note.
128
+ */
129
+ notifyNullifiedNote(innerNullifier: Fr, noteHash: Fr, counter: number): Promise<void>;
130
+ /**
131
+ * Adding a siloed nullifier into the current set of all pending nullifiers created
132
+ * within the current transaction/execution.
133
+ * @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
134
+ * @param noteHash - A hash of the new note.
135
+ */
136
+ notifyCreatedNullifier(innerNullifier: Fr): Promise<void>;
137
+ /**
138
+ * Emit a contract class log.
139
+ * This fn exists because we only carry a poseidon hash through the kernels, and need to
140
+ * keep the preimage in ts for later.
141
+ * @param log - The contract class log to be emitted.
142
+ * @param counter - The contract class log's counter.
143
+ */
144
+ notifyCreatedContractClassLog(log: ContractClassLog, counter: number): void;
145
+ /**
146
+ * Calls a private function as a nested execution.
147
+ * @param targetContractAddress - The address of the contract to call.
148
+ * @param functionSelector - The function selector of the function to call.
149
+ * @param argsHash - The arguments hash to pass to the function.
150
+ * @param sideEffectCounter - The side effect counter at the start of the call.
151
+ * @param isStaticCall - Whether the call is a static call.
152
+ * @returns The execution result.
153
+ */
154
+ callPrivateFunction(targetContractAddress: AztecAddress, functionSelector: FunctionSelector, argsHash: Fr, sideEffectCounter: number, isStaticCall: boolean): Promise<{
155
+ endSideEffectCounter: Fr;
156
+ returnsHash: Fr;
157
+ }>;
158
+ /**
159
+ * Verify relevant information when a public function is enqueued.
160
+ * @param targetContractAddress - The address of the contract to call.
161
+ * @param calldataHash - The hash of the function selector and arguments.
162
+ * @param sideEffectCounter - The side effect counter at the start of the call.
163
+ * @param isStaticCall - Whether the call is a static call.
164
+ */
165
+ notifyEnqueuedPublicFunctionCall(_targetContractAddress: AztecAddress, calldataHash: Fr, _sideEffectCounter: number, _isStaticCall: boolean): Promise<void>;
166
+ /**
167
+ * Verify relevant information when a public teardown function is set.
168
+ * @param targetContractAddress - The address of the contract to call.
169
+ * @param argsHash - The arguments hash to pass to the function.
170
+ * @param sideEffectCounter - The side effect counter at the start of the call.
171
+ * @param isStaticCall - Whether the call is a static call.
172
+ */
173
+ notifySetPublicTeardownFunctionCall(_targetContractAddress: AztecAddress, calldataHash: Fr, _sideEffectCounter: number, _isStaticCall: boolean): Promise<void>;
174
+ notifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter: number): Promise<void>;
175
+ /**
176
+ * Derives the call context for a nested execution.
177
+ * @param targetContractAddress - The address of the contract being called.
178
+ * @param targetArtifact - The artifact of the function being called.
179
+ * @param isStaticCall - Whether the call is a static call.
180
+ * @returns The derived call context.
181
+ */
182
+ private deriveCallContext;
183
+ getDebugFunctionName(): Promise<string>;
184
+ incrementAppTaggingSecretIndexAsSender(sender: AztecAddress, recipient: AztecAddress): Promise<void>;
185
+ fetchTaggedLogs(pendingTaggedLogArrayBaseSlot: Fr): Promise<void>;
186
+ }
187
+ //# sourceMappingURL=private_execution_oracle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private_execution_oracle.d.ts","sourceRoot":"","sources":["../../../src/contract_function_simulator/oracle/private_execution_oracle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EACL,KAAK,WAAW,EAEhB,gBAAgB,EAChB,KAAK,YAAY,EAElB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,KAAK,WAAW,EAChB,WAAW,EACX,OAAO,EACP,uBAAuB,EACvB,WAAW,EACX,0BAA0B,EAC1B,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,O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