@aztec/sequencer-client 0.0.0-test.1 → 0.0.1-commit.0b941701

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 (135) hide show
  1. package/dest/client/index.d.ts +1 -1
  2. package/dest/client/sequencer-client.d.ts +31 -31
  3. package/dest/client/sequencer-client.d.ts.map +1 -1
  4. package/dest/client/sequencer-client.js +82 -60
  5. package/dest/config.d.ts +15 -16
  6. package/dest/config.d.ts.map +1 -1
  7. package/dest/config.js +118 -70
  8. package/dest/global_variable_builder/global_builder.d.ts +26 -15
  9. package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
  10. package/dest/global_variable_builder/global_builder.js +62 -44
  11. package/dest/global_variable_builder/index.d.ts +1 -1
  12. package/dest/index.d.ts +2 -4
  13. package/dest/index.d.ts.map +1 -1
  14. package/dest/index.js +1 -3
  15. package/dest/publisher/config.d.ts +15 -12
  16. package/dest/publisher/config.d.ts.map +1 -1
  17. package/dest/publisher/config.js +32 -19
  18. package/dest/publisher/index.d.ts +3 -1
  19. package/dest/publisher/index.d.ts.map +1 -1
  20. package/dest/publisher/index.js +3 -0
  21. package/dest/publisher/sequencer-publisher-factory.d.ts +44 -0
  22. package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -0
  23. package/dest/publisher/sequencer-publisher-factory.js +51 -0
  24. package/dest/publisher/sequencer-publisher-metrics.d.ts +5 -4
  25. package/dest/publisher/sequencer-publisher-metrics.d.ts.map +1 -1
  26. package/dest/publisher/sequencer-publisher-metrics.js +26 -62
  27. package/dest/publisher/sequencer-publisher.d.ts +134 -87
  28. package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
  29. package/dest/publisher/sequencer-publisher.js +1146 -249
  30. package/dest/sequencer/checkpoint_proposal_job.d.ts +79 -0
  31. package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -0
  32. package/dest/sequencer/checkpoint_proposal_job.js +1165 -0
  33. package/dest/sequencer/checkpoint_voter.d.ts +35 -0
  34. package/dest/sequencer/checkpoint_voter.d.ts.map +1 -0
  35. package/dest/sequencer/checkpoint_voter.js +109 -0
  36. package/dest/sequencer/config.d.ts +7 -1
  37. package/dest/sequencer/config.d.ts.map +1 -1
  38. package/dest/sequencer/errors.d.ts +11 -0
  39. package/dest/sequencer/errors.d.ts.map +1 -0
  40. package/dest/sequencer/errors.js +15 -0
  41. package/dest/sequencer/events.d.ts +46 -0
  42. package/dest/sequencer/events.d.ts.map +1 -0
  43. package/dest/sequencer/events.js +1 -0
  44. package/dest/sequencer/index.d.ts +4 -2
  45. package/dest/sequencer/index.d.ts.map +1 -1
  46. package/dest/sequencer/index.js +3 -1
  47. package/dest/sequencer/metrics.d.ts +48 -12
  48. package/dest/sequencer/metrics.d.ts.map +1 -1
  49. package/dest/sequencer/metrics.js +204 -69
  50. package/dest/sequencer/sequencer.d.ts +144 -137
  51. package/dest/sequencer/sequencer.d.ts.map +1 -1
  52. package/dest/sequencer/sequencer.js +967 -525
  53. package/dest/sequencer/timetable.d.ts +76 -24
  54. package/dest/sequencer/timetable.d.ts.map +1 -1
  55. package/dest/sequencer/timetable.js +177 -61
  56. package/dest/sequencer/types.d.ts +3 -0
  57. package/dest/sequencer/types.d.ts.map +1 -0
  58. package/dest/sequencer/types.js +1 -0
  59. package/dest/sequencer/utils.d.ts +20 -38
  60. package/dest/sequencer/utils.d.ts.map +1 -1
  61. package/dest/sequencer/utils.js +12 -47
  62. package/dest/test/index.d.ts +9 -1
  63. package/dest/test/index.d.ts.map +1 -1
  64. package/dest/test/index.js +0 -4
  65. package/dest/test/mock_checkpoint_builder.d.ts +95 -0
  66. package/dest/test/mock_checkpoint_builder.d.ts.map +1 -0
  67. package/dest/test/mock_checkpoint_builder.js +222 -0
  68. package/dest/test/utils.d.ts +53 -0
  69. package/dest/test/utils.d.ts.map +1 -0
  70. package/dest/test/utils.js +103 -0
  71. package/package.json +47 -45
  72. package/src/client/sequencer-client.ts +106 -107
  73. package/src/config.ts +131 -81
  74. package/src/global_variable_builder/global_builder.ts +84 -55
  75. package/src/index.ts +1 -3
  76. package/src/publisher/config.ts +45 -32
  77. package/src/publisher/index.ts +4 -0
  78. package/src/publisher/sequencer-publisher-factory.ts +92 -0
  79. package/src/publisher/sequencer-publisher-metrics.ts +30 -64
  80. package/src/publisher/sequencer-publisher.ts +967 -295
  81. package/src/sequencer/README.md +531 -0
  82. package/src/sequencer/checkpoint_proposal_job.ts +845 -0
  83. package/src/sequencer/checkpoint_voter.ts +130 -0
  84. package/src/sequencer/config.ts +8 -0
  85. package/src/sequencer/errors.ts +21 -0
  86. package/src/sequencer/events.ts +27 -0
  87. package/src/sequencer/index.ts +3 -1
  88. package/src/sequencer/metrics.ts +269 -72
  89. package/src/sequencer/sequencer.ts +708 -588
  90. package/src/sequencer/timetable.ts +221 -62
  91. package/src/sequencer/types.ts +6 -0
  92. package/src/sequencer/utils.ts +28 -60
  93. package/src/test/index.ts +12 -4
  94. package/src/test/mock_checkpoint_builder.ts +311 -0
  95. package/src/test/utils.ts +164 -0
  96. package/dest/sequencer/allowed.d.ts +0 -3
  97. package/dest/sequencer/allowed.d.ts.map +0 -1
  98. package/dest/sequencer/allowed.js +0 -27
  99. package/dest/slasher/factory.d.ts +0 -7
  100. package/dest/slasher/factory.d.ts.map +0 -1
  101. package/dest/slasher/factory.js +0 -8
  102. package/dest/slasher/index.d.ts +0 -3
  103. package/dest/slasher/index.d.ts.map +0 -1
  104. package/dest/slasher/index.js +0 -2
  105. package/dest/slasher/slasher_client.d.ts +0 -75
  106. package/dest/slasher/slasher_client.d.ts.map +0 -1
  107. package/dest/slasher/slasher_client.js +0 -132
  108. package/dest/tx_validator/archive_cache.d.ts +0 -14
  109. package/dest/tx_validator/archive_cache.d.ts.map +0 -1
  110. package/dest/tx_validator/archive_cache.js +0 -22
  111. package/dest/tx_validator/gas_validator.d.ts +0 -14
  112. package/dest/tx_validator/gas_validator.d.ts.map +0 -1
  113. package/dest/tx_validator/gas_validator.js +0 -78
  114. package/dest/tx_validator/nullifier_cache.d.ts +0 -16
  115. package/dest/tx_validator/nullifier_cache.d.ts.map +0 -1
  116. package/dest/tx_validator/nullifier_cache.js +0 -24
  117. package/dest/tx_validator/phases_validator.d.ts +0 -12
  118. package/dest/tx_validator/phases_validator.d.ts.map +0 -1
  119. package/dest/tx_validator/phases_validator.js +0 -80
  120. package/dest/tx_validator/test_utils.d.ts +0 -23
  121. package/dest/tx_validator/test_utils.d.ts.map +0 -1
  122. package/dest/tx_validator/test_utils.js +0 -26
  123. package/dest/tx_validator/tx_validator_factory.d.ts +0 -18
  124. package/dest/tx_validator/tx_validator_factory.d.ts.map +0 -1
  125. package/dest/tx_validator/tx_validator_factory.js +0 -50
  126. package/src/sequencer/allowed.ts +0 -36
  127. package/src/slasher/factory.ts +0 -15
  128. package/src/slasher/index.ts +0 -2
  129. package/src/slasher/slasher_client.ts +0 -193
  130. package/src/tx_validator/archive_cache.ts +0 -28
  131. package/src/tx_validator/gas_validator.ts +0 -101
  132. package/src/tx_validator/nullifier_cache.ts +0 -30
  133. package/src/tx_validator/phases_validator.ts +0 -98
  134. package/src/tx_validator/test_utils.ts +0 -48
  135. package/src/tx_validator/tx_validator_factory.ts +0 -120
@@ -1,78 +1,96 @@
1
- import { Attributes, Metrics, ValueType } from '@aztec/telemetry-client';
2
- import { sequencerStateToNumber } from './utils.js';
1
+ import { Attributes, Metrics } from '@aztec/telemetry-client';
2
+ import { formatUnits } from 'viem';
3
+ // TODO(palla/mbps): Review all metrics and add any missing ones per checkpoint
3
4
  export class SequencerMetrics {
5
+ rollup;
4
6
  tracer;
7
+ meter;
5
8
  blockCounter;
6
9
  blockBuildDuration;
7
10
  blockBuildManaPerSecond;
8
11
  stateTransitionBufferDuration;
9
- currentBlockNumber;
10
- currentBlockSize;
11
- blockBuilderInsertions;
12
+ // these are gauges because for individual sequencers building a block is not something that happens often enough to warrant a histogram
12
13
  timeToCollectAttestations;
13
- constructor(client, getState, name = 'Sequencer'){
14
- const meter = client.getMeter(name);
14
+ allowanceToCollectAttestations;
15
+ requiredAttestions;
16
+ collectedAttestions;
17
+ rewards;
18
+ slots;
19
+ filledSlots;
20
+ blockProposalFailed;
21
+ blockProposalSuccess;
22
+ blockProposalPrecheckFailed;
23
+ checkpointSuccess;
24
+ slashingAttempts;
25
+ checkpointAttestationDelay;
26
+ // Fisherman fee analysis metrics
27
+ fishermanWouldBeIncluded;
28
+ fishermanTimeBeforeBlock;
29
+ fishermanPendingBlobTxCount;
30
+ fishermanIncludedBlobTxCount;
31
+ fishermanCalculatedPriorityFee;
32
+ fishermanPriorityFeeDelta;
33
+ fishermanEstimatedCost;
34
+ fishermanEstimatedOverpayment;
35
+ fishermanMinedBlobTxPriorityFee;
36
+ fishermanMinedBlobTxTotalCost;
37
+ lastSeenSlot;
38
+ constructor(client, rollup, name = 'Sequencer'){
39
+ this.rollup = rollup;
40
+ this.meter = client.getMeter(name);
15
41
  this.tracer = client.getTracer(name);
16
- this.blockCounter = meter.createUpDownCounter(Metrics.SEQUENCER_BLOCK_COUNT);
17
- this.blockBuildDuration = meter.createHistogram(Metrics.SEQUENCER_BLOCK_BUILD_DURATION, {
18
- unit: 'ms',
19
- description: 'Duration to build a block',
20
- valueType: ValueType.INT
21
- });
22
- this.blockBuildManaPerSecond = meter.createGauge(Metrics.SEQUENCER_BLOCK_BUILD_MANA_PER_SECOND, {
23
- unit: 'mana/s',
24
- description: 'Mana per second when building a block',
25
- valueType: ValueType.INT
26
- });
27
- this.stateTransitionBufferDuration = meter.createHistogram(Metrics.SEQUENCER_STATE_TRANSITION_BUFFER_DURATION, {
28
- unit: 'ms',
29
- description: 'The time difference between when the sequencer needed to transition to a new state and when it actually did.',
30
- valueType: ValueType.INT
31
- });
32
- const currentState = meter.createObservableGauge(Metrics.SEQUENCER_CURRENT_STATE, {
33
- description: 'Current state of the sequencer'
34
- });
35
- currentState.addCallback((observer)=>{
36
- observer.observe(sequencerStateToNumber(getState()));
37
- });
38
- this.currentBlockNumber = meter.createGauge(Metrics.SEQUENCER_CURRENT_BLOCK_NUMBER, {
39
- description: 'Current block number',
40
- valueType: ValueType.INT
41
- });
42
- this.currentBlockSize = meter.createGauge(Metrics.SEQUENCER_CURRENT_BLOCK_SIZE, {
43
- description: 'Current block size',
44
- valueType: ValueType.INT
45
- });
46
- this.timeToCollectAttestations = meter.createGauge(Metrics.SEQUENCER_TIME_TO_COLLECT_ATTESTATIONS, {
47
- description: 'The time spent collecting attestations from committee members',
48
- valueType: ValueType.INT
42
+ this.blockCounter = this.meter.createUpDownCounter(Metrics.SEQUENCER_BLOCK_COUNT);
43
+ this.blockBuildDuration = this.meter.createHistogram(Metrics.SEQUENCER_BLOCK_BUILD_DURATION);
44
+ this.blockBuildManaPerSecond = this.meter.createGauge(Metrics.SEQUENCER_BLOCK_BUILD_MANA_PER_SECOND);
45
+ this.stateTransitionBufferDuration = this.meter.createHistogram(Metrics.SEQUENCER_STATE_TRANSITION_BUFFER_DURATION);
46
+ this.checkpointAttestationDelay = this.meter.createHistogram(Metrics.SEQUENCER_CHECKPOINT_ATTESTATION_DELAY);
47
+ // Init gauges and counters
48
+ this.blockCounter.add(0, {
49
+ [Attributes.STATUS]: 'failed'
49
50
  });
50
- this.blockBuilderInsertions = meter.createHistogram(Metrics.SEQUENCER_BLOCK_BUILD_INSERTION_TIME, {
51
- description: 'Timer for tree insertions performed by the block builder',
52
- unit: 'us',
53
- valueType: ValueType.INT
51
+ this.blockCounter.add(0, {
52
+ [Attributes.STATUS]: 'built'
54
53
  });
55
- this.setCurrentBlock(0, 0);
54
+ this.rewards = this.meter.createGauge(Metrics.SEQUENCER_CURRENT_BLOCK_REWARDS);
55
+ this.slots = this.meter.createUpDownCounter(Metrics.SEQUENCER_SLOT_COUNT);
56
+ /**
57
+ * NOTE: we do not track missed slots as a separate metric. That would be difficult to determine
58
+ * Instead, use a computed metric, `slots - filledSlots` to get the number of slots a sequencer has missed.
59
+ */ this.filledSlots = this.meter.createUpDownCounter(Metrics.SEQUENCER_FILLED_SLOT_COUNT);
60
+ this.timeToCollectAttestations = this.meter.createGauge(Metrics.SEQUENCER_COLLECT_ATTESTATIONS_DURATION);
61
+ this.allowanceToCollectAttestations = this.meter.createGauge(Metrics.SEQUENCER_COLLECT_ATTESTATIONS_TIME_ALLOWANCE);
62
+ this.requiredAttestions = this.meter.createGauge(Metrics.SEQUENCER_REQUIRED_ATTESTATIONS_COUNT);
63
+ this.collectedAttestions = this.meter.createGauge(Metrics.SEQUENCER_COLLECTED_ATTESTATIONS_COUNT);
64
+ this.blockProposalFailed = this.meter.createUpDownCounter(Metrics.SEQUENCER_BLOCK_PROPOSAL_FAILED_COUNT);
65
+ this.blockProposalSuccess = this.meter.createUpDownCounter(Metrics.SEQUENCER_BLOCK_PROPOSAL_SUCCESS_COUNT);
66
+ this.checkpointSuccess = this.meter.createUpDownCounter(Metrics.SEQUENCER_CHECKPOINT_SUCCESS_COUNT);
67
+ this.blockProposalPrecheckFailed = this.meter.createUpDownCounter(Metrics.SEQUENCER_BLOCK_PROPOSAL_PRECHECK_FAILED_COUNT);
68
+ this.slashingAttempts = this.meter.createUpDownCounter(Metrics.SEQUENCER_SLASHING_ATTEMPTS_COUNT);
69
+ // Fisherman fee analysis metrics
70
+ this.fishermanWouldBeIncluded = this.meter.createUpDownCounter(Metrics.FISHERMAN_FEE_ANALYSIS_WOULD_BE_INCLUDED);
71
+ this.fishermanTimeBeforeBlock = this.meter.createHistogram(Metrics.FISHERMAN_FEE_ANALYSIS_TIME_BEFORE_BLOCK);
72
+ this.fishermanPendingBlobTxCount = this.meter.createHistogram(Metrics.FISHERMAN_FEE_ANALYSIS_PENDING_BLOB_TX_COUNT);
73
+ this.fishermanIncludedBlobTxCount = this.meter.createHistogram(Metrics.FISHERMAN_FEE_ANALYSIS_INCLUDED_BLOB_TX_COUNT);
74
+ this.fishermanCalculatedPriorityFee = this.meter.createHistogram(Metrics.FISHERMAN_FEE_ANALYSIS_CALCULATED_PRIORITY_FEE);
75
+ this.fishermanPriorityFeeDelta = this.meter.createHistogram(Metrics.FISHERMAN_FEE_ANALYSIS_PRIORITY_FEE_DELTA);
76
+ this.fishermanEstimatedCost = this.meter.createHistogram(Metrics.FISHERMAN_FEE_ANALYSIS_ESTIMATED_COST);
77
+ this.fishermanEstimatedOverpayment = this.meter.createHistogram(Metrics.FISHERMAN_FEE_ANALYSIS_ESTIMATED_OVERPAYMENT);
78
+ this.fishermanMinedBlobTxPriorityFee = this.meter.createHistogram(Metrics.FISHERMAN_FEE_ANALYSIS_MINED_BLOB_TX_PRIORITY_FEE);
79
+ this.fishermanMinedBlobTxTotalCost = this.meter.createHistogram(Metrics.FISHERMAN_FEE_ANALYSIS_MINED_BLOB_TX_TOTAL_COST);
56
80
  }
57
- startCollectingAttestationsTimer() {
58
- const startTime = Date.now();
59
- const stop = ()=>{
60
- const duration = Date.now() - startTime;
61
- this.recordTimeToCollectAttestations(duration);
62
- };
63
- return stop.bind(this);
81
+ recordRequiredAttestations(requiredAttestationsCount, allowanceMs) {
82
+ this.requiredAttestions.record(requiredAttestationsCount);
83
+ this.allowanceToCollectAttestations.record(Math.ceil(allowanceMs));
84
+ // reset
85
+ this.collectedAttestions.record(0);
86
+ this.timeToCollectAttestations.record(0);
64
87
  }
65
- recordTimeToCollectAttestations(time) {
66
- this.timeToCollectAttestations.record(time);
88
+ recordCheckpointAttestationDelay(duration) {
89
+ this.checkpointAttestationDelay.record(duration);
67
90
  }
68
- recordBlockBuilderTreeInsertions(timeUs) {
69
- this.blockBuilderInsertions.record(Math.ceil(timeUs));
70
- }
71
- recordCancelledBlock() {
72
- this.blockCounter.add(1, {
73
- [Attributes.STATUS]: 'cancelled'
74
- });
75
- this.setCurrentBlock(0, 0);
91
+ recordCollectedAttestations(count, durationMs) {
92
+ this.collectedAttestions.record(count);
93
+ this.timeToCollectAttestations.record(Math.ceil(durationMs));
76
94
  }
77
95
  recordBuiltBlock(buildDurationMs, totalMana) {
78
96
  this.blockCounter.add(1, {
@@ -85,18 +103,135 @@ export class SequencerMetrics {
85
103
  this.blockCounter.add(1, {
86
104
  [Attributes.STATUS]: 'failed'
87
105
  });
88
- this.setCurrentBlock(0, 0);
89
- }
90
- recordNewBlock(blockNumber, txCount) {
91
- this.setCurrentBlock(blockNumber, txCount);
92
106
  }
93
107
  recordStateTransitionBufferMs(durationMs, state) {
94
108
  this.stateTransitionBufferDuration.record(durationMs, {
95
109
  [Attributes.SEQUENCER_STATE]: state
96
110
  });
97
111
  }
98
- setCurrentBlock(blockNumber, txCount) {
99
- this.currentBlockNumber.record(blockNumber);
100
- this.currentBlockSize.record(txCount);
112
+ incOpenSlot(slot, proposer) {
113
+ // sequencer went through the loop a second time. Noop
114
+ if (slot === this.lastSeenSlot) {
115
+ return;
116
+ }
117
+ this.slots.add(1, {
118
+ [Attributes.BLOCK_PROPOSER]: proposer
119
+ });
120
+ this.lastSeenSlot = slot;
121
+ }
122
+ async incFilledSlot(proposer, coinbase) {
123
+ this.filledSlots.add(1, {
124
+ [Attributes.BLOCK_PROPOSER]: proposer
125
+ });
126
+ this.lastSeenSlot = undefined;
127
+ if (coinbase) {
128
+ try {
129
+ const rewards = await this.rollup.getSequencerRewards(coinbase);
130
+ const fmt = parseFloat(formatUnits(rewards, 18));
131
+ this.rewards.record(fmt, {
132
+ [Attributes.COINBASE]: coinbase.toString()
133
+ });
134
+ } catch {
135
+ // no-op
136
+ }
137
+ }
138
+ }
139
+ recordCheckpointSuccess() {
140
+ this.checkpointSuccess.add(1);
141
+ }
142
+ recordBlockProposalFailed(reason) {
143
+ this.blockProposalFailed.add(1, {
144
+ ...reason && {
145
+ [Attributes.ERROR_TYPE]: reason
146
+ }
147
+ });
148
+ }
149
+ recordBlockProposalSuccess() {
150
+ this.blockProposalSuccess.add(1);
151
+ }
152
+ recordBlockProposalPrecheckFailed(checkType) {
153
+ this.blockProposalPrecheckFailed.add(1, {
154
+ [Attributes.ERROR_TYPE]: checkType
155
+ });
156
+ }
157
+ recordSlashingAttempt(actionCount) {
158
+ this.slashingAttempts.add(actionCount);
159
+ }
160
+ /**
161
+ * Records metrics for a completed fisherman fee analysis
162
+ * @param analysis - The completed fee analysis result
163
+ */ recordFishermanFeeAnalysis(analysis) {
164
+ // In fisherman mode, we should always have strategy results
165
+ if (!analysis.computedPrices.strategyResults || analysis.computedPrices.strategyResults.length === 0) {
166
+ // This should never happen in fisherman mode - log an error
167
+ // We don't record metrics without strategy IDs as that defeats the purpose
168
+ throw new Error(`No strategy results found in fisherman fee analysis ${analysis.id}. This indicates a bug in the fee analysis.`);
169
+ }
170
+ // Record metrics for each strategy separately
171
+ for (const strategyResult of analysis.computedPrices.strategyResults){
172
+ const strategyAttributes = {
173
+ [Attributes.FISHERMAN_FEE_STRATEGY_ID]: strategyResult.strategyId
174
+ };
175
+ // Record pending block snapshot data (once per strategy for comparison)
176
+ this.fishermanPendingBlobTxCount.record(analysis.pendingSnapshot.pendingBlobTxCount, strategyAttributes);
177
+ // Record mined block data if available
178
+ if (analysis.minedBlock) {
179
+ this.fishermanIncludedBlobTxCount.record(analysis.minedBlock.includedBlobTxCount, strategyAttributes);
180
+ // Record actual fees from blob transactions in the mined block
181
+ for (const blobTx of analysis.minedBlock.includedBlobTxs){
182
+ // Record priority fee per gas in Gwei
183
+ const priorityFeeGwei = Number(blobTx.maxPriorityFeePerGas) / 1e9;
184
+ this.fishermanMinedBlobTxPriorityFee.record(priorityFeeGwei, strategyAttributes);
185
+ // Calculate total cost in ETH
186
+ // Cost = (gas * (baseFee + priorityFee)) + (blobCount * blobGasPerBlob * blobBaseFee)
187
+ const baseFee = analysis.minedBlock.baseFeePerGas;
188
+ const effectiveGasPrice = baseFee + blobTx.maxPriorityFeePerGas;
189
+ // Calculate execution cost using actual gas limit from the transaction
190
+ const executionCost = blobTx.gas * effectiveGasPrice;
191
+ // Calculate blob cost using maxFeePerBlobGas * blobCount * GAS_PER_BLOB
192
+ const blobCost = blobTx.maxFeePerBlobGas * BigInt(blobTx.blobCount) * 131072n; // 128KB per blob
193
+ const totalCostWei = executionCost + blobCost;
194
+ const totalCostEth = Number(totalCostWei) / 1e18;
195
+ this.fishermanMinedBlobTxTotalCost.record(totalCostEth, strategyAttributes);
196
+ }
197
+ }
198
+ // Record the calculated priority fee for this strategy
199
+ const calculatedPriorityFeeGwei = Number(strategyResult.calculatedPriorityFee) / 1e9;
200
+ this.fishermanCalculatedPriorityFee.record(calculatedPriorityFeeGwei, strategyAttributes);
201
+ // Record analysis results if available
202
+ if (analysis.analysis) {
203
+ this.fishermanTimeBeforeBlock.record(Math.ceil(analysis.analysis.timeBeforeBlockMs), strategyAttributes);
204
+ // Record strategy-specific inclusion result
205
+ if (strategyResult.wouldBeIncluded !== undefined) {
206
+ if (strategyResult.wouldBeIncluded) {
207
+ this.fishermanWouldBeIncluded.add(1, {
208
+ ...strategyAttributes,
209
+ [Attributes.OK]: true
210
+ });
211
+ } else {
212
+ this.fishermanWouldBeIncluded.add(1, {
213
+ ...strategyAttributes,
214
+ [Attributes.OK]: false,
215
+ ...strategyResult.exclusionReason && {
216
+ [Attributes.ERROR_TYPE]: strategyResult.exclusionReason
217
+ }
218
+ });
219
+ }
220
+ }
221
+ // Record strategy-specific priority fee delta
222
+ if (strategyResult.priorityFeeDelta !== undefined) {
223
+ const priorityFeeDeltaGwei = Number(strategyResult.priorityFeeDelta) / 1e9;
224
+ this.fishermanPriorityFeeDelta.record(priorityFeeDeltaGwei, strategyAttributes);
225
+ }
226
+ // Record estimated cost if available
227
+ if (strategyResult.estimatedCostEth !== undefined) {
228
+ this.fishermanEstimatedCost.record(strategyResult.estimatedCostEth, strategyAttributes);
229
+ }
230
+ // Record estimated overpayment if available
231
+ if (strategyResult.estimatedOverpaymentEth !== undefined) {
232
+ this.fishermanEstimatedOverpayment.record(strategyResult.estimatedOverpaymentEth, strategyAttributes);
233
+ }
234
+ }
235
+ }
101
236
  }
102
237
  }
@@ -1,180 +1,187 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- import type { L2Block } from '@aztec/aztec.js';
1
+ import type { EpochCache } from '@aztec/epoch-cache';
2
+ import { type RollupContract } from '@aztec/ethereum/contracts';
3
+ import { BlockNumber, CheckpointNumber, EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
4
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
5
  import { EthAddress } from '@aztec/foundation/eth-address';
5
- import type { Signature } from '@aztec/foundation/eth-signature';
6
- import { Fr } from '@aztec/foundation/fields';
7
- import { type DateProvider, Timer } from '@aztec/foundation/timer';
6
+ import type { DateProvider } from '@aztec/foundation/timer';
7
+ import type { TypedEventEmitter } from '@aztec/foundation/types';
8
8
  import type { P2P } from '@aztec/p2p';
9
- import type { BlockBuilderFactory } from '@aztec/prover-client/block-builder';
10
- import type { PublicProcessorFactory } from '@aztec/simulator/server';
11
- import { AztecAddress } from '@aztec/stdlib/aztec-address';
12
- import type { L2BlockSource } from '@aztec/stdlib/block';
13
- import type { ContractDataSource } from '@aztec/stdlib/contract';
14
- import type { L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
15
- import { Gas } from '@aztec/stdlib/gas';
16
- import { type WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
9
+ import type { SlasherClientInterface } from '@aztec/slasher';
10
+ import type { L2Block, L2BlockSink, L2BlockSource, ValidateCheckpointResult } from '@aztec/stdlib/block';
11
+ import type { Checkpoint } from '@aztec/stdlib/checkpoint';
12
+ import { type ResolvedSequencerConfig, type SequencerConfig, type WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
17
13
  import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
18
- import { type GlobalVariables, Tx, type TxHash } from '@aztec/stdlib/tx';
19
14
  import { type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
20
- import type { ValidatorClient } from '@aztec/validator-client';
15
+ import { FullNodeCheckpointsBuilder, type ValidatorClient } from '@aztec/validator-client';
21
16
  import type { GlobalVariableBuilder } from '../global_variable_builder/global_builder.js';
22
- import { type SequencerPublisher } from '../publisher/sequencer-publisher.js';
23
- import type { SlasherClient } from '../slasher/slasher_client.js';
24
- import type { SequencerConfig } from './config.js';
17
+ import type { SequencerPublisherFactory } from '../publisher/sequencer-publisher-factory.js';
18
+ import type { InvalidateCheckpointRequest, SequencerPublisher } from '../publisher/sequencer-publisher.js';
19
+ import { CheckpointProposalJob } from './checkpoint_proposal_job.js';
20
+ import type { SequencerEvents } from './events.js';
25
21
  import { SequencerTimetable } from './timetable.js';
22
+ import type { SequencerRollupConstants } from './types.js';
26
23
  import { SequencerState } from './utils.js';
27
24
  export { SequencerState };
28
- type SequencerRollupConstants = Pick<L1RollupConstants, 'ethereumSlotDuration' | 'l1GenesisTime' | 'slotDuration'>;
25
+ declare const Sequencer_base: new () => TypedEventEmitter<SequencerEvents>;
29
26
  /**
30
27
  * Sequencer client
31
- * - Wins a period of time to become the sequencer (depending on finalized protocol).
32
- * - Chooses a set of txs from the tx pool to be in the rollup.
33
- * - Simulate the rollup of txs.
34
- * - Adds proof requests to the request pool (not for this milestone).
35
- * - Receives results to those proofs from the network (repeats as necessary) (not for this milestone).
36
- * - Publishes L1 tx(s) to the rollup contract via RollupPublisher.
28
+ * - Checks whether it is elected as proposer for the next slot
29
+ * - Builds multiple blocks and broadcasts them
30
+ * - Collects attestations for the checkpoint
31
+ * - Publishes the checkpoint to L1
32
+ * - Votes for proposals and slashes on L1
37
33
  */
38
- export declare class Sequencer {
39
- protected publisher: SequencerPublisher;
40
- protected validatorClient: ValidatorClient | undefined;
34
+ export declare class Sequencer extends Sequencer_base {
35
+ protected publisherFactory: SequencerPublisherFactory;
36
+ protected validatorClient: ValidatorClient;
41
37
  protected globalsBuilder: GlobalVariableBuilder;
42
38
  protected p2pClient: P2P;
43
39
  protected worldState: WorldStateSynchronizer;
44
- protected slasherClient: SlasherClient;
45
- protected blockBuilderFactory: BlockBuilderFactory;
46
- protected l2BlockSource: L2BlockSource;
40
+ protected slasherClient: SlasherClientInterface | undefined;
41
+ protected l2BlockSource: L2BlockSource & L2BlockSink;
47
42
  protected l1ToL2MessageSource: L1ToL2MessageSource;
48
- protected publicProcessorFactory: PublicProcessorFactory;
49
- protected contractDataSource: ContractDataSource;
43
+ protected checkpointsBuilder: FullNodeCheckpointsBuilder;
50
44
  protected l1Constants: SequencerRollupConstants;
51
45
  protected dateProvider: DateProvider;
52
- protected config: SequencerConfig;
53
- protected log: import("@aztec/aztec.js").Logger;
46
+ protected epochCache: EpochCache;
47
+ protected rollupContract: RollupContract;
48
+ protected telemetry: TelemetryClient;
49
+ protected log: import("@aztec/foundation/log").Logger;
54
50
  private runningPromise?;
55
- private pollingIntervalMs;
56
- private maxTxsPerBlock;
57
- private minTxsPerBlock;
58
- private maxL1TxInclusionTimeIntoSlot;
59
- private _coinbase;
60
- private _feeRecipient;
61
51
  private state;
62
- private allowedInSetup;
63
- private maxBlockSizeInBytes;
64
- private maxBlockGas;
65
52
  private metrics;
66
- private isFlushing;
53
+ /** The last slot for which we attempted to perform our voting duties with degraded block production */
54
+ private lastSlotForFallbackVote;
55
+ /** The last slot for which we triggered a checkpoint proposal job, to prevent duplicate attempts. */
56
+ private lastSlotForCheckpointProposalJob;
57
+ /** Last successful checkpoint proposed */
58
+ private lastCheckpointProposed;
59
+ /** The last epoch for which we logged strategy comparison in fisherman mode. */
60
+ private lastEpochForStrategyComparison;
67
61
  /** The maximum number of seconds that the sequencer can be into a slot to transition to a particular state. */
68
62
  protected timetable: SequencerTimetable;
69
- protected enforceTimeTable: boolean;
70
- constructor(publisher: SequencerPublisher, validatorClient: ValidatorClient | undefined, // During migration the validator client can be inactive
71
- globalsBuilder: GlobalVariableBuilder, p2pClient: P2P, worldState: WorldStateSynchronizer, slasherClient: SlasherClient, blockBuilderFactory: BlockBuilderFactory, l2BlockSource: L2BlockSource, l1ToL2MessageSource: L1ToL2MessageSource, publicProcessorFactory: PublicProcessorFactory, contractDataSource: ContractDataSource, l1Constants: SequencerRollupConstants, dateProvider: DateProvider, config?: SequencerConfig, telemetry?: TelemetryClient, log?: import("@aztec/aztec.js").Logger);
72
- get tracer(): Tracer;
73
- /**
74
- * Updates sequencer config.
75
- * @param config - New parameters.
76
- */
77
- updateConfig(config: SequencerConfig): Promise<void>;
78
- private setTimeTable;
79
- /**
80
- * Starts the sequencer and moves to IDLE state.
81
- */
82
- start(): Promise<void>;
83
- /**
84
- * Stops the sequencer from processing txs and moves to STOPPED state.
85
- */
63
+ protected publisher: SequencerPublisher | undefined;
64
+ /** Config for the sequencer */
65
+ protected config: ResolvedSequencerConfig;
66
+ constructor(publisherFactory: SequencerPublisherFactory, validatorClient: ValidatorClient, globalsBuilder: GlobalVariableBuilder, p2pClient: P2P, worldState: WorldStateSynchronizer, slasherClient: SlasherClientInterface | undefined, l2BlockSource: L2BlockSource & L2BlockSink, l1ToL2MessageSource: L1ToL2MessageSource, checkpointsBuilder: FullNodeCheckpointsBuilder, l1Constants: SequencerRollupConstants, dateProvider: DateProvider, epochCache: EpochCache, rollupContract: RollupContract, config: SequencerConfig, telemetry?: TelemetryClient, log?: import("@aztec/foundation/log").Logger);
67
+ /** Updates sequencer config by the defined values and updates the timetable */
68
+ updateConfig(config: Partial<SequencerConfig>): void;
69
+ /** Initializes the sequencer (precomputes tables and creates a publisher). Takes about 3s. */
70
+ init(): Promise<void>;
71
+ /** Starts the sequencer and moves to IDLE state. */
72
+ start(): void;
73
+ /** Stops the sequencer from building blocks and moves to STOPPED state. */
86
74
  stop(): Promise<void>;
87
- /**
88
- * Starts a previously stopped sequencer.
89
- */
90
- restart(): void;
91
- /**
92
- * Returns the current state of the sequencer.
93
- * @returns An object with a state entry with one of SequencerState.
94
- */
75
+ /** Main sequencer loop with a try/catch */
76
+ protected safeWork(): Promise<void>;
77
+ /** Returns the current state of the sequencer. */
95
78
  status(): {
96
79
  state: SequencerState;
97
80
  };
98
- /** Forces the sequencer to bypass all time and tx count checks for the next block and build anyway. */
99
- flush(): void;
100
81
  /**
101
- * @notice Performs most of the sequencer duties:
102
- * - Checks if we are up to date
103
- * - If we are and we are the sequencer, collect txs and build a block
104
- * - Collect attestations for the block
105
- * - Submit block
106
- * - If our block for some reason is not included, revert the state
82
+ * Main sequencer loop:
83
+ * - Checks if we are up to date
84
+ * - If we are and we are the sequencer, collect txs and build blocks
85
+ * - Build multiple blocks per slot when configured
86
+ * - Collect attestations for the final block
87
+ * - Submit checkpoint
107
88
  */
108
- protected doRealWork(): Promise<void>;
109
- protected work(): Promise<void>;
110
- getForwarderAddress(): EthAddress;
89
+ protected work(): Promise<Checkpoint | undefined>;
90
+ private prepareCheckpointProposal;
91
+ protected createCheckpointProposalJob(epoch: EpochNumber, slot: SlotNumber, checkpointNumber: CheckpointNumber, syncedToBlockNumber: BlockNumber, proposer: EthAddress | undefined, publisher: SequencerPublisher, attestorAddress: EthAddress, invalidateCheckpoint: InvalidateCheckpointRequest | undefined): CheckpointProposalJob;
111
92
  /**
112
- * Checks if we can propose at the next block and returns the slot number if we can.
113
- * @param tipArchive - The archive of the previous block.
114
- * @param proposalBlockNumber - The block number of the proposal.
115
- * @returns The slot number if we can propose at the next block, otherwise undefined.
116
- */
117
- slotForProposal(tipArchive: Buffer, proposalBlockNumber: bigint): Promise<bigint | undefined>;
118
- /**
119
- * Sets the sequencer state and checks if we have enough time left in the slot to transition to the new state.
93
+ * Internal helper for setting the sequencer state and checks if we have enough time left in the slot to transition to the new state.
120
94
  * @param proposedState - The new state to transition to.
121
- * @param currentSlotNumber - The current slot number.
95
+ * @param slotNumber - The current slot number.
122
96
  * @param force - Whether to force the transition even if the sequencer is stopped.
123
- *
124
- * @dev If the `currentSlotNumber` doesn't matter (e.g. transitioning to IDLE), pass in `0n`;
125
- * it is only used to check if we have enough time left in the slot to transition to the new state.
126
97
  */
127
- setState(proposedState: SequencerState, currentSlotNumber: bigint, force?: boolean): void;
98
+ protected setState(proposedState: SequencerState, slotNumber: SlotNumber | undefined, opts?: {
99
+ force?: boolean;
100
+ }): void;
128
101
  /**
129
- * Build a block
130
- *
131
- * Shared between the sequencer and the validator for re-execution
132
- *
133
- * @param pendingTxs - The pending transactions to construct the block from
134
- * @param newGlobalVariables - The global variables for the new block
135
- * @param historicalHeader - The historical header of the parent
136
- * @param opts - Whether to just validate the block as a validator, as opposed to building it as a proposal
102
+ * Returns whether all dependencies have caught up.
103
+ * We don't check against the previous block submitted since it may have been reorg'd out.
137
104
  */
138
- protected buildBlock(pendingTxs: Iterable<Tx> | AsyncIterable<Tx>, newGlobalVariables: GlobalVariables, opts?: {
139
- validateOnly?: boolean;
140
- }): Promise<{
141
- block: L2Block;
142
- publicGas: Gas;
143
- publicProcessorDuration: number;
144
- numMsgs: number;
145
- numTxs: number;
146
- numFailedTxs: number;
147
- blockBuildingTimer: Timer;
148
- }>;
105
+ protected checkSync(args: {
106
+ ts: bigint;
107
+ slot: SlotNumber;
108
+ }): Promise<SequencerSyncCheckResult | undefined>;
149
109
  /**
150
- * @notice Build and propose a block to the chain
151
- *
152
- * @dev MUST throw instead of exiting early to ensure that world-state
153
- * is being rolled back if the block is dropped.
154
- *
155
- * @param pendingTxs - Iterable of pending transactions to construct the block from
156
- * @param proposalHeader - The partial header constructed for the proposal
110
+ * Checks if we are the proposer for the next slot.
111
+ * @returns True if we can propose, and the proposer address (undefined if anyone can propose)
157
112
  */
158
- private buildBlockAndEnqueuePublish;
159
- protected collectAttestations(block: L2Block, txHashes: TxHash[]): Promise<Signature[] | undefined>;
113
+ protected checkCanPropose(slot: SlotNumber): Promise<[boolean, EthAddress | undefined]>;
160
114
  /**
161
- * Publishes the L2Block to the rollup contract.
162
- * @param block - The L2Block to be published.
115
+ * Tries to vote on slashing actions and governance when the sync check fails but we're past the max time for initializing a proposal.
116
+ * This allows the sequencer to participate in governance/slashing votes even when it cannot build blocks.
163
117
  */
164
- protected enqueuePublishL2Block(block: L2Block, attestations?: Signature[], txHashes?: TxHash[]): Promise<void>;
118
+ protected tryVoteWhenSyncFails(args: {
119
+ slot: SlotNumber;
120
+ ts: bigint;
121
+ }): Promise<void>;
165
122
  /**
166
- * Returns whether all dependencies have caught up.
167
- * We don't check against the previous block submitted since it may have been reorg'd out.
168
- * @returns Boolean indicating if our dependencies are synced to the latest block.
123
+ * Tries to vote on slashing actions and governance proposals when escape hatch is open.
124
+ * This allows the sequencer to participate in voting without performing checkpoint proposal work.
125
+ */
126
+ protected tryVoteWhenEscapeHatchOpen(args: {
127
+ slot: SlotNumber;
128
+ proposer: EthAddress | undefined;
129
+ }): Promise<void>;
130
+ /**
131
+ * Considers invalidating a block if the pending chain is invalid. Depends on how long the invalid block
132
+ * has been there without being invalidated and whether the sequencer is in the committee or not. We always
133
+ * have the proposer try to invalidate, but if they fail, the sequencers in the committee are expected to try,
134
+ * and if they fail, any sequencer will try as well.
169
135
  */
170
- protected getChainTip(): Promise<{
171
- blockNumber: number;
172
- archive: Fr;
173
- } | undefined>;
174
- private getSlotStartTimestamp;
136
+ protected considerInvalidatingCheckpoint(syncedTo: SequencerSyncCheckResult, currentSlot: SlotNumber): Promise<void>;
137
+ private logStrategyComparison;
138
+ private getSlotStartBuildTimestamp;
175
139
  private getSecondsIntoSlot;
176
140
  get aztecSlotDuration(): number;
177
- get coinbase(): EthAddress;
178
- get feeRecipient(): AztecAddress;
141
+ get maxL2BlockGas(): number | undefined;
142
+ getSlasherClient(): SlasherClientInterface | undefined;
143
+ get tracer(): Tracer;
144
+ getValidatorAddresses(): EthAddress[];
145
+ getConfig(): {
146
+ sequencerPollingIntervalMS: number;
147
+ maxTxsPerBlock: number;
148
+ minTxsPerBlock: number;
149
+ minValidTxsPerBlock?: number | undefined;
150
+ publishTxsWithProposals: boolean;
151
+ maxL2BlockGas: number;
152
+ maxDABlockGas: number;
153
+ coinbase?: EthAddress | undefined;
154
+ feeRecipient?: import("@aztec/stdlib/aztec-address").AztecAddress | undefined;
155
+ acvmWorkingDirectory?: string | undefined;
156
+ acvmBinaryPath?: string | undefined;
157
+ txPublicSetupAllowList?: import("@aztec/stdlib/interfaces/server").AllowedElement[] | undefined;
158
+ maxBlockSizeInBytes: number;
159
+ governanceProposerPayload?: EthAddress | undefined;
160
+ enforceTimeTable: boolean;
161
+ l1PublishingTime?: number | undefined;
162
+ fakeProcessingDelayPerTxMs?: number | undefined;
163
+ fakeThrowAfterProcessingTxCount?: number | undefined;
164
+ attestationPropagationTime: number;
165
+ secondsBeforeInvalidatingBlockAsCommitteeMember: number;
166
+ secondsBeforeInvalidatingBlockAsNonCommitteeMember: number;
167
+ skipCollectingAttestations: boolean;
168
+ skipInvalidateBlockAsProposer: boolean;
169
+ broadcastInvalidBlockProposal: boolean;
170
+ injectFakeAttestation: boolean;
171
+ fishermanMode: boolean;
172
+ shuffleAttestationOrdering: boolean;
173
+ blockDurationMs?: number | undefined;
174
+ buildCheckpointIfEmpty: boolean;
175
+ skipPushProposedBlocksToArchiver: boolean;
176
+ };
177
+ private get l1PublishingTime();
179
178
  }
180
- //# sourceMappingURL=sequencer.d.ts.map
179
+ type SequencerSyncCheckResult = {
180
+ block?: L2Block;
181
+ checkpointNumber: CheckpointNumber;
182
+ blockNumber: BlockNumber;
183
+ archive: Fr;
184
+ l1Timestamp: bigint;
185
+ pendingChainValidationStatus: ValidateCheckpointResult;
186
+ };
187
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VxdWVuY2VyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VxdWVuY2VyL3NlcXVlbmNlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNyRCxPQUFPLEVBQW9CLEtBQUssY0FBYyxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDbEYsT0FBTyxFQUFFLFdBQVcsRUFBRSxnQkFBZ0IsRUFBRSxXQUFXLEVBQUUsVUFBVSxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFekcsT0FBTyxFQUFF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