@aztec/sequencer-client 5.0.0-nightly.20260421 → 5.0.0-nightly.20260423
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/sequencer/checkpoint_proposal_job.d.ts +15 -2
- package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -1
- package/dest/sequencer/checkpoint_proposal_job.js +172 -24
- package/dest/sequencer/events.d.ts +6 -1
- package/dest/sequencer/events.d.ts.map +1 -1
- package/dest/sequencer/metrics.d.ts +3 -1
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +15 -0
- package/package.json +27 -27
- package/src/sequencer/checkpoint_proposal_job.ts +203 -27
- package/src/sequencer/events.ts +5 -0
- package/src/sequencer/metrics.ts +20 -0
|
@@ -53,7 +53,7 @@ export declare class CheckpointProposalJob implements Traceable {
|
|
|
53
53
|
private readonly dateProvider;
|
|
54
54
|
private readonly metrics;
|
|
55
55
|
private readonly checkpointMetrics;
|
|
56
|
-
|
|
56
|
+
protected readonly eventEmitter: TypedEventEmitter<SequencerEvents>;
|
|
57
57
|
private readonly setStateFn;
|
|
58
58
|
readonly tracer: Tracer;
|
|
59
59
|
private readonly proposedCheckpointData?;
|
|
@@ -75,6 +75,18 @@ export declare class CheckpointProposalJob implements Traceable {
|
|
|
75
75
|
execute(): Promise<Checkpoint | undefined>;
|
|
76
76
|
private waitForAttestationsAndEnqueueSubmissionAsync;
|
|
77
77
|
private enqueueCheckpointForSubmission;
|
|
78
|
+
private waitForSyncedL2SlotNumber;
|
|
79
|
+
/**
|
|
80
|
+
* Waits for the parent checkpoint to land on L1 before submitting a pipelined checkpoint.
|
|
81
|
+
* Polls until the archiver has synced L1 past the parent's slot, then verifies:
|
|
82
|
+
* - If we built on a proposed parent: it must have landed on L1 with matching hash and valid attestations.
|
|
83
|
+
* - If we built without a proposed parent: no new checkpoint must have appeared for that slot.
|
|
84
|
+
* If the parent has invalid attestations, enqueues an invalidation. Returns whether to proceed with the proposal.
|
|
85
|
+
*/
|
|
86
|
+
protected waitForValidParentCheckpointOnL1(): Promise<boolean>;
|
|
87
|
+
/** Emits the pipelined-checkpoint-discarded event and records the metric. */
|
|
88
|
+
private emitPipelinedCheckpointDiscarded;
|
|
89
|
+
private enqueueInvalidation;
|
|
78
90
|
private proposeCheckpoint;
|
|
79
91
|
private buildBlocksForCheckpoint;
|
|
80
92
|
/** Creates a block proposal for a given block via the validator client (unless in fisherman mode) */
|
|
@@ -98,6 +110,7 @@ export declare class CheckpointProposalJob implements Traceable {
|
|
|
98
110
|
}>;
|
|
99
111
|
private buildSingleBlockWithCheckpointBuilder;
|
|
100
112
|
private waitForMinTxs;
|
|
113
|
+
private getSignedCommitteeAttestations;
|
|
101
114
|
private waitForAttestations;
|
|
102
115
|
/** Breaks the attestations before publishing based on attack configs */
|
|
103
116
|
private manipulateAttestations;
|
|
@@ -116,4 +129,4 @@ export declare class CheckpointProposalJob implements Traceable {
|
|
|
116
129
|
private getSecondsIntoSlot;
|
|
117
130
|
getPublisher(): SequencerPublisher;
|
|
118
131
|
}
|
|
119
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
132
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2twb2ludF9wcm9wb3NhbF9qb2IuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZXF1ZW5jZXIvY2hlY2twb2ludF9wcm9wb3NhbF9qb2IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFFckQsT0FBTyxFQUNMLFdBQVcsRUFDWCxnQkFBZ0IsRUFDaEIsV0FBVyxFQUNYLHFCQUFxQixFQUNyQixVQUFVLEVBQ1gsTUFBTSxpQ0FBaUMsQ0FBQztBQVF6QyxPQUFPLEVBQUU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UF5RmpDLHdFQUF3RTtJQUN4RSxPQUFPLENBQUMsc0JBQXNCO1lBdUVoQixvQkFBb0I7WUFtQnBCLDJCQUEyQjtZQWdCM0IsOEJBQThCO0lBd0I1Qzs7T0FFRztJQUNILE9BQU8sQ0FBQyxvQkFBb0I7SUFtQjVCLDBEQUEwRDtJQUMxRCxVQUNnQixtQkFBbUIsQ0FBQyxxQkFBcUIsRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUloRjtJQUVELGtGQUFrRjtJQUNsRixVQUFnQix5QkFBeUIsSUFBSSxPQUFPLENBQUMsSUFBSSxDQUFDLENBRXpEO0lBRUQsT0FBTyxDQUFDLDBCQUEwQjtJQUlsQyxPQUFPLENBQUMsa0JBQWtCO0lBS25CLFlBQVksdUJBRWxCO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint_proposal_job.d.ts","sourceRoot":"","sources":["../../src/sequencer/checkpoint_proposal_job.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,qBAAqB,EACrB,UAAU,EACX,MAAM,iCAAiC,CAAC;AAQzC,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"checkpoint_proposal_job.d.ts","sourceRoot":"","sources":["../../src/sequencer/checkpoint_proposal_job.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,qBAAqB,EACrB,UAAU,EACX,MAAM,iCAAiC,CAAC;AAQzC,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B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AA0B;IAIlC,OAAO,CAAC,kBAAkB;IAKnB,YAAY,uBAElB;CACF"}
|
|
@@ -436,11 +436,12 @@ function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
|
|
|
436
436
|
return (_apply_decs_2203_r = applyDecs2203RFactory())(targetClass, memberDecs, classDecs, parentClass);
|
|
437
437
|
}
|
|
438
438
|
var _dec, _dec1, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _initProto;
|
|
439
|
-
import { BlockNumber, IndexWithinCheckpoint } from '@aztec/foundation/branded-types';
|
|
439
|
+
import { BlockNumber, CheckpointNumber, IndexWithinCheckpoint } from '@aztec/foundation/branded-types';
|
|
440
440
|
import { randomInt } from '@aztec/foundation/crypto/random';
|
|
441
441
|
import { flipSignature, generateRecoverableSignature, generateUnrecoverableSignature } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
442
442
|
import { filter } from '@aztec/foundation/iterator';
|
|
443
443
|
import { createLogger } from '@aztec/foundation/log';
|
|
444
|
+
import { retryUntil } from '@aztec/foundation/retry';
|
|
444
445
|
import { sleep, sleepUntil } from '@aztec/foundation/sleep';
|
|
445
446
|
import { Timer } from '@aztec/foundation/timer';
|
|
446
447
|
import { isErrorClass, unfreeze } from '@aztec/foundation/types';
|
|
@@ -627,31 +628,36 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
627
628
|
* Background pipeline: collects attestations, signs them, enqueues the checkpoint, and submits to L1.
|
|
628
629
|
* Runs as a fire-and-forget task stored in `pendingL1Submission` so the work loop is unblocked.
|
|
629
630
|
*/ async waitForAttestationsAndEnqueueSubmissionAsync(broadcast, votesPromises) {
|
|
630
|
-
const { checkpoint
|
|
631
|
+
const { checkpoint } = broadcast;
|
|
632
|
+
const isPipelining = this.epochCache.isProposerPipeliningEnabled();
|
|
631
633
|
try {
|
|
634
|
+
// Wait for all votes actions, enqueued at the beginning, to resolve
|
|
632
635
|
await Promise.all(votesPromises);
|
|
633
|
-
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
//
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
636
|
+
// Try to collect attestations from the committee
|
|
637
|
+
const signedAttestations = await this.getSignedCommitteeAttestations(broadcast);
|
|
638
|
+
// If pipelining, wait for the previous checkpoint to land on L1 before submitting,
|
|
639
|
+
// so we can check it matches the proposed checkpoint we used as parent, and has valid attestations.
|
|
640
|
+
if (signedAttestations && (!isPipelining || await this.waitForValidParentCheckpointOnL1())) {
|
|
641
|
+
await this.enqueueCheckpointForSubmission({
|
|
642
|
+
checkpoint,
|
|
643
|
+
...signedAttestations
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
// If we failed to collect attestations, at least check if we need to issue an invalidation
|
|
647
|
+
// Note that if we are not pipelining, we enqueued the invalidation at the beginning
|
|
648
|
+
if (!signedAttestations && isPipelining && await this.waitForSyncedL2SlotNumber(this.slotNow)) {
|
|
649
|
+
const validationStatus = await this.l2BlockSource.getPendingChainValidationStatus();
|
|
650
|
+
if (!validationStatus.valid) {
|
|
651
|
+
this.log.warn(`Checkpoint ${validationStatus.checkpoint.checkpointNumber} has invalid attestations, enqueuing invalidation in spite of attestation collection failure`, {
|
|
652
|
+
checkpoint: validationStatus.checkpoint,
|
|
653
|
+
reason: validationStatus.reason
|
|
654
|
+
});
|
|
655
|
+
await this.enqueueInvalidation(validationStatus);
|
|
644
656
|
}
|
|
645
|
-
throw err;
|
|
646
657
|
}
|
|
647
|
-
//
|
|
648
|
-
await this.enqueueCheckpointForSubmission({
|
|
649
|
-
checkpoint,
|
|
650
|
-
attestations,
|
|
651
|
-
attestationsSignature
|
|
652
|
-
});
|
|
658
|
+
// Send whatever was enqueued: votes + (propose | invalidation | nothing).
|
|
653
659
|
// Compute the earliest time to submit: pipeline slot start when pipelining, now otherwise.
|
|
654
|
-
const submitAfter =
|
|
660
|
+
const submitAfter = isPipelining ? new Date(Number(getTimestampForSlot(this.targetSlot, this.l1Constants)) * 1000) : new Date(this.dateProvider.now());
|
|
655
661
|
const l1Response = await this.publisher.sendRequestsAt(submitAfter);
|
|
656
662
|
const proposedAction = l1Response?.successfulActions.find((a)=>a === 'propose');
|
|
657
663
|
if (proposedAction) {
|
|
@@ -666,7 +672,7 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
666
672
|
...l1Response,
|
|
667
673
|
slot: this.targetSlot
|
|
668
674
|
});
|
|
669
|
-
if (
|
|
675
|
+
if (isPipelining) {
|
|
670
676
|
this.metrics.recordPipelineDiscard();
|
|
671
677
|
}
|
|
672
678
|
}
|
|
@@ -678,7 +684,7 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
678
684
|
this.eventEmitter.emit('checkpoint-publish-failed', {
|
|
679
685
|
slot: this.targetSlot
|
|
680
686
|
});
|
|
681
|
-
if (
|
|
687
|
+
if (isPipelining) {
|
|
682
688
|
this.metrics.recordPipelineDiscard();
|
|
683
689
|
}
|
|
684
690
|
}
|
|
@@ -711,6 +717,121 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
711
717
|
} : {}
|
|
712
718
|
});
|
|
713
719
|
}
|
|
720
|
+
/**
|
|
721
|
+
* Wait until the archiver syncs past the given L2 slot number.
|
|
722
|
+
* The deadline is the end of `this.targetSlot`, beyond which any pipelined work would miss its
|
|
723
|
+
* L1 submission window and is no longer useful.
|
|
724
|
+
*/ async waitForSyncedL2SlotNumber(waitForSlot) {
|
|
725
|
+
const targetSlotStart = Number(getTimestampForSlot(this.targetSlot, this.l1Constants));
|
|
726
|
+
const targetSlotEndMs = (targetSlotStart + this.l1Constants.slotDuration) * 1000;
|
|
727
|
+
const syncDelayTolerance = this.l1Constants.ethereumSlotDuration * 2 * 1000;
|
|
728
|
+
const timeoutSeconds = Math.max(0.1, (targetSlotEndMs + syncDelayTolerance - this.dateProvider.now()) / 1000);
|
|
729
|
+
try {
|
|
730
|
+
return await retryUntil(async ()=>{
|
|
731
|
+
const syncedSlot = await this.l2BlockSource.getSyncedL2SlotNumber();
|
|
732
|
+
return syncedSlot !== undefined && syncedSlot >= waitForSlot;
|
|
733
|
+
}, `archiver sync past slot ${waitForSlot}`, timeoutSeconds, 0.2);
|
|
734
|
+
} catch {
|
|
735
|
+
this.log.warn(`Archiver did not sync L1 past slot ${waitForSlot} before slot ${this.targetSlot} expired, discarding pipelined work`, {
|
|
736
|
+
checkpointNumber: this.checkpointNumber
|
|
737
|
+
});
|
|
738
|
+
this.emitPipelinedCheckpointDiscarded('archiver-sync-timeout');
|
|
739
|
+
return false;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* Waits for the parent checkpoint to land on L1 before submitting a pipelined checkpoint.
|
|
744
|
+
* Polls until the archiver has synced L1 past the parent's slot, then verifies:
|
|
745
|
+
* - If we built on a proposed parent: it must have landed on L1 with matching hash and valid attestations.
|
|
746
|
+
* - If we built without a proposed parent: no new checkpoint must have appeared for that slot.
|
|
747
|
+
* If the parent has invalid attestations, enqueues an invalidation. Returns whether to proceed with the proposal.
|
|
748
|
+
*/ async waitForValidParentCheckpointOnL1() {
|
|
749
|
+
const parentCheckpointNumber = CheckpointNumber(this.checkpointNumber - 1);
|
|
750
|
+
// Wait until archiver has synced L1 past the parent's slot (slotNow)
|
|
751
|
+
if (!await this.waitForSyncedL2SlotNumber(this.slotNow)) {
|
|
752
|
+
return false;
|
|
753
|
+
}
|
|
754
|
+
const tips = await this.l2BlockSource.getL2Tips();
|
|
755
|
+
const checkpointedNumber = tips.checkpointed.checkpoint.number;
|
|
756
|
+
// We built on top of a proposed checkpoint. Verify it landed on L1 as expected.
|
|
757
|
+
if (this.proposedCheckpointData) {
|
|
758
|
+
// After syncing from L1 we see the chain tip has invalid attestations. This means the parent checkpoint was posted
|
|
759
|
+
// with invalid attestations, or it built on top of something with invalid attestations and didnt invalidate them.
|
|
760
|
+
// Either way, we thought our parent would be valid, so we have to throw away our work. But at least we'll try and
|
|
761
|
+
// invalidate on L1 so we clean up the chain for the next proposer. And we'll slash them, but that's handled elsewhere.
|
|
762
|
+
const validationStatus = await this.l2BlockSource.getPendingChainValidationStatus();
|
|
763
|
+
if (!validationStatus.valid) {
|
|
764
|
+
this.log.warn(`Parent checkpoint ${parentCheckpointNumber} has invalid attestations, discarding pipelined work`, {
|
|
765
|
+
checkpointNumber: this.checkpointNumber,
|
|
766
|
+
reason: validationStatus.reason
|
|
767
|
+
});
|
|
768
|
+
this.emitPipelinedCheckpointDiscarded('parent-invalid-attestations');
|
|
769
|
+
await this.enqueueInvalidation(validationStatus);
|
|
770
|
+
return false;
|
|
771
|
+
}
|
|
772
|
+
// The pending chain is valid. But did the parent checkpoint land on L1 at all?
|
|
773
|
+
if (checkpointedNumber < parentCheckpointNumber) {
|
|
774
|
+
this.log.warn(`Parent checkpoint ${parentCheckpointNumber} did not land on L1, discarding pipelined work`, {
|
|
775
|
+
checkpointNumber: this.checkpointNumber,
|
|
776
|
+
checkpointedNumber
|
|
777
|
+
});
|
|
778
|
+
this.emitPipelinedCheckpointDiscarded('parent-not-on-l1');
|
|
779
|
+
return false;
|
|
780
|
+
}
|
|
781
|
+
// It landed. But is it the one we were expecting?
|
|
782
|
+
const expectedHash = this.proposedCheckpointData.header.hash().toString();
|
|
783
|
+
if (tips.checkpointed.checkpoint.hash !== expectedHash) {
|
|
784
|
+
this.log.warn(`Parent checkpoint ${parentCheckpointNumber} hash mismatch on L1, discarding pipelined work`, {
|
|
785
|
+
checkpointNumber: this.checkpointNumber,
|
|
786
|
+
expectedHash,
|
|
787
|
+
actualHash: tips.checkpointed.checkpoint.hash
|
|
788
|
+
});
|
|
789
|
+
this.emitPipelinedCheckpointDiscarded('parent-hash-mismatch');
|
|
790
|
+
return false;
|
|
791
|
+
}
|
|
792
|
+
return true;
|
|
793
|
+
} else {
|
|
794
|
+
// We didn't see a proposed checkpoint at build time, so we built on checkpointed parent from two slots ago.
|
|
795
|
+
// But if a new checkpoint for the previous slot appeared on L1 in the meantime, our checkpoint assumed the wrong parent,
|
|
796
|
+
// so we have to discard our work. This can happen if we're somehow cut off from p2p and fail to see the checkpoint
|
|
797
|
+
// proposal for the previous slot.
|
|
798
|
+
if (checkpointedNumber > parentCheckpointNumber) {
|
|
799
|
+
this.log.warn(`Unexpected checkpoint ${checkpointedNumber} landed on L1 after we built on top of parent ${parentCheckpointNumber}, discarding pipelined work`, {
|
|
800
|
+
checkpointNumber: this.checkpointNumber,
|
|
801
|
+
checkpointedNumber
|
|
802
|
+
});
|
|
803
|
+
this.emitPipelinedCheckpointDiscarded('unexpected-parent-appeared');
|
|
804
|
+
return false;
|
|
805
|
+
}
|
|
806
|
+
return true;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
/** Emits the pipelined-checkpoint-discarded event and records the metric. */ emitPipelinedCheckpointDiscarded(reason) {
|
|
810
|
+
this.metrics.recordPipelineParentCheckpointMismatch(reason);
|
|
811
|
+
this.eventEmitter.emit('pipelined-checkpoint-discarded', {
|
|
812
|
+
slot: this.targetSlot,
|
|
813
|
+
checkpointNumber: this.checkpointNumber,
|
|
814
|
+
reason
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
/** Simulates and enqueues an invalidation request for the invalid parent checkpoint. */ async enqueueInvalidation(validationStatus) {
|
|
818
|
+
if (this.config.skipInvalidateBlockAsProposer) {
|
|
819
|
+
this.log.warn(`Skipping checkpoint invalidation as proposer due to test configuration`);
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
const invalidateRequest = await this.publisher.simulateInvalidateCheckpoint(validationStatus);
|
|
823
|
+
if (invalidateRequest) {
|
|
824
|
+
const submissionSlotStart = Number(getTimestampForSlot(this.targetSlot, this.l1Constants));
|
|
825
|
+
const txTimeoutAt = new Date((submissionSlotStart + this.l1Constants.slotDuration) * 1000);
|
|
826
|
+
this.publisher.enqueueInvalidateCheckpoint(invalidateRequest, {
|
|
827
|
+
txTimeoutAt
|
|
828
|
+
});
|
|
829
|
+
} else {
|
|
830
|
+
this.log.info(`Invalidation simulation returned undefined, checkpoint may have been removed already`, {
|
|
831
|
+
checkpointNumber: this.checkpointNumber
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
}
|
|
714
835
|
async proposeCheckpoint() {
|
|
715
836
|
try {
|
|
716
837
|
const env = {
|
|
@@ -1152,6 +1273,30 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
1152
1273
|
minTxs
|
|
1153
1274
|
};
|
|
1154
1275
|
}
|
|
1276
|
+
async getSignedCommitteeAttestations(broadcast) {
|
|
1277
|
+
const { proposal, blockProposedAt } = broadcast;
|
|
1278
|
+
this.setStateFn(SequencerState.COLLECTING_ATTESTATIONS, this.targetSlot);
|
|
1279
|
+
const attestations = await this.waitForAttestations(proposal);
|
|
1280
|
+
if (!attestations) {
|
|
1281
|
+
return undefined;
|
|
1282
|
+
}
|
|
1283
|
+
this.checkpointMetrics.recordCheckpointAttestationDelay(this.dateProvider.now() - blockProposedAt);
|
|
1284
|
+
// Proposer must sign over the attestations before pushing them to L1
|
|
1285
|
+
const signer = this.proposer ?? this.publisher.getSenderAddress();
|
|
1286
|
+
try {
|
|
1287
|
+
const attestationsSignature = await this.validatorClient.signAttestationsAndSigners(attestations, signer, this.targetSlot, this.checkpointNumber);
|
|
1288
|
+
return {
|
|
1289
|
+
attestations,
|
|
1290
|
+
attestationsSignature
|
|
1291
|
+
};
|
|
1292
|
+
} catch (err) {
|
|
1293
|
+
if (this.handleHASigningError(err, 'Attestations signature')) {
|
|
1294
|
+
return;
|
|
1295
|
+
}
|
|
1296
|
+
this.log.error(`Error signing attestations for checkpoint proposal at slot ${proposal.slotNumber}`, err);
|
|
1297
|
+
return undefined;
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1155
1300
|
/**
|
|
1156
1301
|
* Waits for enough attestations to be collected via p2p.
|
|
1157
1302
|
* This is run after all blocks for the checkpoint have been built.
|
|
@@ -1202,8 +1347,11 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
1202
1347
|
} catch (err) {
|
|
1203
1348
|
if (err && err instanceof AttestationTimeoutError) {
|
|
1204
1349
|
collectedAttestationsCount = err.collectedCount;
|
|
1350
|
+
this.log.error(`Timeout while waiting for attestations for checkpoint proposal at slot ${proposal.slotNumber} (collected ${collectedAttestationsCount}/${numberOfRequiredAttestations})`, err);
|
|
1351
|
+
} else {
|
|
1352
|
+
this.log.error(`Error collecting attestations for checkpoint proposal at slot ${proposal.slotNumber}`, err);
|
|
1205
1353
|
}
|
|
1206
|
-
|
|
1354
|
+
return undefined;
|
|
1207
1355
|
} finally{
|
|
1208
1356
|
this.metrics.recordCollectedAttestations(collectedAttestationsCount, collectAttestationsTimer.ms());
|
|
1209
1357
|
}
|
|
@@ -43,5 +43,10 @@ export type SequencerEvents = {
|
|
|
43
43
|
['checkpoint-error']: (args: {
|
|
44
44
|
error: Error;
|
|
45
45
|
}) => void;
|
|
46
|
+
['pipelined-checkpoint-discarded']: (args: {
|
|
47
|
+
slot: SlotNumber;
|
|
48
|
+
checkpointNumber: CheckpointNumber;
|
|
49
|
+
reason: string;
|
|
50
|
+
}) => void;
|
|
46
51
|
};
|
|
47
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
52
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VxdWVuY2VyL2V2ZW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsZ0JBQWdCLEVBQUUsVUFBVSxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFakcsT0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;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7E,CAAC,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,WAAW,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,UAAU,CAAC;QAAC,SAAS,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1G,CAAC,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3D,CAAC,2BAA2B,CAAC,EAAE,CAAC,IAAI,EAAE;QACpC,IAAI,EAAE,UAAU,CAAC;QACjB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC7B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;KAC3B,KAAK,IAAI,CAAC;IACX,CAAC,sBAAsB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,gBAAgB,CAAC;QAAC,IAAI,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7F,CAAC,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,KAAK,IAAI,CAAC;IACvD,CAAC,gCAAgC,CAAC,EAAE,CAAC,IAAI,EAAE;QACzC,IAAI,EAAE,UAAU,CAAC;QACjB,gBAAgB,EAAE,gBAAgB,CAAC;QACnC,MAAM,EAAE,MAAM,CAAC;KAChB,KAAK,IAAI,CAAC;CACZ,CAAC"}
|
|
@@ -28,6 +28,7 @@ export declare class SequencerMetrics {
|
|
|
28
28
|
private slashingAttempts;
|
|
29
29
|
private pipelineDepth;
|
|
30
30
|
private pipelineDiscards;
|
|
31
|
+
private pipelineParentCheckpointMismatches;
|
|
31
32
|
private fishermanWouldBeIncluded;
|
|
32
33
|
private fishermanTimeBeforeBlock;
|
|
33
34
|
private fishermanPendingBlobTxCount;
|
|
@@ -54,6 +55,7 @@ export declare class SequencerMetrics {
|
|
|
54
55
|
recordStateTransitionBufferMs(durationMs: number, state: SequencerState): void;
|
|
55
56
|
recordPipelineDepth(depth: number): void;
|
|
56
57
|
recordPipelineDiscard(count?: number): void;
|
|
58
|
+
recordPipelineParentCheckpointMismatch(reason: string): void;
|
|
57
59
|
incOpenSlot(slot: SlotNumber, proposer: string): void;
|
|
58
60
|
incFilledSlot(proposer: string, coinbase: Hex | EthAddress | undefined): Promise<void>;
|
|
59
61
|
recordCheckpointSuccess(): void;
|
|
@@ -68,4 +70,4 @@ export declare class SequencerMetrics {
|
|
|
68
70
|
*/
|
|
69
71
|
recordFishermanFeeAnalysis(analysis: L1FeeAnalysisResult): void;
|
|
70
72
|
}
|
|
71
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
73
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWV0cmljcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NlcXVlbmNlci9tZXRyaWNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUN2RCxPQUFPLEtBQUssRUFBRSxjQUFjLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQzNFLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2xFLE9BQU8sRUFNTCxLQUFLLGVBQWUsRUFDcEIsS0FBSyxNQUFNLEVBR1osTUFBTSx5QkFBeUIsQ0FBQztBQUVqQyxPQUFPLEVBQUUsS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UAAU,QAc5E;IAED,iBAAiB,SAIhB;IAED,6BAA6B,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,QAItE;IAED,mBAAmB,CAAC,KAAK,EAAE,MAAM,QAEhC;IAED,qBAAqB,CAAC,KAAK,SAAI,QAE9B;IAED,sCAAsC,CAAC,MAAM,EAAE,MAAM,QAIpD;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,uBAAuB,SAEtB;IAED,yBAAyB,CAAC,MAAM,CAAC,EAAE,MAAM,QAIxC;IAED,+BAA+B,SAE9B;IAED,8BAA8B,CAC5B,SAAS,EAAE,oBAAoB,GAAG,8BAA8B,GAAG,eAAe,GAAG,uBAAuB,QAG7G;IAED,8BAA8B,CAAC,MAAM,CAAC,EAAE,MAAM,QAI7C;IAED,qBAAqB,CAAC,WAAW,EAAE,MAAM,QAExC;IAED;;;OAGG;IACH,0BAA0B,CAAC,QAAQ,EAAE,mBAAmB,QAkHvD;CACF"}
|
|
@@ -24,6 +24,7 @@ export class SequencerMetrics {
|
|
|
24
24
|
slashingAttempts;
|
|
25
25
|
pipelineDepth;
|
|
26
26
|
pipelineDiscards;
|
|
27
|
+
pipelineParentCheckpointMismatches;
|
|
27
28
|
// Fisherman fee analysis metrics
|
|
28
29
|
fishermanWouldBeIncluded;
|
|
29
30
|
fishermanTimeBeforeBlock;
|
|
@@ -82,6 +83,15 @@ export class SequencerMetrics {
|
|
|
82
83
|
this.slashingAttempts = createUpDownCounterWithDefault(this.meter, Metrics.SEQUENCER_SLASHING_ATTEMPTS_COUNT);
|
|
83
84
|
this.pipelineDepth = this.meter.createGauge(Metrics.SEQUENCER_PIPELINE_DEPTH);
|
|
84
85
|
this.pipelineDiscards = createUpDownCounterWithDefault(this.meter, Metrics.SEQUENCER_PIPELINE_DISCARDS_COUNT);
|
|
86
|
+
this.pipelineParentCheckpointMismatches = createUpDownCounterWithDefault(this.meter, Metrics.SEQUENCER_PIPELINE_PARENT_CHECKPOINT_MISMATCH_COUNT, {
|
|
87
|
+
[Attributes.ERROR_TYPE]: [
|
|
88
|
+
'archiver-sync-timeout',
|
|
89
|
+
'parent-not-on-l1',
|
|
90
|
+
'parent-hash-mismatch',
|
|
91
|
+
'parent-invalid-attestations',
|
|
92
|
+
'unexpected-parent-appeared'
|
|
93
|
+
]
|
|
94
|
+
});
|
|
85
95
|
this.pipelineDepth.record(0);
|
|
86
96
|
// Fisherman fee analysis metrics
|
|
87
97
|
this.fishermanWouldBeIncluded = createUpDownCounterWithDefault(this.meter, Metrics.FISHERMAN_FEE_ANALYSIS_WOULD_BE_INCLUDED, {
|
|
@@ -154,6 +164,11 @@ export class SequencerMetrics {
|
|
|
154
164
|
recordPipelineDiscard(count = 1) {
|
|
155
165
|
this.pipelineDiscards.add(count);
|
|
156
166
|
}
|
|
167
|
+
recordPipelineParentCheckpointMismatch(reason) {
|
|
168
|
+
this.pipelineParentCheckpointMismatches.add(1, {
|
|
169
|
+
[Attributes.ERROR_TYPE]: reason
|
|
170
|
+
});
|
|
171
|
+
}
|
|
157
172
|
incOpenSlot(slot, proposer) {
|
|
158
173
|
// sequencer went through the loop a second time. Noop
|
|
159
174
|
if (slot === this.lastSeenSlot) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/sequencer-client",
|
|
3
|
-
"version": "5.0.0-nightly.
|
|
3
|
+
"version": "5.0.0-nightly.20260423",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -26,37 +26,37 @@
|
|
|
26
26
|
"test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --config jest.integration.config.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@aztec/aztec.js": "5.0.0-nightly.
|
|
30
|
-
"@aztec/bb-prover": "5.0.0-nightly.
|
|
31
|
-
"@aztec/blob-client": "5.0.0-nightly.
|
|
32
|
-
"@aztec/blob-lib": "5.0.0-nightly.
|
|
33
|
-
"@aztec/constants": "5.0.0-nightly.
|
|
34
|
-
"@aztec/epoch-cache": "5.0.0-nightly.
|
|
35
|
-
"@aztec/ethereum": "5.0.0-nightly.
|
|
36
|
-
"@aztec/foundation": "5.0.0-nightly.
|
|
37
|
-
"@aztec/l1-artifacts": "5.0.0-nightly.
|
|
38
|
-
"@aztec/node-keystore": "5.0.0-nightly.
|
|
39
|
-
"@aztec/noir-acvm_js": "5.0.0-nightly.
|
|
40
|
-
"@aztec/noir-contracts.js": "5.0.0-nightly.
|
|
41
|
-
"@aztec/noir-protocol-circuits-types": "5.0.0-nightly.
|
|
42
|
-
"@aztec/noir-types": "5.0.0-nightly.
|
|
43
|
-
"@aztec/p2p": "5.0.0-nightly.
|
|
44
|
-
"@aztec/protocol-contracts": "5.0.0-nightly.
|
|
45
|
-
"@aztec/prover-client": "5.0.0-nightly.
|
|
46
|
-
"@aztec/simulator": "5.0.0-nightly.
|
|
47
|
-
"@aztec/slasher": "5.0.0-nightly.
|
|
48
|
-
"@aztec/stdlib": "5.0.0-nightly.
|
|
49
|
-
"@aztec/telemetry-client": "5.0.0-nightly.
|
|
50
|
-
"@aztec/validator-client": "5.0.0-nightly.
|
|
51
|
-
"@aztec/validator-ha-signer": "5.0.0-nightly.
|
|
52
|
-
"@aztec/world-state": "5.0.0-nightly.
|
|
29
|
+
"@aztec/aztec.js": "5.0.0-nightly.20260423",
|
|
30
|
+
"@aztec/bb-prover": "5.0.0-nightly.20260423",
|
|
31
|
+
"@aztec/blob-client": "5.0.0-nightly.20260423",
|
|
32
|
+
"@aztec/blob-lib": "5.0.0-nightly.20260423",
|
|
33
|
+
"@aztec/constants": "5.0.0-nightly.20260423",
|
|
34
|
+
"@aztec/epoch-cache": "5.0.0-nightly.20260423",
|
|
35
|
+
"@aztec/ethereum": "5.0.0-nightly.20260423",
|
|
36
|
+
"@aztec/foundation": "5.0.0-nightly.20260423",
|
|
37
|
+
"@aztec/l1-artifacts": "5.0.0-nightly.20260423",
|
|
38
|
+
"@aztec/node-keystore": "5.0.0-nightly.20260423",
|
|
39
|
+
"@aztec/noir-acvm_js": "5.0.0-nightly.20260423",
|
|
40
|
+
"@aztec/noir-contracts.js": "5.0.0-nightly.20260423",
|
|
41
|
+
"@aztec/noir-protocol-circuits-types": "5.0.0-nightly.20260423",
|
|
42
|
+
"@aztec/noir-types": "5.0.0-nightly.20260423",
|
|
43
|
+
"@aztec/p2p": "5.0.0-nightly.20260423",
|
|
44
|
+
"@aztec/protocol-contracts": "5.0.0-nightly.20260423",
|
|
45
|
+
"@aztec/prover-client": "5.0.0-nightly.20260423",
|
|
46
|
+
"@aztec/simulator": "5.0.0-nightly.20260423",
|
|
47
|
+
"@aztec/slasher": "5.0.0-nightly.20260423",
|
|
48
|
+
"@aztec/stdlib": "5.0.0-nightly.20260423",
|
|
49
|
+
"@aztec/telemetry-client": "5.0.0-nightly.20260423",
|
|
50
|
+
"@aztec/validator-client": "5.0.0-nightly.20260423",
|
|
51
|
+
"@aztec/validator-ha-signer": "5.0.0-nightly.20260423",
|
|
52
|
+
"@aztec/world-state": "5.0.0-nightly.20260423",
|
|
53
53
|
"lodash.chunk": "^4.2.0",
|
|
54
54
|
"tslib": "^2.4.0",
|
|
55
55
|
"viem": "npm:@aztec/viem@2.38.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@aztec/archiver": "5.0.0-nightly.
|
|
59
|
-
"@aztec/kv-store": "5.0.0-nightly.
|
|
58
|
+
"@aztec/archiver": "5.0.0-nightly.20260423",
|
|
59
|
+
"@aztec/kv-store": "5.0.0-nightly.20260423",
|
|
60
60
|
"@electric-sql/pglite": "^0.3.14",
|
|
61
61
|
"@jest/globals": "^30.0.0",
|
|
62
62
|
"@types/jest": "^30.0.0",
|
|
@@ -18,6 +18,7 @@ import { EthAddress } from '@aztec/foundation/eth-address';
|
|
|
18
18
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
19
19
|
import { filter } from '@aztec/foundation/iterator';
|
|
20
20
|
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
21
|
+
import { retryUntil } from '@aztec/foundation/retry';
|
|
21
22
|
import { sleep, sleepUntil } from '@aztec/foundation/sleep';
|
|
22
23
|
import { type DateProvider, Timer } from '@aztec/foundation/timer';
|
|
23
24
|
import { type TypedEventEmitter, isErrorClass, unfreeze } from '@aztec/foundation/types';
|
|
@@ -30,6 +31,7 @@ import {
|
|
|
30
31
|
type L2BlockSink,
|
|
31
32
|
type L2BlockSource,
|
|
32
33
|
MaliciousCommitteeAttestationsAndSigners,
|
|
34
|
+
type ValidateCheckpointResult,
|
|
33
35
|
} from '@aztec/stdlib/block';
|
|
34
36
|
import { type Checkpoint, type ProposedCheckpointData, validateCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
35
37
|
import { computeQuorum, getSlotStartBuildTimestamp, getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
|
|
@@ -129,7 +131,7 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
129
131
|
private readonly dateProvider: DateProvider,
|
|
130
132
|
private readonly metrics: SequencerMetrics,
|
|
131
133
|
private readonly checkpointMetrics: CheckpointProposalJobMetricsRecorder,
|
|
132
|
-
|
|
134
|
+
protected readonly eventEmitter: TypedEventEmitter<SequencerEvents>,
|
|
133
135
|
private readonly setStateFn: (state: SequencerState, slot?: SlotNumber) => void,
|
|
134
136
|
public readonly tracer: Tracer,
|
|
135
137
|
bindings?: LoggerBindings,
|
|
@@ -208,37 +210,38 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
208
210
|
broadcast: CheckpointProposalBroadcast,
|
|
209
211
|
votesPromises: Promise<unknown>[],
|
|
210
212
|
): Promise<void> {
|
|
211
|
-
const { checkpoint
|
|
213
|
+
const { checkpoint } = broadcast;
|
|
214
|
+
const isPipelining = this.epochCache.isProposerPipeliningEnabled();
|
|
215
|
+
|
|
212
216
|
try {
|
|
217
|
+
// Wait for all votes actions, enqueued at the beginning, to resolve
|
|
213
218
|
await Promise.all(votesPromises);
|
|
214
219
|
|
|
215
|
-
|
|
216
|
-
const
|
|
220
|
+
// Try to collect attestations from the committee
|
|
221
|
+
const signedAttestations = await this.getSignedCommitteeAttestations(broadcast);
|
|
217
222
|
|
|
218
|
-
|
|
223
|
+
// If pipelining, wait for the previous checkpoint to land on L1 before submitting,
|
|
224
|
+
// so we can check it matches the proposed checkpoint we used as parent, and has valid attestations.
|
|
225
|
+
if (signedAttestations && (!isPipelining || (await this.waitForValidParentCheckpointOnL1()))) {
|
|
226
|
+
await this.enqueueCheckpointForSubmission({ checkpoint, ...signedAttestations });
|
|
227
|
+
}
|
|
219
228
|
|
|
220
|
-
//
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
} catch (err) {
|
|
231
|
-
if (this.handleHASigningError(err, 'Attestations signature')) {
|
|
232
|
-
return;
|
|
229
|
+
// If we failed to collect attestations, at least check if we need to issue an invalidation
|
|
230
|
+
// Note that if we are not pipelining, we enqueued the invalidation at the beginning
|
|
231
|
+
if (!signedAttestations && isPipelining && (await this.waitForSyncedL2SlotNumber(this.slotNow))) {
|
|
232
|
+
const validationStatus = await this.l2BlockSource.getPendingChainValidationStatus();
|
|
233
|
+
if (!validationStatus.valid) {
|
|
234
|
+
this.log.warn(
|
|
235
|
+
`Checkpoint ${validationStatus.checkpoint.checkpointNumber} has invalid attestations, enqueuing invalidation in spite of attestation collection failure`,
|
|
236
|
+
{ checkpoint: validationStatus.checkpoint, reason: validationStatus.reason },
|
|
237
|
+
);
|
|
238
|
+
await this.enqueueInvalidation(validationStatus);
|
|
233
239
|
}
|
|
234
|
-
throw err;
|
|
235
240
|
}
|
|
236
241
|
|
|
237
|
-
//
|
|
238
|
-
await this.enqueueCheckpointForSubmission({ checkpoint, attestations, attestationsSignature });
|
|
239
|
-
|
|
242
|
+
// Send whatever was enqueued: votes + (propose | invalidation | nothing).
|
|
240
243
|
// Compute the earliest time to submit: pipeline slot start when pipelining, now otherwise.
|
|
241
|
-
const submitAfter =
|
|
244
|
+
const submitAfter = isPipelining
|
|
242
245
|
? new Date(Number(getTimestampForSlot(this.targetSlot, this.l1Constants)) * 1000)
|
|
243
246
|
: new Date(this.dateProvider.now());
|
|
244
247
|
|
|
@@ -250,7 +253,7 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
250
253
|
await this.metrics.incFilledSlot(this.publisher.getSenderAddress().toString(), coinbase);
|
|
251
254
|
} else {
|
|
252
255
|
this.eventEmitter.emit('checkpoint-publish-failed', { ...l1Response, slot: this.targetSlot });
|
|
253
|
-
if (
|
|
256
|
+
if (isPipelining) {
|
|
254
257
|
this.metrics.recordPipelineDiscard();
|
|
255
258
|
}
|
|
256
259
|
}
|
|
@@ -260,7 +263,7 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
260
263
|
}
|
|
261
264
|
this.log.error(`Background attestation/L1 pipeline failed for slot ${this.targetSlot}`, err);
|
|
262
265
|
this.eventEmitter.emit('checkpoint-publish-failed', { slot: this.targetSlot });
|
|
263
|
-
if (
|
|
266
|
+
if (isPipelining) {
|
|
264
267
|
this.metrics.recordPipelineDiscard();
|
|
265
268
|
}
|
|
266
269
|
}
|
|
@@ -303,6 +306,141 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
303
306
|
});
|
|
304
307
|
}
|
|
305
308
|
|
|
309
|
+
/**
|
|
310
|
+
* Wait until the archiver syncs past the given L2 slot number.
|
|
311
|
+
* The deadline is the end of `this.targetSlot`, beyond which any pipelined work would miss its
|
|
312
|
+
* L1 submission window and is no longer useful.
|
|
313
|
+
*/
|
|
314
|
+
private async waitForSyncedL2SlotNumber(waitForSlot: SlotNumber): Promise<boolean> {
|
|
315
|
+
const targetSlotStart = Number(getTimestampForSlot(this.targetSlot, this.l1Constants));
|
|
316
|
+
const targetSlotEndMs = (targetSlotStart + this.l1Constants.slotDuration) * 1000;
|
|
317
|
+
const syncDelayTolerance = this.l1Constants.ethereumSlotDuration * 2 * 1000;
|
|
318
|
+
const timeoutSeconds = Math.max(0.1, (targetSlotEndMs + syncDelayTolerance - this.dateProvider.now()) / 1000);
|
|
319
|
+
|
|
320
|
+
try {
|
|
321
|
+
return await retryUntil(
|
|
322
|
+
async () => {
|
|
323
|
+
const syncedSlot = await this.l2BlockSource.getSyncedL2SlotNumber();
|
|
324
|
+
return syncedSlot !== undefined && syncedSlot >= waitForSlot;
|
|
325
|
+
},
|
|
326
|
+
`archiver sync past slot ${waitForSlot}`,
|
|
327
|
+
timeoutSeconds,
|
|
328
|
+
0.2,
|
|
329
|
+
);
|
|
330
|
+
} catch {
|
|
331
|
+
this.log.warn(
|
|
332
|
+
`Archiver did not sync L1 past slot ${waitForSlot} before slot ${this.targetSlot} expired, discarding pipelined work`,
|
|
333
|
+
{ checkpointNumber: this.checkpointNumber },
|
|
334
|
+
);
|
|
335
|
+
this.emitPipelinedCheckpointDiscarded('archiver-sync-timeout');
|
|
336
|
+
return false;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Waits for the parent checkpoint to land on L1 before submitting a pipelined checkpoint.
|
|
342
|
+
* Polls until the archiver has synced L1 past the parent's slot, then verifies:
|
|
343
|
+
* - If we built on a proposed parent: it must have landed on L1 with matching hash and valid attestations.
|
|
344
|
+
* - If we built without a proposed parent: no new checkpoint must have appeared for that slot.
|
|
345
|
+
* If the parent has invalid attestations, enqueues an invalidation. Returns whether to proceed with the proposal.
|
|
346
|
+
*/
|
|
347
|
+
protected async waitForValidParentCheckpointOnL1(): Promise<boolean> {
|
|
348
|
+
const parentCheckpointNumber = CheckpointNumber(this.checkpointNumber - 1);
|
|
349
|
+
|
|
350
|
+
// Wait until archiver has synced L1 past the parent's slot (slotNow)
|
|
351
|
+
if (!(await this.waitForSyncedL2SlotNumber(this.slotNow))) {
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const tips = await this.l2BlockSource.getL2Tips();
|
|
356
|
+
const checkpointedNumber = tips.checkpointed.checkpoint.number;
|
|
357
|
+
|
|
358
|
+
// We built on top of a proposed checkpoint. Verify it landed on L1 as expected.
|
|
359
|
+
if (this.proposedCheckpointData) {
|
|
360
|
+
// After syncing from L1 we see the chain tip has invalid attestations. This means the parent checkpoint was posted
|
|
361
|
+
// with invalid attestations, or it built on top of something with invalid attestations and didnt invalidate them.
|
|
362
|
+
// Either way, we thought our parent would be valid, so we have to throw away our work. But at least we'll try and
|
|
363
|
+
// invalidate on L1 so we clean up the chain for the next proposer. And we'll slash them, but that's handled elsewhere.
|
|
364
|
+
const validationStatus = await this.l2BlockSource.getPendingChainValidationStatus();
|
|
365
|
+
if (!validationStatus.valid) {
|
|
366
|
+
this.log.warn(
|
|
367
|
+
`Parent checkpoint ${parentCheckpointNumber} has invalid attestations, discarding pipelined work`,
|
|
368
|
+
{ checkpointNumber: this.checkpointNumber, reason: validationStatus.reason },
|
|
369
|
+
);
|
|
370
|
+
this.emitPipelinedCheckpointDiscarded('parent-invalid-attestations');
|
|
371
|
+
await this.enqueueInvalidation(validationStatus);
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// The pending chain is valid. But did the parent checkpoint land on L1 at all?
|
|
376
|
+
if (checkpointedNumber < parentCheckpointNumber) {
|
|
377
|
+
this.log.warn(`Parent checkpoint ${parentCheckpointNumber} did not land on L1, discarding pipelined work`, {
|
|
378
|
+
checkpointNumber: this.checkpointNumber,
|
|
379
|
+
checkpointedNumber,
|
|
380
|
+
});
|
|
381
|
+
this.emitPipelinedCheckpointDiscarded('parent-not-on-l1');
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// It landed. But is it the one we were expecting?
|
|
386
|
+
const expectedHash = this.proposedCheckpointData.header.hash().toString();
|
|
387
|
+
if (tips.checkpointed.checkpoint.hash !== expectedHash) {
|
|
388
|
+
this.log.warn(`Parent checkpoint ${parentCheckpointNumber} hash mismatch on L1, discarding pipelined work`, {
|
|
389
|
+
checkpointNumber: this.checkpointNumber,
|
|
390
|
+
expectedHash,
|
|
391
|
+
actualHash: tips.checkpointed.checkpoint.hash,
|
|
392
|
+
});
|
|
393
|
+
this.emitPipelinedCheckpointDiscarded('parent-hash-mismatch');
|
|
394
|
+
return false;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
return true;
|
|
398
|
+
} else {
|
|
399
|
+
// We didn't see a proposed checkpoint at build time, so we built on checkpointed parent from two slots ago.
|
|
400
|
+
// But if a new checkpoint for the previous slot appeared on L1 in the meantime, our checkpoint assumed the wrong parent,
|
|
401
|
+
// so we have to discard our work. This can happen if we're somehow cut off from p2p and fail to see the checkpoint
|
|
402
|
+
// proposal for the previous slot.
|
|
403
|
+
if (checkpointedNumber > parentCheckpointNumber) {
|
|
404
|
+
this.log.warn(
|
|
405
|
+
`Unexpected checkpoint ${checkpointedNumber} landed on L1 after we built on top of parent ${parentCheckpointNumber}, discarding pipelined work`,
|
|
406
|
+
{ checkpointNumber: this.checkpointNumber, checkpointedNumber },
|
|
407
|
+
);
|
|
408
|
+
this.emitPipelinedCheckpointDiscarded('unexpected-parent-appeared');
|
|
409
|
+
return false;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
return true;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/** Emits the pipelined-checkpoint-discarded event and records the metric. */
|
|
417
|
+
private emitPipelinedCheckpointDiscarded(reason: string): void {
|
|
418
|
+
this.metrics.recordPipelineParentCheckpointMismatch(reason);
|
|
419
|
+
this.eventEmitter.emit('pipelined-checkpoint-discarded', {
|
|
420
|
+
slot: this.targetSlot,
|
|
421
|
+
checkpointNumber: this.checkpointNumber,
|
|
422
|
+
reason,
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/** Simulates and enqueues an invalidation request for the invalid parent checkpoint. */
|
|
427
|
+
private async enqueueInvalidation(validationStatus: ValidateCheckpointResult): Promise<void> {
|
|
428
|
+
if (this.config.skipInvalidateBlockAsProposer) {
|
|
429
|
+
this.log.warn(`Skipping checkpoint invalidation as proposer due to test configuration`);
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
const invalidateRequest = await this.publisher.simulateInvalidateCheckpoint(validationStatus);
|
|
433
|
+
if (invalidateRequest) {
|
|
434
|
+
const submissionSlotStart = Number(getTimestampForSlot(this.targetSlot, this.l1Constants));
|
|
435
|
+
const txTimeoutAt = new Date((submissionSlotStart + this.l1Constants.slotDuration) * 1000);
|
|
436
|
+
this.publisher.enqueueInvalidateCheckpoint(invalidateRequest, { txTimeoutAt });
|
|
437
|
+
} else {
|
|
438
|
+
this.log.info(`Invalidation simulation returned undefined, checkpoint may have been removed already`, {
|
|
439
|
+
checkpointNumber: this.checkpointNumber,
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
306
444
|
@trackSpan('CheckpointProposalJob.proposeCheckpoint', function () {
|
|
307
445
|
return {
|
|
308
446
|
// nullish operator needed for tests
|
|
@@ -870,12 +1008,44 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
870
1008
|
return { canStartBuilding: true, availableTxs, minTxs };
|
|
871
1009
|
}
|
|
872
1010
|
|
|
1011
|
+
private async getSignedCommitteeAttestations(
|
|
1012
|
+
broadcast: CheckpointProposalBroadcast,
|
|
1013
|
+
): Promise<{ attestations: CommitteeAttestationsAndSigners; attestationsSignature: Signature } | undefined> {
|
|
1014
|
+
const { proposal, blockProposedAt } = broadcast;
|
|
1015
|
+
this.setStateFn(SequencerState.COLLECTING_ATTESTATIONS, this.targetSlot);
|
|
1016
|
+
const attestations = await this.waitForAttestations(proposal);
|
|
1017
|
+
if (!attestations) {
|
|
1018
|
+
return undefined;
|
|
1019
|
+
}
|
|
1020
|
+
this.checkpointMetrics.recordCheckpointAttestationDelay(this.dateProvider.now() - blockProposedAt);
|
|
1021
|
+
|
|
1022
|
+
// Proposer must sign over the attestations before pushing them to L1
|
|
1023
|
+
const signer = this.proposer ?? this.publisher.getSenderAddress();
|
|
1024
|
+
try {
|
|
1025
|
+
const attestationsSignature = await this.validatorClient.signAttestationsAndSigners(
|
|
1026
|
+
attestations,
|
|
1027
|
+
signer,
|
|
1028
|
+
this.targetSlot,
|
|
1029
|
+
this.checkpointNumber,
|
|
1030
|
+
);
|
|
1031
|
+
return { attestations, attestationsSignature };
|
|
1032
|
+
} catch (err) {
|
|
1033
|
+
if (this.handleHASigningError(err, 'Attestations signature')) {
|
|
1034
|
+
return;
|
|
1035
|
+
}
|
|
1036
|
+
this.log.error(`Error signing attestations for checkpoint proposal at slot ${proposal.slotNumber}`, err);
|
|
1037
|
+
return undefined;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
|
|
873
1041
|
/**
|
|
874
1042
|
* Waits for enough attestations to be collected via p2p.
|
|
875
1043
|
* This is run after all blocks for the checkpoint have been built.
|
|
876
1044
|
*/
|
|
877
1045
|
@trackSpan('CheckpointProposalJob.waitForAttestations')
|
|
878
|
-
private async waitForAttestations(
|
|
1046
|
+
private async waitForAttestations(
|
|
1047
|
+
proposal: CheckpointProposal,
|
|
1048
|
+
): Promise<CommitteeAttestationsAndSigners | undefined> {
|
|
879
1049
|
if (this.config.fishermanMode) {
|
|
880
1050
|
this.log.debug('Skipping attestation collection in fisherman mode');
|
|
881
1051
|
return CommitteeAttestationsAndSigners.empty();
|
|
@@ -949,8 +1119,14 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
949
1119
|
} catch (err) {
|
|
950
1120
|
if (err && err instanceof AttestationTimeoutError) {
|
|
951
1121
|
collectedAttestationsCount = err.collectedCount;
|
|
1122
|
+
this.log.error(
|
|
1123
|
+
`Timeout while waiting for attestations for checkpoint proposal at slot ${proposal.slotNumber} (collected ${collectedAttestationsCount}/${numberOfRequiredAttestations})`,
|
|
1124
|
+
err,
|
|
1125
|
+
);
|
|
1126
|
+
} else {
|
|
1127
|
+
this.log.error(`Error collecting attestations for checkpoint proposal at slot ${proposal.slotNumber}`, err);
|
|
952
1128
|
}
|
|
953
|
-
|
|
1129
|
+
return undefined;
|
|
954
1130
|
} finally {
|
|
955
1131
|
this.metrics.recordCollectedAttestations(collectedAttestationsCount, collectAttestationsTimer.ms());
|
|
956
1132
|
}
|
package/src/sequencer/events.ts
CHANGED
|
@@ -24,4 +24,9 @@ export type SequencerEvents = {
|
|
|
24
24
|
}) => void;
|
|
25
25
|
['checkpoint-published']: (args: { checkpoint: CheckpointNumber; slot: SlotNumber }) => void;
|
|
26
26
|
['checkpoint-error']: (args: { error: Error }) => void;
|
|
27
|
+
['pipelined-checkpoint-discarded']: (args: {
|
|
28
|
+
slot: SlotNumber;
|
|
29
|
+
checkpointNumber: CheckpointNumber;
|
|
30
|
+
reason: string;
|
|
31
|
+
}) => void;
|
|
27
32
|
};
|
package/src/sequencer/metrics.ts
CHANGED
|
@@ -46,6 +46,7 @@ export class SequencerMetrics {
|
|
|
46
46
|
private slashingAttempts: UpDownCounter;
|
|
47
47
|
private pipelineDepth: Gauge;
|
|
48
48
|
private pipelineDiscards: UpDownCounter;
|
|
49
|
+
private pipelineParentCheckpointMismatches: UpDownCounter;
|
|
49
50
|
|
|
50
51
|
// Fisherman fee analysis metrics
|
|
51
52
|
private fishermanWouldBeIncluded: UpDownCounter;
|
|
@@ -141,6 +142,19 @@ export class SequencerMetrics {
|
|
|
141
142
|
|
|
142
143
|
this.pipelineDepth = this.meter.createGauge(Metrics.SEQUENCER_PIPELINE_DEPTH);
|
|
143
144
|
this.pipelineDiscards = createUpDownCounterWithDefault(this.meter, Metrics.SEQUENCER_PIPELINE_DISCARDS_COUNT);
|
|
145
|
+
this.pipelineParentCheckpointMismatches = createUpDownCounterWithDefault(
|
|
146
|
+
this.meter,
|
|
147
|
+
Metrics.SEQUENCER_PIPELINE_PARENT_CHECKPOINT_MISMATCH_COUNT,
|
|
148
|
+
{
|
|
149
|
+
[Attributes.ERROR_TYPE]: [
|
|
150
|
+
'archiver-sync-timeout',
|
|
151
|
+
'parent-not-on-l1',
|
|
152
|
+
'parent-hash-mismatch',
|
|
153
|
+
'parent-invalid-attestations',
|
|
154
|
+
'unexpected-parent-appeared',
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
);
|
|
144
158
|
this.pipelineDepth.record(0);
|
|
145
159
|
|
|
146
160
|
// Fisherman fee analysis metrics
|
|
@@ -246,6 +260,12 @@ export class SequencerMetrics {
|
|
|
246
260
|
this.pipelineDiscards.add(count);
|
|
247
261
|
}
|
|
248
262
|
|
|
263
|
+
recordPipelineParentCheckpointMismatch(reason: string) {
|
|
264
|
+
this.pipelineParentCheckpointMismatches.add(1, {
|
|
265
|
+
[Attributes.ERROR_TYPE]: reason,
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
|
|
249
269
|
incOpenSlot(slot: SlotNumber, proposer: string) {
|
|
250
270
|
// sequencer went through the loop a second time. Noop
|
|
251
271
|
if (slot === this.lastSeenSlot) {
|