Skip to content

Commit 44206f5

Browse files
committed
address code review comments
1 parent 2545dbb commit 44206f5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

yarn-project/sequencer-client/src/sequencer/checkpoint_proposal_job.timing.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ describe('CheckpointProposalJob Timing Tests', () => {
10731073
beforeEach(() => {
10741074
epochCache.isProposerPipeliningEnabled.mockReturnValue(true);
10751075

1076-
// Mock l2BlockSource methods needed by waitForParentCheckpointOnL1
1076+
// Mock l2BlockSource methods needed by waitForValidParentCheckpointOnL1
10771077
l2BlockSource.getSyncedL2SlotNumber.mockResolvedValue(slotNumber);
10781078
l2BlockSource.getL2Tips.mockResolvedValue({
10791079
proposed: { number: BlockNumber.ZERO, hash: '' },

yarn-project/sequencer-client/src/sequencer/checkpoint_proposal_job.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export class CheckpointProposalJob implements Traceable {
222222

223223
// If pipelining, wait for the previous checkpoint to land on L1 before submitting,
224224
// so we can check it matches the proposed checkpoint we used as parent, and has valid attestations.
225-
if (signedAttestations && (!isPipelining || (await this.waitForParentCheckpointOnL1()))) {
225+
if (signedAttestations && (!isPipelining || (await this.waitForValidParentCheckpointOnL1()))) {
226226
await this.enqueueCheckpointForSubmission({ checkpoint, ...signedAttestations });
227227
}
228228

@@ -314,7 +314,7 @@ export class CheckpointProposalJob implements Traceable {
314314
private async waitForSyncedL2SlotNumber(waitForSlot: SlotNumber): Promise<boolean> {
315315
const targetSlotStart = Number(getTimestampForSlot(this.targetSlot, this.l1Constants));
316316
const targetSlotEndMs = (targetSlotStart + this.l1Constants.slotDuration) * 1000;
317-
const syncDelayTolerance = this.l1Constants.slotDuration * 1000;
317+
const syncDelayTolerance = this.l1Constants.ethereumSlotDuration * 2 * 1000;
318318
const timeoutSeconds = Math.max(0.1, (targetSlotEndMs + syncDelayTolerance - this.dateProvider.now()) / 1000);
319319

320320
try {
@@ -344,7 +344,7 @@ export class CheckpointProposalJob implements Traceable {
344344
* - If we built without a proposed parent: no new checkpoint must have appeared for that slot.
345345
* If the parent has invalid attestations, enqueues an invalidation. Returns whether to proceed with the proposal.
346346
*/
347-
protected async waitForParentCheckpointOnL1(): Promise<boolean> {
347+
protected async waitForValidParentCheckpointOnL1(): Promise<boolean> {
348348
const parentCheckpointNumber = CheckpointNumber(this.checkpointNumber - 1);
349349

350350
// Wait until archiver has synced L1 past the parent's slot (slotNow)

0 commit comments

Comments
 (0)