@aztec/pxe 0.0.1-commit.6d63667d → 0.0.1-commit.858058eac
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +49 -27
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +65 -31
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +2 -2
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.d.ts +2 -2
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +3 -3
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +34 -36
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +62 -17
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +30 -11
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +44 -28
- package/dest/debug/pxe_debug_utils.d.ts +2 -4
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +0 -3
- package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +9 -1
- package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +9 -1
- package/dest/entrypoints/server/utils.js +9 -1
- package/dest/oracle_version.d.ts +2 -2
- package/dest/oracle_version.js +2 -2
- package/dest/pxe.d.ts +63 -22
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +42 -28
- package/dest/storage/contract_store/contract_store.js +5 -5
- package/dest/storage/note_store/note_store.d.ts +1 -1
- package/dest/storage/note_store/note_store.d.ts.map +1 -1
- package/dest/storage/note_store/note_store.js +3 -0
- package/package.json +16 -16
- package/src/contract_function_simulator/contract_function_simulator.ts +108 -73
- package/src/contract_function_simulator/oracle/interfaces.ts +1 -1
- package/src/contract_function_simulator/oracle/oracle.ts +3 -3
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +81 -93
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +85 -27
- package/src/debug/pxe_debug_utils.ts +1 -6
- package/src/entrypoints/client/bundle/utils.ts +9 -1
- package/src/entrypoints/client/lazy/utils.ts +9 -1
- package/src/entrypoints/server/utils.ts +7 -7
- package/src/oracle_version.ts +2 -2
- package/src/pxe.ts +98 -59
- package/src/storage/contract_store/contract_store.ts +4 -4
- package/src/storage/note_store/note_store.ts +4 -0
package/dest/pxe.d.ts
CHANGED
|
@@ -9,13 +9,57 @@ import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
|
9
9
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
10
10
|
import { CompleteAddress, type ContractInstanceWithAddress, type PartialAddress } from '@aztec/stdlib/contract';
|
|
11
11
|
import type { AztecNode, PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
|
|
12
|
-
import { type InTx, SimulationOverrides, TxExecutionRequest, TxProfileResult, TxProvingResult, TxSimulationResult, UtilitySimulationResult } from '@aztec/stdlib/tx';
|
|
12
|
+
import { BlockHeader, type InTx, SimulationOverrides, TxExecutionRequest, TxProfileResult, TxProvingResult, TxSimulationResult, UtilitySimulationResult } from '@aztec/stdlib/tx';
|
|
13
13
|
import type { PXEConfig } from './config/index.js';
|
|
14
14
|
import { PXEDebugUtils } from './debug/pxe_debug_utils.js';
|
|
15
15
|
export type PackedPrivateEvent = InTx & {
|
|
16
16
|
packedEvent: Fr[];
|
|
17
17
|
eventSelector: EventSelector;
|
|
18
18
|
};
|
|
19
|
+
/** Options for PXE.profileTx. */
|
|
20
|
+
export type ProfileTxOpts = {
|
|
21
|
+
/** The profiling mode to use. */
|
|
22
|
+
profileMode: 'full' | 'execution-steps' | 'gates';
|
|
23
|
+
/** If true, proof generation is skipped during profiling. Defaults to true. */
|
|
24
|
+
skipProofGeneration?: boolean;
|
|
25
|
+
};
|
|
26
|
+
/** Options for PXE.simulateTx. */
|
|
27
|
+
export type SimulateTxOpts = {
|
|
28
|
+
/** Whether to simulate the public part of the transaction. */
|
|
29
|
+
simulatePublic: boolean;
|
|
30
|
+
/** If false, this function throws if the transaction is unable to be included in a block at the current state. */
|
|
31
|
+
skipTxValidation?: boolean;
|
|
32
|
+
/** If false, fees are enforced. */
|
|
33
|
+
skipFeeEnforcement?: boolean;
|
|
34
|
+
/** State overrides for the simulation, such as contract instances and artifacts. */
|
|
35
|
+
overrides?: SimulationOverrides;
|
|
36
|
+
/** The accounts whose notes we can access in this call. Defaults to all. */
|
|
37
|
+
scopes?: AztecAddress[];
|
|
38
|
+
};
|
|
39
|
+
/** Options for PXE.simulateUtility. */
|
|
40
|
+
export type SimulateUtilityOpts = {
|
|
41
|
+
/** The authentication witnesses required for the function call. */
|
|
42
|
+
authwits?: AuthWitness[];
|
|
43
|
+
/** The accounts whose notes we can access in this call. Defaults to all. */
|
|
44
|
+
scopes?: AztecAddress[];
|
|
45
|
+
};
|
|
46
|
+
/** Args for PXE.create. */
|
|
47
|
+
export type PXECreateArgs = {
|
|
48
|
+
/** The Aztec node to connect to. */
|
|
49
|
+
node: AztecNode;
|
|
50
|
+
/** The key-value store for persisting PXE state. */
|
|
51
|
+
store: AztecAsyncKVStore;
|
|
52
|
+
/** The prover for generating private kernel proofs. */
|
|
53
|
+
proofCreator: PrivateKernelProver;
|
|
54
|
+
/** The circuit simulator for executing ACIR circuits. */
|
|
55
|
+
simulator: CircuitSimulator;
|
|
56
|
+
/** Provider for protocol contract artifacts and instances. */
|
|
57
|
+
protocolContractsProvider: ProtocolContractsProvider;
|
|
58
|
+
/** PXE configuration options. */
|
|
59
|
+
config: PXEConfig;
|
|
60
|
+
/** Optional logger instance or string suffix for the logger name. */
|
|
61
|
+
loggerOrSuffix?: string | Logger;
|
|
62
|
+
};
|
|
19
63
|
/**
|
|
20
64
|
* Private eXecution Environment (PXE) is a library used by wallets to simulate private phase of transactions and to
|
|
21
65
|
* manage private state of users.
|
|
@@ -51,7 +95,17 @@ export declare class PXE {
|
|
|
51
95
|
*
|
|
52
96
|
* @returns A promise that resolves PXE is ready to be used.
|
|
53
97
|
*/
|
|
54
|
-
static create(node
|
|
98
|
+
static create({ node, store, proofCreator, simulator, protocolContractsProvider, config, loggerOrSuffix }: PXECreateArgs): Promise<PXE>;
|
|
99
|
+
/**
|
|
100
|
+
* Returns the block header up to which the PXE has synced.
|
|
101
|
+
* @returns The synced block header
|
|
102
|
+
*/
|
|
103
|
+
getSyncedBlockHeader(): Promise<BlockHeader>;
|
|
104
|
+
/**
|
|
105
|
+
* Returns the contract instance for a given address, if it's registered in the PXE.
|
|
106
|
+
* @param address - The contract address.
|
|
107
|
+
* @returns The contract instance if found, undefined otherwise.
|
|
108
|
+
*/
|
|
55
109
|
getContractInstance(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
|
|
56
110
|
/**
|
|
57
111
|
* Returns the contract artifact for a given contract class id, if it's registered in the PXE.
|
|
@@ -141,14 +195,11 @@ export declare class PXE {
|
|
|
141
195
|
proveTx(txRequest: TxExecutionRequest): Promise<TxProvingResult>;
|
|
142
196
|
/**
|
|
143
197
|
* Profiles a transaction, reporting gate counts (unless disabled) and returns an execution trace.
|
|
144
|
-
*
|
|
145
|
-
* @param txRequest - An authenticated tx request ready for simulation
|
|
146
|
-
* @param msgSender - (Optional) The message sender to use for the simulation.
|
|
147
|
-
* @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
|
|
198
|
+
* @param txRequest - An authenticated tx request ready for simulation.
|
|
148
199
|
* @returns A trace of the program execution with gate counts.
|
|
149
200
|
* @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
|
|
150
201
|
*/
|
|
151
|
-
profileTx(txRequest: TxExecutionRequest, profileMode
|
|
202
|
+
profileTx(txRequest: TxExecutionRequest, { profileMode, skipProofGeneration }: ProfileTxOpts): Promise<TxProfileResult>;
|
|
152
203
|
/**
|
|
153
204
|
* Simulates a transaction based on the provided preauthenticated execution request.
|
|
154
205
|
* This will run a local simulation of private execution (and optionally of public as well), run the
|
|
@@ -160,29 +211,19 @@ export declare class PXE {
|
|
|
160
211
|
* In that case, the transaction returned is only potentially ready to be sent to the network for execution.
|
|
161
212
|
*
|
|
162
213
|
*
|
|
163
|
-
* @param txRequest - An authenticated tx request ready for simulation
|
|
164
|
-
* @param simulatePublic - Whether to simulate the public part of the transaction.
|
|
165
|
-
* @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
|
|
166
|
-
* @param skipFeeEnforcement - (Optional) If false, fees are enforced.
|
|
167
|
-
* @param overrides - (Optional) State overrides for the simulation, such as msgSender, contract instances and artifacts.
|
|
168
|
-
* @param scopes - (Optional) The accounts whose notes we can access in this call. Currently optional and will default to all.
|
|
214
|
+
* @param txRequest - An authenticated tx request ready for simulation.
|
|
169
215
|
* @returns A simulated transaction result object that includes public and private return values.
|
|
170
216
|
* @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
|
|
171
217
|
* Also throws if simulatePublic is true and public simulation reverts.
|
|
172
218
|
*
|
|
173
219
|
* TODO(#7456) Prevent msgSender being defined here for the first call
|
|
174
220
|
*/
|
|
175
|
-
simulateTx(txRequest: TxExecutionRequest, simulatePublic
|
|
221
|
+
simulateTx(txRequest: TxExecutionRequest, { simulatePublic, skipTxValidation, skipFeeEnforcement, overrides, scopes }: SimulateTxOpts): Promise<TxSimulationResult>;
|
|
176
222
|
/**
|
|
177
|
-
*
|
|
178
|
-
*
|
|
223
|
+
* Simulates the execution of a contract utility function.
|
|
179
224
|
* @param call - The function call containing the function details, arguments, and target contract address.
|
|
180
|
-
* @param authwits - (Optional) The authentication witnesses required for the function call.
|
|
181
|
-
* @param scopes - (Optional) The accounts whose notes we can access in this call. Currently optional and will
|
|
182
|
-
* default to all.
|
|
183
|
-
* @returns The result of the utility function call, structured based on the function ABI.
|
|
184
225
|
*/
|
|
185
|
-
simulateUtility(call: FunctionCall, authwits
|
|
226
|
+
simulateUtility(call: FunctionCall, { authwits, scopes }?: SimulateUtilityOpts): Promise<UtilitySimulationResult>;
|
|
186
227
|
/**
|
|
187
228
|
* Returns the private events given search parameters.
|
|
188
229
|
* @param eventSelector - Event selector to search for.
|
|
@@ -202,4 +243,4 @@ export declare class PXE {
|
|
|
202
243
|
*/
|
|
203
244
|
stop(): Promise<void>;
|
|
204
245
|
}
|
|
205
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
246
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHhlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvcHhlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFFakUsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBcUMsTUFBTSx1QkFBdUIsQ0FBQztBQUl2RixPQUFPLEtBQUssRUFBRSxpQkFBaUIsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRXpELE9BQU8sRUFBRSxLQUFLLHlCQUF5QixFQUF5QixNQUFNLDJCQUEyQixDQUFDO0FBQ2xHLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDaEUsT0FBTyxFQUNMLEtBQUssZ0JBQWdCLEVBQ3JCLGFBQWEsRUFDYixZQUFZLEVBR2IsTUFBTSxtQkFBbUI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7B,EAAE,WAAW,EAAE,mBAA0B,EAAE,EAAE,aAAa,GACzD,OAAO,CAAC,eAAe,CAAC,CAuE1B;IAED;;;;;;;;;;;;;;;;;OAiBG;IACI,UAAU,CACf,SAAS,EAAE,kBAAkB,EAC7B,EAAE,cAAc,EAAE,gBAAwB,EAAE,kBAA0B,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,cAAc,GAC1G,OAAO,CAAC,kBAAkB,CAAC,CA+H7B;IAED;;;OAGG;IACI,eAAe,CACpB,IAAI,EAAE,YAAY,EAClB,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAE,mBAAwB,GAC7C,OAAO,CAAC,uBAAuB,CAAC,CAsDlC;IAED;;;;;;;;;;;;OAYG;IACU,gBAAgB,CAC3B,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA6B/B;IAED;;OAEG;IACI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3B;CACF"}
|
package/dest/pxe.js
CHANGED
|
@@ -84,11 +84,12 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
84
84
|
* can be contacted.
|
|
85
85
|
*
|
|
86
86
|
* @returns A promise that resolves PXE is ready to be used.
|
|
87
|
-
*/ static async create(node, store, proofCreator, simulator, protocolContractsProvider, config, loggerOrSuffix) {
|
|
87
|
+
*/ static async create({ node, store, proofCreator, simulator, protocolContractsProvider, config, loggerOrSuffix }) {
|
|
88
88
|
// Extract bindings from the logger, or use empty bindings if a string suffix is provided.
|
|
89
89
|
const bindings = loggerOrSuffix && typeof loggerOrSuffix !== 'string' ? loggerOrSuffix.getBindings() : undefined;
|
|
90
90
|
const log = !loggerOrSuffix || typeof loggerOrSuffix === 'string' ? createLogger(loggerOrSuffix ? `pxe:service:${loggerOrSuffix}` : `pxe:service`) : loggerOrSuffix;
|
|
91
|
-
const
|
|
91
|
+
const info = await node.getNodeInfo();
|
|
92
|
+
const proverEnabled = config.proverEnabled !== undefined ? config.proverEnabled : info.realProofs;
|
|
92
93
|
const addressStore = new AddressStore(store);
|
|
93
94
|
const privateEventStore = new PrivateEventStore(store);
|
|
94
95
|
const contractStore = new ContractStore(store);
|
|
@@ -117,14 +118,26 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
117
118
|
debugUtils.setPXEHelpers(pxe.#putInJobQueue.bind(pxe), pxe.#getSimulatorForTx.bind(pxe), pxe.#simulateUtility.bind(pxe));
|
|
118
119
|
pxe.jobQueue.start();
|
|
119
120
|
await pxe.#registerProtocolContracts();
|
|
120
|
-
const info = await node.getNodeInfo();
|
|
121
121
|
log.info(`Started PXE connected to chain ${info.l1ChainId} version ${info.rollupVersion}`);
|
|
122
122
|
return pxe;
|
|
123
123
|
}
|
|
124
124
|
// Internal methods
|
|
125
125
|
#getSimulatorForTx(overrides) {
|
|
126
126
|
const proxyContractStore = ProxiedContractStoreFactory.create(this.contractStore, overrides?.contracts);
|
|
127
|
-
return new ContractFunctionSimulator(
|
|
127
|
+
return new ContractFunctionSimulator({
|
|
128
|
+
contractStore: proxyContractStore,
|
|
129
|
+
noteStore: this.noteStore,
|
|
130
|
+
keyStore: this.keyStore,
|
|
131
|
+
addressStore: this.addressStore,
|
|
132
|
+
aztecNode: BenchmarkedNodeFactory.create(this.node),
|
|
133
|
+
senderTaggingStore: this.senderTaggingStore,
|
|
134
|
+
recipientTaggingStore: this.recipientTaggingStore,
|
|
135
|
+
senderAddressBookStore: this.senderAddressBookStore,
|
|
136
|
+
capsuleStore: this.capsuleStore,
|
|
137
|
+
privateEventStore: this.privateEventStore,
|
|
138
|
+
simulator: this.simulator,
|
|
139
|
+
contractSyncService: this.contractSyncService
|
|
140
|
+
});
|
|
128
141
|
}
|
|
129
142
|
#contextualizeError(err, ...context) {
|
|
130
143
|
let contextStr = '';
|
|
@@ -181,9 +194,13 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
181
194
|
try {
|
|
182
195
|
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
183
196
|
await this.contractSyncService.ensureContractSynced(contractAddress, functionSelector, (privateSyncCall)=>this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), anchorBlockHeader, jobId);
|
|
184
|
-
const result = await contractFunctionSimulator.run(txRequest,
|
|
185
|
-
|
|
186
|
-
|
|
197
|
+
const result = await contractFunctionSimulator.run(txRequest, {
|
|
198
|
+
contractAddress,
|
|
199
|
+
selector: functionSelector,
|
|
200
|
+
anchorBlockHeader,
|
|
201
|
+
scopes,
|
|
202
|
+
jobId
|
|
203
|
+
});
|
|
187
204
|
this.log.debug(`Private simulation completed for ${contractAddress.toString()}:${functionSelector}`);
|
|
188
205
|
return result;
|
|
189
206
|
} catch (err) {
|
|
@@ -257,7 +274,17 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
257
274
|
return await kernelTraceProver.proveWithKernels(txExecutionRequest.toTxRequest(), privateExecutionResult, config);
|
|
258
275
|
}
|
|
259
276
|
// Public API
|
|
260
|
-
|
|
277
|
+
/**
|
|
278
|
+
* Returns the block header up to which the PXE has synced.
|
|
279
|
+
* @returns The synced block header
|
|
280
|
+
*/ getSyncedBlockHeader() {
|
|
281
|
+
return this.anchorBlockStore.getBlockHeader();
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Returns the contract instance for a given address, if it's registered in the PXE.
|
|
285
|
+
* @param address - The contract address.
|
|
286
|
+
* @returns The contract instance if found, undefined otherwise.
|
|
287
|
+
*/ getContractInstance(address) {
|
|
261
288
|
return this.contractStore.getContractInstance(address);
|
|
262
289
|
}
|
|
263
290
|
/**
|
|
@@ -488,13 +515,10 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
488
515
|
}
|
|
489
516
|
/**
|
|
490
517
|
* Profiles a transaction, reporting gate counts (unless disabled) and returns an execution trace.
|
|
491
|
-
*
|
|
492
|
-
* @param txRequest - An authenticated tx request ready for simulation
|
|
493
|
-
* @param msgSender - (Optional) The message sender to use for the simulation.
|
|
494
|
-
* @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
|
|
518
|
+
* @param txRequest - An authenticated tx request ready for simulation.
|
|
495
519
|
* @returns A trace of the program execution with gate counts.
|
|
496
520
|
* @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
|
|
497
|
-
*/ profileTx(txRequest, profileMode, skipProofGeneration = true) {
|
|
521
|
+
*/ profileTx(txRequest, { profileMode, skipProofGeneration = true }) {
|
|
498
522
|
// We disable concurrent profiles for consistency with simulateTx.
|
|
499
523
|
return this.#putInJobQueue(async (jobId)=>{
|
|
500
524
|
const totalTimer = new Timer();
|
|
@@ -557,18 +581,13 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
557
581
|
* In that case, the transaction returned is only potentially ready to be sent to the network for execution.
|
|
558
582
|
*
|
|
559
583
|
*
|
|
560
|
-
* @param txRequest - An authenticated tx request ready for simulation
|
|
561
|
-
* @param simulatePublic - Whether to simulate the public part of the transaction.
|
|
562
|
-
* @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
|
|
563
|
-
* @param skipFeeEnforcement - (Optional) If false, fees are enforced.
|
|
564
|
-
* @param overrides - (Optional) State overrides for the simulation, such as msgSender, contract instances and artifacts.
|
|
565
|
-
* @param scopes - (Optional) The accounts whose notes we can access in this call. Currently optional and will default to all.
|
|
584
|
+
* @param txRequest - An authenticated tx request ready for simulation.
|
|
566
585
|
* @returns A simulated transaction result object that includes public and private return values.
|
|
567
586
|
* @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
|
|
568
587
|
* Also throws if simulatePublic is true and public simulation reverts.
|
|
569
588
|
*
|
|
570
589
|
* TODO(#7456) Prevent msgSender being defined here for the first call
|
|
571
|
-
*/ simulateTx(txRequest, simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, overrides, scopes) {
|
|
590
|
+
*/ simulateTx(txRequest, { simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, overrides, scopes }) {
|
|
572
591
|
// We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
|
|
573
592
|
// to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
|
|
574
593
|
// delete the same read value, or reading values that another simulation is currently modifying).
|
|
@@ -603,7 +622,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
603
622
|
let publicInputs;
|
|
604
623
|
let executionSteps = [];
|
|
605
624
|
if (skipKernels) {
|
|
606
|
-
({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, this.contractStore));
|
|
625
|
+
({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, (addr, sel)=>this.contractStore.getDebugFunctionName(addr, sel)));
|
|
607
626
|
} else {
|
|
608
627
|
// Kernel logic, plus proving of all private functions and kernels.
|
|
609
628
|
({ publicInputs, executionSteps } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
|
|
@@ -668,14 +687,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
668
687
|
});
|
|
669
688
|
}
|
|
670
689
|
/**
|
|
671
|
-
*
|
|
672
|
-
*
|
|
690
|
+
* Simulates the execution of a contract utility function.
|
|
673
691
|
* @param call - The function call containing the function details, arguments, and target contract address.
|
|
674
|
-
|
|
675
|
-
* @param scopes - (Optional) The accounts whose notes we can access in this call. Currently optional and will
|
|
676
|
-
* default to all.
|
|
677
|
-
* @returns The result of the utility function call, structured based on the function ABI.
|
|
678
|
-
*/ simulateUtility(call, authwits, scopes) {
|
|
692
|
+
*/ simulateUtility(call, { authwits, scopes } = {}) {
|
|
679
693
|
// We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
|
|
680
694
|
// to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
|
|
681
695
|
// delete the same read value, or reading values that another simulation is currently modifying).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toArray } from '@aztec/foundation/iterable';
|
|
2
|
-
import { FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, encodeArguments, getFunctionDebugMetadata } from '@aztec/stdlib/abi';
|
|
2
|
+
import { FunctionCall, FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, encodeArguments, getFunctionDebugMetadata } from '@aztec/stdlib/abi';
|
|
3
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import { SerializableContractInstance, getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
5
5
|
import { PrivateFunctionsTree } from './private_functions_tree.js';
|
|
@@ -219,15 +219,15 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
|
|
|
219
219
|
if (!functionDao) {
|
|
220
220
|
throw new Error(`Unknown function ${functionName} in contract ${contract.name}.`);
|
|
221
221
|
}
|
|
222
|
-
return {
|
|
222
|
+
return FunctionCall.from({
|
|
223
223
|
name: functionDao.name,
|
|
224
|
-
|
|
224
|
+
to,
|
|
225
225
|
selector: await FunctionSelector.fromNameAndParameters(functionDao.name, functionDao.parameters),
|
|
226
226
|
type: functionDao.functionType,
|
|
227
|
-
to,
|
|
228
227
|
hideMsgSender: false,
|
|
229
228
|
isStatic: functionDao.isStatic,
|
|
229
|
+
args: encodeArguments(functionDao, args),
|
|
230
230
|
returnTypes: functionDao.returnTypes
|
|
231
|
-
};
|
|
231
|
+
});
|
|
232
232
|
}
|
|
233
233
|
}
|
|
@@ -80,4 +80,4 @@ export declare class NoteStore implements StagedStore {
|
|
|
80
80
|
commit(jobId: string): Promise<void>;
|
|
81
81
|
discardStaged(jobId: string): Promise<void>;
|
|
82
82
|
}
|
|
83
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
83
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZV9zdG9yZS5kLnRzIiwic291cmNlUm9v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;;;;;;;;;OAcG;IACH,eAAe,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAyChF;IAED;;;;;;;;;;;OAWG;IACU,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMpF;IA6ED;;;;;;;;;OASG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUzC;IAED,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1C;CAkCF"}
|
|
@@ -173,6 +173,9 @@ import { StoredNote } from './stored_note.js';
|
|
|
173
173
|
if (nullifiers.length === 0) {
|
|
174
174
|
return Promise.resolve([]);
|
|
175
175
|
}
|
|
176
|
+
if (nullifiers.some((n)=>n.l2BlockNumber === 0)) {
|
|
177
|
+
return Promise.reject(new Error('applyNullifiers: nullifiers cannot have been emitted at block 0'));
|
|
178
|
+
}
|
|
176
179
|
return this.#withJobLock(jobId, ()=>this.#store.transactionAsync(async ()=>{
|
|
177
180
|
const notesToNullify = await Promise.all(nullifiers.map(async (nullifierInBlock)=>{
|
|
178
181
|
const nullifier = nullifierInBlock.data.toString();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/pxe",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.858058eac",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"typedocOptions": {
|
|
6
6
|
"entryPoints": [
|
|
@@ -70,19 +70,19 @@
|
|
|
70
70
|
]
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
74
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
75
|
-
"@aztec/builder": "0.0.1-commit.
|
|
76
|
-
"@aztec/constants": "0.0.1-commit.
|
|
77
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
78
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
79
|
-
"@aztec/key-store": "0.0.1-commit.
|
|
80
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
81
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
82
|
-
"@aztec/noir-types": "0.0.1-commit.
|
|
83
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
84
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
85
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
73
|
+
"@aztec/bb-prover": "0.0.1-commit.858058eac",
|
|
74
|
+
"@aztec/bb.js": "0.0.1-commit.858058eac",
|
|
75
|
+
"@aztec/builder": "0.0.1-commit.858058eac",
|
|
76
|
+
"@aztec/constants": "0.0.1-commit.858058eac",
|
|
77
|
+
"@aztec/ethereum": "0.0.1-commit.858058eac",
|
|
78
|
+
"@aztec/foundation": "0.0.1-commit.858058eac",
|
|
79
|
+
"@aztec/key-store": "0.0.1-commit.858058eac",
|
|
80
|
+
"@aztec/kv-store": "0.0.1-commit.858058eac",
|
|
81
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.858058eac",
|
|
82
|
+
"@aztec/noir-types": "0.0.1-commit.858058eac",
|
|
83
|
+
"@aztec/protocol-contracts": "0.0.1-commit.858058eac",
|
|
84
|
+
"@aztec/simulator": "0.0.1-commit.858058eac",
|
|
85
|
+
"@aztec/stdlib": "0.0.1-commit.858058eac",
|
|
86
86
|
"koa": "^2.16.1",
|
|
87
87
|
"koa-router": "^13.1.1",
|
|
88
88
|
"lodash.omit": "^4.5.0",
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"viem": "npm:@aztec/viem@2.38.2"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
|
-
"@aztec/merkle-tree": "0.0.1-commit.
|
|
95
|
-
"@aztec/noir-test-contracts.js": "0.0.1-commit.
|
|
94
|
+
"@aztec/merkle-tree": "0.0.1-commit.858058eac",
|
|
95
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.858058eac",
|
|
96
96
|
"@jest/globals": "^30.0.0",
|
|
97
97
|
"@types/jest": "^30.0.0",
|
|
98
98
|
"@types/lodash.omit": "^4.5.7",
|