@aztec/pxe 0.87.5 → 0.87.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +37 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -0
- package/dest/contract_function_simulator/contract_function_simulator.js +117 -0
- package/dest/contract_function_simulator/execution_data_provider.d.ts +301 -0
- package/dest/contract_function_simulator/execution_data_provider.d.ts.map +1 -0
- package/dest/contract_function_simulator/execution_data_provider.js +14 -0
- package/dest/contract_function_simulator/execution_note_cache.d.ts +93 -0
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/execution_note_cache.js +180 -0
- package/dest/contract_function_simulator/hashed_values_cache.d.ts +28 -0
- package/dest/contract_function_simulator/hashed_values_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/hashed_values_cache.js +36 -0
- package/dest/contract_function_simulator/index.d.ts +10 -0
- package/dest/contract_function_simulator/index.d.ts.map +1 -0
- package/dest/contract_function_simulator/index.js +8 -0
- package/dest/contract_function_simulator/oracle/index.d.ts +14 -0
- package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/index.js +2 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +19 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +24 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts +53 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/oracle.js +317 -0
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +24 -0
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/private_execution.js +100 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +187 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +325 -0
- package/dest/contract_function_simulator/oracle/typed_oracle.d.ts +83 -0
- package/dest/contract_function_simulator/oracle/typed_oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/typed_oracle.js +138 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +163 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +257 -0
- package/dest/contract_function_simulator/pick_notes.d.ts +85 -0
- package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -0
- package/dest/contract_function_simulator/pick_notes.js +51 -0
- package/dest/contract_function_simulator/proxied_node.d.ts +9 -0
- package/dest/contract_function_simulator/proxied_node.d.ts.map +1 -0
- package/dest/contract_function_simulator/proxied_node.js +27 -0
- package/dest/{pxe_oracle_interface → contract_function_simulator}/pxe_oracle_interface.d.ts +5 -4
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +1 -0
- package/dest/{pxe_oracle_interface → contract_function_simulator}/pxe_oracle_interface.js +16 -15
- package/dest/contract_function_simulator/tagging_utils.d.ts.map +1 -0
- package/dest/entrypoints/client/bundle/index.d.ts +1 -1
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +10 -4
- package/dest/entrypoints/client/lazy/index.d.ts +1 -1
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +1 -1
- package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +10 -4
- package/dest/entrypoints/{client/pxe_creation_options.d.ts → pxe_creation_options.d.ts} +4 -1
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -0
- package/dest/entrypoints/server/index.d.ts +1 -1
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +1 -1
- package/dest/entrypoints/server/utils.d.ts +6 -6
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +26 -18
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +6 -5
- package/dest/pxe_service/pxe_service.d.ts +2 -2
- package/dest/pxe_service/pxe_service.d.ts.map +1 -1
- package/dest/pxe_service/pxe_service.js +58 -28
- package/dest/storage/note_data_provider/note_dao.d.ts +1 -1
- package/dest/storage/note_data_provider/note_dao.d.ts.map +1 -1
- package/package.json +17 -15
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +193 -0
- package/src/contract_function_simulator/execution_data_provider.ts +391 -0
- package/src/contract_function_simulator/execution_note_cache.ts +217 -0
- package/src/contract_function_simulator/hashed_values_cache.ts +47 -0
- package/src/contract_function_simulator/index.ts +9 -0
- package/src/contract_function_simulator/oracle/index.ts +16 -0
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +23 -0
- package/src/contract_function_simulator/oracle/oracle.ts +541 -0
- package/src/contract_function_simulator/oracle/private_execution.ts +171 -0
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +518 -0
- package/src/contract_function_simulator/oracle/typed_oracle.ts +273 -0
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +384 -0
- package/src/contract_function_simulator/pick_notes.ts +141 -0
- package/src/contract_function_simulator/proxied_node.ts +33 -0
- package/src/{pxe_oracle_interface → contract_function_simulator}/pxe_oracle_interface.ts +18 -21
- package/src/entrypoints/client/bundle/index.ts +1 -1
- package/src/entrypoints/client/bundle/utils.ts +24 -16
- package/src/entrypoints/client/lazy/index.ts +1 -1
- package/src/entrypoints/client/lazy/utils.ts +25 -12
- package/src/entrypoints/{client/pxe_creation_options.ts → pxe_creation_options.ts} +4 -1
- package/src/entrypoints/server/index.ts +1 -1
- package/src/entrypoints/server/utils.ts +44 -26
- package/src/private_kernel/private_kernel_execution_prover.ts +6 -4
- package/src/pxe_service/pxe_service.ts +86 -45
- package/src/storage/note_data_provider/note_dao.ts +2 -1
- package/dest/entrypoints/client/pxe_creation_options.d.ts.map +0 -1
- package/dest/pxe_oracle_interface/pxe_oracle_interface.d.ts.map +0 -1
- package/dest/pxe_oracle_interface/tagging_utils.d.ts.map +0 -1
- /package/dest/{pxe_oracle_interface → contract_function_simulator}/tagging_utils.d.ts +0 -0
- /package/dest/{pxe_oracle_interface → contract_function_simulator}/tagging_utils.js +0 -0
- /package/dest/entrypoints/{client/pxe_creation_options.js → pxe_creation_options.js} +0 -0
- /package/src/{pxe_oracle_interface → contract_function_simulator}/tagging_utils.ts +0 -0
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
type ProtocolContractsProvider,
|
|
13
13
|
protocolContractNames,
|
|
14
14
|
} from '@aztec/protocol-contracts';
|
|
15
|
-
import
|
|
15
|
+
import type { CircuitSimulator } from '@aztec/simulator/client';
|
|
16
16
|
import {
|
|
17
17
|
type ContractArtifact,
|
|
18
18
|
EventSelector,
|
|
@@ -73,12 +73,15 @@ import { inspect } from 'util';
|
|
|
73
73
|
|
|
74
74
|
import type { PXEServiceConfig } from '../config/index.js';
|
|
75
75
|
import { getPackageInfo } from '../config/package_info.js';
|
|
76
|
+
import { ContractFunctionSimulator } from '../contract_function_simulator/contract_function_simulator.js';
|
|
77
|
+
import { readCurrentClassId } from '../contract_function_simulator/oracle/private_execution.js';
|
|
78
|
+
import { ProxiedNodeFactory } from '../contract_function_simulator/proxied_node.js';
|
|
79
|
+
import { PXEOracleInterface } from '../contract_function_simulator/pxe_oracle_interface.js';
|
|
76
80
|
import {
|
|
77
81
|
PrivateKernelExecutionProver,
|
|
78
82
|
type PrivateKernelExecutionProverConfig,
|
|
79
83
|
} from '../private_kernel/private_kernel_execution_prover.js';
|
|
80
84
|
import { PrivateKernelOracleImpl } from '../private_kernel/private_kernel_oracle_impl.js';
|
|
81
|
-
import { PXEOracleInterface } from '../pxe_oracle_interface/pxe_oracle_interface.js';
|
|
82
85
|
import { AddressDataProvider } from '../storage/address_data_provider/address_data_provider.js';
|
|
83
86
|
import { CapsuleDataProvider } from '../storage/capsule_data_provider/capsule_data_provider.js';
|
|
84
87
|
import { ContractDataProvider } from '../storage/contract_data_provider/contract_data_provider.js';
|
|
@@ -106,7 +109,7 @@ export class PXEService implements PXE {
|
|
|
106
109
|
private taggingDataProvider: TaggingDataProvider,
|
|
107
110
|
private addressDataProvider: AddressDataProvider,
|
|
108
111
|
private privateEventDataProvider: PrivateEventDataProvider,
|
|
109
|
-
private simulator:
|
|
112
|
+
private simulator: CircuitSimulator,
|
|
110
113
|
private packageVersion: string,
|
|
111
114
|
private proverEnabled: boolean,
|
|
112
115
|
private proofCreator: PrivateKernelProver,
|
|
@@ -126,7 +129,7 @@ export class PXEService implements PXE {
|
|
|
126
129
|
node: AztecNode,
|
|
127
130
|
store: AztecAsyncKVStore,
|
|
128
131
|
proofCreator: PrivateKernelProver,
|
|
129
|
-
|
|
132
|
+
simulator: CircuitSimulator,
|
|
130
133
|
protocolContractsProvider: ProtocolContractsProvider,
|
|
131
134
|
config: PXEServiceConfig,
|
|
132
135
|
loggerOrSuffix?: string | Logger,
|
|
@@ -156,19 +159,7 @@ export class PXEService implements PXE {
|
|
|
156
159
|
config,
|
|
157
160
|
loggerOrSuffix,
|
|
158
161
|
);
|
|
159
|
-
|
|
160
|
-
node,
|
|
161
|
-
keyStore,
|
|
162
|
-
contractDataProvider,
|
|
163
|
-
noteDataProvider,
|
|
164
|
-
capsuleDataProvider,
|
|
165
|
-
syncDataProvider,
|
|
166
|
-
taggingDataProvider,
|
|
167
|
-
addressDataProvider,
|
|
168
|
-
privateEventDataProvider,
|
|
169
|
-
log,
|
|
170
|
-
);
|
|
171
|
-
const simulator = new AcirSimulator(pxeOracleInterface, simulationProvider);
|
|
162
|
+
|
|
172
163
|
const jobQueue = new SerialQueue();
|
|
173
164
|
|
|
174
165
|
const pxeService = new PXEService(
|
|
@@ -247,6 +238,22 @@ export class PXEService implements PXE {
|
|
|
247
238
|
|
|
248
239
|
// Internal methods
|
|
249
240
|
|
|
241
|
+
#getSimulatorForTx(): ContractFunctionSimulator {
|
|
242
|
+
const pxeOracleInterface = new PXEOracleInterface(
|
|
243
|
+
ProxiedNodeFactory.create(this.node),
|
|
244
|
+
this.keyStore,
|
|
245
|
+
this.contractDataProvider,
|
|
246
|
+
this.noteDataProvider,
|
|
247
|
+
this.capsuleDataProvider,
|
|
248
|
+
this.syncDataProvider,
|
|
249
|
+
this.taggingDataProvider,
|
|
250
|
+
this.addressDataProvider,
|
|
251
|
+
this.privateEventDataProvider,
|
|
252
|
+
this.log,
|
|
253
|
+
);
|
|
254
|
+
return new ContractFunctionSimulator(pxeOracleInterface, this.simulator);
|
|
255
|
+
}
|
|
256
|
+
|
|
250
257
|
#contextualizeError(err: Error, ...context: string[]): Error {
|
|
251
258
|
let contextStr = '';
|
|
252
259
|
if (context.length > 0) {
|
|
@@ -328,6 +335,7 @@ export class PXEService implements PXE {
|
|
|
328
335
|
}
|
|
329
336
|
|
|
330
337
|
async #executePrivate(
|
|
338
|
+
contractFunctionSimulator: ContractFunctionSimulator,
|
|
331
339
|
txRequest: TxExecutionRequest,
|
|
332
340
|
msgSender?: AztecAddress,
|
|
333
341
|
scopes?: AztecAddress[],
|
|
@@ -335,7 +343,13 @@ export class PXEService implements PXE {
|
|
|
335
343
|
const { origin: contractAddress, functionSelector } = txRequest;
|
|
336
344
|
|
|
337
345
|
try {
|
|
338
|
-
const result = await
|
|
346
|
+
const result = await contractFunctionSimulator.run(
|
|
347
|
+
txRequest,
|
|
348
|
+
contractAddress,
|
|
349
|
+
functionSelector,
|
|
350
|
+
msgSender,
|
|
351
|
+
scopes,
|
|
352
|
+
);
|
|
339
353
|
this.log.debug(`Private simulation completed for ${contractAddress.toString()}:${functionSelector}`);
|
|
340
354
|
return result;
|
|
341
355
|
} catch (err) {
|
|
@@ -348,15 +362,21 @@ export class PXEService implements PXE {
|
|
|
348
362
|
|
|
349
363
|
/**
|
|
350
364
|
* Simulate a utility function call on the given contract.
|
|
365
|
+
* @param contractFunctionSimulator - The simulator to use for the function call.
|
|
351
366
|
* @param call - The function call to execute.
|
|
352
367
|
* @param authWitnesses - Authentication witnesses required for the function call.
|
|
353
368
|
* @param scopes - Optional array of account addresses whose notes can be accessed in this call. Defaults to all
|
|
354
369
|
* accounts if not specified.
|
|
355
370
|
* @returns The simulation result containing the outputs of the utility function.
|
|
356
371
|
*/
|
|
357
|
-
async #simulateUtility(
|
|
372
|
+
async #simulateUtility(
|
|
373
|
+
contractFunctionSimulator: ContractFunctionSimulator,
|
|
374
|
+
call: FunctionCall,
|
|
375
|
+
authWitnesses?: AuthWitness[],
|
|
376
|
+
scopes?: AztecAddress[],
|
|
377
|
+
) {
|
|
358
378
|
try {
|
|
359
|
-
return
|
|
379
|
+
return contractFunctionSimulator.runUtility(call, authWitnesses ?? [], scopes);
|
|
360
380
|
} catch (err) {
|
|
361
381
|
if (err instanceof SimulationError) {
|
|
362
382
|
await enrichSimulationError(err, this.contractDataProvider, this.log);
|
|
@@ -660,11 +680,13 @@ export class PXEService implements PXE {
|
|
|
660
680
|
const totalTimer = new Timer();
|
|
661
681
|
try {
|
|
662
682
|
let syncTime: number | undefined;
|
|
683
|
+
let contractFunctionSimulator: ContractFunctionSimulator | undefined;
|
|
663
684
|
if (!privateExecutionResult) {
|
|
664
685
|
const syncTimer = new Timer();
|
|
665
686
|
await this.synchronizer.sync();
|
|
666
687
|
syncTime = syncTimer.ms();
|
|
667
|
-
|
|
688
|
+
contractFunctionSimulator = this.#getSimulatorForTx();
|
|
689
|
+
privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest);
|
|
668
690
|
}
|
|
669
691
|
const {
|
|
670
692
|
publicInputs,
|
|
@@ -679,9 +701,10 @@ export class PXEService implements PXE {
|
|
|
679
701
|
|
|
680
702
|
const totalTime = totalTimer.ms();
|
|
681
703
|
|
|
682
|
-
const perFunction = executionSteps.map(({ functionName, timings: { witgen } }) => ({
|
|
704
|
+
const perFunction = executionSteps.map(({ functionName, timings: { witgen, oracles } }) => ({
|
|
683
705
|
functionName,
|
|
684
706
|
time: witgen,
|
|
707
|
+
oracles,
|
|
685
708
|
}));
|
|
686
709
|
|
|
687
710
|
const timings: ProvingTimings = {
|
|
@@ -696,8 +719,10 @@ export class PXEService implements PXE {
|
|
|
696
719
|
this.log.info(`Proving completed in ${totalTime}ms`, {
|
|
697
720
|
timings,
|
|
698
721
|
});
|
|
699
|
-
|
|
700
|
-
|
|
722
|
+
return new TxProvingResult(privateExecutionResult, publicInputs, clientIvcProof!, {
|
|
723
|
+
timings,
|
|
724
|
+
nodeRPCCalls: contractFunctionSimulator?.getStats().nodeRPCCalls,
|
|
725
|
+
});
|
|
701
726
|
} catch (err: any) {
|
|
702
727
|
throw this.#contextualizeError(err, inspect(txRequest), inspect(privateExecutionResult));
|
|
703
728
|
}
|
|
@@ -731,7 +756,8 @@ export class PXEService implements PXE {
|
|
|
731
756
|
await this.synchronizer.sync();
|
|
732
757
|
const syncTime = syncTimer.ms();
|
|
733
758
|
|
|
734
|
-
const
|
|
759
|
+
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
760
|
+
const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, msgSender);
|
|
735
761
|
|
|
736
762
|
const { executionSteps, timings: { proving } = {} } = await this.#prove(
|
|
737
763
|
txRequest,
|
|
@@ -746,29 +772,31 @@ export class PXEService implements PXE {
|
|
|
746
772
|
|
|
747
773
|
const totalTime = totalTimer.ms();
|
|
748
774
|
|
|
749
|
-
const perFunction = executionSteps.map(({ functionName, timings: { witgen } }) =>
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
775
|
+
const perFunction = executionSteps.map(({ functionName, timings: { witgen, oracles } }) => {
|
|
776
|
+
return {
|
|
777
|
+
functionName,
|
|
778
|
+
time: witgen,
|
|
779
|
+
oracles,
|
|
780
|
+
};
|
|
781
|
+
});
|
|
753
782
|
|
|
754
783
|
// Gate computation is time is not relevant for profiling, so we subtract it from the total time.
|
|
755
784
|
const gateCountComputationTime =
|
|
756
785
|
executionSteps.reduce((acc, { timings }) => acc + (timings.gateCount ?? 0), 0) ?? 0;
|
|
757
786
|
|
|
787
|
+
const total = totalTime - gateCountComputationTime;
|
|
788
|
+
|
|
758
789
|
const timings: ProvingTimings = {
|
|
759
|
-
total
|
|
790
|
+
total,
|
|
760
791
|
sync: syncTime,
|
|
761
792
|
proving,
|
|
762
793
|
perFunction,
|
|
763
794
|
unaccounted:
|
|
764
|
-
|
|
765
|
-
((syncTime ?? 0) +
|
|
766
|
-
(proving ?? 0) +
|
|
767
|
-
perFunction.reduce((acc, { time }) => acc + time, 0) +
|
|
768
|
-
gateCountComputationTime),
|
|
795
|
+
total - ((syncTime ?? 0) + (proving ?? 0) + perFunction.reduce((acc, { time }) => acc + time, 0)),
|
|
769
796
|
};
|
|
770
797
|
|
|
771
|
-
|
|
798
|
+
const simulatorStats = contractFunctionSimulator.getStats();
|
|
799
|
+
return new TxProfileResult(executionSteps, { timings, nodeRPCCalls: simulatorStats.nodeRPCCalls });
|
|
772
800
|
} catch (err: any) {
|
|
773
801
|
throw this.#contextualizeError(
|
|
774
802
|
err,
|
|
@@ -812,7 +840,13 @@ export class PXEService implements PXE {
|
|
|
812
840
|
await this.synchronizer.sync();
|
|
813
841
|
const syncTime = syncTimer.ms();
|
|
814
842
|
|
|
815
|
-
const
|
|
843
|
+
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
844
|
+
const privateExecutionResult = await this.#executePrivate(
|
|
845
|
+
contractFunctionSimulator,
|
|
846
|
+
txRequest,
|
|
847
|
+
msgSender,
|
|
848
|
+
scopes,
|
|
849
|
+
);
|
|
816
850
|
|
|
817
851
|
const { publicInputs, executionSteps } = await this.#prove(
|
|
818
852
|
txRequest,
|
|
@@ -849,9 +883,10 @@ export class PXEService implements PXE {
|
|
|
849
883
|
|
|
850
884
|
const totalTime = totalTimer.ms();
|
|
851
885
|
|
|
852
|
-
const perFunction = executionSteps.map(({ functionName, timings: { witgen } }) => ({
|
|
886
|
+
const perFunction = executionSteps.map(({ functionName, timings: { witgen, oracles } }) => ({
|
|
853
887
|
functionName,
|
|
854
888
|
time: witgen,
|
|
889
|
+
oracles,
|
|
855
890
|
}));
|
|
856
891
|
|
|
857
892
|
const timings: SimulationTimings = {
|
|
@@ -878,14 +913,13 @@ export class PXEService implements PXE {
|
|
|
878
913
|
revertReason: publicOutput.revertReason,
|
|
879
914
|
}
|
|
880
915
|
: {}),
|
|
881
|
-
timings,
|
|
882
916
|
});
|
|
883
917
|
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
publicOutput,
|
|
918
|
+
const simulatorStats = contractFunctionSimulator.getStats();
|
|
919
|
+
return TxSimulationResult.fromPrivateSimulationResultAndPublicOutput(privateSimulationResult, publicOutput, {
|
|
887
920
|
timings,
|
|
888
|
-
|
|
921
|
+
nodeRPCCalls: simulatorStats.nodeRPCCalls,
|
|
922
|
+
});
|
|
889
923
|
} catch (err: any) {
|
|
890
924
|
throw this.#contextualizeError(
|
|
891
925
|
err,
|
|
@@ -932,7 +966,13 @@ export class PXEService implements PXE {
|
|
|
932
966
|
// TODO - Should check if `from` has the permission to call the view function.
|
|
933
967
|
const functionCall = await this.#getFunctionCall(functionName, args, to);
|
|
934
968
|
const functionTimer = new Timer();
|
|
935
|
-
const
|
|
969
|
+
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
970
|
+
const executionResult = await this.#simulateUtility(
|
|
971
|
+
contractFunctionSimulator,
|
|
972
|
+
functionCall,
|
|
973
|
+
authwits ?? [],
|
|
974
|
+
scopes,
|
|
975
|
+
);
|
|
936
976
|
const functionTime = functionTimer.ms();
|
|
937
977
|
|
|
938
978
|
const totalTime = totalTimer.ms();
|
|
@@ -946,7 +986,8 @@ export class PXEService implements PXE {
|
|
|
946
986
|
unaccounted: totalTime - (syncTime + perFunction.reduce((acc, { time }) => acc + time, 0)),
|
|
947
987
|
};
|
|
948
988
|
|
|
949
|
-
|
|
989
|
+
const simulationStats = contractFunctionSimulator.getStats();
|
|
990
|
+
return { result: executionResult, stats: { timings, nodeRPCCalls: simulationStats.nodeRPCCalls } };
|
|
950
991
|
} catch (err: any) {
|
|
951
992
|
const stringifiedArgs = args.map(arg => arg.toString()).join(', ');
|
|
952
993
|
throw this.#contextualizeError(
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
2
2
|
import { Fr, Point } from '@aztec/foundation/fields';
|
|
3
3
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
-
import type { NoteData } from '@aztec/simulator/client';
|
|
5
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
5
|
import { Note } from '@aztec/stdlib/note';
|
|
7
6
|
import { TxHash } from '@aztec/stdlib/tx';
|
|
8
7
|
|
|
8
|
+
import type { NoteData } from '../../contract_function_simulator/oracle/typed_oracle.js';
|
|
9
|
+
|
|
9
10
|
/**
|
|
10
11
|
* A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
|
|
11
12
|
* information required to use it during execution and manage its state.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_creation_options.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/client/pxe_creation_options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,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0B,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG1D,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,wBAAgB,oCAAoC,CAClD,iBAAiB,EAAE;IAAE,gBAAgB,EAAE,EAAE,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,EAAE,GAC3F,oBAAoB,EAAE,CAQxB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,qBAAqB,EAAE,oBAAoB,EAAE,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAQ3G"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|