@aztec/simulator 0.0.1-commit.b9865e97 → 0.0.1-commit.be03c316
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/client.d.ts +1 -3
- package/dest/client.d.ts.map +1 -1
- package/dest/client.js +0 -2
- package/dest/private/circuit_recording/circuit_recorder.d.ts +36 -23
- package/dest/private/circuit_recording/circuit_recorder.d.ts.map +1 -1
- package/dest/private/circuit_recording/circuit_recorder.js +65 -69
- package/dest/private/circuit_recording/file_circuit_recorder.d.ts +7 -19
- package/dest/private/circuit_recording/file_circuit_recorder.d.ts.map +1 -1
- package/dest/private/circuit_recording/file_circuit_recorder.js +38 -42
- package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts +1 -1
- package/dest/private/circuit_recording/simulator_recorder_wrapper.d.ts.map +1 -1
- package/dest/private/circuit_recording/simulator_recorder_wrapper.js +11 -14
- package/dest/public/avm/testing/base_avm_simulation_tester.js +1 -1
- package/dest/public/avm/testing/utils.js +1 -1
- package/dest/public/avm_simulator.d.ts +28 -0
- package/dest/public/avm_simulator.d.ts.map +1 -0
- package/dest/public/avm_simulator.js +4 -0
- package/dest/public/avm_simulator_pool.d.ts +45 -0
- package/dest/public/avm_simulator_pool.d.ts.map +1 -0
- package/dest/public/avm_simulator_pool.js +197 -0
- package/dest/public/cdb/generated/api_types.d.ts +171 -0
- package/dest/public/cdb/generated/api_types.d.ts.map +1 -0
- package/dest/public/cdb/generated/api_types.js +314 -0
- package/dest/public/cdb/generated/server.d.ts +26 -0
- package/dest/public/cdb/generated/server.d.ts.map +1 -0
- package/dest/public/cdb/generated/server.js +135 -0
- package/dest/public/cdb_ipc_server.d.ts +33 -0
- package/dest/public/cdb_ipc_server.d.ts.map +1 -0
- package/dest/public/cdb_ipc_server.js +153 -0
- package/dest/public/fixtures/amm_test.js +2 -2
- package/dest/public/fixtures/bulk_test.js +2 -2
- 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_tester.js +2 -2
- package/dest/public/fixtures/index.d.ts +2 -1
- package/dest/public/fixtures/index.d.ts.map +1 -1
- package/dest/public/fixtures/index.js +1 -0
- package/dest/public/fixtures/public_processor_test_env.d.ts +30 -0
- package/dest/public/fixtures/public_processor_test_env.d.ts.map +1 -0
- package/dest/public/fixtures/public_processor_test_env.js +73 -0
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts +9 -5
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +1 -1
- package/dest/public/fixtures/public_tx_simulation_tester.js +29 -38
- package/dest/public/fixtures/token_test.js +3 -3
- package/dest/public/fixtures/utils.d.ts +1 -1
- package/dest/public/fixtures/utils.d.ts.map +1 -1
- package/dest/public/fixtures/utils.js +5 -3
- package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts +7 -2
- package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts.map +1 -1
- package/dest/public/fuzzing/avm_fuzzer_simulator.js +15 -6
- package/dest/public/index.d.ts +5 -2
- package/dest/public/index.d.ts.map +1 -1
- package/dest/public/index.js +2 -1
- package/dest/public/public_db_sources.d.ts +2 -2
- package/dest/public/public_db_sources.d.ts.map +1 -1
- package/dest/public/public_db_sources.js +1 -1
- package/dest/public/public_processor/public_processor.d.ts +8 -4
- package/dest/public/public_processor/public_processor.d.ts.map +1 -1
- package/dest/public/public_processor/public_processor.js +17 -13
- package/dest/public/public_tx_simulator/dumping_public_tx_simulator.d.ts +6 -12
- package/dest/public/public_tx_simulator/dumping_public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/dumping_public_tx_simulator.js +8 -21
- package/dest/public/public_tx_simulator/factories.d.ts +5 -5
- package/dest/public/public_tx_simulator/factories.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/factories.js +5 -5
- package/dest/public/public_tx_simulator/index.d.ts +3 -3
- package/dest/public/public_tx_simulator/index.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/index.js +1 -1
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts +16 -16
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/public_tx_simulator.js +59 -58
- package/dest/public/public_tx_simulator/public_tx_simulator_base.d.ts +10 -8
- package/dest/public/public_tx_simulator/public_tx_simulator_base.d.ts.map +1 -1
- package/dest/public/public_tx_simulator/public_tx_simulator_base.js +11 -8
- package/dest/public/public_tx_simulator/public_tx_simulator_interface.d.ts +5 -5
- package/dest/public/test_executor_metrics.d.ts +1 -6
- package/dest/public/test_executor_metrics.d.ts.map +1 -1
- package/dest/public/test_executor_metrics.js +0 -22
- package/package.json +21 -17
- package/src/client.ts +0 -2
- package/src/private/circuit_recording/circuit_recorder.ts +84 -78
- package/src/private/circuit_recording/file_circuit_recorder.ts +38 -48
- package/src/private/circuit_recording/simulator_recorder_wrapper.ts +9 -15
- package/src/public/avm/testing/base_avm_simulation_tester.ts +1 -1
- package/src/public/avm/testing/utils.ts +1 -1
- package/src/public/avm_simulator.ts +29 -0
- package/src/public/avm_simulator_pool.ts +226 -0
- package/src/public/cdb/generated/api_types.ts +457 -0
- package/src/public/cdb/generated/server.ts +109 -0
- package/src/public/cdb_ipc_server.ts +197 -0
- package/src/public/fixtures/amm_test.ts +2 -2
- package/src/public/fixtures/bulk_test.ts +2 -2
- package/src/public/fixtures/custom_bytecode_tester.ts +2 -2
- package/src/public/fixtures/index.ts +1 -0
- package/src/public/fixtures/public_processor_test_env.ts +88 -0
- package/src/public/fixtures/public_tx_simulation_tester.ts +37 -48
- package/src/public/fixtures/token_test.ts +3 -3
- package/src/public/fixtures/utils.ts +6 -11
- package/src/public/fuzzing/avm_fuzzer_simulator.ts +28 -10
- package/src/public/index.ts +4 -0
- package/src/public/public_db_sources.ts +1 -1
- package/src/public/public_processor/public_processor.ts +22 -15
- package/src/public/public_tx_simulator/dumping_public_tx_simulator.ts +13 -29
- package/src/public/public_tx_simulator/factories.ts +24 -7
- package/src/public/public_tx_simulator/index.ts +5 -2
- package/src/public/public_tx_simulator/public_tx_simulator.ts +70 -81
- package/src/public/public_tx_simulator/public_tx_simulator_base.ts +8 -6
- package/src/public/public_tx_simulator/public_tx_simulator_interface.ts +5 -5
- package/src/public/test_executor_metrics.ts +0 -24
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.d.ts +0 -19
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.d.ts.map +0 -1
- package/dest/public/public_tx_simulator/contract_provider_for_cpp.js +0 -99
- package/src/public/public_tx_simulator/contract_provider_for_cpp.ts +0 -125
|
@@ -1,107 +1,108 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import { sleep } from '@aztec/foundation/sleep';
|
|
3
|
-
import { avmSimulate, cancelSimulation, createCancellationToken } from '@aztec/native';
|
|
4
|
-
import { ProtocolContractsList } from '@aztec/protocol-contracts';
|
|
5
3
|
import { AvmFastSimulationInputs, AvmTxHint, PublicTxResult, deserializeFromMessagePack } from '@aztec/stdlib/avm';
|
|
6
4
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
5
|
+
import { WorldStateRevision } from '@aztec/stdlib/world-state';
|
|
7
6
|
import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
8
7
|
import { ExecutorMetrics } from '../executor_metrics.js';
|
|
9
|
-
import { ContractProviderForCpp } from './contract_provider_for_cpp.js';
|
|
10
8
|
import { PublicTxSimulatorBase } from './public_tx_simulator_base.js';
|
|
11
9
|
/**
|
|
12
|
-
* Simulates a transaction's public portion
|
|
13
|
-
*
|
|
14
|
-
* For contract DB accesses, it makes callbacks through NAPI back to the TS PublicContractsDB cache.
|
|
10
|
+
* Simulates a transaction's public portion by running its public calls through an {@link AvmSimulator}.
|
|
11
|
+
* `forkId` selects the fork whose contract data the simulation reads.
|
|
15
12
|
*/ export class PublicTxSimulator extends PublicTxSimulatorBase {
|
|
16
13
|
log;
|
|
17
|
-
/**
|
|
14
|
+
/** Aborts the in-flight simulation. */ abortController;
|
|
18
15
|
/** Current simulation promise, used to wait for completion after cancellation. */ simulationPromise;
|
|
19
|
-
constructor(
|
|
20
|
-
super(
|
|
16
|
+
constructor(avmSimulator, globalVariables, contractsDB, forkId, config, bindings){
|
|
17
|
+
super(avmSimulator, globalVariables, contractsDB, forkId, config, undefined, bindings);
|
|
21
18
|
this.log = createLogger(`simulator:public_tx_simulator`, bindings);
|
|
22
19
|
}
|
|
23
20
|
/**
|
|
24
|
-
* Simulate a transaction's public portion
|
|
21
|
+
* Simulate a transaction's public portion.
|
|
25
22
|
*
|
|
26
23
|
* @param tx - The transaction to simulate.
|
|
27
24
|
* @returns The result of the transaction's public execution.
|
|
28
25
|
*/ async simulate(tx) {
|
|
26
|
+
this.abortController = new AbortController();
|
|
27
|
+
this.simulationPromise = this.doSimulate(tx, this.abortController.signal);
|
|
28
|
+
try {
|
|
29
|
+
return await this.simulationPromise;
|
|
30
|
+
} finally{
|
|
31
|
+
this.abortController = undefined;
|
|
32
|
+
this.simulationPromise = undefined;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async doSimulate(tx, signal) {
|
|
29
36
|
const txHash = this.computeTxHash(tx);
|
|
30
|
-
this.log.debug(`
|
|
37
|
+
this.log.debug(`Simulating ${tx.publicFunctionCalldata.length} public calls for tx ${txHash}, forkId=${this.forkId}`, {
|
|
31
38
|
txHash
|
|
32
39
|
});
|
|
33
|
-
|
|
34
|
-
const wsdbIpcPath = this.merkleTree.getIpcPath();
|
|
35
|
-
this.log.trace(`Running C++ simulation with world state revision ${JSON.stringify(wsRevision)}`);
|
|
36
|
-
// Create the fast simulation inputs
|
|
40
|
+
// Create the fast simulation inputs.
|
|
37
41
|
const txHint = AvmTxHint.fromTx(tx, this.globalVariables.gasFees);
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
const fastSimInputs = new AvmFastSimulationInputs(// blockNumber: WorldStateRevision.LATEST sentinel so the WSDB walks the fork's current
|
|
43
|
+
// uncommitted state. Using 0 here makes WSDB treat this as a historical query against
|
|
44
|
+
// the empty genesis tree and miss any in-fork uncommitted leaves (deployed contracts,
|
|
45
|
+
// etc.) from earlier txs in the same block.
|
|
46
|
+
{
|
|
47
|
+
forkId: this.forkId,
|
|
48
|
+
blockNumber: WorldStateRevision.LATEST,
|
|
49
|
+
includeUncommitted: true
|
|
50
|
+
}, this.config, txHint, this.globalVariables, this.protocolContracts);
|
|
43
51
|
this.log.trace(`Serializing fast simulation inputs to msgpack...`);
|
|
44
52
|
const inputBuffer = fastSimInputs.serializeWithMessagePack();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
this.log.debug(`Running AVM simulation for tx ${txHash}`);
|
|
54
|
+
const context = {
|
|
55
|
+
contractsDB: this.contractsDB,
|
|
56
|
+
forkId: this.forkId,
|
|
57
|
+
timestamp: this.globalVariables.timestamp
|
|
58
|
+
};
|
|
50
59
|
let resultBuffer;
|
|
51
60
|
try {
|
|
52
|
-
resultBuffer = await this.
|
|
61
|
+
resultBuffer = await this.avmSimulator.simulate(inputBuffer, context, signal);
|
|
53
62
|
} catch (error) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
throw new SimulationError(`C++ simulation cancelled`, []);
|
|
63
|
+
if (error.message?.includes('cancelled')) {
|
|
64
|
+
throw new SimulationError(`AVM simulation cancelled`, []);
|
|
57
65
|
}
|
|
58
|
-
throw new SimulationError(`
|
|
59
|
-
} finally{
|
|
60
|
-
this.cancellationToken = undefined;
|
|
61
|
-
this.simulationPromise = undefined;
|
|
66
|
+
throw new SimulationError(`AVM simulation failed: ${error.message}`, []);
|
|
62
67
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
this.log.trace(`Deserializing C++ result to PublicTxResult...`);
|
|
68
|
-
const cppResult = PublicTxResult.fromPlainObject(cppResultJSON);
|
|
69
|
-
this.log.trace(`C++ simulation completed for tx ${txHash}`, {
|
|
68
|
+
this.log.trace(`Deserializing simulation result from buffer (size: ${resultBuffer.length})...`);
|
|
69
|
+
const resultJSON = deserializeFromMessagePack(Buffer.from(resultBuffer));
|
|
70
|
+
const result = PublicTxResult.fromPlainObject(resultJSON);
|
|
71
|
+
this.log.trace(`AVM simulation completed for tx ${txHash}`, {
|
|
70
72
|
txHash,
|
|
71
|
-
reverted: !
|
|
72
|
-
|
|
73
|
+
reverted: !result.revertCode.isOK(),
|
|
74
|
+
l2GasUsed: result.gasUsed.totalGas.l2Gas
|
|
73
75
|
});
|
|
74
|
-
return
|
|
76
|
+
return result;
|
|
75
77
|
}
|
|
76
78
|
/**
|
|
77
79
|
* Cancel the current simulation if one is in progress.
|
|
78
|
-
* This signals the
|
|
79
|
-
* Safe to call even if no simulation is in progress.
|
|
80
|
+
* This signals the underlying simulator to stop at the next safe point (between opcodes, before a
|
|
81
|
+
* world-state write). Safe to call even if no simulation is in progress.
|
|
80
82
|
*
|
|
81
83
|
* @param waitTimeoutMs - If provided, wait up to this many ms for the simulation to actually stop.
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
+
* Cancellation is cooperative: the simulator may be mid slow-operation and
|
|
85
|
+
* won't observe the cancellation until it completes.
|
|
84
86
|
* Default timeout of 100ms after cancellation.
|
|
85
87
|
*/ async cancel(waitTimeoutMs = 100) {
|
|
86
|
-
if (this.
|
|
87
|
-
this.log.debug('Cancelling
|
|
88
|
-
|
|
88
|
+
if (this.abortController) {
|
|
89
|
+
this.log.debug('Cancelling AVM simulation');
|
|
90
|
+
this.abortController.abort();
|
|
89
91
|
}
|
|
90
|
-
// Wait for the simulation to actually complete if not already done
|
|
91
92
|
if (this.simulationPromise) {
|
|
92
|
-
this.log.debug(`Waiting up to ${waitTimeoutMs}ms for
|
|
93
|
+
this.log.debug(`Waiting up to ${waitTimeoutMs}ms for AVM simulation to stop`);
|
|
93
94
|
await Promise.race([
|
|
94
95
|
this.simulationPromise.catch(()=>{}),
|
|
95
96
|
sleep(waitTimeoutMs)
|
|
96
97
|
]);
|
|
97
|
-
this.log.debug('
|
|
98
|
+
this.log.debug('AVM simulation stopped or wait timed out');
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
export class MeasuredPublicTxSimulator extends PublicTxSimulator {
|
|
102
103
|
metrics;
|
|
103
|
-
constructor(
|
|
104
|
-
super(
|
|
104
|
+
constructor(avmSimulator, globalVariables, contractsDB, forkId, metrics, config, bindings){
|
|
105
|
+
super(avmSimulator, globalVariables, contractsDB, forkId, config, bindings), this.metrics = metrics;
|
|
105
106
|
}
|
|
106
107
|
async simulate(tx, txLabel = 'unlabeledTx') {
|
|
107
108
|
this.metrics.startRecordingTxSimulation(txLabel);
|
|
@@ -115,12 +116,12 @@ export class MeasuredPublicTxSimulator extends PublicTxSimulator {
|
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
/**
|
|
118
|
-
* A
|
|
119
|
+
* A public tx simulator that tracks runtime/production metrics with telemetry.
|
|
119
120
|
*/ export class TelemetryPublicTxSimulator extends MeasuredPublicTxSimulator {
|
|
120
121
|
/* tracer needed by trackSpans */ tracer;
|
|
121
|
-
constructor(
|
|
122
|
+
constructor(avmSimulator, globalVariables, contractsDB, forkId, telemetryClient = getTelemetryClient(), config, bindings){
|
|
122
123
|
const metrics = new ExecutorMetrics(telemetryClient, 'PublicTxSimulator');
|
|
123
|
-
super(
|
|
124
|
+
super(avmSimulator, globalVariables, contractsDB, forkId, metrics, config, bindings);
|
|
124
125
|
this.tracer = metrics.tracer;
|
|
125
126
|
}
|
|
126
127
|
}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { type Logger, type LoggerBindings } from '@aztec/foundation/log';
|
|
2
2
|
import { PublicSimulatorConfig } from '@aztec/stdlib/avm';
|
|
3
|
-
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/trees';
|
|
4
3
|
import type { GlobalVariables, ProtocolContracts, Tx } from '@aztec/stdlib/tx';
|
|
4
|
+
import type { AvmSimulator } from '../avm_simulator.js';
|
|
5
5
|
import type { PublicContractsDB } from '../public_db_sources.js';
|
|
6
6
|
/**
|
|
7
|
-
* Shared base for public tx simulators
|
|
8
|
-
*
|
|
9
|
-
* and
|
|
7
|
+
* Shared base for public tx simulators: holds the common configuration, the {@link AvmSimulator} used
|
|
8
|
+
* to run the transaction's public calls, the contracts DB and fork id that scope the simulation's
|
|
9
|
+
* contract-data lookups, the logger, and the tx-hash helper. Concrete simulators extend this and
|
|
10
|
+
* implement `simulate`.
|
|
10
11
|
*/
|
|
11
12
|
export declare abstract class PublicTxSimulatorBase {
|
|
12
|
-
protected
|
|
13
|
-
protected contractsDB: PublicContractsDB;
|
|
13
|
+
protected avmSimulator: AvmSimulator;
|
|
14
14
|
protected globalVariables: GlobalVariables;
|
|
15
|
+
protected contractsDB: PublicContractsDB;
|
|
16
|
+
protected forkId: number;
|
|
15
17
|
protected protocolContracts: ProtocolContracts;
|
|
16
18
|
protected log: Logger;
|
|
17
19
|
protected readonly config: PublicSimulatorConfig;
|
|
18
20
|
protected readonly bindings?: LoggerBindings;
|
|
19
|
-
constructor(
|
|
21
|
+
constructor(avmSimulator: AvmSimulator, globalVariables: GlobalVariables, contractsDB: PublicContractsDB, forkId: number, config?: Partial<PublicSimulatorConfig>, protocolContracts?: ProtocolContracts, bindings?: LoggerBindings);
|
|
20
22
|
protected computeTxHash(tx: Tx): import("@aztec/stdlib/tx").TxHash;
|
|
21
23
|
}
|
|
22
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX3R4X3NpbXVsYXRvcl9iYXNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcHVibGljL3B1YmxpY190eF9zaW11bGF0b3Ivc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HFCQUFxQixDQUFDLEVBQzdCLGlCQUFpQixHQUFFLGlCQUF5QyxFQUN0RSxRQUFRLENBQUMsRUFBRSxjQUFjLEVBSzFCO0lBRUQsU0FBUyxDQUFDLGFBQWEsQ0FBQyxFQUFFLEVBQUUsRUFBRSxxQ0FFN0I7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_tx_simulator_base.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/public_tx_simulator_base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAEvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"public_tx_simulator_base.d.ts","sourceRoot":"","sources":["../../../src/public/public_tx_simulator/public_tx_simulator_base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAEvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE;;;;;GAKG;AACH,8BAAsB,qBAAqB;IAMvC,SAAS,CAAC,YAAY,EAAE,YAAY;IACpC,SAAS,CAAC,eAAe,EAAE,eAAe;IAC1C,SAAS,CAAC,WAAW,EAAE,iBAAiB;IACxC,SAAS,CAAC,MAAM,EAAE,MAAM;IAExB,SAAS,CAAC,iBAAiB,EAAE,iBAAiB;IAVhD,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACjD,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE7C,YACY,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,iBAAiB,EAC9B,MAAM,EAAE,MAAM,EACxB,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,EAC7B,iBAAiB,GAAE,iBAAyC,EACtE,QAAQ,CAAC,EAAE,cAAc,EAK1B;IAED,SAAS,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,qCAE7B;CACF"}
|
|
@@ -2,21 +2,24 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
2
2
|
import { ProtocolContractsList } from '@aztec/protocol-contracts';
|
|
3
3
|
import { PublicSimulatorConfig } from '@aztec/stdlib/avm';
|
|
4
4
|
/**
|
|
5
|
-
* Shared base for public tx simulators
|
|
6
|
-
*
|
|
7
|
-
* and
|
|
5
|
+
* Shared base for public tx simulators: holds the common configuration, the {@link AvmSimulator} used
|
|
6
|
+
* to run the transaction's public calls, the contracts DB and fork id that scope the simulation's
|
|
7
|
+
* contract-data lookups, the logger, and the tx-hash helper. Concrete simulators extend this and
|
|
8
|
+
* implement `simulate`.
|
|
8
9
|
*/ export class PublicTxSimulatorBase {
|
|
9
|
-
|
|
10
|
-
contractsDB;
|
|
10
|
+
avmSimulator;
|
|
11
11
|
globalVariables;
|
|
12
|
+
contractsDB;
|
|
13
|
+
forkId;
|
|
12
14
|
protocolContracts;
|
|
13
15
|
log;
|
|
14
16
|
config;
|
|
15
17
|
bindings;
|
|
16
|
-
constructor(
|
|
17
|
-
this.
|
|
18
|
-
this.contractsDB = contractsDB;
|
|
18
|
+
constructor(avmSimulator, globalVariables, contractsDB, forkId, config, protocolContracts = ProtocolContractsList, bindings){
|
|
19
|
+
this.avmSimulator = avmSimulator;
|
|
19
20
|
this.globalVariables = globalVariables;
|
|
21
|
+
this.contractsDB = contractsDB;
|
|
22
|
+
this.forkId = forkId;
|
|
20
23
|
this.protocolContracts = protocolContracts;
|
|
21
24
|
this.config = PublicSimulatorConfig.from(config ?? {});
|
|
22
25
|
this.bindings = bindings;
|
|
@@ -4,14 +4,14 @@ export interface PublicTxSimulatorInterface {
|
|
|
4
4
|
simulate(tx: Tx): Promise<PublicTxResult>;
|
|
5
5
|
/**
|
|
6
6
|
* Cancel the current simulation if one is in progress.
|
|
7
|
-
* This signals the underlying simulator
|
|
7
|
+
* This signals the underlying simulator to stop at the next safe point.
|
|
8
8
|
* Safe to call even if no simulation is in progress.
|
|
9
9
|
* Optional - not all implementations support cancellation.
|
|
10
10
|
*
|
|
11
11
|
* @param waitTimeoutMs - If provided, wait up to this many ms for the simulation to actually stop.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* Cancellation is cooperative: signaling it only sets a flag the simulator
|
|
13
|
+
* checks at certain points, so if it's mid slow-operation it won't stop until
|
|
14
|
+
* that completes.
|
|
15
15
|
* @returns Promise that resolves when cancellation is signaled (and optionally when simulation stops)
|
|
16
16
|
*/
|
|
17
17
|
cancel?(waitTimeoutMs?: number): Promise<void>;
|
|
@@ -20,7 +20,7 @@ export interface MeasuredPublicTxSimulatorInterface {
|
|
|
20
20
|
simulate(tx: Tx, txLabel: string): Promise<PublicTxResult>;
|
|
21
21
|
/**
|
|
22
22
|
* Cancel the current simulation if one is in progress.
|
|
23
|
-
* This signals the underlying simulator
|
|
23
|
+
* This signals the underlying simulator to stop at the next safe point.
|
|
24
24
|
* Safe to call even if no simulation is in progress.
|
|
25
25
|
* Optional - not all implementations support cancellation.
|
|
26
26
|
*
|
|
@@ -13,10 +13,6 @@ export interface PublicTxMetrics {
|
|
|
13
13
|
totalDurationMs: number;
|
|
14
14
|
manaUsed: number | undefined;
|
|
15
15
|
totalInstructionsExecuted: number;
|
|
16
|
-
bytecodeSizes: {
|
|
17
|
-
contractName: string;
|
|
18
|
-
sizeBytes: number;
|
|
19
|
-
}[];
|
|
20
16
|
nonRevertiblePrivateInsertionsUs: number | undefined;
|
|
21
17
|
revertiblePrivateInsertionsUs: number | undefined;
|
|
22
18
|
enqueuedCalls: PublicEnqueuedCallMetrics[];
|
|
@@ -51,11 +47,10 @@ export declare class TestExecutorMetrics implements ExecutorMetricsInterface {
|
|
|
51
47
|
recordEnqueuedCallSimulation(fnName: string, durationMs: number, manaUsed: number, totalInstructionsExecuted: number): void;
|
|
52
48
|
recordEnqueuedCallSimulationFailure(fnName: string, durationMs: number, manaUsed: number, totalInstructionsExecuted: number): void;
|
|
53
49
|
recordPrivateEffectsInsertion(durationUs: number, type: 'revertible' | 'non-revertible'): void;
|
|
54
|
-
recordBytecodeSize(txLabel: string, contractName: string, sizeBytes: number): void;
|
|
55
50
|
recordProverMetrics(txLabel: string, metrics: Partial<PublicTxMetrics>): void;
|
|
56
51
|
prettyPrint(filter?: PublicTxMetricsFilter): void;
|
|
57
52
|
toPrettyString(filter?: PublicTxMetricsFilter): string;
|
|
58
53
|
toJSON(indent?: number): string;
|
|
59
54
|
toGithubActionBenchmarkJSON(indent?: number): string;
|
|
60
55
|
}
|
|
61
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdF9leGVjdXRvcl9tZXRyaWNzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHVibGljL3Rlc3RfZXhlY3V0b3JfbWV0cmljcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQWUsS0FBSyxjQUFjLEVBQWdCLE1BQU0sdUJBQXVCLENBQUM7QUFFdkYsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDcEQsT0FBTyxLQUFLLEVBQUUsT0FBTyxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFJakQsT0FBTy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T0FBTyxFQUFFLE9BQU8sQ0FBQyxlQUFlLENBQUMsUUFVckU7SUFFRCxXQUFXLENBQUMsTUFBTSxHQUFFLHFCQUFpRCxRQUVwRTtJQUVELGNBQWMsQ0FBQyxNQUFNLEdBQUUscUJBQWlELFVBK0V2RTtJQTBCRCxNQUFNLENBQUMsTUFBTSxTQUFJLFVBRWhCO0lBRUQsMkJBQTJCLENBQUMsTUFBTSxTQUFJLFVBNEZyQztDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test_executor_metrics.d.ts","sourceRoot":"","sources":["../../src/public/test_executor_metrics.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAEvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAEhF,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB,EAAE,MAAM,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAE9B,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,yBAAyB,EAAE,MAAM,CAAC;IAClC,
|
|
1
|
+
{"version":3,"file":"test_executor_metrics.d.ts","sourceRoot":"","sources":["../../src/public/test_executor_metrics.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAEvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIjD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,cAAc,CAAqB;IAC3C,OAAO,CAAC,OAAO,CAAoB;IAEnC,YAAY,QAAQ,CAAC,EAAE,cAAc,EAEpC;IAED,0BAA0B,CAAC,OAAO,EAAE,MAAM,QAMzC;IAED,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,UAAU,QAgBtF;IAED,4BAA4B,CAC1B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,yBAAyB,EAAE,MAAM,QAGlC;IAED,mCAAmC,CACjC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,yBAAyB,EAAE,MAAM,QAGlC;IAoBD,6BAA6B,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,gBAAgB,QAgBtF;IAED,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,QAUrE;IAED,WAAW,CAAC,MAAM,GAAE,qBAAiD,QAEpE;IAED,cAAc,CAAC,MAAM,GAAE,qBAAiD,UA+EvE;IA0BD,MAAM,CAAC,MAAM,SAAI,UAEhB;IAED,2BAA2B,CAAC,MAAM,SAAI,UA4FrC;CACF"}
|
|
@@ -24,7 +24,6 @@ function createEmptyTxMetrics() {
|
|
|
24
24
|
totalDurationMs: 0,
|
|
25
25
|
manaUsed: 0,
|
|
26
26
|
totalInstructionsExecuted: 0,
|
|
27
|
-
bytecodeSizes: [],
|
|
28
27
|
nonRevertiblePrivateInsertionsUs: undefined,
|
|
29
28
|
revertiblePrivateInsertionsUs: undefined,
|
|
30
29
|
enqueuedCalls: [],
|
|
@@ -100,14 +99,6 @@ export class TestExecutorMetrics {
|
|
|
100
99
|
txMetrics.nonRevertiblePrivateInsertionsUs = durationUs;
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
|
-
recordBytecodeSize(txLabel, contractName, sizeBytes) {
|
|
104
|
-
const txMetrics = this.txMetrics.get(txLabel);
|
|
105
|
-
assert(txMetrics, `Cannot record bytecode size for unknown tx label: ${txLabel}`);
|
|
106
|
-
txMetrics.bytecodeSizes.push({
|
|
107
|
-
contractName,
|
|
108
|
-
sizeBytes
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
102
|
recordProverMetrics(txLabel, metrics) {
|
|
112
103
|
if (!this.txMetrics.has(txLabel)) {
|
|
113
104
|
this.txMetrics.set(txLabel, createEmptyTxMetrics());
|
|
@@ -141,12 +132,6 @@ export class TestExecutorMetrics {
|
|
|
141
132
|
if (filter === 3 || filter === 1 || filter === 0) {
|
|
142
133
|
pretty += `${INDENT0}Total instructions executed: ${fmtNum(txMetrics.totalInstructionsExecuted)}\n`;
|
|
143
134
|
}
|
|
144
|
-
if ((filter === 1 || filter === 0) && txMetrics.bytecodeSizes.length > 0) {
|
|
145
|
-
pretty += `${INDENT0}Bytecode sizes:\n`;
|
|
146
|
-
for (const { contractName, sizeBytes } of txMetrics.bytecodeSizes){
|
|
147
|
-
pretty += `${INDENT1}${contractName}: ${fmtNum(sizeBytes, 'bytes')}\n`;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
135
|
if (filter === 2 || filter === 0) {
|
|
151
136
|
pretty += `${INDENT0}Private insertions:\n`;
|
|
152
137
|
pretty += `${INDENT1}Non-revertible: ${fmtNum(txMetrics.nonRevertiblePrivateInsertionsUs / 1_000, 'ms')}\n`;
|
|
@@ -313,13 +298,6 @@ export class TestExecutorMetrics {
|
|
|
313
298
|
});
|
|
314
299
|
}
|
|
315
300
|
}
|
|
316
|
-
for (const { contractName, sizeBytes } of txMetrics.bytecodeSizes){
|
|
317
|
-
data.push({
|
|
318
|
-
name: `${txLabel}/bytecodeSizeBytes/${contractName}`,
|
|
319
|
-
value: sizeBytes,
|
|
320
|
-
unit: 'bytes'
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
301
|
}
|
|
324
302
|
return JSON.stringify(data, null, indent);
|
|
325
303
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/simulator",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.be03c316",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/server.js",
|
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
"build": "yarn clean && ../scripts/tsc.sh",
|
|
20
20
|
"build:dev": "../scripts/tsc.sh --watch",
|
|
21
21
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
22
|
+
"generate": "node --experimental-strip-types --experimental-transform-types --no-warnings ../../ipc-codegen/src/generate.ts --schema ../../barretenberg/cpp/src/barretenberg/cdb/cdb_schema.json --lang ts --server --out src/public/cdb/generated",
|
|
22
23
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}",
|
|
23
|
-
"build:fuzzer": "yarn clean && ../scripts/tsc.sh"
|
|
24
|
+
"build:fuzzer": "yarn clean && yarn generate && ../scripts/tsc.sh"
|
|
24
25
|
},
|
|
25
26
|
"inherits": [
|
|
26
27
|
"../package.common.json"
|
|
@@ -63,26 +64,29 @@
|
|
|
63
64
|
]
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
|
-
"@aztec/
|
|
67
|
-
"@aztec/
|
|
68
|
-
"@aztec/
|
|
69
|
-
"@aztec/
|
|
70
|
-
"@aztec/
|
|
71
|
-
"@aztec/noir-
|
|
72
|
-
"@aztec/noir-
|
|
73
|
-
"@aztec/protocol-
|
|
74
|
-
"@aztec/
|
|
75
|
-
"@aztec/
|
|
76
|
-
"@aztec/
|
|
77
|
-
"@aztec/
|
|
67
|
+
"@aztec/bb-avm-sim": "0.0.1-commit.be03c316",
|
|
68
|
+
"@aztec/constants": "0.0.1-commit.be03c316",
|
|
69
|
+
"@aztec/foundation": "0.0.1-commit.be03c316",
|
|
70
|
+
"@aztec/ipc-runtime": "0.0.1-commit.be03c316",
|
|
71
|
+
"@aztec/native": "0.0.1-commit.be03c316",
|
|
72
|
+
"@aztec/noir-acvm_js": "0.0.1-commit.be03c316",
|
|
73
|
+
"@aztec/noir-noirc_abi": "0.0.1-commit.be03c316",
|
|
74
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.be03c316",
|
|
75
|
+
"@aztec/noir-types": "0.0.1-commit.be03c316",
|
|
76
|
+
"@aztec/protocol-contracts": "0.0.1-commit.be03c316",
|
|
77
|
+
"@aztec/standard-contracts": "0.0.1-commit.be03c316",
|
|
78
|
+
"@aztec/stdlib": "0.0.1-commit.be03c316",
|
|
79
|
+
"@aztec/telemetry-client": "0.0.1-commit.be03c316",
|
|
80
|
+
"@aztec/world-state": "0.0.1-commit.be03c316",
|
|
78
81
|
"lodash.clonedeep": "^4.5.0",
|
|
79
82
|
"lodash.merge": "^4.6.2",
|
|
83
|
+
"msgpackr": "^1.11.2",
|
|
80
84
|
"tslib": "^2.4.0"
|
|
81
85
|
},
|
|
82
86
|
"devDependencies": {
|
|
83
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
84
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
85
|
-
"@aztec/noir-test-contracts.js": "0.0.1-commit.
|
|
87
|
+
"@aztec/kv-store": "0.0.1-commit.be03c316",
|
|
88
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.be03c316",
|
|
89
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.be03c316",
|
|
86
90
|
"@jest/globals": "^30.0.0",
|
|
87
91
|
"@types/jest": "^30.0.0",
|
|
88
92
|
"@types/lodash.clonedeep": "^4.5.7",
|
package/src/client.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export * from './private/acvm/index.js';
|
|
2
2
|
export { WASMSimulator } from './private/acvm_wasm.js';
|
|
3
|
-
export { SimulatorRecorderWrapper } from './private/circuit_recording/simulator_recorder_wrapper.js';
|
|
4
|
-
export { MemoryCircuitRecorder } from './private/circuit_recording/memory_circuit_recorder.js';
|
|
5
3
|
export { type CircuitSimulator, type DecodedError } from './private/circuit_simulator.js';
|
|
6
4
|
export * from './common/index.js';
|