@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.
@@ -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(txLabel: string, gasUsed?: GasUsed, revertedCode?: RevertCode) {
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
- // add manaUsed across all enqueued calls
116
+ // manaUsed and totalInstructionsExecuted are tx-level totals reported by the simulator.
113
117
  txMetrics.manaUsed = gasUsed?.publicGas.l2Gas;
114
- // add totalInstructionsExecuted across all enqueued calls
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;