@aztec/validator-client 0.0.1-commit.3fd054f6 → 0.0.1-commit.431c48d

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 (42) hide show
  1. package/README.md +12 -11
  2. package/dest/checkpoint_builder.d.ts +12 -4
  3. package/dest/checkpoint_builder.d.ts.map +1 -1
  4. package/dest/checkpoint_builder.js +14 -3
  5. package/dest/config.d.ts +9 -3
  6. package/dest/config.d.ts.map +1 -1
  7. package/dest/config.js +23 -10
  8. package/dest/duties/validation_service.d.ts +12 -13
  9. package/dest/duties/validation_service.d.ts.map +1 -1
  10. package/dest/duties/validation_service.js +32 -38
  11. package/dest/factory.d.ts +9 -5
  12. package/dest/factory.d.ts.map +1 -1
  13. package/dest/factory.js +8 -8
  14. package/dest/index.d.ts +2 -2
  15. package/dest/index.d.ts.map +1 -1
  16. package/dest/index.js +1 -1
  17. package/dest/key_store/web3signer_key_store.d.ts +10 -2
  18. package/dest/key_store/web3signer_key_store.d.ts.map +1 -1
  19. package/dest/key_store/web3signer_key_store.js +32 -41
  20. package/dest/metrics.d.ts +6 -2
  21. package/dest/metrics.d.ts.map +1 -1
  22. package/dest/metrics.js +15 -1
  23. package/dest/proposal_handler.d.ts +173 -0
  24. package/dest/proposal_handler.d.ts.map +1 -0
  25. package/dest/proposal_handler.js +1302 -0
  26. package/dest/validator.d.ts +37 -23
  27. package/dest/validator.d.ts.map +1 -1
  28. package/dest/validator.js +218 -252
  29. package/package.json +19 -19
  30. package/src/checkpoint_builder.ts +16 -5
  31. package/src/config.ts +31 -12
  32. package/src/duties/validation_service.ts +51 -47
  33. package/src/factory.ts +17 -8
  34. package/src/index.ts +1 -1
  35. package/src/key_store/web3signer_key_store.ts +43 -59
  36. package/src/metrics.ts +21 -1
  37. package/src/proposal_handler.ts +1418 -0
  38. package/src/validator.ts +293 -289
  39. package/dest/block_proposal_handler.d.ts +0 -64
  40. package/dest/block_proposal_handler.d.ts.map +0 -1
  41. package/dest/block_proposal_handler.js +0 -614
  42. package/src/block_proposal_handler.ts +0 -632
package/src/metrics.ts CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  createUpDownCounterWithDefault,
12
12
  } from '@aztec/telemetry-client';
13
13
 
14
- import type { BlockProposalValidationFailureReason } from './block_proposal_handler.js';
14
+ import type { BlockProposalValidationFailureReason } from './proposal_handler.js';
15
15
 
16
16
  export class ValidatorMetrics {
17
17
  private failedReexecutionCounter: UpDownCounter;
@@ -24,6 +24,8 @@ export class ValidatorMetrics {
24
24
  private reexMana: Histogram;
25
25
  private reexTx: Histogram;
26
26
  private reexDuration: Gauge;
27
+ private checkpointProposalToPipelinedStateDuration: Histogram;
28
+ private checkpointProposalReceiveOffsetFromNextSlotBoundary: Histogram;
27
29
 
28
30
  constructor(telemetryClient: TelemetryClient) {
29
31
  const meter = telemetryClient.getMeter('Validator');
@@ -47,6 +49,8 @@ export class ValidatorMetrics {
47
49
  'failed_txs',
48
50
  'in_hash_mismatch',
49
51
  'parent_block_wrong_slot',
52
+ 'duplicate_txs',
53
+ 'invalid_embedded_txs',
50
54
  ],
51
55
  [Attributes.IS_COMMITTEE_MEMBER]: [true, false],
52
56
  },
@@ -77,6 +81,12 @@ export class ValidatorMetrics {
77
81
  this.reexTx = meter.createHistogram(Metrics.VALIDATOR_RE_EXECUTION_TX_COUNT);
78
82
 
79
83
  this.reexDuration = meter.createGauge(Metrics.VALIDATOR_RE_EXECUTION_TIME);
84
+ this.checkpointProposalToPipelinedStateDuration = meter.createHistogram(
85
+ Metrics.VALIDATOR_CHECKPOINT_PROPOSAL_TO_PIPELINED_STATE_DURATION,
86
+ );
87
+ this.checkpointProposalReceiveOffsetFromNextSlotBoundary = meter.createHistogram(
88
+ Metrics.VALIDATOR_CHECKPOINT_PROPOSAL_RECEIVE_OFFSET_FROM_NEXT_SLOT_BOUNDARY,
89
+ );
80
90
  }
81
91
 
82
92
  public recordReex(time: number, txs: number, mManaTotal: number) {
@@ -85,6 +95,16 @@ export class ValidatorMetrics {
85
95
  this.reexMana.record(mManaTotal);
86
96
  }
87
97
 
98
+ public recordCheckpointProposalToPipelinedStateDuration(durationMs: number) {
99
+ this.checkpointProposalToPipelinedStateDuration.record(Math.ceil(durationMs));
100
+ }
101
+
102
+ public recordCheckpointProposalReceiveOffsetFromNextSlotBoundary(offsetMs: number) {
103
+ this.checkpointProposalReceiveOffsetFromNextSlotBoundary.record(Math.ceil(Math.abs(offsetMs)), {
104
+ [Attributes.SLOT_BOUNDARY_SIDE]: offsetMs < 0 ? 'before' : 'after',
105
+ });
106
+ }
107
+
88
108
  public recordFailedReexecution(proposal: BlockProposal) {
89
109
  const proposer = proposal.getSender();
90
110
  this.failedReexecutionCounter.add(1, {