Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions yarn-project/sequencer-client/src/sequencer/sequencer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,6 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
isPendingChainValid: pick(syncedTo.pendingChainValidationStatus, 'valid', 'reason', 'invalidIndex'),
};

// Check that the slot is not taken by a block already (should never happen, since only us can propose for this slot)
if (syncedTo.block && syncedTo.block.header.getSlot() >= slot) {
this.log.warn(
`Cannot propose block at next L2 slot ${slot} since that slot was taken by block ${syncedTo.blockNumber}`,
{ ...syncLogData, block: syncedTo.block.header.toInspect() },
);
return;
}

// Check that we are a proposer for the next slot
this.setState(SequencerState.PROPOSER_CHECK, slot);
const [canPropose, proposer] = await this.checkCanPropose(slot);
Expand All @@ -303,6 +294,15 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
return;
}

// Check that the slot is not taken by a block already (should never happen, since only us can propose for this slot)
if (syncedTo.block && syncedTo.block.header.getSlot() >= slot) {
this.log.warn(
`Cannot propose block at next L2 slot ${slot} since that slot was taken by block ${syncedTo.blockNumber}`,
{ ...syncLogData, block: syncedTo.block.header.toInspect() },
);
return;
}

// We now need to get ourselves a publisher.
// The returned attestor will be the one we provided if we provided one.
// Otherwise it will be a valid attestor for the returned publisher.
Expand Down
Loading