@aztec/validator-client 4.0.0-nightly.20250907 → 4.0.0-nightly.20260108
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/block_proposal_handler.d.ts +53 -0
- package/dest/block_proposal_handler.d.ts.map +1 -0
- package/dest/block_proposal_handler.js +290 -0
- package/dest/config.d.ts +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +10 -0
- package/dest/duties/validation_service.d.ts +11 -6
- package/dest/duties/validation_service.d.ts.map +1 -1
- package/dest/duties/validation_service.js +19 -7
- package/dest/factory.d.ts +16 -5
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +11 -1
- package/dest/index.d.ts +2 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -0
- package/dest/key_store/index.d.ts +1 -1
- package/dest/key_store/interface.d.ts +1 -1
- package/dest/key_store/local_key_store.d.ts +1 -1
- package/dest/key_store/local_key_store.d.ts.map +1 -1
- package/dest/key_store/local_key_store.js +1 -1
- package/dest/key_store/node_keystore_adapter.d.ts +1 -1
- package/dest/key_store/node_keystore_adapter.d.ts.map +1 -1
- package/dest/key_store/node_keystore_adapter.js +2 -4
- package/dest/key_store/web3signer_key_store.d.ts +1 -7
- package/dest/key_store/web3signer_key_store.d.ts.map +1 -1
- package/dest/key_store/web3signer_key_store.js +7 -8
- package/dest/metrics.d.ts +7 -5
- package/dest/metrics.d.ts.map +1 -1
- package/dest/metrics.js +25 -12
- package/dest/validator.d.ts +28 -27
- package/dest/validator.d.ts.map +1 -1
- package/dest/validator.js +579 -198
- package/package.json +17 -15
- package/src/block_proposal_handler.ts +346 -0
- package/src/config.ts +12 -0
- package/src/duties/validation_service.ts +30 -12
- package/src/factory.ts +37 -4
- package/src/index.ts +1 -0
- package/src/key_store/local_key_store.ts +1 -1
- package/src/key_store/node_keystore_adapter.ts +3 -4
- package/src/key_store/web3signer_key_store.ts +7 -10
- package/src/metrics.ts +34 -13
- 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
|
|
14
|
-
private
|
|
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.
|
|
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.
|
|
35
|
-
|
|
36
|
-
|
|
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]:
|
|
80
|
+
[Attributes.BLOCK_PROPOSER]: proposer?.toString() ?? 'unknown',
|
|
68
81
|
});
|
|
69
82
|
}
|
|
70
83
|
|
|
71
|
-
public
|
|
72
|
-
this.
|
|
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
|
|
76
|
-
this.
|
|
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
|
}
|