@aztec/validator-client 4.0.0-nightly.20250907 → 4.0.0-nightly.20260107

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 (43) hide show
  1. package/dest/block_proposal_handler.d.ts +53 -0
  2. package/dest/block_proposal_handler.d.ts.map +1 -0
  3. package/dest/block_proposal_handler.js +290 -0
  4. package/dest/config.d.ts +1 -1
  5. package/dest/config.d.ts.map +1 -1
  6. package/dest/config.js +10 -0
  7. package/dest/duties/validation_service.d.ts +11 -6
  8. package/dest/duties/validation_service.d.ts.map +1 -1
  9. package/dest/duties/validation_service.js +19 -7
  10. package/dest/factory.d.ts +16 -5
  11. package/dest/factory.d.ts.map +1 -1
  12. package/dest/factory.js +11 -1
  13. package/dest/index.d.ts +2 -1
  14. package/dest/index.d.ts.map +1 -1
  15. package/dest/index.js +1 -0
  16. package/dest/key_store/index.d.ts +1 -1
  17. package/dest/key_store/interface.d.ts +1 -1
  18. package/dest/key_store/local_key_store.d.ts +1 -1
  19. package/dest/key_store/local_key_store.d.ts.map +1 -1
  20. package/dest/key_store/local_key_store.js +1 -1
  21. package/dest/key_store/node_keystore_adapter.d.ts +1 -1
  22. package/dest/key_store/node_keystore_adapter.d.ts.map +1 -1
  23. package/dest/key_store/node_keystore_adapter.js +2 -4
  24. package/dest/key_store/web3signer_key_store.d.ts +1 -7
  25. package/dest/key_store/web3signer_key_store.d.ts.map +1 -1
  26. package/dest/key_store/web3signer_key_store.js +7 -8
  27. package/dest/metrics.d.ts +7 -5
  28. package/dest/metrics.d.ts.map +1 -1
  29. package/dest/metrics.js +25 -12
  30. package/dest/validator.d.ts +28 -27
  31. package/dest/validator.d.ts.map +1 -1
  32. package/dest/validator.js +579 -198
  33. package/package.json +17 -15
  34. package/src/block_proposal_handler.ts +346 -0
  35. package/src/config.ts +12 -0
  36. package/src/duties/validation_service.ts +30 -12
  37. package/src/factory.ts +37 -4
  38. package/src/index.ts +1 -0
  39. package/src/key_store/local_key_store.ts +1 -1
  40. package/src/key_store/node_keystore_adapter.ts +3 -4
  41. package/src/key_store/web3signer_key_store.ts +7 -10
  42. package/src/metrics.ts +34 -13
  43. package/src/validator.ts +281 -271
package/src/metrics.ts CHANGED
@@ -10,8 +10,9 @@ import {
10
10
 
11
11
  export class ValidatorMetrics {
12
12
  private failedReexecutionCounter: UpDownCounter;
13
- private attestationsCount: UpDownCounter;
14
- private failedAttestationsCount: UpDownCounter;
13
+ private successfulAttestationsCount: UpDownCounter;
14
+ private failedAttestationsBadProposalCount: UpDownCounter;
15
+ private failedAttestationsNodeIssueCount: UpDownCounter;
15
16
 
16
17
  private reexMana: Histogram;
17
18
  private reexTx: Histogram;
@@ -26,15 +27,26 @@ export class ValidatorMetrics {
26
27
  valueType: ValueType.INT,
27
28
  });
28
29
 
29
- this.attestationsCount = meter.createUpDownCounter(Metrics.VALIDATOR_ATTESTATION_COUNT, {
30
- description: 'The number of attestations',
30
+ this.successfulAttestationsCount = meter.createUpDownCounter(Metrics.VALIDATOR_ATTESTATION_SUCCESS_COUNT, {
31
+ description: 'The number of successful attestations',
31
32
  valueType: ValueType.INT,
32
33
  });
33
34
 
34
- this.failedAttestationsCount = meter.createUpDownCounter(Metrics.VALIDATOR_FAILED_ATTESTATION_COUNT, {
35
- description: 'The number of failed attestations',
36
- valueType: ValueType.INT,
37
- });
35
+ this.failedAttestationsBadProposalCount = meter.createUpDownCounter(
36
+ Metrics.VALIDATOR_ATTESTATION_FAILED_BAD_PROPOSAL_COUNT,
37
+ {
38
+ description: 'The number of failed attestations due to invalid block proposals',
39
+ valueType: ValueType.INT,
40
+ },
41
+ );
42
+
43
+ this.failedAttestationsNodeIssueCount = meter.createUpDownCounter(
44
+ Metrics.VALIDATOR_ATTESTATION_FAILED_NODE_ISSUE_COUNT,
45
+ {
46
+ description: 'The number of failed attestations due to node issues (timeout, missing data, etc.)',
47
+ valueType: ValueType.INT,
48
+ },
49
+ );
38
50
 
39
51
  this.reexMana = meter.createHistogram(Metrics.VALIDATOR_RE_EXECUTION_MANA, {
40
52
  description: 'The mana consumed by blocks',
@@ -62,19 +74,28 @@ export class ValidatorMetrics {
62
74
  }
63
75
 
64
76
  public recordFailedReexecution(proposal: BlockProposal) {
77
+ const proposer = proposal.getSender();
65
78
  this.failedReexecutionCounter.add(1, {
66
79
  [Attributes.STATUS]: 'failed',
67
- [Attributes.BLOCK_PROPOSER]: proposal.getSender().toString(),
80
+ [Attributes.BLOCK_PROPOSER]: proposer?.toString() ?? 'unknown',
68
81
  });
69
82
  }
70
83
 
71
- public incAttestations(num: number) {
72
- this.attestationsCount.add(num);
84
+ public incSuccessfulAttestations(num: number) {
85
+ this.successfulAttestationsCount.add(num);
86
+ }
87
+
88
+ public incFailedAttestationsBadProposal(num: number, reason: string, inCommittee: boolean) {
89
+ this.failedAttestationsBadProposalCount.add(num, {
90
+ [Attributes.ERROR_TYPE]: reason,
91
+ [Attributes.IS_COMMITTEE_MEMBER]: inCommittee,
92
+ });
73
93
  }
74
94
 
75
- public incFailedAttestations(num: number, reason: string) {
76
- this.failedAttestationsCount.add(num, {
95
+ public incFailedAttestationsNodeIssue(num: number, reason: string, inCommittee: boolean) {
96
+ this.failedAttestationsNodeIssueCount.add(num, {
77
97
  [Attributes.ERROR_TYPE]: reason,
98
+ [Attributes.IS_COMMITTEE_MEMBER]: inCommittee,
78
99
  });
79
100
  }
80
101
  }