@aztec/simulator 6.0.0-nightly.20260810 → 6.0.0-nightly.20260821
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/public/avm_simulator_pool.d.ts +43 -4
- package/dest/public/avm_simulator_pool.d.ts.map +1 -1
- package/dest/public/avm_simulator_pool.js +171 -57
- package/dest/public/executor_metrics.d.ts +2 -2
- package/dest/public/executor_metrics.d.ts.map +1 -1
- package/dest/public/executor_metrics.js +1 -1
- package/dest/public/executor_metrics_interface.d.ts +2 -2
- package/dest/public/executor_metrics_interface.d.ts.map +1 -1
- package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts +2 -4
- package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts.map +1 -1
- package/dest/public/fuzzing/avm_fuzzer_simulator.js +2 -6
- package/dest/public/fuzzing/avm_simulator_bin.js +11 -21
- package/dest/public/public_tx_simulator/public_tx_simulator.js +1 -1
- package/dest/public/test_executor_metrics.d.ts +2 -2
- package/dest/public/test_executor_metrics.d.ts.map +1 -1
- package/dest/public/test_executor_metrics.js +3 -5
- package/package.json +18 -18
- package/src/public/avm_simulator_pool.ts +195 -67
- package/src/public/executor_metrics.ts +6 -1
- package/src/public/executor_metrics_interface.ts +6 -1
- package/src/public/fuzzing/avm_fuzzer_simulator.ts +0 -4
- package/src/public/fuzzing/avm_simulator_bin.ts +9 -25
- package/src/public/public_tx_simulator/public_tx_simulator.ts +1 -1
- package/src/public/test_executor_metrics.ts +8 -5
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { sum } from '@aztec/foundation/collection';
|
|
2
1
|
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
3
2
|
import { Timer } from '@aztec/foundation/timer';
|
|
4
3
|
import type { RevertCode } from '@aztec/stdlib/avm';
|
|
@@ -100,7 +99,12 @@ export class TestExecutorMetrics implements ExecutorMetricsInterface {
|
|
|
100
99
|
this.txTimer = new Timer();
|
|
101
100
|
}
|
|
102
101
|
|
|
103
|
-
stopRecordingTxSimulation(
|
|
102
|
+
stopRecordingTxSimulation(
|
|
103
|
+
txLabel: string,
|
|
104
|
+
gasUsed?: GasUsed,
|
|
105
|
+
revertedCode?: RevertCode,
|
|
106
|
+
stats?: Record<string, string>,
|
|
107
|
+
) {
|
|
104
108
|
assert(this.currentTxLabel === txLabel, 'Cannot stop recording metrics for tx when another is live');
|
|
105
109
|
|
|
106
110
|
const txMetrics = this.txMetrics.get(txLabel)!;
|
|
@@ -109,10 +113,9 @@ export class TestExecutorMetrics implements ExecutorMetricsInterface {
|
|
|
109
113
|
txMetrics.totalDurationMs = this.txTimer!.ms();
|
|
110
114
|
this.logger.debug(`Public TX simulation of ${txLabel} took ${txMetrics.totalDurationMs}ms`);
|
|
111
115
|
|
|
112
|
-
//
|
|
116
|
+
// manaUsed and totalInstructionsExecuted are tx-level totals reported by the simulator.
|
|
113
117
|
txMetrics.manaUsed = gasUsed?.publicGas.l2Gas;
|
|
114
|
-
|
|
115
|
-
txMetrics.totalInstructionsExecuted = sum(txMetrics.enqueuedCalls.map(call => call.totalInstructionsExecuted));
|
|
118
|
+
txMetrics.totalInstructionsExecuted = Number(stats?.['total_instructions_executed'] ?? 0);
|
|
116
119
|
txMetrics.revertedCode = revertedCode;
|
|
117
120
|
|
|
118
121
|
this.currentTxLabel = undefined;
|