@aztec/simulator 0.0.1-commit.6c91f13 → 0.0.1-commit.96bb3f7

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.
Files changed (31) hide show
  1. package/dest/public/avm/opcodes/accrued_substate.js +1 -1
  2. package/dest/public/avm/opcodes/environment_getters.d.ts +3 -3
  3. package/dest/public/avm/opcodes/environment_getters.d.ts.map +1 -1
  4. package/dest/public/avm/opcodes/environment_getters.js +2 -2
  5. package/dest/public/avm/opcodes/external_calls.d.ts +1 -1
  6. package/dest/public/avm/opcodes/external_calls.d.ts.map +1 -1
  7. package/dest/public/avm/opcodes/external_calls.js +1 -0
  8. package/dest/public/executor_metrics.d.ts +1 -1
  9. package/dest/public/executor_metrics.d.ts.map +1 -1
  10. package/dest/public/executor_metrics.js +8 -34
  11. package/dest/public/fixtures/bulk_test.js +1 -17
  12. package/dest/public/fuzzing/avm_simulator_bin.js +14 -3
  13. package/dest/public/hinting_db_sources.js +3 -1
  14. package/dest/public/public_processor/guarded_merkle_tree.js +3 -1
  15. package/dest/public/public_processor/public_processor.js +399 -20
  16. package/dest/public/public_processor/public_processor_metrics.d.ts +1 -1
  17. package/dest/public/public_processor/public_processor_metrics.d.ts.map +1 -1
  18. package/dest/public/public_processor/public_processor_metrics.js +12 -45
  19. package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts +1 -1
  20. package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts.map +1 -1
  21. package/dest/public/public_tx_simulator/cpp_public_tx_simulator.js +1 -1
  22. package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.js +395 -19
  23. package/package.json +16 -16
  24. package/src/public/avm/opcodes/accrued_substate.ts +1 -1
  25. package/src/public/avm/opcodes/environment_getters.ts +4 -4
  26. package/src/public/avm/opcodes/external_calls.ts +1 -0
  27. package/src/public/executor_metrics.ts +7 -34
  28. package/src/public/fixtures/bulk_test.ts +2 -2
  29. package/src/public/fuzzing/avm_simulator_bin.ts +17 -4
  30. package/src/public/public_processor/public_processor_metrics.ts +11 -45
  31. package/src/public/public_tx_simulator/cpp_public_tx_simulator.ts +8 -1
@@ -9,7 +9,6 @@ import {
9
9
  type TelemetryClient,
10
10
  type Tracer,
11
11
  type UpDownCounter,
12
- ValueType,
13
12
  } from '@aztec/telemetry-client';
14
13
 
15
14
  export class PublicProcessorMetrics {
@@ -34,60 +33,27 @@ export class PublicProcessorMetrics {
34
33
  this.tracer = client.getTracer(name);
35
34
  const meter = client.getMeter(name);
36
35
 
37
- this.txDuration = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_TX_DURATION, {
38
- description: 'How long it takes to process a transaction',
39
- unit: 'ms',
40
- valueType: ValueType.INT,
41
- });
36
+ this.txDuration = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_TX_DURATION);
42
37
 
43
- this.txCount = meter.createUpDownCounter(Metrics.PUBLIC_PROCESSOR_TX_COUNT, {
44
- description: 'Number of transactions processed',
45
- });
38
+ this.txCount = meter.createUpDownCounter(Metrics.PUBLIC_PROCESSOR_TX_COUNT);
46
39
 
47
- this.txPhaseCount = meter.createUpDownCounter(Metrics.PUBLIC_PROCESSOR_TX_PHASE_COUNT, {
48
- description: 'Number of phases processed',
49
- });
40
+ this.txPhaseCount = meter.createUpDownCounter(Metrics.PUBLIC_PROCESSOR_TX_PHASE_COUNT);
50
41
 
51
- this.phaseDuration = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_PHASE_DURATION, {
52
- description: 'How long it takes to process a phase',
53
- unit: 'ms',
54
- valueType: ValueType.INT,
55
- });
42
+ this.phaseDuration = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_PHASE_DURATION);
56
43
 
57
- this.phaseCount = meter.createUpDownCounter(Metrics.PUBLIC_PROCESSOR_PHASE_COUNT, {
58
- description: 'Number of failed phases',
59
- });
44
+ this.phaseCount = meter.createUpDownCounter(Metrics.PUBLIC_PROCESSOR_PHASE_COUNT);
60
45
 
61
- this.bytecodeDeployed = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_DEPLOY_BYTECODE_SIZE, {
62
- description: 'Size of deployed bytecode',
63
- unit: 'By',
64
- });
46
+ this.bytecodeDeployed = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_DEPLOY_BYTECODE_SIZE);
65
47
 
66
- this.totalGas = meter.createGauge(Metrics.PUBLIC_PROCESSOR_TOTAL_GAS, {
67
- description: 'Total gas used in block',
68
- unit: 'gas',
69
- });
48
+ this.totalGas = meter.createGauge(Metrics.PUBLIC_PROCESSOR_TOTAL_GAS);
70
49
 
71
- this.totalGasHistogram = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_TOTAL_GAS_HISTOGRAM, {
72
- description: 'Total gas used in block as histogram',
73
- unit: 'gas/block',
74
- });
50
+ this.totalGasHistogram = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_TOTAL_GAS_HISTOGRAM);
75
51
 
76
- this.txGas = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_TX_GAS, {
77
- description: 'Gas used in transaction',
78
- unit: 'gas/tx',
79
- });
52
+ this.txGas = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_TX_GAS);
80
53
 
81
- this.gasRate = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_GAS_RATE, {
82
- description: 'L2 gas per second for complete block',
83
- unit: 'gas/s',
84
- });
54
+ this.gasRate = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_GAS_RATE);
85
55
 
86
- this.treeInsertionDuration = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_TREE_INSERTION, {
87
- description: 'How long it takes for tree insertion',
88
- unit: 'us',
89
- valueType: ValueType.INT,
90
- });
56
+ this.treeInsertionDuration = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_TREE_INSERTION);
91
57
  }
92
58
 
93
59
  recordPhaseDuration(phaseName: TxExecutionPhase, durationMs: number) {
@@ -95,7 +95,14 @@ export class CppPublicTxSimulator extends PublicTxSimulator implements PublicTxS
95
95
 
96
96
  // Store the promise so cancel() can wait for it
97
97
  this.log.debug(`Calling C++ simulator for tx ${txHash}`);
98
- this.simulationPromise = avmSimulate(inputBuffer, contractProvider, wsCppHandle, logLevel, this.cancellationToken);
98
+ this.simulationPromise = avmSimulate(
99
+ inputBuffer,
100
+ contractProvider,
101
+ wsCppHandle,
102
+ logLevel,
103
+ this.log,
104
+ this.cancellationToken,
105
+ );
99
106
 
100
107
  let resultBuffer: Buffer;
101
108
  try {