@aztec/simulator 3.0.0-nightly.20251118 → 3.0.0-nightly.20251119
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/public/avm/fixtures/avm_simulation_tester.d.ts.map +1 -1
- package/dest/public/avm/fixtures/avm_simulation_tester.js +2 -1
- package/dest/public/fixtures/token_test.js +3 -4
- package/dest/public/public_processor/public_processor.d.ts.map +1 -1
- package/dest/public/public_processor/public_processor.js +5 -12
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator.js +2 -0
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.d.ts +8 -2
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts +12 -2
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/public_tx_simulator.js +3 -1
- package/package.json +16 -16
- package/src/public/avm/fixtures/avm_simulation_tester.ts +1 -0
- package/src/public/fixtures/token_test.ts +3 -4
- package/src/public/public_processor/public_processor.ts +4 -14
- package/src/public/public_tx_simulator/cpp_public_tx_simulator.ts +2 -0
- package/src/public/public_tx_simulator/measured_public_tx_simulator.ts +2 -2
- package/src/public/public_tx_simulator/public_tx_simulator.ts +15 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avm_simulation_tester.d.ts","sourceRoot":"","sources":["../../../../src/public/avm/fixtures/avm_simulation_tester.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AACn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AA6B;WAKxC,MAAM,CACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,mBAAmB,CAAC;IAkB/B;;OAEG;IACG,YAAY,CAChB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,GAAG,EAAE,EACX,YAAY,UAAQ,GACnB,OAAO,CAAC,qBAAqB,CAAC;CA8ClC"}
|
|
@@ -52,7 +52,8 @@ const DEFAULT_GAS_FEES = new GasFees(2, 3);
|
|
|
52
52
|
skipFeeEnforcement: false,
|
|
53
53
|
collectDebugLogs: true,
|
|
54
54
|
collectHints: false,
|
|
55
|
-
collectStatistics: false
|
|
55
|
+
collectStatistics: false,
|
|
56
|
+
collectCallMetadata: true
|
|
56
57
|
});
|
|
57
58
|
const environment = initExecutionEnvironment({
|
|
58
59
|
calldata,
|
|
@@ -88,8 +88,7 @@ async function checkBalance(tester, token, sender, account, expectedBalance, exp
|
|
|
88
88
|
]);
|
|
89
89
|
expectToBeTrue(balResult.revertCode.isOK());
|
|
90
90
|
// should be 1 call with 1 return value that is expectedBalance
|
|
91
|
-
expectToBeTrue(balResult.
|
|
92
|
-
expectToBeTrue(balResult.
|
|
93
|
-
expectToBeTrue(balResult.
|
|
94
|
-
expectToBeTrue(balResult.processedPhases[0].returnValues[0].values[0].toBigInt() == expectedBalance);
|
|
91
|
+
expectToBeTrue(balResult.appLogicReturnValues.length == 1);
|
|
92
|
+
expectToBeTrue(balResult.appLogicReturnValues[0].values.length == 1);
|
|
93
|
+
expectToBeTrue(balResult.appLogicReturnValues[0].values[0].toBigInt() == expectedBalance);
|
|
95
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_processor.d.ts","sourceRoot":"","sources":["../../../src/public/public_processor/public_processor.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAkC,MAAM,yBAAyB,CAAC;AAIvF,OAAO,EAML,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAGjE,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,EAChB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL,KAAK,QAAQ,EACb,eAAe,EACf,yBAAyB,EACzB,KAAK,WAAW,EAEhB,EAAE,
|
|
1
|
+
{"version":3,"file":"public_processor.d.ts","sourceRoot":"","sources":["../../../src/public/public_processor/public_processor.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAkC,MAAM,yBAAyB,CAAC;AAIvF,OAAO,EAML,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAGjE,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,EAChB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL,KAAK,QAAQ,EACb,eAAe,EACf,yBAAyB,EACzB,KAAK,WAAW,EAEhB,EAAE,EAGH,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,MAAM,EAGZ,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAE,iBAAiB,EAAiB,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAE7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAGvE;;GAEG;AACH,qBAAa,sBAAsB;IAE/B,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,YAAY;IACpB,SAAS,CAAC,eAAe,EAAE,eAAe;gBAFlC,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,GAAE,YAAiC,EAC7C,eAAe,GAAE,eAAsC;IAGnE;;;;;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BhC,oBAAoB;YA+BpB,wBAAwB;IAoCtC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;CAStC"}
|
|
@@ -18,7 +18,7 @@ import { computeTransactionFee } from '@aztec/stdlib/fees';
|
|
|
18
18
|
import { Gas } from '@aztec/stdlib/gas';
|
|
19
19
|
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
20
20
|
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
21
|
-
import { NestedProcessReturnValues, Tx,
|
|
21
|
+
import { NestedProcessReturnValues, Tx, makeProcessedTxFromPrivateOnlyTx, makeProcessedTxFromTxWithPublicCalls } from '@aztec/stdlib/tx';
|
|
22
22
|
import { Attributes, getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
|
|
23
23
|
import { ForkCheckpoint } from '@aztec/world-state/native';
|
|
24
24
|
import { AssertionError } from 'assert';
|
|
@@ -379,28 +379,21 @@ class PublicProcessorTimeoutError extends Error {
|
|
|
379
379
|
}
|
|
380
380
|
async processTxWithPublicCalls(tx) {
|
|
381
381
|
const timer = new Timer();
|
|
382
|
-
const { hints, publicInputs, gasUsed, revertCode, revertReason,
|
|
382
|
+
const { hints, publicInputs, gasUsed, revertCode, revertReason, appLogicReturnValues } = await this.publicTxSimulator.simulate(tx);
|
|
383
383
|
if (!hints) {
|
|
384
384
|
this.metrics.recordFailedTx();
|
|
385
385
|
throw new Error('Avm proving result was not generated.');
|
|
386
386
|
}
|
|
387
|
-
processedPhases?.forEach((phase)=>{
|
|
388
|
-
if (phase.reverted) {
|
|
389
|
-
this.metrics.recordRevertedPhase(phase.phase);
|
|
390
|
-
} else {
|
|
391
|
-
this.metrics.recordPhaseDuration(phase.phase, phase.durationMs ?? 0);
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
387
|
const contractClassLogs = revertCode.isOK() ? tx.getContractClassLogs() : tx.getSplitContractClassLogs(false);
|
|
395
388
|
this.metrics.recordClassPublication(...contractClassLogs.filter((log)=>ContractClassPublishedEvent.isContractClassPublishedEvent(log)).map((log)=>ContractClassPublishedEvent.fromLog(log)));
|
|
396
|
-
|
|
389
|
+
// TODO(fcarreiro): remove phase count metric.
|
|
390
|
+
const phaseCount = 1;
|
|
397
391
|
const durationMs = timer.ms();
|
|
398
392
|
this.metrics.recordTx(phaseCount, durationMs, gasUsed.publicGas);
|
|
399
393
|
const processedTx = makeProcessedTxFromTxWithPublicCalls(tx, PublicProcessor.generateProvingRequest(publicInputs, hints), gasUsed, revertCode, revertReason);
|
|
400
|
-
const returnValues = processedPhases?.find(({ phase })=>phase === TxExecutionPhase.APP_LOGIC)?.returnValues ?? [];
|
|
401
394
|
return [
|
|
402
395
|
processedTx,
|
|
403
|
-
|
|
396
|
+
appLogicReturnValues ?? []
|
|
404
397
|
];
|
|
405
398
|
}
|
|
406
399
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cpp_public_tx_simulator.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/cpp_public_tx_simulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAIlE,OAAO,EAIL,KAAK,qBAAqB,EAC1B,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAkB,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAK5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EACV,kCAAkC,EAClC,0BAA0B,EAC3B,MAAM,oCAAoC,CAAC;AAE5C;;;;;;;GAOG;AACH,qBAAa,oBAAqB,SAAQ,iBAAkB,YAAW,0BAA0B;IAC/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AQ,oBAAqB,YAAW,kCAAkC;IAKhH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,wBAAwB;gBAHpD,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,iBAAiB,EAC9B,eAAe,EAAE,eAAe,EACb,OAAO,EAAE,wBAAwB,EACpD,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC;IAKnB,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,GAAE,MAAsB,GAAG,OAAO,CAAC,cAAc,CAAC;CAUjG;AAED;;;;;GAKG;AACH,qBAAa,6BAA8B,SAAQ,iBAAkB,YAAW,0BAA0B;IACxG,UAAmB,GAAG,EAAE,MAAM,CAAC;gBAG7B,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,iBAAiB,EAC9B,eAAe,EAAE,eAAe,EAChC,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC;IAMzC;;;;;;;;;OASG;IACmB,QAAQ,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC;CA+ChE;AAED;;;;;;GAMG;AACH,qBAAa,qCACX,SAAQ,6BACR,YAAW,kCAAkC;IAM3C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,wBAAwB;gBAHpD,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,iBAAiB,EAC9B,eAAe,EAAE,eAAe,EACb,OAAO,EAAE,wBAAwB,EACpD,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC;IAKnB,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,GAAE,MAAsB,GAAG,OAAO,CAAC,cAAc,CAAC;CAUjG"}
|
|
@@ -91,6 +91,8 @@ import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
|
91
91
|
// TODO(fcarreiro): complete this.
|
|
92
92
|
assert(cppResult.revertCode.equals(tsResult.revertCode));
|
|
93
93
|
assert(cppResult.gasUsed.totalGas.equals(tsResult.gasUsed.totalGas));
|
|
94
|
+
// FIXME(https://github.com/AztecProtocol/aztec-packages/issues/18441): a few but not all keccaks fail!
|
|
95
|
+
// expect(cppResult.appLogicReturnValues).toEqual(tsResult.appLogicReturnValues);
|
|
94
96
|
// Confirm that tree roots match
|
|
95
97
|
const cppStateRef = await this.merkleTree.getStateReference();
|
|
96
98
|
assert(cppStateRef.equals(tsStateRef), `Tree roots mismatch between TS and C++ public simulations for tx ${txHash}`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PublicSimulatorConfig, PublicTxResult } from '@aztec/stdlib/avm';
|
|
3
3
|
import type { Gas } from '@aztec/stdlib/gas';
|
|
4
4
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
5
5
|
import { type GlobalVariables, PublicCallRequestWithCalldata, Tx, TxExecutionPhase } from '@aztec/stdlib/tx';
|
|
@@ -19,7 +19,13 @@ export declare class MeasuredPublicTxSimulator extends PublicTxSimulator impleme
|
|
|
19
19
|
simulate(tx: Tx, txLabel?: string): Promise<PublicTxResult>;
|
|
20
20
|
protected insertNonRevertiblesFromPrivate(context: PublicTxContext): Promise<void>;
|
|
21
21
|
protected insertRevertiblesFromPrivate(context: PublicTxContext): Promise<void>;
|
|
22
|
-
protected simulatePhase(phase: TxExecutionPhase, context: PublicTxContext): Promise<
|
|
22
|
+
protected simulatePhase(phase: TxExecutionPhase, context: PublicTxContext): Promise<{
|
|
23
|
+
phase: TxExecutionPhase;
|
|
24
|
+
durationMs?: number;
|
|
25
|
+
returnValues: import("@aztec/stdlib/tx").NestedProcessReturnValues[];
|
|
26
|
+
reverted: boolean;
|
|
27
|
+
revertReason?: import("@aztec/stdlib/errors").SimulationError;
|
|
28
|
+
}>;
|
|
23
29
|
protected simulateEnqueuedCallInternal(stateManager: PublicPersistableStateManager, callRequest: PublicCallRequestWithCalldata, allocatedGas: Gas, transactionFee: Fr, fnName: string): Promise<AvmFinalizedCallResult>;
|
|
24
30
|
}
|
|
25
31
|
//# sourceMappingURL=measured_public_tx_simulator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measured_public_tx_simulator.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/measured_public_tx_simulator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"measured_public_tx_simulator.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/measured_public_tx_simulator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,KAAK,eAAe,EAAE,6BAA6B,EAAE,EAAE,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE7G,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,oCAAoC,CAAC;AAE7F;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,iBAAkB,YAAW,kCAAkC;IAK1G,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,wBAAwB;gBAHpD,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,iBAAiB,EAC9B,eAAe,EAAE,eAAe,EACb,OAAO,EAAE,wBAAwB,EACpD,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC;IAKnB,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,GAAE,MAAsB,GAAG,OAAO,CAAC,cAAc,CAAC;cAWvE,+BAA+B,CAAC,OAAO,EAAE,eAAe;cAMxD,4BAA4B,CAAC,OAAO,EAAE,eAAe;cAMrD,aAAa,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe;;;;;;;cAO/D,4BAA4B,CACnD,YAAY,EAAE,6BAA6B,EAC3C,WAAW,EAAE,6BAA6B,EAC1C,YAAY,EAAE,GAAG,EACjB,cAAc,EAAE,EAAE,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,sBAAsB,CAAC;CAsCnC"}
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
2
|
import { type Logger } from '@aztec/foundation/log';
|
|
3
|
-
import {
|
|
3
|
+
import { PublicSimulatorConfig, PublicTxResult } from '@aztec/stdlib/avm';
|
|
4
|
+
import { SimulationError } from '@aztec/stdlib/errors';
|
|
4
5
|
import type { Gas } from '@aztec/stdlib/gas';
|
|
5
6
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
6
|
-
import { type GlobalVariables, PublicCallRequestWithCalldata, Tx, TxExecutionPhase } from '@aztec/stdlib/tx';
|
|
7
|
+
import { type GlobalVariables, NestedProcessReturnValues, PublicCallRequestWithCalldata, Tx, TxExecutionPhase } from '@aztec/stdlib/tx';
|
|
7
8
|
import type { AvmFinalizedCallResult } from '../avm/avm_contract_call_result.js';
|
|
8
9
|
import { type PublicContractsDB } from '../public_db_sources.js';
|
|
9
10
|
import type { PublicPersistableStateManager } from '../state_manager/state_manager.js';
|
|
10
11
|
import { PublicTxContext } from './public_tx_context.js';
|
|
11
12
|
import type { PublicTxSimulatorInterface } from './public_tx_simulator_interface.js';
|
|
13
|
+
/** Only used internally. */
|
|
14
|
+
type ProcessedPhase = {
|
|
15
|
+
phase: TxExecutionPhase;
|
|
16
|
+
durationMs?: number;
|
|
17
|
+
returnValues: NestedProcessReturnValues[];
|
|
18
|
+
reverted: boolean;
|
|
19
|
+
revertReason?: SimulationError;
|
|
20
|
+
};
|
|
12
21
|
export declare class PublicTxSimulator implements PublicTxSimulatorInterface {
|
|
13
22
|
protected merkleTree: MerkleTreeWriteOperations;
|
|
14
23
|
protected contractsDB: PublicContractsDB;
|
|
@@ -67,4 +76,5 @@ export declare class PublicTxSimulator implements PublicTxSimulatorInterface {
|
|
|
67
76
|
protected insertRevertiblesFromPrivate(context: PublicTxContext): Promise<void>;
|
|
68
77
|
private payFee;
|
|
69
78
|
}
|
|
79
|
+
export {};
|
|
70
80
|
//# sourceMappingURL=public_tx_simulator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_tx_simulator.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/public_tx_simulator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAGlE,OAAO,
|
|
1
|
+
{"version":3,"file":"public_tx_simulator.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/public_tx_simulator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAGlE,OAAO,EAAgC,qBAAqB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxG,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;A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AC,aAAa,CAAC,EAAE,EAAE,EAAE;IAI9B;;;;OAIG;cACa,aAAa,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IAqCzG;;;;;;OAMG;cACa,oBAAoB,CAClC,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,6BAA6B,GACzC,OAAO,CAAC,sBAAsB,CAAC;IA6BlC;;;;;;;;;;;;OAYG;cACa,4BAA4B,CAC1C,YAAY,EAAE,6BAA6B,EAC3C,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,6BAA6B,EACpD,YAAY,EAAE,GAAG,EACjB,cAAc,EAAE,EAAE,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,sBAAsB,CAAC;IAuBlC;;OAEG;cACa,+BAA+B,CAAC,OAAO,EAAE,eAAe;IA2BxE;;;;;;;;OAQG;cACa,4BAA4B,CAAC,OAAO,EAAE,eAAe;YA4EvD,MAAM;CA8BrB"}
|
|
@@ -136,12 +136,14 @@ export class PublicTxSimulator {
|
|
|
136
136
|
await this.payFee(context);
|
|
137
137
|
const publicInputs = await context.generateAvmCircuitPublicInputs();
|
|
138
138
|
const revertCode = context.getFinalRevertCode();
|
|
139
|
+
// We only return the app logic phase information.
|
|
140
|
+
const appLogicReturnValues = processedPhases.find(({ phase })=>phase === TxExecutionPhase.APP_LOGIC)?.returnValues ?? [];
|
|
139
141
|
return new PublicTxResult(/*gasUsed=*/ {
|
|
140
142
|
totalGas: context.getActualGasUsed(),
|
|
141
143
|
teardownGas: context.teardownGasUsed,
|
|
142
144
|
publicGas: context.getActualPublicGasUsed(),
|
|
143
145
|
billedGas: context.getTotalGasUsed()
|
|
144
|
-
}, /*revertCode=*/ revertCode, /*revertReason=*/ context.revertReason, /*
|
|
146
|
+
}, /*revertCode=*/ revertCode, /*revertReason=*/ context.revertReason, /*appLogicReturnValues=*/ appLogicReturnValues, /*logs=*/ context.state.getActiveStateManager().getLogs(), /*hints=*/ hints, /*publicInputs=*/ publicInputs);
|
|
145
147
|
}
|
|
146
148
|
computeTxHash(tx) {
|
|
147
149
|
return tx.getTxHash();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/simulator",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251119",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/server.js",
|
|
@@ -64,26 +64,26 @@
|
|
|
64
64
|
]
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
68
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
69
|
-
"@aztec/native": "3.0.0-nightly.
|
|
70
|
-
"@aztec/noir-acvm_js": "3.0.0-nightly.
|
|
71
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
72
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
73
|
-
"@aztec/noir-types": "3.0.0-nightly.
|
|
74
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
75
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
76
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
77
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
67
|
+
"@aztec/constants": "3.0.0-nightly.20251119",
|
|
68
|
+
"@aztec/foundation": "3.0.0-nightly.20251119",
|
|
69
|
+
"@aztec/native": "3.0.0-nightly.20251119",
|
|
70
|
+
"@aztec/noir-acvm_js": "3.0.0-nightly.20251119",
|
|
71
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20251119",
|
|
72
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251119",
|
|
73
|
+
"@aztec/noir-types": "3.0.0-nightly.20251119",
|
|
74
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20251119",
|
|
75
|
+
"@aztec/stdlib": "3.0.0-nightly.20251119",
|
|
76
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20251119",
|
|
77
|
+
"@aztec/world-state": "3.0.0-nightly.20251119",
|
|
78
78
|
"lodash.clonedeep": "^4.5.0",
|
|
79
79
|
"lodash.merge": "^4.6.2",
|
|
80
80
|
"tslib": "^2.4.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
84
|
-
"@aztec/merkle-tree": "3.0.0-nightly.
|
|
85
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
86
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
83
|
+
"@aztec/kv-store": "3.0.0-nightly.20251119",
|
|
84
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20251119",
|
|
85
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20251119",
|
|
86
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20251119",
|
|
87
87
|
"@jest/globals": "^30.0.0",
|
|
88
88
|
"@types/jest": "^30.0.0",
|
|
89
89
|
"@types/lodash.clonedeep": "^4.5.7",
|
|
@@ -133,8 +133,7 @@ async function checkBalance(
|
|
|
133
133
|
);
|
|
134
134
|
expectToBeTrue(balResult.revertCode.isOK());
|
|
135
135
|
// should be 1 call with 1 return value that is expectedBalance
|
|
136
|
-
expectToBeTrue(balResult.
|
|
137
|
-
expectToBeTrue(balResult.
|
|
138
|
-
expectToBeTrue(balResult.
|
|
139
|
-
expectToBeTrue(balResult.processedPhases![0].returnValues[0].values![0].toBigInt() == expectedBalance);
|
|
136
|
+
expectToBeTrue(balResult.appLogicReturnValues.length == 1);
|
|
137
|
+
expectToBeTrue(balResult.appLogicReturnValues[0].values!.length == 1);
|
|
138
|
+
expectToBeTrue(balResult.appLogicReturnValues[0].values![0].toBigInt() == expectedBalance);
|
|
140
139
|
}
|
|
@@ -34,7 +34,6 @@ import {
|
|
|
34
34
|
type ProcessedTx,
|
|
35
35
|
StateReference,
|
|
36
36
|
Tx,
|
|
37
|
-
TxExecutionPhase,
|
|
38
37
|
makeProcessedTxFromPrivateOnlyTx,
|
|
39
38
|
makeProcessedTxFromTxWithPublicCalls,
|
|
40
39
|
} from '@aztec/stdlib/tx';
|
|
@@ -522,7 +521,7 @@ export class PublicProcessor implements Traceable {
|
|
|
522
521
|
private async processTxWithPublicCalls(tx: Tx): Promise<[ProcessedTx, NestedProcessReturnValues[]]> {
|
|
523
522
|
const timer = new Timer();
|
|
524
523
|
|
|
525
|
-
const { hints, publicInputs, gasUsed, revertCode, revertReason,
|
|
524
|
+
const { hints, publicInputs, gasUsed, revertCode, revertReason, appLogicReturnValues } =
|
|
526
525
|
await this.publicTxSimulator.simulate(tx);
|
|
527
526
|
|
|
528
527
|
if (!hints) {
|
|
@@ -530,14 +529,6 @@ export class PublicProcessor implements Traceable {
|
|
|
530
529
|
throw new Error('Avm proving result was not generated.');
|
|
531
530
|
}
|
|
532
531
|
|
|
533
|
-
processedPhases?.forEach(phase => {
|
|
534
|
-
if (phase.reverted) {
|
|
535
|
-
this.metrics.recordRevertedPhase(phase.phase);
|
|
536
|
-
} else {
|
|
537
|
-
this.metrics.recordPhaseDuration(phase.phase, phase.durationMs ?? 0);
|
|
538
|
-
}
|
|
539
|
-
});
|
|
540
|
-
|
|
541
532
|
const contractClassLogs = revertCode.isOK()
|
|
542
533
|
? tx.getContractClassLogs()
|
|
543
534
|
: tx.getSplitContractClassLogs(false /* revertible */);
|
|
@@ -547,7 +538,8 @@ export class PublicProcessor implements Traceable {
|
|
|
547
538
|
.map(log => ContractClassPublishedEvent.fromLog(log)),
|
|
548
539
|
);
|
|
549
540
|
|
|
550
|
-
|
|
541
|
+
// TODO(fcarreiro): remove phase count metric.
|
|
542
|
+
const phaseCount = 1;
|
|
551
543
|
const durationMs = timer.ms();
|
|
552
544
|
this.metrics.recordTx(phaseCount, durationMs, gasUsed.publicGas);
|
|
553
545
|
|
|
@@ -559,9 +551,7 @@ export class PublicProcessor implements Traceable {
|
|
|
559
551
|
revertReason,
|
|
560
552
|
);
|
|
561
553
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
return [processedTx, returnValues];
|
|
554
|
+
return [processedTx, appLogicReturnValues ?? []];
|
|
565
555
|
}
|
|
566
556
|
|
|
567
557
|
/**
|
|
@@ -143,6 +143,8 @@ export class CppPublicTxSimulator extends PublicTxSimulator implements PublicTxS
|
|
|
143
143
|
// TODO(fcarreiro): complete this.
|
|
144
144
|
assert(cppResult.revertCode.equals(tsResult.revertCode));
|
|
145
145
|
assert(cppResult.gasUsed.totalGas.equals(tsResult.gasUsed.totalGas));
|
|
146
|
+
// FIXME(https://github.com/AztecProtocol/aztec-packages/issues/18441): a few but not all keccaks fail!
|
|
147
|
+
// expect(cppResult.appLogicReturnValues).toEqual(tsResult.appLogicReturnValues);
|
|
146
148
|
|
|
147
149
|
// Confirm that tree roots match
|
|
148
150
|
const cppStateRef = await this.merkleTree.getStateReference();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
2
|
import { Timer } from '@aztec/foundation/timer';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PublicSimulatorConfig, PublicTxResult } from '@aztec/stdlib/avm';
|
|
4
4
|
import type { Gas } from '@aztec/stdlib/gas';
|
|
5
5
|
import type { AvmSimulationStats } from '@aztec/stdlib/stats';
|
|
6
6
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
@@ -51,7 +51,7 @@ export class MeasuredPublicTxSimulator extends PublicTxSimulator implements Meas
|
|
|
51
51
|
this.metrics.recordPrivateEffectsInsertion(timer.us(), 'revertible');
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
protected override async simulatePhase(phase: TxExecutionPhase, context: PublicTxContext)
|
|
54
|
+
protected override async simulatePhase(phase: TxExecutionPhase, context: PublicTxContext) {
|
|
55
55
|
const timer = new Timer();
|
|
56
56
|
const result = await super.simulatePhase(phase, context);
|
|
57
57
|
result.durationMs = timer.ms();
|
|
@@ -3,13 +3,7 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
3
3
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
4
4
|
import { ProtocolContractAddress, ProtocolContractsList } from '@aztec/protocol-contracts';
|
|
5
5
|
import { computeFeePayerBalanceStorageSlot } from '@aztec/protocol-contracts/fee-juice';
|
|
6
|
-
import {
|
|
7
|
-
AvmExecutionHints,
|
|
8
|
-
AvmTxHint,
|
|
9
|
-
type ProcessedPhase,
|
|
10
|
-
PublicSimulatorConfig,
|
|
11
|
-
PublicTxResult,
|
|
12
|
-
} from '@aztec/stdlib/avm';
|
|
6
|
+
import { AvmExecutionHints, AvmTxHint, PublicSimulatorConfig, PublicTxResult } from '@aztec/stdlib/avm';
|
|
13
7
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
14
8
|
import type { Gas } from '@aztec/stdlib/gas';
|
|
15
9
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
@@ -73,6 +67,15 @@ class TxSimTeardownRevert extends Error {
|
|
|
73
67
|
}
|
|
74
68
|
}
|
|
75
69
|
|
|
70
|
+
/** Only used internally. */
|
|
71
|
+
type ProcessedPhase = {
|
|
72
|
+
phase: TxExecutionPhase;
|
|
73
|
+
durationMs?: number;
|
|
74
|
+
returnValues: NestedProcessReturnValues[];
|
|
75
|
+
reverted: boolean;
|
|
76
|
+
revertReason?: SimulationError;
|
|
77
|
+
};
|
|
78
|
+
|
|
76
79
|
export class PublicTxSimulator implements PublicTxSimulatorInterface {
|
|
77
80
|
protected log: Logger;
|
|
78
81
|
protected readonly config: PublicSimulatorConfig;
|
|
@@ -197,6 +200,10 @@ export class PublicTxSimulator implements PublicTxSimulatorInterface {
|
|
|
197
200
|
const publicInputs = await context.generateAvmCircuitPublicInputs();
|
|
198
201
|
const revertCode = context.getFinalRevertCode();
|
|
199
202
|
|
|
203
|
+
// We only return the app logic phase information.
|
|
204
|
+
const appLogicReturnValues =
|
|
205
|
+
processedPhases.find(({ phase }) => phase === TxExecutionPhase.APP_LOGIC)?.returnValues ?? [];
|
|
206
|
+
|
|
200
207
|
return new PublicTxResult(
|
|
201
208
|
/*gasUsed=*/ {
|
|
202
209
|
totalGas: context.getActualGasUsed(),
|
|
@@ -206,7 +213,7 @@ export class PublicTxSimulator implements PublicTxSimulatorInterface {
|
|
|
206
213
|
},
|
|
207
214
|
/*revertCode=*/ revertCode,
|
|
208
215
|
/*revertReason=*/ context.revertReason,
|
|
209
|
-
/*
|
|
216
|
+
/*appLogicReturnValues=*/ appLogicReturnValues,
|
|
210
217
|
/*logs=*/ context.state.getActiveStateManager().getLogs(),
|
|
211
218
|
/*hints=*/ hints,
|
|
212
219
|
/*publicInputs=*/ publicInputs,
|