@aztec/sequencer-client 0.0.1-commit.e0f15ab9b → 0.0.1-commit.e304674f1
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/sequencer-client.d.ts +1 -1
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +0 -4
- package/dest/global_variable_builder/global_builder.d.ts +3 -3
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +7 -4
- package/dest/publisher/sequencer-publisher-factory.d.ts +1 -3
- package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-factory.js +0 -1
- package/dest/publisher/sequencer-publisher.d.ts +52 -31
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +106 -87
- package/dest/sequencer/checkpoint_proposal_job.d.ts +31 -10
- package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -1
- package/dest/sequencer/checkpoint_proposal_job.js +179 -108
- package/dest/sequencer/checkpoint_voter.d.ts +1 -2
- package/dest/sequencer/checkpoint_voter.d.ts.map +1 -1
- package/dest/sequencer/checkpoint_voter.js +2 -5
- package/dest/sequencer/sequencer.d.ts +14 -4
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +67 -18
- package/dest/sequencer/timetable.d.ts +4 -1
- package/dest/sequencer/timetable.d.ts.map +1 -1
- package/dest/sequencer/timetable.js +15 -5
- package/package.json +27 -27
- package/src/client/sequencer-client.ts +0 -7
- package/src/global_variable_builder/global_builder.ts +15 -3
- package/src/publisher/sequencer-publisher-factory.ts +0 -3
- package/src/publisher/sequencer-publisher.ts +174 -124
- package/src/sequencer/README.md +81 -12
- package/src/sequencer/checkpoint_proposal_job.ts +215 -117
- package/src/sequencer/checkpoint_voter.ts +1 -12
- package/src/sequencer/sequencer.ts +97 -20
- package/src/sequencer/timetable.ts +19 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencer.d.ts","sourceRoot":"","sources":["../../src/sequencer/sequencer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAEzG,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC3G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"sequencer.d.ts","sourceRoot":"","sources":["../../src/sequencer/sequencer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAEzG,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,KAAK,EAAE,YAAY,EAA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I,MAAM,CAE1B;IAEM,qBAAqB,iBAE3B;IAED,qFAAqF;IAC9E,2BAA2B,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAErE;IAEM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEf;IAED,OAAO,KAAK,gBAAgB,GAE3B;CACF;AAED,KAAK,wBAAwB,GAAG;IAC9B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,4BAA4B,EAAE,gBAAgB,CAAC;IAC/C,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,EAAE,CAAC;IACZ,qBAAqB,EAAE,OAAO,CAAC;IAC/B,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAChD,YAAY,EAAE,UAAU,CAAC;IACzB,4BAA4B,EAAE,wBAAwB,CAAC;CACxD,CAAC"}
|
|
@@ -454,6 +454,7 @@ _dec = trackSpan('Sequencer.work'), _dec1 = trackSpan('Sequencer.prepareCheckpoi
|
|
|
454
454
|
/** The last slot for which we triggered a checkpoint proposal job, to prevent duplicate attempts. */ lastSlotForCheckpointProposalJob;
|
|
455
455
|
/** Last successful checkpoint proposed */ lastCheckpointProposed;
|
|
456
456
|
/** The last epoch for which we logged strategy comparison in fisherman mode. */ lastEpochForStrategyComparison;
|
|
457
|
+
/** The last checkpoint proposal job, tracked so we can await its pending L1 submission during shutdown. */ lastCheckpointProposalJob;
|
|
457
458
|
/** The maximum number of seconds that the sequencer can be into a slot to transition to a particular state. */ timetable;
|
|
458
459
|
/** Config for the sequencer */ config;
|
|
459
460
|
constructor(publisherFactory, validatorClient, globalsBuilder, p2pClient, worldState, slasherClient, l2BlockSource, l1ToL2MessageSource, checkpointsBuilder, l1Constants, dateProvider, epochCache, rollupContract, config, telemetry = getTelemetryClient(), log = createLogger('sequencer')){
|
|
@@ -475,7 +476,8 @@ _dec = trackSpan('Sequencer.work'), _dec1 = trackSpan('Sequencer.prepareCheckpoi
|
|
|
475
476
|
l1PublishingTime: this.l1PublishingTime,
|
|
476
477
|
p2pPropagationTime: this.config.attestationPropagationTime,
|
|
477
478
|
blockDurationMs: this.config.blockDurationMs,
|
|
478
|
-
enforce: this.config.enforceTimeTable
|
|
479
|
+
enforce: this.config.enforceTimeTable,
|
|
480
|
+
pipelining: this.epochCache.isProposerPipeliningEnabled()
|
|
479
481
|
}, this.metrics, this.log);
|
|
480
482
|
}
|
|
481
483
|
/** Initializes the sequencer (precomputes tables). Takes about 3s. */ init() {
|
|
@@ -496,6 +498,7 @@ _dec = trackSpan('Sequencer.work'), _dec1 = trackSpan('Sequencer.prepareCheckpoi
|
|
|
496
498
|
});
|
|
497
499
|
await this.publisherFactory.stopAll();
|
|
498
500
|
await this.runningPromise?.stop();
|
|
501
|
+
await this.lastCheckpointProposalJob?.awaitPendingSubmission();
|
|
499
502
|
this.setState(SequencerState.STOPPED, undefined, {
|
|
500
503
|
force: true
|
|
501
504
|
});
|
|
@@ -546,6 +549,8 @@ _dec = trackSpan('Sequencer.work'), _dec1 = trackSpan('Sequencer.prepareCheckpoi
|
|
|
546
549
|
if (!checkpointProposalJob) {
|
|
547
550
|
return;
|
|
548
551
|
}
|
|
552
|
+
// Track the job so we can await its pending L1 submission during shutdown
|
|
553
|
+
this.lastCheckpointProposalJob = checkpointProposalJob;
|
|
549
554
|
// Execute the checkpoint proposal job
|
|
550
555
|
const checkpoint = await checkpointProposalJob.execute();
|
|
551
556
|
// Update last checkpoint proposed (currently unused)
|
|
@@ -629,6 +634,13 @@ _dec = trackSpan('Sequencer.work'), _dec1 = trackSpan('Sequencer.prepareCheckpoi
|
|
|
629
634
|
await this.considerInvalidatingCheckpoint(syncedTo, slot);
|
|
630
635
|
return undefined;
|
|
631
636
|
}
|
|
637
|
+
// Guard: don't exceed 1-deep pipeline. Without a proposed checkpoint, we can only build
|
|
638
|
+
// confirmed + 1. With a proposed checkpoint, we can build confirmed + 2.
|
|
639
|
+
const confirmedCkpt = syncedTo.checkpointedCheckpointNumber;
|
|
640
|
+
if (checkpointNumber > confirmedCkpt + 2) {
|
|
641
|
+
this.log.verbose(`Skipping slot ${targetSlot}: checkpoint ${checkpointNumber} exceeds max pipeline depth (confirmed=${confirmedCkpt})`);
|
|
642
|
+
return undefined;
|
|
643
|
+
}
|
|
632
644
|
// Check that the target slot is not taken by a block already (should never happen, since only us can propose for this slot)
|
|
633
645
|
if (syncedTo.blockData && syncedTo.blockData.header.getSlot() >= targetSlot) {
|
|
634
646
|
this.log.warn(`Cannot propose block at target slot ${targetSlot} since that slot was taken by block ${syncedTo.blockNumber}`, {
|
|
@@ -651,12 +663,35 @@ _dec = trackSpan('Sequencer.work'), _dec1 = trackSpan('Sequencer.prepareCheckpoi
|
|
|
651
663
|
this.log.debug(`Set proposer address ${proposer} for simulation in fisherman mode`);
|
|
652
664
|
}
|
|
653
665
|
// Prepare invalidation request if the pending chain is invalid (returns undefined if no need)
|
|
654
|
-
|
|
655
|
-
//
|
|
656
|
-
//
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
}
|
|
666
|
+
let invalidateCheckpoint = await publisher.simulateInvalidateCheckpoint(syncedTo.pendingChainValidationStatus);
|
|
667
|
+
// Determine the correct archive and L1 state overrides for the canProposeAt check.
|
|
668
|
+
// The L1 contract reads archives[proposedCheckpointNumber] and compares it with the provided archive.
|
|
669
|
+
// When invalidating or pipelining, the local archive may differ from L1's, so we adjust accordingly.
|
|
670
|
+
let archiveForCheck = syncedTo.archive;
|
|
671
|
+
const l1Overrides = {};
|
|
672
|
+
if (this.epochCache.isProposerPipeliningEnabled() && syncedTo.hasProposedCheckpoint) {
|
|
673
|
+
// Parent checkpoint hasn't landed on L1 yet. Override both the proposed checkpoint number
|
|
674
|
+
// and the archive at that checkpoint so L1 simulation sees the correct chain tip.
|
|
675
|
+
const parentCheckpointNumber = CheckpointNumber(checkpointNumber - 1);
|
|
676
|
+
l1Overrides.forcePendingCheckpointNumber = parentCheckpointNumber;
|
|
677
|
+
l1Overrides.forceArchive = {
|
|
678
|
+
checkpointNumber: parentCheckpointNumber,
|
|
679
|
+
archive: syncedTo.archive
|
|
680
|
+
};
|
|
681
|
+
this.metrics.recordPipelineDepth(1);
|
|
682
|
+
this.log.verbose(`Building on top of proposed checkpoint (pending=${syncedTo.proposedCheckpointData?.checkpointNumber})`);
|
|
683
|
+
// Clear the invalidation - the proposed checkpoint should handle it.
|
|
684
|
+
invalidateCheckpoint = undefined;
|
|
685
|
+
} else if (invalidateCheckpoint) {
|
|
686
|
+
// After invalidation, L1 will roll back to checkpoint N-1. The archive at N-1 already
|
|
687
|
+
// exists on L1, so we just pass the matching archive (the lastArchive of the invalid checkpoint).
|
|
688
|
+
archiveForCheck = invalidateCheckpoint.lastArchive;
|
|
689
|
+
l1Overrides.forcePendingCheckpointNumber = invalidateCheckpoint.forcePendingCheckpointNumber;
|
|
690
|
+
this.metrics.recordPipelineDepth(0);
|
|
691
|
+
} else {
|
|
692
|
+
this.metrics.recordPipelineDepth(0);
|
|
693
|
+
}
|
|
694
|
+
const canProposeCheck = await publisher.canProposeAt(archiveForCheck, proposer ?? EthAddress.ZERO, l1Overrides);
|
|
660
695
|
if (canProposeCheck === undefined) {
|
|
661
696
|
this.log.warn(`Cannot propose checkpoint ${checkpointNumber} at slot ${slot} due to failed rollup contract check`, logCtx);
|
|
662
697
|
this.emit('proposer-rollup-check-failed', {
|
|
@@ -700,10 +735,10 @@ _dec = trackSpan('Sequencer.work'), _dec1 = trackSpan('Sequencer.prepareCheckpoi
|
|
|
700
735
|
pipeliningEnabled: this.epochCache.isProposerPipeliningEnabled()
|
|
701
736
|
});
|
|
702
737
|
// Create and return the checkpoint proposal job
|
|
703
|
-
return this.createCheckpointProposalJob(slot, targetSlot,
|
|
738
|
+
return this.createCheckpointProposalJob(slot, targetSlot, targetEpoch, checkpointNumber, syncedTo.blockNumber, proposer, publisher, attestorAddress, invalidateCheckpoint, syncedTo.proposedCheckpointData);
|
|
704
739
|
}
|
|
705
|
-
createCheckpointProposalJob(slot, targetSlot,
|
|
706
|
-
return new CheckpointProposalJob(slot, targetSlot,
|
|
740
|
+
createCheckpointProposalJob(slot, targetSlot, targetEpoch, checkpointNumber, syncedToBlockNumber, proposer, publisher, attestorAddress, invalidateCheckpoint, proposedCheckpointData) {
|
|
741
|
+
return new CheckpointProposalJob(slot, targetSlot, targetEpoch, checkpointNumber, syncedToBlockNumber, proposer, publisher, attestorAddress, invalidateCheckpoint, this.validatorClient, this.globalsBuilder, this.p2pClient, this.worldState, this.l1ToL2MessageSource, this.l2BlockSource, this.checkpointsBuilder, this.l2BlockSource, this.l1Constants, this.config, this.timetable, this.slasherClient, this.epochCache, this.dateProvider, this.metrics, this, this.setState.bind(this), this.tracer, this.log.getBindings(), proposedCheckpointData);
|
|
707
742
|
}
|
|
708
743
|
/**
|
|
709
744
|
* Returns the current sequencer state.
|
|
@@ -767,22 +802,30 @@ _dec = trackSpan('Sequencer.work'), _dec1 = trackSpan('Sequencer.prepareCheckpoi
|
|
|
767
802
|
number: syncSummary.latestBlockNumber,
|
|
768
803
|
hash: syncSummary.latestBlockHash
|
|
769
804
|
})),
|
|
770
|
-
this.l2BlockSource.getL2Tips().then((t)=>
|
|
805
|
+
this.l2BlockSource.getL2Tips().then((t)=>({
|
|
806
|
+
proposed: t.proposed,
|
|
807
|
+
checkpointed: t.checkpointed,
|
|
808
|
+
proposedCheckpoint: t.proposedCheckpoint
|
|
809
|
+
})),
|
|
771
810
|
this.p2pClient.getStatus().then((p2p)=>p2p.syncedToL2Block),
|
|
772
|
-
this.l1ToL2MessageSource.getL2Tips().then((t)=>
|
|
773
|
-
|
|
811
|
+
this.l1ToL2MessageSource.getL2Tips().then((t)=>({
|
|
812
|
+
proposed: t.proposed,
|
|
813
|
+
checkpointed: t.checkpointed
|
|
814
|
+
})),
|
|
815
|
+
this.l2BlockSource.getPendingChainValidationStatus(),
|
|
816
|
+
this.l2BlockSource.getProposedCheckpointOnly()
|
|
774
817
|
]);
|
|
775
|
-
const [worldState,
|
|
818
|
+
const [worldState, l2Tips, p2p, l1ToL2MessageSourceTips, pendingChainValidationStatus, proposedCheckpointData] = syncedBlocks;
|
|
776
819
|
// Handle zero as a special case, since the block hash won't match across services if we're changing the prefilled data for the genesis block,
|
|
777
820
|
// as the world state can compute the new genesis block hash, but other components use the hardcoded constant.
|
|
778
821
|
// TODO(palla/mbps): Fix the above. All components should be able to handle dynamic genesis block hashes.
|
|
779
|
-
const result =
|
|
822
|
+
const result = l2Tips.proposed.number === 0 && l2Tips.checkpointed.block.number === 0 && l2Tips.checkpointed.checkpoint.number === 0 && worldState.number === 0 && p2p.number === 0 && l1ToL2MessageSourceTips.proposed.number === 0 && l1ToL2MessageSourceTips.checkpointed.block.number === 0 && l1ToL2MessageSourceTips.checkpointed.checkpoint.number === 0 || worldState.hash === l2Tips.proposed.hash && p2p.hash === l2Tips.proposed.hash && l1ToL2MessageSourceTips.proposed.hash === l2Tips.proposed.hash && l1ToL2MessageSourceTips.checkpointed.block.hash === l2Tips.checkpointed.block.hash && l1ToL2MessageSourceTips.checkpointed.checkpoint.hash === l2Tips.checkpointed.checkpoint.hash;
|
|
780
823
|
if (!result) {
|
|
781
824
|
this.log.debug(`Sequencer sync check failed`, {
|
|
782
825
|
worldState,
|
|
783
|
-
l2BlockSource,
|
|
826
|
+
l2BlockSource: l2Tips.proposed,
|
|
784
827
|
p2p,
|
|
785
|
-
|
|
828
|
+
l1ToL2MessageSourceTips
|
|
786
829
|
});
|
|
787
830
|
return undefined;
|
|
788
831
|
}
|
|
@@ -792,8 +835,10 @@ _dec = trackSpan('Sequencer.work'), _dec1 = trackSpan('Sequencer.prepareCheckpoi
|
|
|
792
835
|
const archive = new Fr((await this.worldState.getCommitted().getTreeInfo(MerkleTreeId.ARCHIVE)).root);
|
|
793
836
|
return {
|
|
794
837
|
checkpointNumber: CheckpointNumber.ZERO,
|
|
838
|
+
checkpointedCheckpointNumber: CheckpointNumber.ZERO,
|
|
795
839
|
blockNumber: BlockNumber.ZERO,
|
|
796
840
|
archive,
|
|
841
|
+
hasProposedCheckpoint: false,
|
|
797
842
|
syncedL2Slot,
|
|
798
843
|
pendingChainValidationStatus
|
|
799
844
|
};
|
|
@@ -804,11 +849,15 @@ _dec = trackSpan('Sequencer.work'), _dec1 = trackSpan('Sequencer.prepareCheckpoi
|
|
|
804
849
|
this.log.error(`Failed to get L2 block data ${blockNumber} from the archiver with all components in sync`);
|
|
805
850
|
return undefined;
|
|
806
851
|
}
|
|
852
|
+
const hasProposedCheckpoint = l2Tips.proposedCheckpoint.checkpoint.number > l2Tips.checkpointed.checkpoint.number;
|
|
807
853
|
return {
|
|
808
854
|
blockData,
|
|
809
855
|
blockNumber: blockData.header.getBlockNumber(),
|
|
810
856
|
checkpointNumber: blockData.checkpointNumber,
|
|
857
|
+
checkpointedCheckpointNumber: l2Tips.checkpointed.checkpoint.number,
|
|
811
858
|
archive: blockData.archive.root,
|
|
859
|
+
hasProposedCheckpoint,
|
|
860
|
+
proposedCheckpointData,
|
|
812
861
|
syncedL2Slot,
|
|
813
862
|
pendingChainValidationStatus
|
|
814
863
|
};
|
|
@@ -864,7 +913,7 @@ _dec = trackSpan('Sequencer.work'), _dec1 = trackSpan('Sequencer.prepareCheckpoi
|
|
|
864
913
|
proposer
|
|
865
914
|
];
|
|
866
915
|
}
|
|
867
|
-
this.log.
|
|
916
|
+
this.log.info(`We are the proposer for pipeline slot ${targetSlot}`, {
|
|
868
917
|
targetSlot,
|
|
869
918
|
proposer
|
|
870
919
|
});
|
|
@@ -50,6 +50,8 @@ export declare class SequencerTimetable {
|
|
|
50
50
|
readonly blockDuration: number | undefined;
|
|
51
51
|
/** Maximum number of blocks that can be built in this slot configuration */
|
|
52
52
|
readonly maxNumberOfBlocks: number;
|
|
53
|
+
/** Whether pipelining is enabled (checkpoint finalization deferred to next slot). */
|
|
54
|
+
readonly pipelining: boolean;
|
|
53
55
|
constructor(opts: {
|
|
54
56
|
ethereumSlotDuration: number;
|
|
55
57
|
aztecSlotDuration: number;
|
|
@@ -57,6 +59,7 @@ export declare class SequencerTimetable {
|
|
|
57
59
|
p2pPropagationTime?: number;
|
|
58
60
|
blockDurationMs?: number;
|
|
59
61
|
enforce: boolean;
|
|
62
|
+
pipelining?: boolean;
|
|
60
63
|
}, metrics?: SequencerMetrics | undefined, log?: Logger | undefined);
|
|
61
64
|
getMaxAllowedTime(state: Extract<SequencerState, SequencerState.STOPPED | SequencerState.IDLE | SequencerState.SYNCHRONIZING>): undefined;
|
|
62
65
|
getMaxAllowedTime(state: Exclude<SequencerState, SequencerState.STOPPED | SequencerState.IDLE | SequencerState.SYNCHRONIZING>): number;
|
|
@@ -85,4 +88,4 @@ export declare class SequencerTimetable {
|
|
|
85
88
|
isLastBlock: boolean;
|
|
86
89
|
};
|
|
87
90
|
}
|
|
88
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
91
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZXRhYmxlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VxdWVuY2VyL3RpbWV0YWJsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQVNwRCxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGNBQWMsQ0FBQztBQUNyRCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sWUFBWSxDQUFDO0FBRTVDLHFCQUFhLGtCQUFrQjtJQXlFM0IsT0FBTyxDQUFDLFFBQVEsQ0FBQyxPQUFPLENBQUM7SUFDekIsT0FBTyxDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQUM7SUF6RXZCOzs7O09BSUc7SUFDSCxTQUFnQixrQkFBa0IsRUFBRSxNQUFNLENBQUM7SUFFM0M7Ozs7T0FJRztJQUNILFNBQWdCLG9CQ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|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timetable.d.ts","sourceRoot":"","sources":["../../src/sequencer/timetable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AASpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,qBAAa,kBAAkB;
|
|
1
|
+
{"version":3,"file":"timetable.d.ts","sourceRoot":"","sources":["../../src/sequencer/timetable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AASpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,qBAAa,kBAAkB;IAyE3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;IAzEvB;;;;OAIG;IACH,SAAgB,kBAAkB,EAAE,MAAM,CAAC;IAE3C;;;;OAIG;IACH,SAAgB,oBAAoB,EAAE,MAAM,CAAC;IAE7C;;;;;OAKG;IACH,SAAgB,0BAA0B,EAAE,MAAM,CAAC;IAEnD;;;;OAIG;IACH,SAAgB,gBAAgB,EAAE,MAAM,CAAC;IAEzC;;;OAGG;IACH,SAAgB,gBAAgB,EAAE,MAAM,CAAsB;IAE9D,uDAAuD;IACvD,SAAgB,4BAA4B,EAAE,MAAM,CAAkC;IAEtF,mGAAmG;IACnG,SAAgB,kBAAkB,EAAE,MAAM,CAAC;IAE3C,mFAAmF;IACnF,SAAgB,sBAAsB,EAAE,MAAM,CAA4B;IAE1E,wCAAwC;IACxC,SAAgB,oBAAoB,EAAE,MAAM,CAAC;IAE7C,kFAAkF;IAClF,SAAgB,iBAAiB,EAAE,MAAM,CAAC;IAE1C,4DAA4D;IAC5D,SA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KAAE,GAC5D;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,CAwDhE;CACF"}
|
|
@@ -37,6 +37,7 @@ export class SequencerTimetable {
|
|
|
37
37
|
/** Whether assertTimeLeft will throw if not enough time. */ enforce;
|
|
38
38
|
/** Duration per block when building multiple blocks per slot (undefined = single block per slot) */ blockDuration;
|
|
39
39
|
/** Maximum number of blocks that can be built in this slot configuration */ maxNumberOfBlocks;
|
|
40
|
+
/** Whether pipelining is enabled (checkpoint finalization deferred to next slot). */ pipelining;
|
|
40
41
|
constructor(opts, metrics, log){
|
|
41
42
|
this.metrics = metrics;
|
|
42
43
|
this.log = log;
|
|
@@ -49,6 +50,7 @@ export class SequencerTimetable {
|
|
|
49
50
|
this.p2pPropagationTime = opts.p2pPropagationTime ?? DEFAULT_P2P_PROPAGATION_TIME;
|
|
50
51
|
this.blockDuration = opts.blockDurationMs ? opts.blockDurationMs / 1000 : undefined;
|
|
51
52
|
this.enforce = opts.enforce;
|
|
53
|
+
this.pipelining = opts.pipelining ?? false;
|
|
52
54
|
// Assume zero-cost propagation time and faster runs in test environments where L1 slot duration is shortened
|
|
53
55
|
if (this.ethereumSlotDuration < 8) {
|
|
54
56
|
this.p2pPropagationTime = 0;
|
|
@@ -70,14 +72,21 @@ export class SequencerTimetable {
|
|
|
70
72
|
if (!this.blockDuration) {
|
|
71
73
|
this.maxNumberOfBlocks = 1; // Single block per slot
|
|
72
74
|
} else {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
// When pipelining, finalization is deferred to the next slot, but we still need
|
|
76
|
+
// a sub-slot for validator re-execution so they can produce attestations.
|
|
77
|
+
let timeReservedAtEnd = this.blockDuration; // Validatior re-execution only
|
|
78
|
+
if (!this.pipelining) {
|
|
79
|
+
timeReservedAtEnd += this.checkpointFinalizationTime;
|
|
80
|
+
}
|
|
75
81
|
const timeAvailableForBlocks = this.aztecSlotDuration - this.initializationOffset - timeReservedAtEnd;
|
|
76
82
|
this.maxNumberOfBlocks = Math.floor(timeAvailableForBlocks / this.blockDuration);
|
|
77
83
|
}
|
|
78
|
-
// Minimum work to do within a slot for building a block with the minimum time for execution and publishing its checkpoint
|
|
79
|
-
|
|
80
|
-
this.
|
|
84
|
+
// Minimum work to do within a slot for building a block with the minimum time for execution and publishing its checkpoint.
|
|
85
|
+
// When pipelining, finalization is deferred, but we still need time for execution and validator re-execution.
|
|
86
|
+
let minWorkToDo = this.initializationOffset + this.minExecutionTime * 2;
|
|
87
|
+
if (!this.pipelining) {
|
|
88
|
+
minWorkToDo += this.checkpointFinalizationTime;
|
|
89
|
+
}
|
|
81
90
|
const initializeDeadline = this.aztecSlotDuration - minWorkToDo;
|
|
82
91
|
this.initializeDeadline = initializeDeadline;
|
|
83
92
|
this.log?.info(`Sequencer timetable initialized with ${this.maxNumberOfBlocks} blocks per slot (${this.enforce ? 'enforced' : 'not enforced'})`, {
|
|
@@ -90,6 +99,7 @@ export class SequencerTimetable {
|
|
|
90
99
|
blockAssembleTime: this.checkpointAssembleTime,
|
|
91
100
|
initializeDeadline: this.initializeDeadline,
|
|
92
101
|
enforce: this.enforce,
|
|
102
|
+
pipelining: this.pipelining,
|
|
93
103
|
minWorkToDo,
|
|
94
104
|
blockDuration: this.blockDuration,
|
|
95
105
|
maxNumberOfBlocks: this.maxNumberOfBlocks
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/sequencer-client",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.e304674f1",
|
|
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": "0.0.1-commit.
|
|
30
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
31
|
-
"@aztec/blob-client": "0.0.1-commit.
|
|
32
|
-
"@aztec/blob-lib": "0.0.1-commit.
|
|
33
|
-
"@aztec/constants": "0.0.1-commit.
|
|
34
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
35
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
36
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
37
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
38
|
-
"@aztec/node-keystore": "0.0.1-commit.
|
|
39
|
-
"@aztec/noir-acvm_js": "0.0.1-commit.
|
|
40
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
41
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
42
|
-
"@aztec/noir-types": "0.0.1-commit.
|
|
43
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
44
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
45
|
-
"@aztec/prover-client": "0.0.1-commit.
|
|
46
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
47
|
-
"@aztec/slasher": "0.0.1-commit.
|
|
48
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
49
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
50
|
-
"@aztec/validator-client": "0.0.1-commit.
|
|
51
|
-
"@aztec/validator-ha-signer": "0.0.1-commit.
|
|
52
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
29
|
+
"@aztec/aztec.js": "0.0.1-commit.e304674f1",
|
|
30
|
+
"@aztec/bb-prover": "0.0.1-commit.e304674f1",
|
|
31
|
+
"@aztec/blob-client": "0.0.1-commit.e304674f1",
|
|
32
|
+
"@aztec/blob-lib": "0.0.1-commit.e304674f1",
|
|
33
|
+
"@aztec/constants": "0.0.1-commit.e304674f1",
|
|
34
|
+
"@aztec/epoch-cache": "0.0.1-commit.e304674f1",
|
|
35
|
+
"@aztec/ethereum": "0.0.1-commit.e304674f1",
|
|
36
|
+
"@aztec/foundation": "0.0.1-commit.e304674f1",
|
|
37
|
+
"@aztec/l1-artifacts": "0.0.1-commit.e304674f1",
|
|
38
|
+
"@aztec/node-keystore": "0.0.1-commit.e304674f1",
|
|
39
|
+
"@aztec/noir-acvm_js": "0.0.1-commit.e304674f1",
|
|
40
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.e304674f1",
|
|
41
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.e304674f1",
|
|
42
|
+
"@aztec/noir-types": "0.0.1-commit.e304674f1",
|
|
43
|
+
"@aztec/p2p": "0.0.1-commit.e304674f1",
|
|
44
|
+
"@aztec/protocol-contracts": "0.0.1-commit.e304674f1",
|
|
45
|
+
"@aztec/prover-client": "0.0.1-commit.e304674f1",
|
|
46
|
+
"@aztec/simulator": "0.0.1-commit.e304674f1",
|
|
47
|
+
"@aztec/slasher": "0.0.1-commit.e304674f1",
|
|
48
|
+
"@aztec/stdlib": "0.0.1-commit.e304674f1",
|
|
49
|
+
"@aztec/telemetry-client": "0.0.1-commit.e304674f1",
|
|
50
|
+
"@aztec/validator-client": "0.0.1-commit.e304674f1",
|
|
51
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.e304674f1",
|
|
52
|
+
"@aztec/world-state": "0.0.1-commit.e304674f1",
|
|
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": "0.0.1-commit.
|
|
59
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
58
|
+
"@aztec/archiver": "0.0.1-commit.e304674f1",
|
|
59
|
+
"@aztec/kv-store": "0.0.1-commit.e304674f1",
|
|
60
60
|
"@electric-sql/pglite": "^0.3.14",
|
|
61
61
|
"@jest/globals": "^30.0.0",
|
|
62
62
|
"@types/jest": "^30.0.0",
|
|
@@ -14,7 +14,6 @@ import type { P2P } from '@aztec/p2p';
|
|
|
14
14
|
import type { SlasherClientInterface } from '@aztec/slasher';
|
|
15
15
|
import type { L2BlockSink, L2BlockSource } from '@aztec/stdlib/block';
|
|
16
16
|
import type { ValidatorClientFullConfig, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
|
|
17
|
-
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
18
17
|
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
19
18
|
import { L1Metrics, type TelemetryClient } from '@aztec/telemetry-client';
|
|
20
19
|
import { FullNodeCheckpointsBuilder, NodeKeystoreAdapter, type ValidatorClient } from '@aztec/validator-client';
|
|
@@ -118,11 +117,6 @@ export class SequencerClient {
|
|
|
118
117
|
{ dateProvider: deps.dateProvider },
|
|
119
118
|
));
|
|
120
119
|
|
|
121
|
-
const slashFactoryContract = new SlashFactoryContract(
|
|
122
|
-
publicClient,
|
|
123
|
-
config.l1Contracts.slashFactoryAddress?.toString() ?? EthAddress.ZERO.toString(),
|
|
124
|
-
);
|
|
125
|
-
|
|
126
120
|
const publisherFactory =
|
|
127
121
|
deps.publisherFactory ??
|
|
128
122
|
new SequencerPublisherFactory(config, {
|
|
@@ -130,7 +124,6 @@ export class SequencerClient {
|
|
|
130
124
|
blobClient: deps.blobClient,
|
|
131
125
|
epochCache,
|
|
132
126
|
governanceProposerContract,
|
|
133
|
-
slashFactoryContract,
|
|
134
127
|
rollupContract,
|
|
135
128
|
dateProvider: deps.dateProvider,
|
|
136
129
|
publisherManager,
|
|
@@ -10,6 +10,7 @@ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
|
10
10
|
import { type L1RollupConstants, getNextL1SlotTimestamp, getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
|
|
11
11
|
import { GasFees } from '@aztec/stdlib/gas';
|
|
12
12
|
import type {
|
|
13
|
+
BuildCheckpointGlobalVariablesOpts,
|
|
13
14
|
CheckpointGlobalVariables,
|
|
14
15
|
GlobalVariableBuilder as GlobalVariableBuilderInterface,
|
|
15
16
|
} from '@aztec/stdlib/tx';
|
|
@@ -119,6 +120,7 @@ export class GlobalVariableBuilder implements GlobalVariableBuilderInterface {
|
|
|
119
120
|
coinbase: EthAddress,
|
|
120
121
|
feeRecipient: AztecAddress,
|
|
121
122
|
slotNumber: SlotNumber,
|
|
123
|
+
opts?: BuildCheckpointGlobalVariablesOpts,
|
|
122
124
|
): Promise<CheckpointGlobalVariables> {
|
|
123
125
|
const { chainId, version } = this;
|
|
124
126
|
|
|
@@ -127,9 +129,19 @@ export class GlobalVariableBuilder implements GlobalVariableBuilderInterface {
|
|
|
127
129
|
l1GenesisTime: this.l1GenesisTime,
|
|
128
130
|
});
|
|
129
131
|
|
|
130
|
-
//
|
|
131
|
-
//
|
|
132
|
-
const
|
|
132
|
+
// When pipelining, force the proposed checkpoint number and fee header to the parent so that
|
|
133
|
+
// the fee computation matches what L1 will see when the previous pipelined checkpoint has landed.
|
|
134
|
+
const pendingNumberOverride = await this.rollupContract.makePendingCheckpointNumberOverride(
|
|
135
|
+
opts?.forcePendingCheckpointNumber,
|
|
136
|
+
);
|
|
137
|
+
const feeHeaderOverride = opts?.forceProposedFeeHeader
|
|
138
|
+
? await this.rollupContract.makeFeeHeaderOverride(
|
|
139
|
+
opts.forceProposedFeeHeader.checkpointNumber,
|
|
140
|
+
opts.forceProposedFeeHeader.feeHeader,
|
|
141
|
+
)
|
|
142
|
+
: [];
|
|
143
|
+
const stateOverride = RollupContract.mergeStateOverrides(pendingNumberOverride, feeHeaderOverride);
|
|
144
|
+
const gasFees = new GasFees(0, await this.rollupContract.getManaMinFeeAt(timestamp, true, stateOverride));
|
|
133
145
|
|
|
134
146
|
return { chainId, version, slotNumber, timestamp, coinbase, feeRecipient, gasFees };
|
|
135
147
|
}
|
|
@@ -7,7 +7,6 @@ import type { L1TxUtils } from '@aztec/ethereum/l1-tx-utils';
|
|
|
7
7
|
import type { PublisherFilter, PublisherManager } from '@aztec/ethereum/publisher-manager';
|
|
8
8
|
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
9
9
|
import type { DateProvider } from '@aztec/foundation/timer';
|
|
10
|
-
import type { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
11
10
|
import type { TelemetryClient } from '@aztec/telemetry-client';
|
|
12
11
|
import { NodeKeystoreAdapter } from '@aztec/validator-client';
|
|
13
12
|
|
|
@@ -40,7 +39,6 @@ export class SequencerPublisherFactory {
|
|
|
40
39
|
epochCache: EpochCache;
|
|
41
40
|
rollupContract: RollupContract;
|
|
42
41
|
governanceProposerContract: GovernanceProposerContract;
|
|
43
|
-
slashFactoryContract: SlashFactoryContract;
|
|
44
42
|
nodeKeyStore: NodeKeystoreAdapter;
|
|
45
43
|
logger?: Logger;
|
|
46
44
|
},
|
|
@@ -104,7 +102,6 @@ export class SequencerPublisherFactory {
|
|
|
104
102
|
epochCache: this.deps.epochCache,
|
|
105
103
|
governanceProposerContract: this.deps.governanceProposerContract,
|
|
106
104
|
slashingProposerContract,
|
|
107
|
-
slashFactoryContract: this.deps.slashFactoryContract,
|
|
108
105
|
dateProvider: this.deps.dateProvider,
|
|
109
106
|
metrics: this.publisherMetrics,
|
|
110
107
|
lastActions: this.lastActions,
|