@aztec/sequencer-client 0.0.1-commit.b655e406 → 0.0.1-commit.d3ec352c
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 +1 -1
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +2 -1
- package/dest/config.d.ts +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +9 -0
- package/dest/global_variable_builder/global_builder.d.ts +3 -6
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +9 -6
- package/dest/global_variable_builder/index.d.ts +1 -1
- package/dest/index.d.ts +1 -1
- package/dest/publisher/config.d.ts +3 -1
- package/dest/publisher/config.d.ts.map +1 -1
- package/dest/publisher/config.js +5 -0
- package/dest/publisher/index.d.ts +1 -1
- package/dest/publisher/sequencer-publisher-factory.d.ts +1 -1
- 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 +35 -29
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +115 -62
- package/dest/sequencer/block_builder.d.ts +3 -2
- package/dest/sequencer/block_builder.d.ts.map +1 -1
- package/dest/sequencer/block_builder.js +12 -8
- package/dest/sequencer/config.d.ts +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 +11 -2
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +38 -0
- package/dest/sequencer/sequencer.d.ts +19 -27
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +175 -51
- package/dest/sequencer/timetable.d.ts +1 -1
- package/dest/sequencer/timetable.d.ts.map +1 -1
- package/dest/sequencer/utils.d.ts +1 -1
- package/dest/test/index.d.ts +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/package.json +31 -30
- package/src/client/sequencer-client.ts +2 -2
- package/src/config.ts +10 -0
- package/src/global_variable_builder/global_builder.ts +13 -9
- package/src/publisher/config.ts +8 -0
- package/src/publisher/sequencer-publisher-factory.ts +2 -1
- package/src/publisher/sequencer-publisher.ts +155 -84
- package/src/sequencer/block_builder.ts +15 -11
- package/src/sequencer/metrics.ts +51 -2
- package/src/sequencer/sequencer.ts +215 -72
- package/src/tx_validator/tx_validator_factory.ts +2 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Blob, getBlobsPerL1Block, getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
|
|
2
2
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
3
|
-
import { FormattedViemError, MULTI_CALL_3_ADDRESS, Multicall3, RollupContract, formatViemError, tryExtractEvent } from '@aztec/ethereum';
|
|
3
|
+
import { FormattedViemError, MULTI_CALL_3_ADDRESS, Multicall3, RollupContract, WEI_CONST, formatViemError, tryExtractEvent } from '@aztec/ethereum';
|
|
4
4
|
import { sumBigint } from '@aztec/foundation/bigint';
|
|
5
5
|
import { toHex as toPaddedHex } from '@aztec/foundation/bigint-buffer';
|
|
6
|
+
import { BlockNumber, CheckpointNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
6
7
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
7
8
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
8
9
|
import { createLogger } from '@aztec/foundation/log';
|
|
@@ -38,6 +39,7 @@ export class SequencerPublisher {
|
|
|
38
39
|
log;
|
|
39
40
|
ethereumSlotDuration;
|
|
40
41
|
blobSinkClient;
|
|
42
|
+
/** Address to use for simulations in fisherman mode (actual proposer's address) */ proposerAddressForSimulation;
|
|
41
43
|
// @note - with blobs, the below estimate seems too large.
|
|
42
44
|
// Total used for full block from int_l1_pub e2e test: 1m (of which 86k is 1x blob)
|
|
43
45
|
// Total used for emptier block from above test: 429k (of which 84k is 1x blob)
|
|
@@ -85,6 +87,12 @@ export class SequencerPublisher {
|
|
|
85
87
|
getSenderAddress() {
|
|
86
88
|
return this.l1TxUtils.getSenderAddress();
|
|
87
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Sets the proposer address to use for simulations in fisherman mode.
|
|
92
|
+
* @param proposerAddress - The actual proposer's address to use for balance lookups in simulations
|
|
93
|
+
*/ setProposerAddressForSimulation(proposerAddress) {
|
|
94
|
+
this.proposerAddressForSimulation = proposerAddress;
|
|
95
|
+
}
|
|
88
96
|
addRequest(request) {
|
|
89
97
|
this.requests.push(request);
|
|
90
98
|
}
|
|
@@ -92,6 +100,15 @@ export class SequencerPublisher {
|
|
|
92
100
|
return this.epochCache.getEpochAndSlotNow().slot;
|
|
93
101
|
}
|
|
94
102
|
/**
|
|
103
|
+
* Clears all pending requests without sending them.
|
|
104
|
+
*/ clearPendingRequests() {
|
|
105
|
+
const count = this.requests.length;
|
|
106
|
+
this.requests = [];
|
|
107
|
+
if (count > 0) {
|
|
108
|
+
this.log.debug(`Cleared ${count} pending request(s)`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
95
112
|
* Sends all requests that are still valid.
|
|
96
113
|
* @returns one of:
|
|
97
114
|
* - A receipt and stats if the tx succeeded
|
|
@@ -211,7 +228,9 @@ export class SequencerPublisher {
|
|
|
211
228
|
'InvalidProposer',
|
|
212
229
|
'InvalidArchive'
|
|
213
230
|
];
|
|
214
|
-
return this.rollupContract.canProposeAtNextEthBlock(tipArchive.toBuffer(), msgSender.toString(), this.ethereumSlotDuration,
|
|
231
|
+
return this.rollupContract.canProposeAtNextEthBlock(tipArchive.toBuffer(), msgSender.toString(), Number(this.ethereumSlotDuration), {
|
|
232
|
+
forcePendingCheckpointNumber: opts.forcePendingBlockNumber !== undefined ? CheckpointNumber.fromBlockNumber(opts.forcePendingBlockNumber) : undefined
|
|
233
|
+
}).catch((err)=>{
|
|
215
234
|
if (err instanceof FormattedViemError && ignoredErrors.find((e)=>err.message.includes(e))) {
|
|
216
235
|
this.log.warn(`Failed canProposeAtTime check with ${ignoredErrors.find((e)=>err.message.includes(e))}`, {
|
|
217
236
|
error: err.message
|
|
@@ -242,9 +261,20 @@ export class SequencerPublisher {
|
|
|
242
261
|
flags
|
|
243
262
|
];
|
|
244
263
|
const ts = BigInt((await this.l1TxUtils.getBlock()).timestamp + this.ethereumSlotDuration);
|
|
245
|
-
|
|
246
|
-
const
|
|
247
|
-
|
|
264
|
+
const optsForcePendingCheckpointNumber = opts?.forcePendingBlockNumber !== undefined ? CheckpointNumber.fromBlockNumber(opts.forcePendingBlockNumber) : undefined;
|
|
265
|
+
const stateOverrides = await this.rollupContract.makePendingCheckpointNumberOverride(optsForcePendingCheckpointNumber);
|
|
266
|
+
let balance = 0n;
|
|
267
|
+
if (this.config.fishermanMode) {
|
|
268
|
+
// In fisherman mode, we can't know where the proposer is publishing from
|
|
269
|
+
// so we just add sufficient balance to the multicall3 address
|
|
270
|
+
balance = 10n * WEI_CONST * WEI_CONST; // 10 ETH
|
|
271
|
+
} else {
|
|
272
|
+
balance = await this.l1TxUtils.getSenderBalance();
|
|
273
|
+
}
|
|
274
|
+
stateOverrides.push({
|
|
275
|
+
address: MULTI_CALL_3_ADDRESS,
|
|
276
|
+
balance
|
|
277
|
+
});
|
|
248
278
|
await this.l1TxUtils.simulate({
|
|
249
279
|
to: this.rollupContract.address,
|
|
250
280
|
data: encodeFunctionData({
|
|
@@ -255,13 +285,7 @@ export class SequencerPublisher {
|
|
|
255
285
|
from: MULTI_CALL_3_ADDRESS
|
|
256
286
|
}, {
|
|
257
287
|
time: ts + 1n
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
address: MULTI_CALL_3_ADDRESS,
|
|
261
|
-
balance
|
|
262
|
-
},
|
|
263
|
-
...await this.rollupContract.makePendingBlockNumberOverride(opts?.forcePendingBlockNumber)
|
|
264
|
-
]);
|
|
288
|
+
}, stateOverrides);
|
|
265
289
|
this.log.debug(`Simulated validateHeader`);
|
|
266
290
|
}
|
|
267
291
|
/**
|
|
@@ -277,7 +301,7 @@ export class SequencerPublisher {
|
|
|
277
301
|
...block,
|
|
278
302
|
reason
|
|
279
303
|
};
|
|
280
|
-
const currentBlockNumber = await this.rollupContract.
|
|
304
|
+
const currentBlockNumber = await this.rollupContract.getCheckpointNumber();
|
|
281
305
|
if (currentBlockNumber < validationResult.block.blockNumber) {
|
|
282
306
|
this.log.verbose(`Skipping block ${blockNumber} invalidation since it has already been removed from the pending chain`, {
|
|
283
307
|
currentBlockNumber,
|
|
@@ -301,7 +325,7 @@ export class SequencerPublisher {
|
|
|
301
325
|
request,
|
|
302
326
|
gasUsed,
|
|
303
327
|
blockNumber,
|
|
304
|
-
forcePendingBlockNumber: blockNumber - 1,
|
|
328
|
+
forcePendingBlockNumber: BlockNumber(blockNumber - 1),
|
|
305
329
|
reason
|
|
306
330
|
};
|
|
307
331
|
} catch (err) {
|
|
@@ -314,7 +338,7 @@ export class SequencerPublisher {
|
|
|
314
338
|
request,
|
|
315
339
|
error: viemError.message
|
|
316
340
|
});
|
|
317
|
-
const latestPendingBlockNumber = await this.rollupContract.
|
|
341
|
+
const latestPendingBlockNumber = await this.rollupContract.getCheckpointNumber();
|
|
318
342
|
if (latestPendingBlockNumber < blockNumber) {
|
|
319
343
|
this.log.verbose(`Block number ${blockNumber} has already been invalidated`, {
|
|
320
344
|
...logData
|
|
@@ -346,9 +370,9 @@ export class SequencerPublisher {
|
|
|
346
370
|
this.log.debug(`Simulating invalidate block ${block.blockNumber}`, logData);
|
|
347
371
|
const attestationsAndSigners = new CommitteeAttestationsAndSigners(validationResult.attestations).getPackedAttestations();
|
|
348
372
|
if (reason === 'invalid-attestation') {
|
|
349
|
-
return this.rollupContract.buildInvalidateBadAttestationRequest(block.blockNumber, attestationsAndSigners, committee, validationResult.invalidIndex);
|
|
373
|
+
return this.rollupContract.buildInvalidateBadAttestationRequest(CheckpointNumber.fromBlockNumber(block.blockNumber), attestationsAndSigners, committee, validationResult.invalidIndex);
|
|
350
374
|
} else if (reason === 'insufficient-attestations') {
|
|
351
|
-
return this.rollupContract.buildInvalidateInsufficientAttestationsRequest(block.blockNumber, attestationsAndSigners, committee);
|
|
375
|
+
return this.rollupContract.buildInvalidateInsufficientAttestationsRequest(CheckpointNumber.fromBlockNumber(block.blockNumber), attestationsAndSigners, committee);
|
|
352
376
|
} else {
|
|
353
377
|
const _ = reason;
|
|
354
378
|
throw new Error(`Unknown reason for invalidation`);
|
|
@@ -368,10 +392,10 @@ export class SequencerPublisher {
|
|
|
368
392
|
// so that the committee is recalculated correctly
|
|
369
393
|
const ignoreSignatures = attestationsAndSigners.attestations.length === 0;
|
|
370
394
|
if (ignoreSignatures) {
|
|
371
|
-
const { committee } = await this.epochCache.getCommittee(block.header.globalVariables.slotNumber
|
|
395
|
+
const { committee } = await this.epochCache.getCommittee(block.header.globalVariables.slotNumber);
|
|
372
396
|
if (!committee) {
|
|
373
|
-
this.log.warn(`No committee found for slot ${block.header.globalVariables.slotNumber
|
|
374
|
-
throw new Error(`No committee found for slot ${block.header.globalVariables.slotNumber
|
|
397
|
+
this.log.warn(`No committee found for slot ${block.header.globalVariables.slotNumber}`);
|
|
398
|
+
throw new Error(`No committee found for slot ${block.header.globalVariables.slotNumber}`);
|
|
375
399
|
}
|
|
376
400
|
attestationsAndSigners.attestations = committee.map((committeeMember)=>CommitteeAttestation.fromAddress(committeeMember));
|
|
377
401
|
}
|
|
@@ -382,7 +406,6 @@ export class SequencerPublisher {
|
|
|
382
406
|
{
|
|
383
407
|
header: block.getCheckpointHeader().toViem(),
|
|
384
408
|
archive: toHex(block.archive.root.toBuffer()),
|
|
385
|
-
stateReference: block.header.state.toViem(),
|
|
386
409
|
oracleInput: {
|
|
387
410
|
feeAssetPriceModifier: 0n
|
|
388
411
|
}
|
|
@@ -568,7 +591,6 @@ export class SequencerPublisher {
|
|
|
568
591
|
const proposeTxArgs = {
|
|
569
592
|
header: checkpointHeader,
|
|
570
593
|
archive: block.archive.root.toBuffer(),
|
|
571
|
-
stateReference: block.header.state,
|
|
572
594
|
body: block.body.toBuffer(),
|
|
573
595
|
blobs,
|
|
574
596
|
attestationsAndSigners,
|
|
@@ -585,7 +607,7 @@ export class SequencerPublisher {
|
|
|
585
607
|
} catch (err) {
|
|
586
608
|
this.log.error(`Block validation failed. ${err instanceof Error ? err.message : 'No error message'}`, err, {
|
|
587
609
|
...block.getStats(),
|
|
588
|
-
slotNumber: block.header.globalVariables.slotNumber
|
|
610
|
+
slotNumber: block.header.globalVariables.slotNumber,
|
|
589
611
|
forcePendingBlockNumber: opts.forcePendingBlockNumber
|
|
590
612
|
});
|
|
591
613
|
throw err;
|
|
@@ -618,9 +640,9 @@ export class SequencerPublisher {
|
|
|
618
640
|
gasLimit,
|
|
619
641
|
txTimeoutAt: opts.txTimeoutAt
|
|
620
642
|
},
|
|
621
|
-
lastValidL2Slot: this.getCurrentL2Slot() +
|
|
643
|
+
lastValidL2Slot: SlotNumber(this.getCurrentL2Slot() + 2),
|
|
622
644
|
checkSuccess: (_req, result)=>{
|
|
623
|
-
const success = result && result.receipt && result.receipt.status === 'success' && tryExtractEvent(result.receipt.logs, this.rollupContract.address, RollupAbi, '
|
|
645
|
+
const success = result && result.receipt && result.receipt.status === 'success' && tryExtractEvent(result.receipt.logs, this.rollupContract.address, RollupAbi, 'CheckpointInvalidated');
|
|
624
646
|
if (!success) {
|
|
625
647
|
this.log.warn(`Invalidate block ${request.blockNumber} failed`, {
|
|
626
648
|
...result,
|
|
@@ -713,31 +735,40 @@ export class SequencerPublisher {
|
|
|
713
735
|
this.log.debug('Validating blob input', {
|
|
714
736
|
blobInput
|
|
715
737
|
});
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
738
|
+
// Get blob evaluation gas
|
|
739
|
+
let blobEvaluationGas;
|
|
740
|
+
if (this.config.fishermanMode) {
|
|
741
|
+
// In fisherman mode, we can't estimate blob gas because estimateGas doesn't support state overrides
|
|
742
|
+
// Use a fixed estimate.
|
|
743
|
+
blobEvaluationGas = BigInt(encodedData.blobs.length) * 21_000n;
|
|
744
|
+
this.log.debug(`Using fixed blob evaluation gas estimate in fisherman mode: ${blobEvaluationGas}`);
|
|
745
|
+
} else {
|
|
746
|
+
// Normal mode - use estimateGas with blob inputs
|
|
747
|
+
blobEvaluationGas = await this.l1TxUtils.estimateGas(this.getSenderAddress().toString(), {
|
|
748
|
+
to: this.rollupContract.address,
|
|
749
|
+
data: encodeFunctionData({
|
|
750
|
+
abi: RollupAbi,
|
|
751
|
+
functionName: 'validateBlobs',
|
|
752
|
+
args: [
|
|
753
|
+
blobInput
|
|
754
|
+
]
|
|
755
|
+
})
|
|
756
|
+
}, {}, {
|
|
757
|
+
blobs: encodedData.blobs.map((b)=>b.data),
|
|
758
|
+
kzg
|
|
759
|
+
}).catch((err)=>{
|
|
760
|
+
const { message, metaMessages } = formatViemError(err);
|
|
761
|
+
this.log.error(`Failed to validate blobs`, message, {
|
|
762
|
+
metaMessages
|
|
763
|
+
});
|
|
764
|
+
throw new Error('Failed to validate blobs');
|
|
732
765
|
});
|
|
733
|
-
|
|
734
|
-
});
|
|
766
|
+
}
|
|
735
767
|
const signers = encodedData.attestationsAndSigners.getSigners().map((signer)=>signer.toString());
|
|
736
768
|
const args = [
|
|
737
769
|
{
|
|
738
770
|
header: encodedData.header.toViem(),
|
|
739
771
|
archive: toHex(encodedData.archive),
|
|
740
|
-
stateReference: encodedData.stateReference.toViem(),
|
|
741
772
|
oracleInput: {
|
|
742
773
|
// We are currently not modifying these. See #9963
|
|
743
774
|
feeAssetPriceModifier: 0n
|
|
@@ -767,18 +798,10 @@ export class SequencerPublisher {
|
|
|
767
798
|
functionName: 'propose',
|
|
768
799
|
args
|
|
769
800
|
});
|
|
770
|
-
// override the pending
|
|
771
|
-
const
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
data: rollupData,
|
|
775
|
-
gas: SequencerPublisher.PROPOSE_GAS_GUESS
|
|
776
|
-
}, {
|
|
777
|
-
// @note we add 1n to the timestamp because geth implementation doesn't like simulation timestamp to be equal to the current block timestamp
|
|
778
|
-
time: timestamp + 1n,
|
|
779
|
-
// @note reth should have a 30m gas limit per block but throws errors that this tx is beyond limit so we increase here
|
|
780
|
-
gasLimit: SequencerPublisher.PROPOSE_GAS_GUESS * 2n
|
|
781
|
-
}, [
|
|
801
|
+
// override the pending checkpoint number if requested
|
|
802
|
+
const optsForcePendingCheckpointNumber = options.forcePendingBlockNumber !== undefined ? CheckpointNumber.fromBlockNumber(options.forcePendingBlockNumber) : undefined;
|
|
803
|
+
const forcePendingCheckpointNumberStateDiff = (optsForcePendingCheckpointNumber !== undefined ? await this.rollupContract.makePendingCheckpointNumberOverride(optsForcePendingCheckpointNumber) : []).flatMap((override)=>override.stateDiff ?? []);
|
|
804
|
+
const stateOverrides = [
|
|
782
805
|
{
|
|
783
806
|
address: this.rollupContract.address,
|
|
784
807
|
// @note we override checkBlob to false since blobs are not part simulate()
|
|
@@ -787,14 +810,44 @@ export class SequencerPublisher {
|
|
|
787
810
|
slot: toPaddedHex(RollupContract.checkBlobStorageSlot, true),
|
|
788
811
|
value: toPaddedHex(0n, true)
|
|
789
812
|
},
|
|
790
|
-
...
|
|
813
|
+
...forcePendingCheckpointNumberStateDiff
|
|
791
814
|
]
|
|
792
815
|
}
|
|
793
|
-
]
|
|
816
|
+
];
|
|
817
|
+
// In fisherman mode, simulate as the proposer but with sufficient balance
|
|
818
|
+
if (this.proposerAddressForSimulation) {
|
|
819
|
+
stateOverrides.push({
|
|
820
|
+
address: this.proposerAddressForSimulation.toString(),
|
|
821
|
+
balance: 10n * WEI_CONST * WEI_CONST
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
const simulationResult = await this.l1TxUtils.simulate({
|
|
825
|
+
to: this.rollupContract.address,
|
|
826
|
+
data: rollupData,
|
|
827
|
+
gas: SequencerPublisher.PROPOSE_GAS_GUESS,
|
|
828
|
+
...this.proposerAddressForSimulation && {
|
|
829
|
+
from: this.proposerAddressForSimulation.toString()
|
|
830
|
+
}
|
|
831
|
+
}, {
|
|
832
|
+
// @note we add 1n to the timestamp because geth implementation doesn't like simulation timestamp to be equal to the current block timestamp
|
|
833
|
+
time: timestamp + 1n,
|
|
834
|
+
// @note reth should have a 30m gas limit per block but throws errors that this tx is beyond limit so we increase here
|
|
835
|
+
gasLimit: SequencerPublisher.PROPOSE_GAS_GUESS * 2n
|
|
836
|
+
}, stateOverrides, RollupAbi, {
|
|
794
837
|
// @note fallback gas estimate to use if the node doesn't support simulation API
|
|
795
838
|
fallbackGasEstimate: SequencerPublisher.PROPOSE_GAS_GUESS
|
|
796
839
|
}).catch((err)=>{
|
|
797
|
-
|
|
840
|
+
// In fisherman mode, we expect ValidatorSelection__MissingProposerSignature since fisherman doesn't have proposer signature
|
|
841
|
+
const viemError = formatViemError(err);
|
|
842
|
+
if (this.config.fishermanMode && viemError.message?.includes('ValidatorSelection__MissingProposerSignature')) {
|
|
843
|
+
this.log.debug(`Ignoring expected ValidatorSelection__MissingProposerSignature error in fisherman mode`);
|
|
844
|
+
// Return a minimal simulation result with the fallback gas estimate
|
|
845
|
+
return {
|
|
846
|
+
gasUsed: SequencerPublisher.PROPOSE_GAS_GUESS,
|
|
847
|
+
logs: []
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
this.log.error(`Failed to simulate propose tx`, viemError);
|
|
798
851
|
throw err;
|
|
799
852
|
});
|
|
800
853
|
return {
|
|
@@ -819,7 +872,7 @@ export class SequencerPublisher {
|
|
|
819
872
|
to: this.rollupContract.address,
|
|
820
873
|
data: rollupData
|
|
821
874
|
},
|
|
822
|
-
lastValidL2Slot: block.header.globalVariables.slotNumber
|
|
875
|
+
lastValidL2Slot: block.header.globalVariables.slotNumber,
|
|
823
876
|
gasConfig: {
|
|
824
877
|
...opts,
|
|
825
878
|
gasLimit
|
|
@@ -833,7 +886,7 @@ export class SequencerPublisher {
|
|
|
833
886
|
return false;
|
|
834
887
|
}
|
|
835
888
|
const { receipt, stats, errorMsg } = result;
|
|
836
|
-
const success = receipt && receipt.status === 'success' && tryExtractEvent(receipt.logs, this.rollupContract.address, RollupAbi, '
|
|
889
|
+
const success = receipt && receipt.status === 'success' && tryExtractEvent(receipt.logs, this.rollupContract.address, RollupAbi, 'CheckpointProposed');
|
|
837
890
|
if (success) {
|
|
838
891
|
const endBlock = receipt.blockNumber;
|
|
839
892
|
const inclusionBlocks = Number(endBlock - startBlock);
|
|
@@ -865,7 +918,7 @@ export class SequencerPublisher {
|
|
|
865
918
|
...block.getStats(),
|
|
866
919
|
receipt,
|
|
867
920
|
txHash: receipt.transactionHash,
|
|
868
|
-
slotNumber: block.header.globalVariables.slotNumber
|
|
921
|
+
slotNumber: block.header.globalVariables.slotNumber
|
|
869
922
|
});
|
|
870
923
|
return false;
|
|
871
924
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
3
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
3
4
|
import { PublicProcessor } from '@aztec/simulator/server';
|
|
@@ -22,6 +23,6 @@ export declare class FullNodeBlockBuilder implements IFullNodeBlockBuilder {
|
|
|
22
23
|
}>;
|
|
23
24
|
private syncToPreviousBlock;
|
|
24
25
|
buildBlock(pendingTxs: Iterable<Tx> | AsyncIterable<Tx>, l1ToL2Messages: Fr[], globalVariables: GlobalVariables, opts: PublicProcessorLimits, suppliedFork?: MerkleTreeWriteOperations): Promise<BuildBlockResult>;
|
|
25
|
-
getFork(blockNumber:
|
|
26
|
+
getFork(blockNumber: BlockNumber): Promise<MerkleTreeWriteOperations>;
|
|
26
27
|
}
|
|
27
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2tfYnVpbGRlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NlcXVlbmNlci9ibG9ja19idWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUU5RCxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUluRCxPQUFPLEVBQUUsWUFBWSxFQUFrQixNQUFNLHlCQUF5QixDQUFDO0FBR3ZFLE9BQU8sRUFHTCxlQUFlLEVBRWhCLE1BQU0seUJBQXlCLENBQUM7QUFFakMsT0FBTyxLQUFLLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUNqRSxPQUFPLEVBQUUsS0FBSyxpQkFBaUIsRUFBdUIsTUFBTSw2QkFBNkIsQ0FBQztBQUUxRixPQUFPLEtBQUssRUFDVixnQkFBZ0IsRUFDaEIsMEJBQTBCLEVBQzFCLHFCQUFxQixFQUNyQix5QkFBeUIsRUFDekIscUJBQXFCLEVBQ3JCLHdCQUF3QixFQUN4QixzQkFBc0IsRUFDdkIsTUFBTSxpQ0FBaUMsQ0FBQztBQUN6QyxPQUFPLEVBQUUsZUFBZSxFQUFFLEVBQUUsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQ3ZEL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UFBRSx5QkFBeUI7OztPQXlDbEc7WUFFYSxtQkFBbUI7SUFVM0IsVUFBVSxDQUNkLFVBQVUsRUFBRSxRQUFRLENBQUMsRUFBRSxDQUFDLEdBQUcsYUFBYSxDQUFDLEVBQUUsQ0FBQyxFQUM1QyxjQUFjLEVBQUUsRUFBRSxFQUFFLEVBQ3BCLGVBQWUsRUFBRSxlQUFlLEVBQ2hDLElBQUksRUFBRSxxQkFBcUIsRUFDM0IsWUFBWSxDQUFDLEVBQUUseUJBQXlCLEdBQ3ZDLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQXNDM0I7SUFFRCxPQUFPLENBQUMsV0FBVyxFQUFFLFdBQVcsR0FBRyxPQUFPLENBQUMseUJBQXlCLENBQUMsQ0FFcEU7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_builder.d.ts","sourceRoot":"","sources":["../../src/sequencer/block_builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"block_builder.d.ts","sourceRoot":"","sources":["../../src/sequencer/block_builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAInD,OAAO,EAAE,YAAY,EAAkB,MAAM,yBAAyB,CAAC;AAGvE,OAAO,EAGL,eAAe,EAEhB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,KAAK,iBAAiB,EAAuB,MAAM,6BAA6B,CAAC;AAE1F,OAAO,KAAK,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;A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AAW,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAEpE;CACF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MerkleTreeId } from '@aztec/aztec.js/trees';
|
|
2
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
3
|
import { merge, pick } from '@aztec/foundation/collection';
|
|
3
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
5
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
@@ -6,7 +7,8 @@ import { bufferToHex } from '@aztec/foundation/string';
|
|
|
6
7
|
import { Timer, elapsed } from '@aztec/foundation/timer';
|
|
7
8
|
import { getDefaultAllowedSetupFunctions } from '@aztec/p2p/msg_validators';
|
|
8
9
|
import { LightweightBlockFactory } from '@aztec/prover-client/block-factory';
|
|
9
|
-
import { GuardedMerkleTreeOperations, PublicContractsDB, PublicProcessor,
|
|
10
|
+
import { GuardedMerkleTreeOperations, PublicContractsDB, PublicProcessor, TelemetryCppPublicTxSimulator } from '@aztec/simulator/server';
|
|
11
|
+
import { PublicSimulatorConfig } from '@aztec/stdlib/avm';
|
|
10
12
|
import { getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
|
|
11
13
|
import { Gas } from '@aztec/stdlib/gas';
|
|
12
14
|
import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
@@ -15,7 +17,7 @@ const log = createLogger('block-builder');
|
|
|
15
17
|
export async function buildBlock(pendingTxs, l1ToL2Messages, newGlobalVariables, opts = {}, worldStateFork, processor, validator, l1Constants, dateProvider, telemetryClient = getTelemetryClient()) {
|
|
16
18
|
const blockBuildingTimer = new Timer();
|
|
17
19
|
const blockNumber = newGlobalVariables.blockNumber;
|
|
18
|
-
const slot = newGlobalVariables.slotNumber
|
|
20
|
+
const slot = newGlobalVariables.slotNumber;
|
|
19
21
|
const msgCount = l1ToL2Messages.length;
|
|
20
22
|
const stateReference = await worldStateFork.getStateReference();
|
|
21
23
|
const archiveTree = await worldStateFork.getTreeInfo(MerkleTreeId.ARCHIVE);
|
|
@@ -81,11 +83,13 @@ export class FullNodeBlockBuilder {
|
|
|
81
83
|
const txPublicSetupAllowList = this.config.txPublicSetupAllowList ?? await getDefaultAllowedSetupFunctions();
|
|
82
84
|
const contractsDB = new PublicContractsDB(this.contractDataSource);
|
|
83
85
|
const guardedFork = new GuardedMerkleTreeOperations(fork);
|
|
84
|
-
const publicTxSimulator = new
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
const publicTxSimulator = new TelemetryCppPublicTxSimulator(guardedFork, contractsDB, globalVariables, this.telemetryClient, PublicSimulatorConfig.from({
|
|
87
|
+
skipFeeEnforcement: false,
|
|
88
|
+
collectDebugLogs: false,
|
|
89
|
+
collectHints: false,
|
|
90
|
+
collectStatistics: false,
|
|
91
|
+
collectCallMetadata: false
|
|
92
|
+
}));
|
|
89
93
|
const processor = new PublicProcessor(globalVariables, guardedFork, contractsDB, publicTxSimulator, this.dateProvider, this.telemetryClient, undefined, this.config);
|
|
90
94
|
const validator = createValidatorForBlockBuilding(fork, this.contractDataSource, globalVariables, txPublicSetupAllowList);
|
|
91
95
|
return {
|
|
@@ -98,7 +102,7 @@ export class FullNodeBlockBuilder {
|
|
|
98
102
|
log.debug(`Synced to previous block ${parentBlockNumber}`);
|
|
99
103
|
}
|
|
100
104
|
async buildBlock(pendingTxs, l1ToL2Messages, globalVariables, opts, suppliedFork) {
|
|
101
|
-
const parentBlockNumber = globalVariables.blockNumber - 1;
|
|
105
|
+
const parentBlockNumber = BlockNumber(globalVariables.blockNumber - 1);
|
|
102
106
|
const syncTimeout = opts.deadline ? (opts.deadline.getTime() - this.dateProvider.now()) / 1000 : undefined;
|
|
103
107
|
await this.syncToPreviousBlock(parentBlockNumber, syncTimeout);
|
|
104
108
|
const fork = suppliedFork ?? await this.worldState.fork(parentBlockNumber);
|
|
@@ -4,4 +4,4 @@ export type SequencerContracts = {
|
|
|
4
4
|
rollupContract: RollupContract;
|
|
5
5
|
governanceProposerContract: GovernanceProposerContract;
|
|
6
6
|
};
|
|
7
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VxdWVuY2VyL2NvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSwwQkFBMEIsRUFBRSxjQUFjLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUVsRixPQUFPLEVBQUUsS0FBSyxlQUFlLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUU1RCxNQUFNLE1BQU0sa0JBQWtCLEdBQUc7SUFDL0IsY0FBYyxFQUFFLGNBQWMsQ0FBQztJQUMvQiwwQkFBMEIsRUFBRSwwQkFBMEIsQ0FBQztDQUN4RCxDQUFDIn0=
|
|
@@ -8,4 +8,4 @@ export declare class SequencerTooSlowError extends Error {
|
|
|
8
8
|
export declare class SequencerInterruptedError extends Error {
|
|
9
9
|
constructor();
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VxdWVuY2VyL2Vycm9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxjQUFjLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFFakQscUJBQWEscUJBQXNCLFNBQVEsS0FBSzthQUU1QixhQUFhLEVBQUUsY0FBYzthQUM3QixjQUFjLEVBQUUsTUFBTTthQUN0QixXQUFXLEVBQUUsTUFBTTtJQUhyQyxZQUNrQixhQUFhLEVBQUUsY0FBYyxFQUM3QixjQUFjLEVBQUUsTUFBTSxFQUN0QixXQUFXLEVBQUUsTUFBTSxFQU1wQztDQUNGO0FBRUQscUJBQWEseUJBQTBCLFNBQVEsS0FBSztJQUNsRCxjQUdDO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/sequencer/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,qBAAa,qBAAsB,SAAQ,KAAK;aAE5B,aAAa,EAAE,cAAc;aAC7B,cAAc,EAAE,MAAM;aACtB,WAAW,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/sequencer/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,qBAAa,qBAAsB,SAAQ,KAAK;aAE5B,aAAa,EAAE,cAAc;aAC7B,cAAc,EAAE,MAAM;aACtB,WAAW,EAAE,MAAM;IAHrC,YACkB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EAMpC;CACF;AAED,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,cAGC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './block_builder.js';
|
|
2
2
|
export * from './config.js';
|
|
3
3
|
export * from './sequencer.js';
|
|
4
|
-
//# sourceMappingURL=
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZXF1ZW5jZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLGFBQWEsQ0FBQztBQUM1QixjQUFjLGdCQUFnQixDQUFDIn0=
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
2
|
import type { RollupContract } from '@aztec/ethereum';
|
|
3
|
+
import type { SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
4
|
import { type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
|
|
4
5
|
import { type Hex } from 'viem';
|
|
5
6
|
import type { SequencerState } from './utils.js';
|
|
@@ -18,6 +19,10 @@ export declare class SequencerMetrics {
|
|
|
18
19
|
private rewards;
|
|
19
20
|
private slots;
|
|
20
21
|
private filledSlots;
|
|
22
|
+
private blockProposalFailed;
|
|
23
|
+
private blockProposalSuccess;
|
|
24
|
+
private blockProposalPrecheckFailed;
|
|
25
|
+
private slashingAttempts;
|
|
21
26
|
private lastSeenSlot?;
|
|
22
27
|
constructor(client: TelemetryClient, rollup: RollupContract, name?: string);
|
|
23
28
|
recordRequiredAttestations(requiredAttestationsCount: number, allowanceMs: number): void;
|
|
@@ -25,7 +30,11 @@ export declare class SequencerMetrics {
|
|
|
25
30
|
recordBuiltBlock(buildDurationMs: number, totalMana: number): void;
|
|
26
31
|
recordFailedBlock(): void;
|
|
27
32
|
recordStateTransitionBufferMs(durationMs: number, state: SequencerState): void;
|
|
28
|
-
incOpenSlot(slot:
|
|
33
|
+
incOpenSlot(slot: SlotNumber, proposer: string): void;
|
|
29
34
|
incFilledSlot(proposer: string, coinbase: Hex | EthAddress | undefined): Promise<void>;
|
|
35
|
+
recordBlockProposalFailed(reason?: string): void;
|
|
36
|
+
recordBlockProposalSuccess(): void;
|
|
37
|
+
recordBlockProposalPrecheckFailed(checkType: string): void;
|
|
38
|
+
recordSlashingAttempt(actionCount: number): void;
|
|
30
39
|
}
|
|
31
|
-
//# sourceMappingURL=
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWV0cmljcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInN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|
-
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/sequencer/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAML,KAAK,eAAe,EACpB,KAAK,MAAM,EAGZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,KAAK,GAAG,EAAe,MAAM,MAAM,CAAC;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,qBAAa,gBAAgB;
|
|
1
|
+
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/sequencer/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAML,KAAK,eAAe,EACpB,KAAK,MAAM,EAGZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,KAAK,GAAG,EAAe,MAAM,MAAM,CAAC;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,qBAAa,gBAAgB;IA6BzB,OAAO,CAAC,MAAM;IA5BhB,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,OAAO,CAAC,KAAK,CAAQ;IAErB,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,kBAAkB,CAAY;IACtC,OAAO,CAAC,uBAAuB,CAAQ;IACvC,OAAO,CAAC,6BAA6B,CAAY;IAGjD,OAAO,CAAC,yBAAyB,CAAQ;IACzC,OAAO,CAAC,8BAA8B,CAAQ;IAC9C,OAAO,CAAC,kBAAkB,CAAQ;IAClC,OAAO,CAAC,mBAAmB,CAAQ;IAEnC,OAAO,CAAC,OAAO,CAAQ;IAEvB,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,WAAW,CAAgB;IAEnC,OAAO,CAAC,mBAAmB,CAAgB;IAC3C,OAAO,CAAC,oBAAoB,CAAgB;IAC5C,OAAO,CAAC,2BAA2B,CAAgB;IACnD,OAAO,CAAC,gBAAgB,CAAgB;IAExC,OAAO,CAAC,YAAY,CAAC,CAAa;IAElC,YACE,MAAM,EAAE,eAAe,EACf,MAAM,EAAE,cAAc,EAC9B,IAAI,SAAc,EAuGnB;IAEM,0BAA0B,CAAC,yBAAyB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAOvF;IAEM,2BAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAGnE;IAED,gBAAgB,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,QAM1D;IAED,iBAAiB,SAIhB;IAED,6BAA6B,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,QAItE;IAED,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,QAW7C;IAEK,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB3F;IAED,yBAAyB,CAAC,MAAM,CAAC,EAAE,MAAM,QAIxC;IAED,0BAA0B,SAEzB;IAED,iCAAiC,CAAC,SAAS,EAAE,MAAM,QAIlD;IAED,qBAAqB,CAAC,WAAW,EAAE,MAAM,QAExC;CACF"}
|
|
@@ -16,6 +16,10 @@ export class SequencerMetrics {
|
|
|
16
16
|
rewards;
|
|
17
17
|
slots;
|
|
18
18
|
filledSlots;
|
|
19
|
+
blockProposalFailed;
|
|
20
|
+
blockProposalSuccess;
|
|
21
|
+
blockProposalPrecheckFailed;
|
|
22
|
+
slashingAttempts;
|
|
19
23
|
lastSeenSlot;
|
|
20
24
|
constructor(client, rollup, name = 'Sequencer'){
|
|
21
25
|
this.rollup = rollup;
|
|
@@ -77,6 +81,22 @@ export class SequencerMetrics {
|
|
|
77
81
|
valueType: ValueType.INT,
|
|
78
82
|
description: 'The minimum number of attestations required to publish a block'
|
|
79
83
|
});
|
|
84
|
+
this.blockProposalFailed = this.meter.createUpDownCounter(Metrics.SEQUENCER_BLOCK_PROPOSAL_FAILED_COUNT, {
|
|
85
|
+
valueType: ValueType.INT,
|
|
86
|
+
description: 'The number of times block proposal failed (including validation builds)'
|
|
87
|
+
});
|
|
88
|
+
this.blockProposalSuccess = this.meter.createUpDownCounter(Metrics.SEQUENCER_BLOCK_PROPOSAL_SUCCESS_COUNT, {
|
|
89
|
+
valueType: ValueType.INT,
|
|
90
|
+
description: 'The number of times block proposal succeeded (including validation builds)'
|
|
91
|
+
});
|
|
92
|
+
this.blockProposalPrecheckFailed = this.meter.createUpDownCounter(Metrics.SEQUENCER_BLOCK_PROPOSAL_PRECHECK_FAILED_COUNT, {
|
|
93
|
+
valueType: ValueType.INT,
|
|
94
|
+
description: 'The number of times block proposal pre-build checks failed'
|
|
95
|
+
});
|
|
96
|
+
this.slashingAttempts = this.meter.createUpDownCounter(Metrics.SEQUENCER_SLASHING_ATTEMPTS_COUNT, {
|
|
97
|
+
valueType: ValueType.INT,
|
|
98
|
+
description: 'The number of slashing action attempts'
|
|
99
|
+
});
|
|
80
100
|
}
|
|
81
101
|
recordRequiredAttestations(requiredAttestationsCount, allowanceMs) {
|
|
82
102
|
this.requiredAttestions.record(requiredAttestationsCount);
|
|
@@ -133,4 +153,22 @@ export class SequencerMetrics {
|
|
|
133
153
|
}
|
|
134
154
|
}
|
|
135
155
|
}
|
|
156
|
+
recordBlockProposalFailed(reason) {
|
|
157
|
+
this.blockProposalFailed.add(1, {
|
|
158
|
+
...reason && {
|
|
159
|
+
[Attributes.ERROR_TYPE]: reason
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
recordBlockProposalSuccess() {
|
|
164
|
+
this.blockProposalSuccess.add(1);
|
|
165
|
+
}
|
|
166
|
+
recordBlockProposalPrecheckFailed(checkType) {
|
|
167
|
+
this.blockProposalPrecheckFailed.add(1, {
|
|
168
|
+
[Attributes.ERROR_TYPE]: checkType
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
recordSlashingAttempt(actionCount) {
|
|
172
|
+
this.slashingAttempts.add(actionCount);
|
|
173
|
+
}
|
|
136
174
|
}
|