@aztec/sequencer-client 3.0.0-devnet.2 → 3.0.0-devnet.2-patch.1
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/client/index.d.ts +1 -1
- package/dest/client/sequencer-client.d.ts +2 -2
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +6 -2
- package/dest/config.d.ts +3 -2
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +11 -1
- package/dest/global_variable_builder/global_builder.d.ts +5 -7
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +12 -8
- package/dest/global_variable_builder/index.d.ts +1 -1
- package/dest/index.d.ts +1 -1
- package/dest/publisher/config.d.ts +7 -2
- package/dest/publisher/config.d.ts.map +1 -1
- package/dest/publisher/config.js +12 -1
- package/dest/publisher/index.d.ts +1 -1
- package/dest/publisher/sequencer-publisher-factory.d.ts +3 -2
- package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-metrics.d.ts +1 -1
- package/dest/publisher/sequencer-publisher-metrics.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.d.ts +40 -31
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +117 -62
- package/dest/sequencer/block_builder.d.ts +4 -3
- package/dest/sequencer/block_builder.d.ts.map +1 -1
- package/dest/sequencer/block_builder.js +5 -8
- package/dest/sequencer/config.d.ts +2 -2
- package/dest/sequencer/config.d.ts.map +1 -1
- package/dest/sequencer/errors.d.ts +1 -1
- package/dest/sequencer/errors.d.ts.map +1 -1
- package/dest/sequencer/index.d.ts +1 -1
- package/dest/sequencer/metrics.d.ts +12 -3
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +38 -0
- package/dest/sequencer/sequencer.d.ts +48 -27
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +418 -166
- package/dest/sequencer/timetable.d.ts +3 -1
- package/dest/sequencer/timetable.d.ts.map +1 -1
- package/dest/sequencer/utils.d.ts +1 -1
- package/dest/test/index.d.ts +2 -2
- package/dest/test/index.d.ts.map +1 -1
- package/dest/tx_validator/nullifier_cache.d.ts +1 -1
- package/dest/tx_validator/nullifier_cache.d.ts.map +1 -1
- package/dest/tx_validator/tx_validator_factory.d.ts +4 -3
- package/dest/tx_validator/tx_validator_factory.d.ts.map +1 -1
- package/dest/tx_validator/tx_validator_factory.js +1 -1
- package/package.json +31 -30
- package/src/client/sequencer-client.ts +6 -9
- package/src/config.ts +12 -6
- package/src/global_variable_builder/global_builder.ts +19 -17
- package/src/publisher/config.ts +17 -6
- package/src/publisher/sequencer-publisher-factory.ts +4 -2
- package/src/publisher/sequencer-publisher.ts +165 -94
- package/src/sequencer/block_builder.ts +8 -12
- package/src/sequencer/config.ts +1 -1
- package/src/sequencer/metrics.ts +52 -3
- package/src/sequencer/sequencer.ts +480 -198
- package/src/sequencer/timetable.ts +7 -0
- package/src/test/index.ts +1 -1
- package/src/tx_validator/tx_validator_factory.ts +3 -2
package/src/sequencer/metrics.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import type { RollupContract } from '@aztec/ethereum';
|
|
2
|
+
import type { RollupContract } from '@aztec/ethereum/contracts';
|
|
3
|
+
import type { SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
4
|
import {
|
|
4
5
|
Attributes,
|
|
5
6
|
type Gauge,
|
|
@@ -36,7 +37,12 @@ export class SequencerMetrics {
|
|
|
36
37
|
private slots: UpDownCounter;
|
|
37
38
|
private filledSlots: UpDownCounter;
|
|
38
39
|
|
|
39
|
-
private
|
|
40
|
+
private blockProposalFailed: UpDownCounter;
|
|
41
|
+
private blockProposalSuccess: UpDownCounter;
|
|
42
|
+
private blockProposalPrecheckFailed: UpDownCounter;
|
|
43
|
+
private slashingAttempts: UpDownCounter;
|
|
44
|
+
|
|
45
|
+
private lastSeenSlot?: SlotNumber;
|
|
40
46
|
|
|
41
47
|
constructor(
|
|
42
48
|
client: TelemetryClient,
|
|
@@ -121,6 +127,29 @@ export class SequencerMetrics {
|
|
|
121
127
|
valueType: ValueType.INT,
|
|
122
128
|
description: 'The minimum number of attestations required to publish a block',
|
|
123
129
|
});
|
|
130
|
+
|
|
131
|
+
this.blockProposalFailed = this.meter.createUpDownCounter(Metrics.SEQUENCER_BLOCK_PROPOSAL_FAILED_COUNT, {
|
|
132
|
+
valueType: ValueType.INT,
|
|
133
|
+
description: 'The number of times block proposal failed (including validation builds)',
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
this.blockProposalSuccess = this.meter.createUpDownCounter(Metrics.SEQUENCER_BLOCK_PROPOSAL_SUCCESS_COUNT, {
|
|
137
|
+
valueType: ValueType.INT,
|
|
138
|
+
description: 'The number of times block proposal succeeded (including validation builds)',
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
this.blockProposalPrecheckFailed = this.meter.createUpDownCounter(
|
|
142
|
+
Metrics.SEQUENCER_BLOCK_PROPOSAL_PRECHECK_FAILED_COUNT,
|
|
143
|
+
{
|
|
144
|
+
valueType: ValueType.INT,
|
|
145
|
+
description: 'The number of times block proposal pre-build checks failed',
|
|
146
|
+
},
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
this.slashingAttempts = this.meter.createUpDownCounter(Metrics.SEQUENCER_SLASHING_ATTEMPTS_COUNT, {
|
|
150
|
+
valueType: ValueType.INT,
|
|
151
|
+
description: 'The number of slashing action attempts',
|
|
152
|
+
});
|
|
124
153
|
}
|
|
125
154
|
|
|
126
155
|
public recordRequiredAttestations(requiredAttestationsCount: number, allowanceMs: number) {
|
|
@@ -157,7 +186,7 @@ export class SequencerMetrics {
|
|
|
157
186
|
});
|
|
158
187
|
}
|
|
159
188
|
|
|
160
|
-
incOpenSlot(slot:
|
|
189
|
+
incOpenSlot(slot: SlotNumber, proposer: string) {
|
|
161
190
|
// sequencer went through the loop a second time. Noop
|
|
162
191
|
if (slot === this.lastSeenSlot) {
|
|
163
192
|
return;
|
|
@@ -188,4 +217,24 @@ export class SequencerMetrics {
|
|
|
188
217
|
}
|
|
189
218
|
}
|
|
190
219
|
}
|
|
220
|
+
|
|
221
|
+
recordBlockProposalFailed(reason?: string) {
|
|
222
|
+
this.blockProposalFailed.add(1, {
|
|
223
|
+
...(reason && { [Attributes.ERROR_TYPE]: reason }),
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
recordBlockProposalSuccess() {
|
|
228
|
+
this.blockProposalSuccess.add(1);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
recordBlockProposalPrecheckFailed(checkType: string) {
|
|
232
|
+
this.blockProposalPrecheckFailed.add(1, {
|
|
233
|
+
[Attributes.ERROR_TYPE]: checkType,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
recordSlashingAttempt(actionCount: number) {
|
|
238
|
+
this.slashingAttempts.add(actionCount);
|
|
239
|
+
}
|
|
191
240
|
}
|