@aztec/simulator 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 (122) hide show
  1. package/dest/client.d.ts +5 -5
  2. package/dest/client.d.ts.map +1 -1
  3. package/dest/client.js +4 -4
  4. package/dest/private/acvm/acvm.d.ts +1 -2
  5. package/dest/private/acvm/acvm.d.ts.map +1 -1
  6. package/dest/private/acvm/index.d.ts +0 -1
  7. package/dest/private/acvm/index.d.ts.map +1 -1
  8. package/dest/private/acvm/index.js +0 -1
  9. package/dest/private/{providers/acvm_native.d.ts → acvm_native.d.ts} +4 -4
  10. package/dest/private/acvm_native.d.ts.map +1 -0
  11. package/dest/private/{providers/acvm_wasm.d.ts → acvm_wasm.d.ts} +4 -4
  12. package/dest/private/acvm_wasm.d.ts.map +1 -0
  13. package/dest/private/{providers/acvm_wasm.js → acvm_wasm.js} +2 -2
  14. package/dest/private/{providers/acvm_wasm_with_blobs.d.ts → acvm_wasm_with_blobs.d.ts} +5 -5
  15. package/dest/private/acvm_wasm_with_blobs.d.ts.map +1 -0
  16. package/dest/private/{providers/acvm_wasm_with_blobs.js → acvm_wasm_with_blobs.js} +2 -2
  17. package/dest/private/{providers/circuit_recording → circuit_recording}/circuit_recorder.d.ts +2 -2
  18. package/dest/private/circuit_recording/circuit_recorder.d.ts.map +1 -0
  19. package/dest/private/{providers/circuit_recording → circuit_recording}/circuit_recorder.js +2 -3
  20. package/dest/private/{providers/circuit_recording → circuit_recording}/file_circuit_recorder.d.ts +1 -1
  21. package/dest/private/circuit_recording/file_circuit_recorder.d.ts.map +1 -0
  22. package/dest/private/circuit_recording/memory_circuit_recorder.d.ts.map +1 -0
  23. package/dest/private/{providers/circuit_recording/simulation_provider_recorder_wrapper.d.ts → circuit_recording/simulator_recorder_wrapper.d.ts} +7 -7
  24. package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts.map +1 -0
  25. package/dest/private/{providers/circuit_recording/simulation_provider_recorder_wrapper.js → circuit_recording/simulator_recorder_wrapper.js} +2 -2
  26. package/dest/private/{providers/simulation_provider.d.ts → circuit_simulator.d.ts} +4 -4
  27. package/dest/private/circuit_simulator.d.ts.map +1 -0
  28. package/dest/private/{providers/simulation_provider.js → circuit_simulator.js} +1 -1
  29. package/dest/private/factory.d.ts +12 -0
  30. package/dest/private/factory.d.ts.map +1 -0
  31. package/dest/private/{providers/factory.js → factory.js} +2 -2
  32. package/dest/server.d.ts +6 -5
  33. package/dest/server.d.ts.map +1 -1
  34. package/dest/server.js +5 -4
  35. package/dest/testing.d.ts +1 -1
  36. package/dest/testing.d.ts.map +1 -1
  37. package/dest/testing.js +1 -1
  38. package/package.json +15 -15
  39. package/src/client.ts +5 -5
  40. package/src/private/acvm/acvm.ts +2 -3
  41. package/src/private/acvm/index.ts +0 -1
  42. package/src/private/{providers/acvm_native.ts → acvm_native.ts} +4 -4
  43. package/src/private/{providers/acvm_wasm.ts → acvm_wasm.ts} +4 -4
  44. package/src/private/{providers/acvm_wasm_with_blobs.ts → acvm_wasm_with_blobs.ts} +5 -5
  45. package/src/private/{providers/circuit_recording → circuit_recording}/circuit_recorder.ts +4 -5
  46. package/src/private/{providers/circuit_recording → circuit_recording}/file_circuit_recorder.ts +1 -1
  47. package/src/private/{providers/circuit_recording/simulation_provider_recorder_wrapper.ts → circuit_recording/simulator_recorder_wrapper.ts} +6 -6
  48. package/src/private/{providers/simulation_provider.ts → circuit_simulator.ts} +3 -3
  49. package/src/private/{providers/factory.ts → factory.ts} +6 -6
  50. package/src/server.ts +6 -5
  51. package/src/testing.ts +1 -1
  52. package/dest/private/acvm/oracle/index.d.ts +0 -14
  53. package/dest/private/acvm/oracle/index.d.ts.map +0 -1
  54. package/dest/private/acvm/oracle/index.js +0 -2
  55. package/dest/private/acvm/oracle/oracle.d.ts +0 -52
  56. package/dest/private/acvm/oracle/oracle.d.ts.map +0 -1
  57. package/dest/private/acvm/oracle/oracle.js +0 -312
  58. package/dest/private/acvm/oracle/typed_oracle.d.ts +0 -83
  59. package/dest/private/acvm/oracle/typed_oracle.d.ts.map +0 -1
  60. package/dest/private/acvm/oracle/typed_oracle.js +0 -138
  61. package/dest/private/execution_data_provider.d.ts +0 -301
  62. package/dest/private/execution_data_provider.d.ts.map +0 -1
  63. package/dest/private/execution_data_provider.js +0 -14
  64. package/dest/private/execution_note_cache.d.ts +0 -93
  65. package/dest/private/execution_note_cache.d.ts.map +0 -1
  66. package/dest/private/execution_note_cache.js +0 -180
  67. package/dest/private/hashed_values_cache.d.ts +0 -28
  68. package/dest/private/hashed_values_cache.d.ts.map +0 -1
  69. package/dest/private/hashed_values_cache.js +0 -36
  70. package/dest/private/index.d.ts +0 -16
  71. package/dest/private/index.d.ts.map +0 -1
  72. package/dest/private/index.js +0 -15
  73. package/dest/private/message_load_oracle_inputs.d.ts +0 -19
  74. package/dest/private/message_load_oracle_inputs.d.ts.map +0 -1
  75. package/dest/private/message_load_oracle_inputs.js +0 -24
  76. package/dest/private/pick_notes.d.ts +0 -85
  77. package/dest/private/pick_notes.d.ts.map +0 -1
  78. package/dest/private/pick_notes.js +0 -51
  79. package/dest/private/private_execution.d.ts +0 -25
  80. package/dest/private/private_execution.d.ts.map +0 -1
  81. package/dest/private/private_execution.js +0 -96
  82. package/dest/private/private_execution_oracle.d.ts +0 -187
  83. package/dest/private/private_execution_oracle.d.ts.map +0 -1
  84. package/dest/private/private_execution_oracle.js +0 -318
  85. package/dest/private/providers/acvm_native.d.ts.map +0 -1
  86. package/dest/private/providers/acvm_wasm.d.ts.map +0 -1
  87. package/dest/private/providers/acvm_wasm_with_blobs.d.ts.map +0 -1
  88. package/dest/private/providers/circuit_recording/circuit_recorder.d.ts.map +0 -1
  89. package/dest/private/providers/circuit_recording/file_circuit_recorder.d.ts.map +0 -1
  90. package/dest/private/providers/circuit_recording/memory_circuit_recorder.d.ts.map +0 -1
  91. package/dest/private/providers/circuit_recording/simulation_provider_recorder_wrapper.d.ts.map +0 -1
  92. package/dest/private/providers/factory.d.ts +0 -12
  93. package/dest/private/providers/factory.d.ts.map +0 -1
  94. package/dest/private/providers/simulation_provider.d.ts.map +0 -1
  95. package/dest/private/simulator.d.ts +0 -36
  96. package/dest/private/simulator.d.ts.map +0 -1
  97. package/dest/private/simulator.js +0 -104
  98. package/dest/private/utility_execution_oracle.d.ts +0 -163
  99. package/dest/private/utility_execution_oracle.d.ts.map +0 -1
  100. package/dest/private/utility_execution_oracle.js +0 -257
  101. package/dest/test/utils.d.ts +0 -13
  102. package/dest/test/utils.d.ts.map +0 -1
  103. package/dest/test/utils.js +0 -22
  104. package/src/private/acvm/oracle/index.ts +0 -16
  105. package/src/private/acvm/oracle/oracle.ts +0 -523
  106. package/src/private/acvm/oracle/typed_oracle.ts +0 -273
  107. package/src/private/execution_data_provider.ts +0 -388
  108. package/src/private/execution_note_cache.ts +0 -217
  109. package/src/private/hashed_values_cache.ts +0 -47
  110. package/src/private/index.ts +0 -19
  111. package/src/private/message_load_oracle_inputs.ts +0 -23
  112. package/src/private/pick_notes.ts +0 -141
  113. package/src/private/private_execution.ts +0 -160
  114. package/src/private/private_execution_oracle.ts +0 -508
  115. package/src/private/simulator.ts +0 -170
  116. package/src/private/utility_execution_oracle.ts +0 -384
  117. package/src/test/utils.ts +0 -36
  118. /package/dest/private/{providers/acvm_native.js → acvm_native.js} +0 -0
  119. /package/dest/private/{providers/circuit_recording → circuit_recording}/file_circuit_recorder.js +0 -0
  120. /package/dest/private/{providers/circuit_recording → circuit_recording}/memory_circuit_recorder.d.ts +0 -0
  121. /package/dest/private/{providers/circuit_recording → circuit_recording}/memory_circuit_recorder.js +0 -0
  122. /package/src/private/{providers/circuit_recording → circuit_recording}/memory_circuit_recorder.ts +0 -0
@@ -1,187 +0,0 @@
1
- import { Fr } from '@aztec/foundation/fields';
2
- import { type FunctionAbi, FunctionSelector, type NoteSelector } from '@aztec/stdlib/abi';
3
- import type { AuthWitness } from '@aztec/stdlib/auth-witness';
4
- import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
- import type { ContractClassLog } from '@aztec/stdlib/logs';
6
- import { type NoteStatus } from '@aztec/stdlib/note';
7
- import { type BlockHeader, CallContext, Capsule, CountedContractClassLog, NoteAndSlot, PrivateCallExecutionResult, type TxContext } from '@aztec/stdlib/tx';
8
- import { type NoteData } from './acvm/index.js';
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 { SimulationProvider } from './providers/simulation_provider.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 provider;
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, provider: SimulationProvider, 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
@@ -1 +0,0 @@
1
-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,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9G;;;;;;OAMG;YACW,iBAAiB;IAaxB,oBAAoB;IAIL,sCAAsC,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY;IAIpF,eAAe,CAAC,6BAA6B,EAAE,EAAE;CAKxE"}
@@ -1,318 +0,0 @@
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 { FunctionSelector, countArgumentsSize } from '@aztec/stdlib/abi';
5
- import { computeUniqueNoteHash, siloNoteHash } from '@aztec/stdlib/hash';
6
- import { PrivateContextInputs } from '@aztec/stdlib/kernel';
7
- import { Note } from '@aztec/stdlib/note';
8
- import { CallContext, CountedContractClassLog, NoteAndSlot } from '@aztec/stdlib/tx';
9
- import { toACVMWitness } from './acvm/index.js';
10
- import { pickNotes } from './pick_notes.js';
11
- import { executePrivateFunction, verifyCurrentClassId } from './private_execution.js';
12
- import { UtilityExecutionOracle } from './utility_execution_oracle.js';
13
- /**
14
- * The execution oracle for the private part of a transaction.
15
- */ export class PrivateExecutionOracle extends UtilityExecutionOracle {
16
- argsHash;
17
- txContext;
18
- callContext;
19
- historicalHeader;
20
- executionCache;
21
- noteCache;
22
- provider;
23
- totalPublicCalldataCount;
24
- sideEffectCounter;
25
- /**
26
- * New notes created during this execution.
27
- * 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.
28
- * But we still include those notes in the execution result because their commitments are still in the public inputs of this execution.
29
- * This information is only for references (currently used for tests), and is not used for any sort of constrains.
30
- * Users can also use this to get a clearer idea of what's happened during a simulation.
31
- */ newNotes;
32
- /**
33
- * Notes from previous transactions that are returned to the oracle call `getNotes` during this execution.
34
- * The mapping maps from the unique siloed note hash to the index for notes created in private executions.
35
- * It maps from siloed note hash to the index for notes created by public functions.
36
- *
37
- * They are not part of the ExecutionNoteCache and being forwarded to nested contexts via `extend()`
38
- * because these notes are meant to be maintained on a per-call basis
39
- * They should act as references for the read requests output by an app circuit via public inputs.
40
- */ noteHashLeafIndexMap;
41
- noteHashNullifierCounterMap;
42
- contractClassLogs;
43
- nestedExecutions;
44
- 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, provider, totalPublicCalldataCount, sideEffectCounter = 0, log = createLogger('simulator:client_execution_context'), scopes){
45
- 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.provider = provider, this.totalPublicCalldataCount = totalPublicCalldataCount, this.sideEffectCounter = sideEffectCounter, this.newNotes = [], this.noteHashLeafIndexMap = new Map(), this.noteHashNullifierCounterMap = new Map(), this.contractClassLogs = [], this.nestedExecutions = [];
46
- }
47
- // We still need this function until we can get user-defined ordering of structs for fn arguments
48
- // TODO When that is sorted out on noir side, we can use instead the utilities in serialize.ts
49
- /**
50
- * Writes the function inputs to the initial witness.
51
- * @param abi - The function ABI.
52
- * @returns The initial witness.
53
- */ getInitialWitness(abi) {
54
- const argumentsSize = countArgumentsSize(abi);
55
- const args = this.executionCache.getPreimage(this.argsHash);
56
- if (args?.length !== argumentsSize) {
57
- throw new Error(`Invalid arguments size: expected ${argumentsSize}, got ${args?.length}`);
58
- }
59
- const privateContextInputs = new PrivateContextInputs(this.callContext, this.historicalHeader, this.txContext, this.sideEffectCounter);
60
- const privateContextInputsAsFields = privateContextInputs.toFields();
61
- if (privateContextInputsAsFields.length !== PRIVATE_CONTEXT_INPUTS_LENGTH) {
62
- throw new Error('Invalid private context inputs size');
63
- }
64
- const fields = [
65
- ...privateContextInputsAsFields,
66
- ...args
67
- ];
68
- return toACVMWitness(0, fields);
69
- }
70
- /**
71
- * The KernelProver will use this to fully populate witnesses and provide hints to the kernel circuit
72
- * regarding which note hash each settled read request corresponds to.
73
- */ getNoteHashLeafIndexMap() {
74
- return this.noteHashLeafIndexMap;
75
- }
76
- /**
77
- * Get the data for the newly created notes.
78
- */ getNewNotes() {
79
- return this.newNotes;
80
- }
81
- getNoteHashNullifierCounterMap() {
82
- return this.noteHashNullifierCounterMap;
83
- }
84
- /**
85
- * Return the contract class logs emitted during this execution.
86
- */ getContractClassLogs() {
87
- return this.contractClassLogs;
88
- }
89
- /**
90
- * Return the nested execution results during this execution.
91
- */ getNestedExecutions() {
92
- return this.nestedExecutions;
93
- }
94
- /**
95
- * Store values in the execution cache.
96
- * @param values - Values to store.
97
- * @returns The hash of the values.
98
- */ storeInExecutionCache(values, hash) {
99
- return this.executionCache.store(values, hash);
100
- }
101
- /**
102
- * Gets values from the execution cache.
103
- * @param hash - Hash of the values.
104
- * @returns The values.
105
- */ loadFromExecutionCache(hash) {
106
- const preimage = this.executionCache.getPreimage(hash);
107
- if (!preimage) {
108
- throw new Error(`Preimage for hash ${hash.toString()} not found in cache`);
109
- }
110
- return Promise.resolve(preimage);
111
- }
112
- /**
113
- * Gets some notes for a storage slot.
114
- *
115
- * @remarks
116
- * Check for pending notes with matching slot.
117
- * Real notes coming from DB will have a leafIndex which
118
- * represents their index in the note hash tree.
119
- *
120
- * @param storageSlot - The storage slot.
121
- * @param numSelects - The number of valid selects in selectBy and selectValues.
122
- * @param selectBy - An array of indices of the fields to selects.
123
- * @param selectValues - The values to match.
124
- * @param selectComparators - The comparators to match by.
125
- * @param sortBy - An array of indices of the fields to sort.
126
- * @param sortOrder - The order of the corresponding index in sortBy. (1: DESC, 2: ASC, 0: Do nothing)
127
- * @param limit - The number of notes to retrieve per query.
128
- * @param offset - The starting index for pagination.
129
- * @param status - The status of notes to fetch.
130
- * @returns Array of note data.
131
- */ async getNotes(storageSlot, numSelects, selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, limit, offset, status) {
132
- // Nullified pending notes are already removed from the list.
133
- const pendingNotes = this.noteCache.getNotes(this.callContext.contractAddress, storageSlot);
134
- const pendingNullifiers = this.noteCache.getNullifiers(this.callContext.contractAddress);
135
- const dbNotes = await this.executionDataProvider.getNotes(this.callContext.contractAddress, storageSlot, status, this.scopes);
136
- const dbNotesFiltered = dbNotes.filter((n)=>!pendingNullifiers.has(n.siloedNullifier.value));
137
- const notes = pickNotes([
138
- ...dbNotesFiltered,
139
- ...pendingNotes
140
- ], {
141
- selects: selectByIndexes.slice(0, numSelects).map((index, i)=>({
142
- selector: {
143
- index,
144
- offset: selectByOffsets[i],
145
- length: selectByLengths[i]
146
- },
147
- value: selectValues[i],
148
- comparator: selectComparators[i]
149
- })),
150
- sorts: sortByIndexes.map((index, i)=>({
151
- selector: {
152
- index,
153
- offset: sortByOffsets[i],
154
- length: sortByLengths[i]
155
- },
156
- order: sortOrder[i]
157
- })),
158
- limit,
159
- offset
160
- });
161
- 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(', ')}`);
162
- const noteHashesAndIndexes = await Promise.all(notes.map(async (n)=>{
163
- if (n.index !== undefined) {
164
- const siloedNoteHash = await siloNoteHash(n.contractAddress, n.noteHash);
165
- const uniqueNoteHash = await computeUniqueNoteHash(n.nonce, siloedNoteHash);
166
- return {
167
- hash: uniqueNoteHash,
168
- index: n.index
169
- };
170
- }
171
- }));
172
- noteHashesAndIndexes.filter((n)=>n !== undefined).forEach((n)=>{
173
- this.noteHashLeafIndexMap.set(n.hash.toBigInt(), n.index);
174
- });
175
- return notes;
176
- }
177
- /**
178
- * Keep track of the new note created during execution.
179
- * It can be used in subsequent calls (or transactions when chaining txs is possible).
180
- * @param contractAddress - The contract address.
181
- * @param storageSlot - The storage slot.
182
- * @param noteTypeId - The type ID of the note.
183
- * @param noteItems - The items to be included in a Note.
184
- * @param noteHash - A hash of the new note.
185
- * @returns
186
- */ notifyCreatedNote(storageSlot, noteTypeId, noteItems, noteHash, counter) {
187
- this.log.debug(`Notified of new note with inner hash ${noteHash}`, {
188
- contractAddress: this.callContext.contractAddress,
189
- storageSlot,
190
- noteTypeId,
191
- counter
192
- });
193
- const note = new Note(noteItems);
194
- this.noteCache.addNewNote({
195
- contractAddress: this.callContext.contractAddress,
196
- storageSlot,
197
- nonce: Fr.ZERO,
198
- note,
199
- siloedNullifier: undefined,
200
- noteHash
201
- }, counter);
202
- this.newNotes.push(new NoteAndSlot(note, storageSlot, noteTypeId));
203
- }
204
- /**
205
- * Adding a siloed nullifier into the current set of all pending nullifiers created
206
- * within the current transaction/execution.
207
- * @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
208
- * @param noteHash - A hash of the new note.
209
- */ async notifyNullifiedNote(innerNullifier, noteHash, counter) {
210
- const nullifiedNoteHashCounter = await this.noteCache.nullifyNote(this.callContext.contractAddress, innerNullifier, noteHash);
211
- if (nullifiedNoteHashCounter !== undefined) {
212
- this.noteHashNullifierCounterMap.set(nullifiedNoteHashCounter, counter);
213
- }
214
- }
215
- /**
216
- * Adding a siloed nullifier into the current set of all pending nullifiers created
217
- * within the current transaction/execution.
218
- * @param innerNullifier - The pending nullifier to add in the list (not yet siloed by contract address).
219
- * @param noteHash - A hash of the new note.
220
- */ notifyCreatedNullifier(innerNullifier) {
221
- return this.noteCache.nullifierCreated(this.callContext.contractAddress, innerNullifier);
222
- }
223
- /**
224
- * Emit a contract class log.
225
- * This fn exists because we only carry a poseidon hash through the kernels, and need to
226
- * keep the preimage in ts for later.
227
- * @param log - The contract class log to be emitted.
228
- * @param counter - The contract class log's counter.
229
- */ notifyCreatedContractClassLog(log, counter) {
230
- this.contractClassLogs.push(new CountedContractClassLog(log, counter));
231
- const text = log.toBuffer().toString('hex');
232
- this.log.verbose(`Emitted log from ContractClassRegisterer: "${text.length > 100 ? text.slice(0, 100) + '...' : text}"`);
233
- }
234
- #checkValidStaticCall(childExecutionResult) {
235
- 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())) {
236
- throw new Error(`Static call cannot update the state, emit L2->L1 messages or generate logs`);
237
- }
238
- }
239
- /**
240
- * Calls a private function as a nested execution.
241
- * @param targetContractAddress - The address of the contract to call.
242
- * @param functionSelector - The function selector of the function to call.
243
- * @param argsHash - The arguments hash to pass to the function.
244
- * @param sideEffectCounter - The side effect counter at the start of the call.
245
- * @param isStaticCall - Whether the call is a static call.
246
- * @returns The execution result.
247
- */ async callPrivateFunction(targetContractAddress, functionSelector, argsHash, sideEffectCounter, isStaticCall) {
248
- this.log.debug(`Calling private function ${targetContractAddress}:${functionSelector} from ${this.callContext.contractAddress}`);
249
- isStaticCall = isStaticCall || this.callContext.isStaticCall;
250
- await verifyCurrentClassId(targetContractAddress, this.executionDataProvider, this.historicalHeader.globalVariables.blockNumber.toNumber());
251
- const targetArtifact = await this.executionDataProvider.getFunctionArtifact(targetContractAddress, functionSelector);
252
- const derivedTxContext = this.txContext.clone();
253
- const derivedCallContext = await this.deriveCallContext(targetContractAddress, targetArtifact, isStaticCall);
254
- const context = new PrivateExecutionOracle(argsHash, derivedTxContext, derivedCallContext, this.historicalHeader, this.authWitnesses, this.capsules, this.executionCache, this.noteCache, this.executionDataProvider, this.provider, this.totalPublicCalldataCount, sideEffectCounter, this.log, this.scopes);
255
- const childExecutionResult = await executePrivateFunction(this.provider, context, targetArtifact, targetContractAddress, functionSelector);
256
- if (isStaticCall) {
257
- this.#checkValidStaticCall(childExecutionResult);
258
- }
259
- this.nestedExecutions.push(childExecutionResult);
260
- const publicInputs = childExecutionResult.publicInputs;
261
- return {
262
- endSideEffectCounter: publicInputs.endSideEffectCounter,
263
- returnsHash: publicInputs.returnsHash
264
- };
265
- }
266
- #onNewPublicFunctionCall(calldataHash) {
267
- const calldata = this.executionCache.getPreimage(calldataHash);
268
- if (!calldata) {
269
- throw new Error('Calldata for public call not found in cache');
270
- }
271
- this.totalPublicCalldataCount += calldata.length;
272
- if (this.totalPublicCalldataCount > MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS) {
273
- throw new Error(`Too many total args to all enqueued public calls! (> ${MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS})`);
274
- }
275
- }
276
- /**
277
- * Verify relevant information when a public function is enqueued.
278
- * @param targetContractAddress - The address of the contract to call.
279
- * @param calldataHash - The hash of the function selector and arguments.
280
- * @param sideEffectCounter - The side effect counter at the start of the call.
281
- * @param isStaticCall - Whether the call is a static call.
282
- */ notifyEnqueuedPublicFunctionCall(_targetContractAddress, calldataHash, _sideEffectCounter, _isStaticCall) {
283
- this.#onNewPublicFunctionCall(calldataHash);
284
- return Promise.resolve();
285
- }
286
- /**
287
- * Verify relevant information when a public teardown function is set.
288
- * @param targetContractAddress - The address of the contract to call.
289
- * @param argsHash - The arguments hash to pass to the function.
290
- * @param sideEffectCounter - The side effect counter at the start of the call.
291
- * @param isStaticCall - Whether the call is a static call.
292
- */ notifySetPublicTeardownFunctionCall(_targetContractAddress, calldataHash, _sideEffectCounter, _isStaticCall) {
293
- this.#onNewPublicFunctionCall(calldataHash);
294
- return Promise.resolve();
295
- }
296
- notifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter) {
297
- return this.noteCache.setMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter);
298
- }
299
- /**
300
- * Derives the call context for a nested execution.
301
- * @param targetContractAddress - The address of the contract being called.
302
- * @param targetArtifact - The artifact of the function being called.
303
- * @param isStaticCall - Whether the call is a static call.
304
- * @returns The derived call context.
305
- */ async deriveCallContext(targetContractAddress, targetArtifact, isStaticCall = false) {
306
- return new CallContext(this.contractAddress, targetContractAddress, await FunctionSelector.fromNameAndParameters(targetArtifact.name, targetArtifact.parameters), isStaticCall);
307
- }
308
- getDebugFunctionName() {
309
- return this.executionDataProvider.getDebugFunctionName(this.contractAddress, this.callContext.functionSelector);
310
- }
311
- async incrementAppTaggingSecretIndexAsSender(sender, recipient) {
312
- await this.executionDataProvider.incrementAppTaggingSecretIndexAsSender(this.contractAddress, sender, recipient);
313
- }
314
- async fetchTaggedLogs(pendingTaggedLogArrayBaseSlot) {
315
- await this.executionDataProvider.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes);
316
- await this.executionDataProvider.removeNullifiedNotes(this.contractAddress);
317
- }
318
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"acvm_native.d.ts","sourceRoot":"","sources":["../../../src/private/providers/acvm_native.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAKtE,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAInE,oBAAY,WAAW;IACrB,OAAO,IAAA;IACP,OAAO,IAAA;CACR;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CA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;IACzD,sBAAsB,CAC1B,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,2BAA2B,EACrC,QAAQ,EAAE,kBAAkB,GAC3B,OAAO,CAAC,WAAW,CAAC;IAuBvB,kBAAkB,CAChB,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,gCAAgC,EAC3C,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,mBAAmB,CAAC;CAGhC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"circuit_recorder.d.ts","sourceRoot":"","sources":["../../../../src/private/providers/circuit_recording/circuit_recorder.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAuC,MAAM,qBAAqB,CAAC;AAEnG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IAMb,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,qBAAa,gBAAgB;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,gBAAgB,CAAC;gBAEd,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IASjH,SAAS,CAAC,SAAS,CAAC,EAAE,gBAAgB,GAAG,IAAI;CAG9C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,qBAAa,eAAe;;IAC1B,SAAS,CAAC,QAAQ,CAAC,MAAM,yCAA4C;IAErE,SAAS,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAEvC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAiB;IAEnC,SAAS;IAET;;;;;;;;OAQG;IACH,KAAK,CAAC,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAe5G;;;;OAIG;IACH,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,kBAAkB,GAAG,SAAS,GAAG,YAAY,GAAG,kBAAkB,GAAG,SAAS;IAqFpH;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAYpH;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAUnC;;;OAGG;IACH,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAU3D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"file_circuit_recorder.d.ts","sourceRoot":"","sources":["../../../../src/private/providers/circuit_recording/file_circuit_recorder.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,qBAAa,mBAAoB,SAAQ,eAAe;;IAG1C,OAAO,CAAC,QAAQ,CAAC,SAAS;IAF9B,SAAS,CAAC,EAAE,gBAAgB,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC;gBAErD,SAAS,EAAE,MAAM;IAI/B,KAAK,CAClB,KAAK,EAAE,WAAW,EAClB,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EACnB,YAAY,GAAE,MAAe;IAqE/B;;;;;OAKG;IACY,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAY7G;;;OAGG;IACY,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAalD;;;;OAIG;IACY,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAc1E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory_circuit_recorder.d.ts","sourceRoot":"","sources":["../../../../src/private/providers/circuit_recording/memory_circuit_recorder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAMxD,qBAAa,qBAAsB,SAAQ,eAAe;;CAIzD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"simulation_provider_recorder_wrapper.d.ts","sourceRoot":"","sources":["../../../../src/private/providers/circuit_recording/simulation_provider_recorder_wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAqB,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC/F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;GAGG;AACH,qBAAa,iCAAkC,YAAW,kBAAkB;;IAExE,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,QAAQ;gBADR,SAAS,EAAE,kBAAkB,EAC7B,QAAQ,EAAE,eAAe;IAGnC,sBAAsB,CACpB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,2BAA2B,EACrC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,GACvC,OAAO,CAAC,WAAW,CAAC;IAavB,kBAAkB,CAChB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,gCAAgC,EAC1C,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,mBAAmB,CAAC;CAiDhC"}
@@ -1,12 +0,0 @@
1
- import { type Logger } from '@aztec/foundation/log';
2
- import type { SimulationProvider } from './simulation_provider.js';
3
- export type SimulationProviderConfig = {
4
- acvmBinaryPath?: string;
5
- acvmWorkingDirectory?: string;
6
- };
7
- export declare function getSimulationProviderConfigFromEnv(): {
8
- acvmWorkingDirectory: string | undefined;
9
- acvmBinaryPath: string | undefined;
10
- };
11
- export declare function createSimulationProvider(config: SimulationProviderConfig, logger?: Logger): Promise<SimulationProvider>;
12
- //# sourceMappingURL=factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/private/providers/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAMlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,MAAM,MAAM,wBAAwB,GAAG;IACrC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;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
@@ -1,36 +0,0 @@
1
- import type { AbiDecoded, FunctionCall } from '@aztec/stdlib/abi';
2
- import { FunctionSelector } from '@aztec/stdlib/abi';
3
- import type { AuthWitness } from '@aztec/stdlib/auth-witness';
4
- import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
- import { PrivateExecutionResult, TxExecutionRequest } from '@aztec/stdlib/tx';
6
- import type { ExecutionDataProvider } from './execution_data_provider.js';
7
- import type { SimulationProvider } from './providers/simulation_provider.js';
8
- /**
9
- * The ACIR simulator.
10
- */
11
- export declare class AcirSimulator {
12
- private executionDataProvider;
13
- private simulationProvider;
14
- private log;
15
- constructor(executionDataProvider: ExecutionDataProvider, simulationProvider: SimulationProvider);
16
- /**
17
- * Runs a private function.
18
- * @param request - The transaction request.
19
- * @param entryPointArtifact - The artifact of the entry point function.
20
- * @param contractAddress - The address of the contract (should match request.origin)
21
- * @param msgSender - The address calling the function. This can be replaced to simulate a call from another contract or a specific account.
22
- * @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
23
- * @returns The result of the execution.
24
- */
25
- run(request: TxExecutionRequest, contractAddress: AztecAddress, selector: FunctionSelector, msgSender?: AztecAddress, scopes?: AztecAddress[]): Promise<PrivateExecutionResult>;
26
- /**
27
- * Runs a utility function.
28
- * @param call - The function call to execute.
29
- * @param authwits - Authentication witnesses required for the function call.
30
- * @param scopes - Optional array of account addresses whose notes can be accessed in this call. Defaults to all
31
- * accounts if not specified.
32
- * @returns A decoded ABI value containing the function's return data.
33
- */
34
- runUtility(call: FunctionCall, authwits: AuthWitness[], scopes?: AztecAddress[]): Promise<AbiDecoded>;
35
- }
36
- //# sourceMappingURL=simulator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simulator.d.ts","sourceRoot":"","sources":["../../src/private/simulator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAA+B,MAAM,mBAAmB,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAA6B,sBAAsB,EAAE,kBAAkB,EAAiB,MAAM,kBAAkB,CAAC;AAIxH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAK1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAG7E;;GAEG;AACH,qBAAa,aAAa;IAItB,OAAO,CAAC,qBAAqB;IAC7B,OAAO,CAAC,kBAAkB;IAJ5B,OAAO,CAAC,GAAG,CAAS;gBAGV,qBAAqB,EAAE,qBAAqB,EAC5C,kBAAkB,EAAE,kBAAkB;IAKhD;;;;;;;;OAQG;IACU,GAAG,CACd,OAAO,EAAE,kBAAkB,EAC3B,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,eAA6C,EACtD,MAAM,CAAC,EAAE,YAAY,EAAE,GACtB,OAAO,CAAC,sBAAsB,CAAC;IA2ElC;;;;;;;OAOG;IACU,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;CAwCnH"}