@aztec/simulator 3.0.0-nightly.20251105 → 3.0.0-nightly.20251107
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/fixtures/bulk_test.d.ts +2 -2
- package/dest/public/fixtures/bulk_test.d.ts.map +1 -1
- package/dest/public/fixtures/custom_bytecode_tester.d.ts +1 -1
- package/dest/public/fixtures/custom_bytecode_tester.d.ts.map +1 -1
- package/dest/public/fixtures/custom_bytecode_tests.d.ts +7 -7
- package/dest/public/fixtures/custom_bytecode_tests.d.ts.map +1 -1
- package/dest/public/fixtures/minimal_public_tx.d.ts +1 -2
- package/dest/public/fixtures/minimal_public_tx.d.ts.map +1 -1
- package/dest/public/fixtures/minimal_public_tx.js +2 -2
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts +1 -1
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +1 -1
- package/dest/public/fixtures/token_test.js +1 -1
- package/dest/public/index.d.ts +2 -1
- package/dest/public/index.d.ts.map +1 -1
- package/dest/public/public_processor/public_processor.d.ts +4 -0
- package/dest/public/public_processor/public_processor.d.ts.map +1 -1
- package/dest/public/public_processor/public_processor.js +16 -7
- package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts +2 -1
- 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 +12 -5
- package/dest/public/public_tx_simulator/index.d.ts +1 -0
- package/dest/public/public_tx_simulator/index.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/measured_public_tx_simulator.d.ts +2 -1
- 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 +3 -33
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/public_tx_simulator.js +7 -24
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.d.ts +1 -1
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.d.ts +1 -1
- package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.d.ts.map +1 -1
- package/package.json +16 -16
- package/src/public/fixtures/custom_bytecode_tester.ts +1 -1
- package/src/public/fixtures/minimal_public_tx.ts +3 -4
- package/src/public/fixtures/public_tx_simulation_tester.ts +1 -1
- package/src/public/fixtures/token_test.ts +4 -4
- package/src/public/index.ts +2 -6
- package/src/public/public_processor/public_processor.ts +33 -7
- package/src/public/public_tx_simulator/contract_provider_for_cpp.ts +1 -1
- package/src/public/public_tx_simulator/cpp_public_tx_simulator.ts +21 -6
- package/src/public/public_tx_simulator/index.ts +1 -0
- package/src/public/public_tx_simulator/measured_public_tx_simulator.ts +2 -6
- package/src/public/public_tx_simulator/public_tx_simulator.ts +13 -57
- package/src/public/public_tx_simulator/public_tx_simulator_interface.ts +1 -2
- package/src/public/public_tx_simulator/telemetry_public_tx_simulator.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Logger } from '@aztec/foundation/log';
|
|
2
2
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
3
3
|
import { PublicTxSimulationTester } from './public_tx_simulation_tester.js';
|
|
4
|
-
export declare function bulkTest(tester: PublicTxSimulationTester, logger: Logger, avmTestContractArtifact: ContractArtifact): Promise<import("
|
|
5
|
-
export declare function megaBulkTest(tester: PublicTxSimulationTester, logger: Logger, avmTestContractArtifact: ContractArtifact): Promise<import("
|
|
4
|
+
export declare function bulkTest(tester: PublicTxSimulationTester, logger: Logger, avmTestContractArtifact: ContractArtifact): Promise<import("@aztec/stdlib/avm").PublicTxResult>;
|
|
5
|
+
export declare function megaBulkTest(tester: PublicTxSimulationTester, logger: Logger, avmTestContractArtifact: ContractArtifact): Promise<import("@aztec/stdlib/avm").PublicTxResult>;
|
|
6
6
|
//# sourceMappingURL=bulk_test.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk_test.d.ts","sourceRoot":"","sources":["../../../src/public/fixtures/bulk_test.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,wBAAwB,EAChC,MAAM,EAAE,MAAM,EACd,uBAAuB,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"bulk_test.d.ts","sourceRoot":"","sources":["../../../src/public/fixtures/bulk_test.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,wBAAwB,EAChC,MAAM,EAAE,MAAM,EACd,uBAAuB,EAAE,gBAAgB,uDAkF1C;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,wBAAwB,EAChC,MAAM,EAAE,MAAM,EACd,uBAAuB,EAAE,gBAAgB,uDAsE1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom_bytecode_tester.d.ts","sourceRoot":"","sources":["../../../src/public/fixtures/custom_bytecode_tester.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"custom_bytecode_tester.d.ts","sourceRoot":"","sources":["../../../src/public/fixtures/custom_bytecode_tester.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,wBAAwB,EAChC,OAAO,EAAE,MAAM,EACf,YAAY,GAAE,MAAiC,GAC9C,OAAO,CAAC,cAAc,CAAC,CA6BzB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PublicTxSimulationTester } from './public_tx_simulation_tester.js';
|
|
2
|
-
export declare function addressingWithBaseTagIssueTest(isIndirect: boolean, tester: PublicTxSimulationTester): Promise<import("
|
|
3
|
-
export declare function pcOutOfRangeTest(tester: PublicTxSimulationTester): Promise<import("
|
|
4
|
-
export declare function invalidOpcodeTest(tester: PublicTxSimulationTester): Promise<import("
|
|
5
|
-
export declare function invalidByteTest(tester: PublicTxSimulationTester): Promise<import("
|
|
6
|
-
export declare function instructionTruncatedTest(tester: PublicTxSimulationTester): Promise<import("
|
|
7
|
-
export declare function invalidTagValueTest(tester: PublicTxSimulationTester): Promise<import("
|
|
8
|
-
export declare function invalidTagValueAndInstructionTruncatedTest(tester: PublicTxSimulationTester): Promise<import("
|
|
2
|
+
export declare function addressingWithBaseTagIssueTest(isIndirect: boolean, tester: PublicTxSimulationTester): Promise<import("@aztec/stdlib/avm").PublicTxResult>;
|
|
3
|
+
export declare function pcOutOfRangeTest(tester: PublicTxSimulationTester): Promise<import("@aztec/stdlib/avm").PublicTxResult>;
|
|
4
|
+
export declare function invalidOpcodeTest(tester: PublicTxSimulationTester): Promise<import("@aztec/stdlib/avm").PublicTxResult>;
|
|
5
|
+
export declare function invalidByteTest(tester: PublicTxSimulationTester): Promise<import("@aztec/stdlib/avm").PublicTxResult>;
|
|
6
|
+
export declare function instructionTruncatedTest(tester: PublicTxSimulationTester): Promise<import("@aztec/stdlib/avm").PublicTxResult>;
|
|
7
|
+
export declare function invalidTagValueTest(tester: PublicTxSimulationTester): Promise<import("@aztec/stdlib/avm").PublicTxResult>;
|
|
8
|
+
export declare function invalidTagValueAndInstructionTruncatedTest(tester: PublicTxSimulationTester): Promise<import("@aztec/stdlib/avm").PublicTxResult>;
|
|
9
9
|
//# sourceMappingURL=custom_bytecode_tests.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom_bytecode_tests.d.ts","sourceRoot":"","sources":["../../../src/public/fixtures/custom_bytecode_tests.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAI5E,wBAAsB,8BAA8B,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"custom_bytecode_tests.d.ts","sourceRoot":"","sources":["../../../src/public/fixtures/custom_bytecode_tests.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAI5E,wBAAsB,8BAA8B,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,wBAAwB,uDAczG;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,wBAAwB,uDAQtE;AAED,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,wBAAwB,uDAiBvE;AAGD,wBAAsB,eAAe,CAAC,MAAM,EAAE,wBAAwB,uDAOrE;AAGD,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,wBAAwB,uDAU9E;AAGD,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,wBAAwB,uDAYzE;AAGD,wBAAsB,0CAA0C,CAAC,MAAM,EAAE,wBAAwB,uDAchG"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { AvmCircuitInputs } from '@aztec/stdlib/avm';
|
|
2
|
-
import type { PublicTxResult } from '../public_tx_simulator/public_tx_simulator.js';
|
|
1
|
+
import { AvmCircuitInputs, type PublicTxResult } from '@aztec/stdlib/avm';
|
|
3
2
|
import { PublicTxSimulationTester } from './public_tx_simulation_tester.js';
|
|
4
3
|
export declare function executeAvmMinimalPublicTx(tester: PublicTxSimulationTester): Promise<PublicTxResult>;
|
|
5
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minimal_public_tx.d.ts","sourceRoot":"","sources":["../../../src/public/fixtures/minimal_public_tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"minimal_public_tx.d.ts","sourceRoot":"","sources":["../../../src/public/fixtures/minimal_public_tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAS1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,cAAc,CAAC,CAezG;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,IAAI,gBAAgB,CAEvE"}
|
|
@@ -17,8 +17,8 @@ export async function executeAvmMinimalPublicTx(tester) {
|
|
|
17
17
|
]);
|
|
18
18
|
const result = await testCustomBytecode(minimalBytecode, tester, 'MinimalTx', 'AvmMinimalContract');
|
|
19
19
|
// Modify the protocol contracts to be all zeros
|
|
20
|
-
result.
|
|
21
|
-
result.
|
|
20
|
+
result.hints.protocolContracts = ProtocolContracts.empty();
|
|
21
|
+
result.publicInputs.protocolContracts = ProtocolContracts.empty();
|
|
22
22
|
return result;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
+
import type { PublicTxResult } from '@aztec/stdlib/avm';
|
|
2
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
4
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
|
|
4
5
|
import { GlobalVariables, type Tx } from '@aztec/stdlib/tx';
|
|
5
6
|
import { NativeWorldStateService } from '@aztec/world-state';
|
|
6
7
|
import { BaseAvmSimulationTester } from '../avm/fixtures/base_avm_simulation_tester.js';
|
|
7
|
-
import type { PublicTxResult } from '../public_tx_simulator/public_tx_simulator.js';
|
|
8
8
|
import { TestExecutorMetrics } from '../test_executor_metrics.js';
|
|
9
9
|
import { SimpleContractDataSource } from './simple_contract_data_source.js';
|
|
10
10
|
import { type TestPrivateInsertions } from './utils.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_tx_simulation_tester.d.ts","sourceRoot":"","sources":["../../../src/public/fixtures/public_tx_simulation_tester.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAmB,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAiC,KAAK,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"public_tx_simulation_tester.d.ts","sourceRoot":"","sources":["../../../src/public/fixtures/public_tx_simulation_tester.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAmB,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAiC,KAAK,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AAWxF,OAAO,EAAE,mBAAm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,gBAAgB,EAAO,EACjC,YAAY,CAAC,EAAE,gBAAgB,EAC/B,QAAQ,GAAE,YAAqB,EAE/B,iBAAiB,CAAC,EAAE,qBAAqB,EACzC,OAAO,GAAE,MAAsB,GAC9B,OAAO,CAAC,cAAc,CAAC;IAyB1B;;;;;OAKG;IACU,mBAAmB,CAC9B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,YAAY,EACpB,UAAU,CAAC,EAAE,gBAAgB,EAAE,EAC/B,QAAQ,CAAC,EAAE,gBAAgB,EAAE,EAC7B,YAAY,CAAC,EAAE,gBAAgB,EAC/B,QAAQ,CAAC,EAAE,YAAY,EACvB,iBAAiB,CAAC,EAAE,qBAAqB,GACxC,OAAO,CAAC,cAAc,CAAC;IAI1B;;;;;;OAMG;IACU,kBAAkB,CAC7B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,YAAY,EACpB,UAAU,CAAC,EAAE,gBAAgB,EAAE,EAC/B,QAAQ,CAAC,EAAE,gBAAgB,EAAE,EAC7B,YAAY,CAAC,EAAE,gBAAgB,EAC/B,QAAQ,CAAC,EAAE,YAAY,EACvB,iBAAiB,CAAC,EAAE,qBAAqB,GACxC,OAAO,CAAC,cAAc,CAAC;IAYnB,kBAAkB;CAuB1B;AAED,wBAAgB,cAAc,oBAM7B"}
|
|
@@ -88,7 +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.processedPhases
|
|
91
|
+
expectToBeTrue(balResult.processedPhases?.length == 1);
|
|
92
92
|
expectToBeTrue(balResult.processedPhases[0].returnValues.length == 1);
|
|
93
93
|
expectToBeTrue(balResult.processedPhases[0].returnValues[0].values.length == 1);
|
|
94
94
|
expectToBeTrue(balResult.processedPhases[0].returnValues[0].values[0].toBigInt() == expectedBalance);
|
package/dest/public/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { PublicContractsDB } from './public_db_sources.js';
|
|
2
2
|
export { GuardedMerkleTreeOperations } from './public_processor/guarded_merkle_tree.js';
|
|
3
3
|
export { PublicProcessor, PublicProcessorFactory } from './public_processor/public_processor.js';
|
|
4
|
-
export { PublicTxSimulator,
|
|
4
|
+
export { PublicTxSimulator, TelemetryPublicTxSimulator } from './public_tx_simulator/index.js';
|
|
5
|
+
export type { PublicTxResult, PublicTxSimulatorConfig } from '@aztec/stdlib/avm';
|
|
5
6
|
export { getCallRequestsWithCalldataByPhase } from './utils.js';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/public/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AACjG,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/public/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC/F,YAAY,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,kCAAkC,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -65,5 +65,9 @@ export declare class PublicProcessor implements Traceable {
|
|
|
65
65
|
private performFeePaymentPublicDataWrite;
|
|
66
66
|
private processPrivateOnlyTx;
|
|
67
67
|
private processTxWithPublicCalls;
|
|
68
|
+
/**
|
|
69
|
+
* Generate the proving request for the AVM circuit.
|
|
70
|
+
*/
|
|
71
|
+
private static generateProvingRequest;
|
|
68
72
|
}
|
|
69
73
|
//# sourceMappingURL=public_processor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_processor.d.ts","sourceRoot":"","sources":["../../../src/public/public_processor/public_processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAkC,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"public_processor.d.ts","sourceRoot":"","sources":["../../../src/public/public_processor/public_processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAkC,MAAM,yBAAyB,CAAC;AAYvF,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,EAIH,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,C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AAC,EACrC,MAAM,GAAE,qBAA0B,EAClC,SAAS,GAAE,wBAA6B,GACvC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,yBAAyB,EAAE,CAAC,CAAC;YAkM5D,wBAAwB;YAiBxB,SAAS;YA2BT,gCAAgC;IA2B9C,kFAAkF;YACpE,uBAAuB;IA2CrC;;;;OAIG;YACW,gCAAgC;YA0BhC,oBAAoB;YA+BpB,wBAAwB;IA6CtC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;CAStC"}
|
|
@@ -13,9 +13,10 @@ import { DateProvider, Timer, elapsed, executeTimeout } from '@aztec/foundation/
|
|
|
13
13
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
14
14
|
import { ContractClassPublishedEvent } from '@aztec/protocol-contracts/class-registry';
|
|
15
15
|
import { computeFeePayerBalanceLeafSlot, computeFeePayerBalanceStorageSlot } from '@aztec/protocol-contracts/fee-juice';
|
|
16
|
-
import { PublicDataWrite } from '@aztec/stdlib/avm';
|
|
16
|
+
import { AvmCircuitInputs, PublicDataWrite } from '@aztec/stdlib/avm';
|
|
17
17
|
import { computeTransactionFee } from '@aztec/stdlib/fees';
|
|
18
18
|
import { Gas } from '@aztec/stdlib/gas';
|
|
19
|
+
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
19
20
|
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
20
21
|
import { NestedProcessReturnValues, Tx, TxExecutionPhase, makeProcessedTxFromPrivateOnlyTx, makeProcessedTxFromTxWithPublicCalls } from '@aztec/stdlib/tx';
|
|
21
22
|
import { Attributes, getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
|
|
@@ -384,12 +385,12 @@ class PublicProcessorTimeoutError extends Error {
|
|
|
384
385
|
}
|
|
385
386
|
async processTxWithPublicCalls(tx) {
|
|
386
387
|
const timer = new Timer();
|
|
387
|
-
const {
|
|
388
|
-
if (!
|
|
388
|
+
const { hints, publicInputs, gasUsed, revertCode, revertReason, processedPhases } = await this.publicTxSimulator.simulate(tx);
|
|
389
|
+
if (!hints) {
|
|
389
390
|
this.metrics.recordFailedTx();
|
|
390
391
|
throw new Error('Avm proving result was not generated.');
|
|
391
392
|
}
|
|
392
|
-
processedPhases
|
|
393
|
+
processedPhases?.forEach((phase)=>{
|
|
393
394
|
if (phase.reverted) {
|
|
394
395
|
this.metrics.recordRevertedPhase(phase.phase);
|
|
395
396
|
} else {
|
|
@@ -398,16 +399,24 @@ class PublicProcessorTimeoutError extends Error {
|
|
|
398
399
|
});
|
|
399
400
|
const contractClassLogs = revertCode.isOK() ? tx.getContractClassLogs() : tx.getSplitContractClassLogs(false);
|
|
400
401
|
this.metrics.recordClassPublication(...contractClassLogs.filter((log)=>ContractClassPublishedEvent.isContractClassPublishedEvent(log)).map((log)=>ContractClassPublishedEvent.fromLog(log)));
|
|
401
|
-
const phaseCount = processedPhases
|
|
402
|
+
const phaseCount = processedPhases?.length ?? 0;
|
|
402
403
|
const durationMs = timer.ms();
|
|
403
404
|
this.metrics.recordTx(phaseCount, durationMs, gasUsed.publicGas);
|
|
404
|
-
const processedTx = makeProcessedTxFromTxWithPublicCalls(tx,
|
|
405
|
-
const returnValues = processedPhases
|
|
405
|
+
const processedTx = makeProcessedTxFromTxWithPublicCalls(tx, PublicProcessor.generateProvingRequest(publicInputs, hints), gasUsed, revertCode, revertReason);
|
|
406
|
+
const returnValues = processedPhases?.find(({ phase })=>phase === TxExecutionPhase.APP_LOGIC)?.returnValues ?? [];
|
|
406
407
|
return [
|
|
407
408
|
processedTx,
|
|
408
409
|
returnValues
|
|
409
410
|
];
|
|
410
411
|
}
|
|
412
|
+
/**
|
|
413
|
+
* Generate the proving request for the AVM circuit.
|
|
414
|
+
*/ static generateProvingRequest(publicInputs, hints) {
|
|
415
|
+
return {
|
|
416
|
+
type: ProvingRequestType.PUBLIC_VM,
|
|
417
|
+
inputs: new AvmCircuitInputs(hints, publicInputs)
|
|
418
|
+
};
|
|
419
|
+
}
|
|
411
420
|
}
|
|
412
421
|
_ts_decorate([
|
|
413
422
|
trackSpan('PublicProcessor.processTx', (tx)=>({
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type Logger } from '@aztec/foundation/log';
|
|
2
|
+
import { PublicTxResult, type PublicTxSimulatorConfig } from '@aztec/stdlib/avm';
|
|
2
3
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
3
4
|
import type { GlobalVariables, Tx } from '@aztec/stdlib/tx';
|
|
4
5
|
import type { ExecutorMetricsInterface } from '../executor_metrics_interface.js';
|
|
5
6
|
import type { PublicContractsDB } from '../public_db_sources.js';
|
|
6
|
-
import {
|
|
7
|
+
import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
7
8
|
import type { MeasuredPublicTxSimulatorInterface, PublicTxSimulatorInterface } from './public_tx_simulator_interface.js';
|
|
8
9
|
/**
|
|
9
10
|
* C++ implementation of PublicTxSimulator using the C++ simulator.
|
|
@@ -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;
|
|
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;AAGlE,OAAO,EAIL,cAAc,EACd,KAAK,uBAAuB,EAE7B,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,EAA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+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,uBAAuB,CAAC;IAKrB,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,GAAE,MAAsB,GAAG,OAAO,CAAC,cAAc,CAAC;CAUjG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import { avmSimulate, avmSimulateWithHintedDbs } from '@aztec/native';
|
|
3
3
|
import { ProtocolContractsList } from '@aztec/protocol-contracts';
|
|
4
|
-
import { AvmFastSimulationInputs, AvmTxHint, deserializeFromMessagePack } from '@aztec/stdlib/avm';
|
|
4
|
+
import { AvmCircuitInputs, AvmFastSimulationInputs, AvmTxHint, PublicTxResult, deserializeFromMessagePack } from '@aztec/stdlib/avm';
|
|
5
5
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
6
6
|
import { WorldStateRevisionWithHandle } from '@aztec/stdlib/world-state';
|
|
7
7
|
import { strict as assert } from 'assert';
|
|
@@ -79,7 +79,11 @@ import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
|
79
79
|
assert(tsResult !== undefined, 'TS simulation should have succeeded if C++ succeeded');
|
|
80
80
|
assert(tsStateRef !== undefined, 'TS state reference should have been captured if C++ succeeded');
|
|
81
81
|
// Deserialize the msgpack result
|
|
82
|
-
|
|
82
|
+
// TODO(fcarreiro): complete this.
|
|
83
|
+
const cppResultJSON = deserializeFromMessagePack(resultBuffer);
|
|
84
|
+
const cppResult = PublicTxResult.fromJSON(cppResultJSON);
|
|
85
|
+
assert(cppResult.revertCode.equals(tsResult.revertCode));
|
|
86
|
+
assert(cppResult.gasUsed.totalGas.equals(tsResult.gasUsed.totalGas));
|
|
83
87
|
// Confirm that tree roots match
|
|
84
88
|
const cppStateRef = await this.merkleTree.getStateReference();
|
|
85
89
|
assert(cppStateRef.equals(tsStateRef), `Tree roots mismatch between TS and C++ public simulations for tx ${txHash}`);
|
|
@@ -141,7 +145,7 @@ export class MeasuredCppPublicTxSimulator extends CppPublicTxSimulator {
|
|
|
141
145
|
const tsResult = await super.simulate(tx);
|
|
142
146
|
this.log.debug(`TS simulation succeeded for tx ${txHash}`);
|
|
143
147
|
// Extract the full AvmCircuitInputs from the TS result
|
|
144
|
-
const avmCircuitInputs = tsResult.
|
|
148
|
+
const avmCircuitInputs = new AvmCircuitInputs(tsResult.hints, tsResult.publicInputs);
|
|
145
149
|
// Second, run C++ simulation with hinted DBs
|
|
146
150
|
this.log.debug(`Running C++ simulation with hinted DBs for tx ${txHash}`);
|
|
147
151
|
// Serialize to msgpack and call the C++ simulator
|
|
@@ -153,14 +157,17 @@ export class MeasuredCppPublicTxSimulator extends CppPublicTxSimulator {
|
|
|
153
157
|
throw new SimulationError(`C++ hinted simulation failed: ${error.message}`, []);
|
|
154
158
|
}
|
|
155
159
|
// Deserialize the msgpack result
|
|
156
|
-
const
|
|
160
|
+
const cppResultJSON = deserializeFromMessagePack(resultBuffer);
|
|
161
|
+
const cppResult = PublicTxResult.fromJSON(cppResultJSON);
|
|
162
|
+
assert(cppResult.revertCode.equals(tsResult.revertCode));
|
|
163
|
+
assert(cppResult.gasUsed.totalGas.equals(tsResult.gasUsed.totalGas));
|
|
157
164
|
this.log.debug(`C++ hinted simulation completed for tx ${txHash}`, {
|
|
158
165
|
txHash,
|
|
159
166
|
reverted: !tsResult.revertCode.isOK(),
|
|
160
167
|
tsGasUsed: tsResult.gasUsed.totalGas.l2Gas,
|
|
161
168
|
cppGasUsed: tsResult.gasUsed.totalGas.l2Gas
|
|
162
169
|
});
|
|
163
|
-
// TODO(
|
|
170
|
+
// TODO(fcarreiro): complete this.
|
|
164
171
|
return tsResult;
|
|
165
172
|
}
|
|
166
173
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './public_tx_simulator.js';
|
|
2
2
|
export type { PublicTxSimulatorInterface } from './public_tx_simulator_interface.js';
|
|
3
3
|
export { TelemetryPublicTxSimulator } from './telemetry_public_tx_simulator.js';
|
|
4
|
+
export type { PublicTxResult, PublicTxSimulatorConfig } from '@aztec/stdlib/avm';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,YAAY,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,YAAY,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,YAAY,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import type { ProcessedPhase, PublicTxResult, PublicTxSimulatorConfig } from '@aztec/stdlib/avm';
|
|
2
3
|
import type { Gas } from '@aztec/stdlib/gas';
|
|
3
4
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
4
5
|
import { type GlobalVariables, PublicCallRequestWithCalldata, Tx, TxExecutionPhase } from '@aztec/stdlib/tx';
|
|
@@ -7,7 +8,7 @@ import type { ExecutorMetricsInterface } from '../executor_metrics_interface.js'
|
|
|
7
8
|
import type { PublicContractsDB } from '../public_db_sources.js';
|
|
8
9
|
import type { PublicPersistableStateManager } from '../state_manager/state_manager.js';
|
|
9
10
|
import { PublicTxContext } from './public_tx_context.js';
|
|
10
|
-
import {
|
|
11
|
+
import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
11
12
|
import type { MeasuredPublicTxSimulatorInterface } from './public_tx_simulator_interface.js';
|
|
12
13
|
/**
|
|
13
14
|
* A public tx simulator that tracks miscellaneous simulation metrics without telemetry.
|
|
@@ -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,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,
|
|
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,cAAc,EAAE,cAAc,EAAE,uBAAuB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,WAAW,EAAE,6BAA6B,EAC1C,YAAY,EAAE,GAAG,EACjB,cAAc,EAAE,EAAE,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,sBAAsB,CAAC;CAsCnC"}
|
|
@@ -1,40 +1,14 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
2
|
import { type Logger } from '@aztec/foundation/log';
|
|
3
|
-
import { type
|
|
4
|
-
import {
|
|
5
|
-
import type { Gas, GasUsed } from '@aztec/stdlib/gas';
|
|
6
|
-
import type { DebugLog } from '@aztec/stdlib/logs';
|
|
3
|
+
import { type ProcessedPhase, PublicTxResult, type PublicTxSimulatorConfig } from '@aztec/stdlib/avm';
|
|
4
|
+
import type { Gas } from '@aztec/stdlib/gas';
|
|
7
5
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
8
|
-
import { type GlobalVariables,
|
|
6
|
+
import { type GlobalVariables, PublicCallRequestWithCalldata, Tx, TxExecutionPhase } from '@aztec/stdlib/tx';
|
|
9
7
|
import type { AvmFinalizedCallResult } from '../avm/avm_contract_call_result.js';
|
|
10
8
|
import { type PublicContractsDB } from '../public_db_sources.js';
|
|
11
9
|
import type { PublicPersistableStateManager } from '../state_manager/state_manager.js';
|
|
12
10
|
import { PublicTxContext } from './public_tx_context.js';
|
|
13
11
|
import type { PublicTxSimulatorInterface } from './public_tx_simulator_interface.js';
|
|
14
|
-
export type ProcessedPhase = {
|
|
15
|
-
phase: TxExecutionPhase;
|
|
16
|
-
durationMs?: number;
|
|
17
|
-
returnValues: NestedProcessReturnValues[];
|
|
18
|
-
reverted: boolean;
|
|
19
|
-
revertReason?: SimulationError;
|
|
20
|
-
};
|
|
21
|
-
export type PublicTxResult = {
|
|
22
|
-
avmProvingRequest: AvmProvingRequest;
|
|
23
|
-
/** Gas used during the execution of this tx */
|
|
24
|
-
gasUsed: GasUsed;
|
|
25
|
-
revertCode: RevertCode;
|
|
26
|
-
/** Revert reason, if any */
|
|
27
|
-
revertReason?: SimulationError;
|
|
28
|
-
processedPhases: ProcessedPhase[];
|
|
29
|
-
logs: DebugLog[];
|
|
30
|
-
};
|
|
31
|
-
export type PublicTxSimulatorConfig = {
|
|
32
|
-
proverId: Fr;
|
|
33
|
-
doMerkleOperations: boolean;
|
|
34
|
-
skipFeeEnforcement: boolean;
|
|
35
|
-
clientInitiatedSimulation: boolean;
|
|
36
|
-
maxDebugLogMemoryReads: number;
|
|
37
|
-
};
|
|
38
12
|
export declare class PublicTxSimulator implements PublicTxSimulatorInterface {
|
|
39
13
|
protected merkleTree: MerkleTreeWriteOperations;
|
|
40
14
|
protected contractsDB: PublicContractsDB;
|
|
@@ -92,9 +66,5 @@ export declare class PublicTxSimulator implements PublicTxSimulatorInterface {
|
|
|
92
66
|
*/
|
|
93
67
|
protected insertRevertiblesFromPrivate(context: PublicTxContext): Promise<void>;
|
|
94
68
|
private payFee;
|
|
95
|
-
/**
|
|
96
|
-
* Generate the proving request for the AVM circuit.
|
|
97
|
-
*/
|
|
98
|
-
private static generateProvingRequest;
|
|
99
69
|
}
|
|
100
70
|
//# 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,EAGL,KAAK,cAAc,EACnB,cAAc,EACd,KAAK,uBAAuB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W,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;IAwBlC;;OAEG;cACa,+BAA+B,CAAC,OAAO,EAAE,eAAe;IA2BxE;;;;;;;;OAQG;cACa,4BAA4B,CAAC,OAAO,EAAE,eAAe;YA4EvD,MAAM;CA8BrB"}
|
|
@@ -3,9 +3,8 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
3
3
|
import { 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 {
|
|
6
|
+
import { AvmExecutionHints, AvmTxHint, PublicTxResult } from '@aztec/stdlib/avm';
|
|
7
7
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
8
|
-
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
9
8
|
import { NestedProcessReturnValues, TxExecutionPhase } from '@aztec/stdlib/tx';
|
|
10
9
|
import { strict as assert } from 'assert';
|
|
11
10
|
import { AvmSimulator } from '../avm/index.js';
|
|
@@ -143,21 +142,13 @@ export class PublicTxSimulator {
|
|
|
143
142
|
assert(context.getActualGasUsed().l2Gas <= AVM_MAX_PROCESSABLE_L2_GAS, `Transaction consumes ${context.getActualGasUsed().l2Gas} L2 gas, which exceeds the AVM maximum processable gas of ${AVM_MAX_PROCESSABLE_L2_GAS}`);
|
|
144
143
|
await this.payFee(context);
|
|
145
144
|
const publicInputs = await context.generateAvmCircuitPublicInputs();
|
|
146
|
-
const avmProvingRequest = PublicTxSimulator.generateProvingRequest(publicInputs, hints);
|
|
147
145
|
const revertCode = context.getFinalRevertCode();
|
|
148
|
-
return {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
billedGas: context.getTotalGasUsed()
|
|
155
|
-
},
|
|
156
|
-
revertCode,
|
|
157
|
-
revertReason: context.revertReason,
|
|
158
|
-
processedPhases: processedPhases,
|
|
159
|
-
logs: context.state.getActiveStateManager().getLogs()
|
|
160
|
-
};
|
|
146
|
+
return new PublicTxResult(/*gasUsed=*/ {
|
|
147
|
+
totalGas: context.getActualGasUsed(),
|
|
148
|
+
teardownGas: context.teardownGasUsed,
|
|
149
|
+
publicGas: context.getActualPublicGasUsed(),
|
|
150
|
+
billedGas: context.getTotalGasUsed()
|
|
151
|
+
}, /*revertCode=*/ revertCode, /*revertReason=*/ context.revertReason, /*processedPhases=*/ processedPhases, /*logs=*/ context.state.getActiveStateManager().getLogs(), /*hints=*/ hints, /*publicInputs=*/ publicInputs);
|
|
161
152
|
}
|
|
162
153
|
computeTxHash(tx) {
|
|
163
154
|
return tx.getTxHash();
|
|
@@ -342,12 +333,4 @@ export class PublicTxSimulator {
|
|
|
342
333
|
const updatedBalance = currentBalance.sub(txFee);
|
|
343
334
|
await stateManager.writeStorage(feeJuiceAddress, balanceSlot, updatedBalance, true);
|
|
344
335
|
}
|
|
345
|
-
/**
|
|
346
|
-
* Generate the proving request for the AVM circuit.
|
|
347
|
-
*/ static generateProvingRequest(publicInputs, hints) {
|
|
348
|
-
return {
|
|
349
|
-
type: ProvingRequestType.PUBLIC_VM,
|
|
350
|
-
inputs: new AvmCircuitInputs(hints, publicInputs)
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
336
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_tx_simulator_interface.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/public_tx_simulator_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"public_tx_simulator_interface.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/public_tx_simulator_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC5D"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import type { PublicTxSimulatorConfig } from '@aztec/stdlib/avm';
|
|
2
3
|
import type { Gas } from '@aztec/stdlib/gas';
|
|
3
4
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
4
5
|
import { type GlobalVariables, PublicCallRequestWithCalldata, TxExecutionPhase } from '@aztec/stdlib/tx';
|
|
@@ -8,7 +9,6 @@ import type { PublicContractsDB } from '../public_db_sources.js';
|
|
|
8
9
|
import type { PublicPersistableStateManager } from '../state_manager/state_manager.js';
|
|
9
10
|
import { MeasuredPublicTxSimulator } from './measured_public_tx_simulator.js';
|
|
10
11
|
import { PublicTxContext } from './public_tx_context.js';
|
|
11
|
-
import type { PublicTxSimulatorConfig } from './public_tx_simulator.js';
|
|
12
12
|
/**
|
|
13
13
|
* A public tx simulator that tracks runtime/production metrics with telemetry.
|
|
14
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry_public_tx_simulator.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/telemetry_public_tx_simulator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,KAAK,eAAe,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzG,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,MAAM,EAAiC,MAAM,yBAAyB,CAAC;AAEvH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAEjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"telemetry_public_tx_simulator.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/telemetry_public_tx_simulator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,KAAK,eAAe,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzG,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,MAAM,EAAiC,MAAM,yBAAyB,CAAC;AAEvH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAEjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,yBAAyB;IAEvE,SAAgB,MAAM,EAAE,MAAM,CAAC;gBAG7B,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,iBAAiB,EAC9B,eAAe,EAAE,eAAe,EAChC,eAAe,GAAE,eAAsC,EACvD,MAAM,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC;cAalB,oBAAoB,CAC3C,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,6BAA6B,GACzC,OAAO,CAAC,sBAAsB,CAAC;cAUT,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;CAGnC"}
|
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.20251107",
|
|
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.20251107",
|
|
68
|
+
"@aztec/foundation": "3.0.0-nightly.20251107",
|
|
69
|
+
"@aztec/native": "3.0.0-nightly.20251107",
|
|
70
|
+
"@aztec/noir-acvm_js": "3.0.0-nightly.20251107",
|
|
71
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20251107",
|
|
72
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251107",
|
|
73
|
+
"@aztec/noir-types": "3.0.0-nightly.20251107",
|
|
74
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20251107",
|
|
75
|
+
"@aztec/stdlib": "3.0.0-nightly.20251107",
|
|
76
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20251107",
|
|
77
|
+
"@aztec/world-state": "3.0.0-nightly.20251107",
|
|
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.20251107",
|
|
84
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20251107",
|
|
85
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20251107",
|
|
86
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20251107",
|
|
87
87
|
"@jest/globals": "^30.0.0",
|
|
88
88
|
"@types/jest": "^30.0.0",
|
|
89
89
|
"@types/lodash.clonedeep": "^4.5.7",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FunctionType, emptyContractArtifact, emptyFunctionArtifact } from '@aztec/stdlib/abi';
|
|
2
|
+
import type { PublicTxResult } from '@aztec/stdlib/avm';
|
|
2
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
4
|
|
|
4
|
-
import type { PublicTxResult } from '../public_tx_simulator/public_tx_simulator.js';
|
|
5
5
|
import { PublicTxSimulationTester } from './public_tx_simulation_tester.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AvmCircuitInputs } from '@aztec/stdlib/avm';
|
|
1
|
+
import { AvmCircuitInputs, type PublicTxResult } from '@aztec/stdlib/avm';
|
|
2
2
|
import { ProtocolContracts } from '@aztec/stdlib/tx';
|
|
3
3
|
|
|
4
4
|
import avmMinimalCircuitInputsJson from '../../../artifacts/avm_minimal_inputs.json' with { type: 'json' };
|
|
@@ -6,7 +6,6 @@ import { TypeTag } from '../avm/avm_memory_types.js';
|
|
|
6
6
|
import { Add, Return, Set } from '../avm/opcodes/index.js';
|
|
7
7
|
import { encodeToBytecode } from '../avm/serialization/bytecode_serialization.js';
|
|
8
8
|
import { Opcode } from '../avm/serialization/instruction_serialization.js';
|
|
9
|
-
import type { PublicTxResult } from '../public_tx_simulator/public_tx_simulator.js';
|
|
10
9
|
import { testCustomBytecode } from './custom_bytecode_tester.js';
|
|
11
10
|
import { PublicTxSimulationTester } from './public_tx_simulation_tester.js';
|
|
12
11
|
|
|
@@ -21,8 +20,8 @@ export async function executeAvmMinimalPublicTx(tester: PublicTxSimulationTester
|
|
|
21
20
|
const result = await testCustomBytecode(minimalBytecode, tester, 'MinimalTx', 'AvmMinimalContract');
|
|
22
21
|
|
|
23
22
|
// Modify the protocol contracts to be all zeros
|
|
24
|
-
result.
|
|
25
|
-
result.
|
|
23
|
+
result.hints!.protocolContracts = ProtocolContracts.empty();
|
|
24
|
+
result.publicInputs.protocolContracts = ProtocolContracts.empty();
|
|
26
25
|
|
|
27
26
|
return result;
|
|
28
27
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { asyncMap } from '@aztec/foundation/async-map';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { type ContractArtifact, encodeArguments } from '@aztec/stdlib/abi';
|
|
4
|
+
import type { PublicTxResult } from '@aztec/stdlib/avm';
|
|
4
5
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
6
|
import { Gas, GasFees } from '@aztec/stdlib/gas';
|
|
6
7
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
|
|
@@ -18,7 +19,6 @@ import {
|
|
|
18
19
|
import { PublicContractsDB } from '../public_db_sources.js';
|
|
19
20
|
import { MeasuredCppPublicTxSimulator } from '../public_tx_simulator/cpp_public_tx_simulator.js';
|
|
20
21
|
import { MeasuredPublicTxSimulator } from '../public_tx_simulator/measured_public_tx_simulator.js';
|
|
21
|
-
import type { PublicTxResult } from '../public_tx_simulator/public_tx_simulator.js';
|
|
22
22
|
import type { MeasuredPublicTxSimulatorInterface } from '../public_tx_simulator/public_tx_simulator_interface.js';
|
|
23
23
|
import { TestExecutorMetrics } from '../test_executor_metrics.js';
|
|
24
24
|
import { SimpleContractDataSource } from './simple_contract_data_source.js';
|
|
@@ -133,8 +133,8 @@ 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.processedPhases
|
|
137
|
-
expectToBeTrue(balResult.processedPhases[0].returnValues.length == 1);
|
|
138
|
-
expectToBeTrue(balResult.processedPhases[0].returnValues[0].values!.length == 1);
|
|
139
|
-
expectToBeTrue(balResult.processedPhases[0].returnValues[0].values![0].toBigInt() == expectedBalance);
|
|
136
|
+
expectToBeTrue(balResult.processedPhases?.length == 1);
|
|
137
|
+
expectToBeTrue(balResult.processedPhases![0].returnValues.length == 1);
|
|
138
|
+
expectToBeTrue(balResult.processedPhases![0].returnValues[0].values!.length == 1);
|
|
139
|
+
expectToBeTrue(balResult.processedPhases![0].returnValues[0].values![0].toBigInt() == expectedBalance);
|
|
140
140
|
}
|
package/src/public/index.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
export { PublicContractsDB } from './public_db_sources.js';
|
|
2
2
|
export { GuardedMerkleTreeOperations } from './public_processor/guarded_merkle_tree.js';
|
|
3
3
|
export { PublicProcessor, PublicProcessorFactory } from './public_processor/public_processor.js';
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
type PublicTxSimulatorConfig,
|
|
7
|
-
TelemetryPublicTxSimulator,
|
|
8
|
-
type PublicTxResult,
|
|
9
|
-
} from './public_tx_simulator/index.js';
|
|
4
|
+
export { PublicTxSimulator, TelemetryPublicTxSimulator } from './public_tx_simulator/index.js';
|
|
5
|
+
export type { PublicTxResult, PublicTxSimulatorConfig } from '@aztec/stdlib/avm';
|
|
10
6
|
export { getCallRequestsWithCalldataByPhase } from './utils.js';
|
|
@@ -7,7 +7,13 @@ import { DateProvider, Timer, elapsed, executeTimeout } from '@aztec/foundation/
|
|
|
7
7
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
8
8
|
import { ContractClassPublishedEvent } from '@aztec/protocol-contracts/class-registry';
|
|
9
9
|
import { computeFeePayerBalanceLeafSlot, computeFeePayerBalanceStorageSlot } from '@aztec/protocol-contracts/fee-juice';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
AvmCircuitInputs,
|
|
12
|
+
AvmCircuitPublicInputs,
|
|
13
|
+
AvmExecutionHints,
|
|
14
|
+
type AvmProvingRequest,
|
|
15
|
+
PublicDataWrite,
|
|
16
|
+
} from '@aztec/stdlib/avm';
|
|
11
17
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
12
18
|
import type { ContractDataSource } from '@aztec/stdlib/contract';
|
|
13
19
|
import { computeTransactionFee } from '@aztec/stdlib/fees';
|
|
@@ -18,6 +24,7 @@ import type {
|
|
|
18
24
|
PublicProcessorValidator,
|
|
19
25
|
SequencerConfig,
|
|
20
26
|
} from '@aztec/stdlib/interfaces/server';
|
|
27
|
+
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
21
28
|
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
22
29
|
import {
|
|
23
30
|
type FailedTx,
|
|
@@ -524,15 +531,15 @@ export class PublicProcessor implements Traceable {
|
|
|
524
531
|
private async processTxWithPublicCalls(tx: Tx): Promise<[ProcessedTx, NestedProcessReturnValues[]]> {
|
|
525
532
|
const timer = new Timer();
|
|
526
533
|
|
|
527
|
-
const {
|
|
534
|
+
const { hints, publicInputs, gasUsed, revertCode, revertReason, processedPhases } =
|
|
528
535
|
await this.publicTxSimulator.simulate(tx);
|
|
529
536
|
|
|
530
|
-
if (!
|
|
537
|
+
if (!hints) {
|
|
531
538
|
this.metrics.recordFailedTx();
|
|
532
539
|
throw new Error('Avm proving result was not generated.');
|
|
533
540
|
}
|
|
534
541
|
|
|
535
|
-
processedPhases
|
|
542
|
+
processedPhases?.forEach(phase => {
|
|
536
543
|
if (phase.reverted) {
|
|
537
544
|
this.metrics.recordRevertedPhase(phase.phase);
|
|
538
545
|
} else {
|
|
@@ -549,14 +556,33 @@ export class PublicProcessor implements Traceable {
|
|
|
549
556
|
.map(log => ContractClassPublishedEvent.fromLog(log)),
|
|
550
557
|
);
|
|
551
558
|
|
|
552
|
-
const phaseCount = processedPhases
|
|
559
|
+
const phaseCount = processedPhases?.length ?? 0;
|
|
553
560
|
const durationMs = timer.ms();
|
|
554
561
|
this.metrics.recordTx(phaseCount, durationMs, gasUsed.publicGas);
|
|
555
562
|
|
|
556
|
-
const processedTx = makeProcessedTxFromTxWithPublicCalls(
|
|
563
|
+
const processedTx = makeProcessedTxFromTxWithPublicCalls(
|
|
564
|
+
tx,
|
|
565
|
+
PublicProcessor.generateProvingRequest(publicInputs, hints),
|
|
566
|
+
gasUsed,
|
|
567
|
+
revertCode,
|
|
568
|
+
revertReason,
|
|
569
|
+
);
|
|
557
570
|
|
|
558
|
-
const returnValues = processedPhases
|
|
571
|
+
const returnValues = processedPhases?.find(({ phase }) => phase === TxExecutionPhase.APP_LOGIC)?.returnValues ?? [];
|
|
559
572
|
|
|
560
573
|
return [processedTx, returnValues];
|
|
561
574
|
}
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Generate the proving request for the AVM circuit.
|
|
578
|
+
*/
|
|
579
|
+
private static generateProvingRequest(
|
|
580
|
+
publicInputs: AvmCircuitPublicInputs,
|
|
581
|
+
hints: AvmExecutionHints,
|
|
582
|
+
): AvmProvingRequest {
|
|
583
|
+
return {
|
|
584
|
+
type: ProvingRequestType.PUBLIC_VM,
|
|
585
|
+
inputs: new AvmCircuitInputs(hints, publicInputs),
|
|
586
|
+
};
|
|
587
|
+
}
|
|
562
588
|
}
|
|
@@ -53,7 +53,7 @@ export class ContractProviderForCpp implements ContractProvider {
|
|
|
53
53
|
public addContracts = async (contractDeploymentDataBuffer: Buffer): Promise<void> => {
|
|
54
54
|
this.log.debug(`Contract provider callback: addContracts`);
|
|
55
55
|
|
|
56
|
-
const rawData = deserializeFromMessagePack
|
|
56
|
+
const rawData: any = deserializeFromMessagePack(contractDeploymentDataBuffer);
|
|
57
57
|
|
|
58
58
|
// Construct class instances using the from method
|
|
59
59
|
const contractDeploymentData = this.reconstructContractDeploymentData(rawData);
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import { avmSimulate, avmSimulateWithHintedDbs } from '@aztec/native';
|
|
3
3
|
import { ProtocolContractsList } from '@aztec/protocol-contracts';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
AvmCircuitInputs,
|
|
6
|
+
AvmFastSimulationInputs,
|
|
7
|
+
AvmTxHint,
|
|
8
|
+
PublicTxResult,
|
|
9
|
+
type PublicTxSimulatorConfig,
|
|
10
|
+
deserializeFromMessagePack,
|
|
11
|
+
} from '@aztec/stdlib/avm';
|
|
5
12
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
6
13
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
7
14
|
import type { GlobalVariables, StateReference, Tx } from '@aztec/stdlib/tx';
|
|
@@ -12,7 +19,7 @@ import { strict as assert } from 'assert';
|
|
|
12
19
|
import type { ExecutorMetricsInterface } from '../executor_metrics_interface.js';
|
|
13
20
|
import type { PublicContractsDB } from '../public_db_sources.js';
|
|
14
21
|
import { ContractProviderForCpp } from './contract_provider_for_cpp.js';
|
|
15
|
-
import {
|
|
22
|
+
import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
16
23
|
import type {
|
|
17
24
|
MeasuredPublicTxSimulatorInterface,
|
|
18
25
|
PublicTxSimulatorInterface,
|
|
@@ -114,7 +121,11 @@ export class CppPublicTxSimulator extends PublicTxSimulator implements PublicTxS
|
|
|
114
121
|
assert(tsStateRef !== undefined, 'TS state reference should have been captured if C++ succeeded');
|
|
115
122
|
|
|
116
123
|
// Deserialize the msgpack result
|
|
117
|
-
|
|
124
|
+
// TODO(fcarreiro): complete this.
|
|
125
|
+
const cppResultJSON: object = deserializeFromMessagePack(resultBuffer);
|
|
126
|
+
const cppResult = PublicTxResult.fromJSON(cppResultJSON);
|
|
127
|
+
assert(cppResult.revertCode.equals(tsResult.revertCode));
|
|
128
|
+
assert(cppResult.gasUsed.totalGas.equals(tsResult.gasUsed.totalGas));
|
|
118
129
|
|
|
119
130
|
// Confirm that tree roots match
|
|
120
131
|
const cppStateRef = await this.merkleTree.getStateReference();
|
|
@@ -202,7 +213,7 @@ export class CppPublicTxSimulatorHintedDbs extends PublicTxSimulator implements
|
|
|
202
213
|
this.log.debug(`TS simulation succeeded for tx ${txHash}`);
|
|
203
214
|
|
|
204
215
|
// Extract the full AvmCircuitInputs from the TS result
|
|
205
|
-
const avmCircuitInputs = tsResult.
|
|
216
|
+
const avmCircuitInputs = new AvmCircuitInputs(tsResult.hints!, tsResult.publicInputs);
|
|
206
217
|
|
|
207
218
|
// Second, run C++ simulation with hinted DBs
|
|
208
219
|
this.log.debug(`Running C++ simulation with hinted DBs for tx ${txHash}`);
|
|
@@ -218,7 +229,11 @@ export class CppPublicTxSimulatorHintedDbs extends PublicTxSimulator implements
|
|
|
218
229
|
}
|
|
219
230
|
|
|
220
231
|
// Deserialize the msgpack result
|
|
221
|
-
const
|
|
232
|
+
const cppResultJSON: object = deserializeFromMessagePack(resultBuffer);
|
|
233
|
+
const cppResult = PublicTxResult.fromJSON(cppResultJSON);
|
|
234
|
+
|
|
235
|
+
assert(cppResult.revertCode.equals(tsResult.revertCode));
|
|
236
|
+
assert(cppResult.gasUsed.totalGas.equals(tsResult.gasUsed.totalGas));
|
|
222
237
|
|
|
223
238
|
this.log.debug(`C++ hinted simulation completed for tx ${txHash}`, {
|
|
224
239
|
txHash,
|
|
@@ -227,7 +242,7 @@ export class CppPublicTxSimulatorHintedDbs extends PublicTxSimulator implements
|
|
|
227
242
|
cppGasUsed: tsResult.gasUsed.totalGas.l2Gas,
|
|
228
243
|
});
|
|
229
244
|
|
|
230
|
-
// TODO(
|
|
245
|
+
// TODO(fcarreiro): complete this.
|
|
231
246
|
return tsResult;
|
|
232
247
|
}
|
|
233
248
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * from './public_tx_simulator.js';
|
|
2
2
|
export type { PublicTxSimulatorInterface } from './public_tx_simulator_interface.js';
|
|
3
3
|
export { TelemetryPublicTxSimulator } from './telemetry_public_tx_simulator.js';
|
|
4
|
+
export type { PublicTxResult, PublicTxSimulatorConfig } from '@aztec/stdlib/avm';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
2
|
import { Timer } from '@aztec/foundation/timer';
|
|
3
|
+
import type { ProcessedPhase, PublicTxResult, PublicTxSimulatorConfig } from '@aztec/stdlib/avm';
|
|
3
4
|
import type { Gas } from '@aztec/stdlib/gas';
|
|
4
5
|
import type { AvmSimulationStats } from '@aztec/stdlib/stats';
|
|
5
6
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
@@ -10,12 +11,7 @@ import type { ExecutorMetricsInterface } from '../executor_metrics_interface.js'
|
|
|
10
11
|
import type { PublicContractsDB } from '../public_db_sources.js';
|
|
11
12
|
import type { PublicPersistableStateManager } from '../state_manager/state_manager.js';
|
|
12
13
|
import { PublicTxContext } from './public_tx_context.js';
|
|
13
|
-
import {
|
|
14
|
-
type ProcessedPhase,
|
|
15
|
-
type PublicTxResult,
|
|
16
|
-
PublicTxSimulator,
|
|
17
|
-
type PublicTxSimulatorConfig,
|
|
18
|
-
} from './public_tx_simulator.js';
|
|
14
|
+
import { PublicTxSimulator } from './public_tx_simulator.js';
|
|
19
15
|
import type { MeasuredPublicTxSimulatorInterface } from './public_tx_simulator_interface.js';
|
|
20
16
|
|
|
21
17
|
/**
|
|
@@ -4,17 +4,14 @@ 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
6
|
import {
|
|
7
|
-
AvmCircuitInputs,
|
|
8
|
-
AvmCircuitPublicInputs,
|
|
9
7
|
AvmExecutionHints,
|
|
10
|
-
type AvmProvingRequest,
|
|
11
8
|
AvmTxHint,
|
|
12
|
-
type
|
|
9
|
+
type ProcessedPhase,
|
|
10
|
+
PublicTxResult,
|
|
11
|
+
type PublicTxSimulatorConfig,
|
|
13
12
|
} from '@aztec/stdlib/avm';
|
|
14
13
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
15
|
-
import type { Gas
|
|
16
|
-
import type { DebugLog } from '@aztec/stdlib/logs';
|
|
17
|
-
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
14
|
+
import type { Gas } from '@aztec/stdlib/gas';
|
|
18
15
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
19
16
|
import {
|
|
20
17
|
type GlobalVariables,
|
|
@@ -41,33 +38,6 @@ import type { PublicPersistableStateManager } from '../state_manager/state_manag
|
|
|
41
38
|
import { PublicTxContext } from './public_tx_context.js';
|
|
42
39
|
import type { PublicTxSimulatorInterface } from './public_tx_simulator_interface.js';
|
|
43
40
|
|
|
44
|
-
export type ProcessedPhase = {
|
|
45
|
-
phase: TxExecutionPhase;
|
|
46
|
-
durationMs?: number;
|
|
47
|
-
returnValues: NestedProcessReturnValues[];
|
|
48
|
-
reverted: boolean;
|
|
49
|
-
revertReason?: SimulationError;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export type PublicTxResult = {
|
|
53
|
-
avmProvingRequest: AvmProvingRequest;
|
|
54
|
-
/** Gas used during the execution of this tx */
|
|
55
|
-
gasUsed: GasUsed;
|
|
56
|
-
revertCode: RevertCode;
|
|
57
|
-
/** Revert reason, if any */
|
|
58
|
-
revertReason?: SimulationError;
|
|
59
|
-
processedPhases: ProcessedPhase[];
|
|
60
|
-
logs: DebugLog[];
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export type PublicTxSimulatorConfig = {
|
|
64
|
-
proverId: Fr;
|
|
65
|
-
doMerkleOperations: boolean;
|
|
66
|
-
skipFeeEnforcement: boolean;
|
|
67
|
-
clientInitiatedSimulation: boolean;
|
|
68
|
-
maxDebugLogMemoryReads: number;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
41
|
// The errors below are only thrown here in the public tx simulator,
|
|
72
42
|
// and only during revertible phases (revertible insertions, app logic and teardown).
|
|
73
43
|
// These are strictly "checked" errors (not exported and never propagated).
|
|
@@ -232,23 +202,22 @@ export class PublicTxSimulator implements PublicTxSimulatorInterface {
|
|
|
232
202
|
await this.payFee(context);
|
|
233
203
|
|
|
234
204
|
const publicInputs = await context.generateAvmCircuitPublicInputs();
|
|
235
|
-
const avmProvingRequest = PublicTxSimulator.generateProvingRequest(publicInputs, hints);
|
|
236
|
-
|
|
237
205
|
const revertCode = context.getFinalRevertCode();
|
|
238
206
|
|
|
239
|
-
return
|
|
240
|
-
|
|
241
|
-
gasUsed: {
|
|
207
|
+
return new PublicTxResult(
|
|
208
|
+
/*gasUsed=*/ {
|
|
242
209
|
totalGas: context.getActualGasUsed(),
|
|
243
210
|
teardownGas: context.teardownGasUsed,
|
|
244
211
|
publicGas: context.getActualPublicGasUsed(),
|
|
245
212
|
billedGas: context.getTotalGasUsed(),
|
|
246
213
|
},
|
|
247
|
-
revertCode,
|
|
248
|
-
revertReason
|
|
249
|
-
processedPhases
|
|
250
|
-
logs
|
|
251
|
-
|
|
214
|
+
/*revertCode=*/ revertCode,
|
|
215
|
+
/*revertReason=*/ context.revertReason,
|
|
216
|
+
/*processedPhases=*/ processedPhases,
|
|
217
|
+
/*logs=*/ context.state.getActiveStateManager().getLogs(),
|
|
218
|
+
/*hints=*/ hints,
|
|
219
|
+
/*publicInputs=*/ publicInputs,
|
|
220
|
+
);
|
|
252
221
|
}
|
|
253
222
|
|
|
254
223
|
protected computeTxHash(tx: Tx) {
|
|
@@ -525,17 +494,4 @@ export class PublicTxSimulator implements PublicTxSimulatorInterface {
|
|
|
525
494
|
const updatedBalance = currentBalance.sub(txFee);
|
|
526
495
|
await stateManager.writeStorage(feeJuiceAddress, balanceSlot, updatedBalance, true);
|
|
527
496
|
}
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* Generate the proving request for the AVM circuit.
|
|
531
|
-
*/
|
|
532
|
-
private static generateProvingRequest(
|
|
533
|
-
publicInputs: AvmCircuitPublicInputs,
|
|
534
|
-
hints: AvmExecutionHints,
|
|
535
|
-
): AvmProvingRequest {
|
|
536
|
-
return {
|
|
537
|
-
type: ProvingRequestType.PUBLIC_VM,
|
|
538
|
-
inputs: new AvmCircuitInputs(hints, publicInputs),
|
|
539
|
-
};
|
|
540
|
-
}
|
|
541
497
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import type { PublicTxResult } from '@aztec/stdlib/avm';
|
|
1
2
|
import type { Tx } from '@aztec/stdlib/tx';
|
|
2
3
|
|
|
3
|
-
import type { PublicTxResult } from './public_tx_simulator.js';
|
|
4
|
-
|
|
5
4
|
export interface PublicTxSimulatorInterface {
|
|
6
5
|
simulate(tx: Tx): Promise<PublicTxResult>;
|
|
7
6
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import type { PublicTxSimulatorConfig } from '@aztec/stdlib/avm';
|
|
2
3
|
import type { Gas } from '@aztec/stdlib/gas';
|
|
3
4
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
4
5
|
import { type GlobalVariables, PublicCallRequestWithCalldata, TxExecutionPhase } from '@aztec/stdlib/tx';
|
|
@@ -10,7 +11,6 @@ import type { PublicContractsDB } from '../public_db_sources.js';
|
|
|
10
11
|
import type { PublicPersistableStateManager } from '../state_manager/state_manager.js';
|
|
11
12
|
import { MeasuredPublicTxSimulator } from './measured_public_tx_simulator.js';
|
|
12
13
|
import { PublicTxContext } from './public_tx_context.js';
|
|
13
|
-
import type { PublicTxSimulatorConfig } from './public_tx_simulator.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* A public tx simulator that tracks runtime/production metrics with telemetry.
|