Skip to content

Commit 3a5f63b

Browse files
authored
fix: Enforce timetable on proposer check (#16702)
Fixes the fix from #16668. Since we were not passing the slot number into the `setState` call, the check was never done.
2 parents 0fb97ce + 5aba5c0 commit 3a5f63b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ describe('sequencer', () => {
322322

323323
expect(blockBuilder.buildBlock).not.toHaveBeenCalled();
324324
expect(publisher.enqueueProposeL2Block).not.toHaveBeenCalled();
325+
expect(publisher.canProposeAtNextEthBlock).not.toHaveBeenCalled();
325326
});
326327

327328
it('does not publish a block if it does not have enough time left in the slot after collecting attestations', async () => {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,13 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
267267
return;
268268
}
269269

270-
this.setState(SequencerState.PROPOSER_CHECK, undefined);
271-
272270
const chainTipArchive = syncedTo.archive;
273271
const newBlockNumber = syncedTo.blockNumber + 1;
274272

275273
const { slot, ts, now } = this.epochCache.getEpochAndSlotInNextL1Slot();
276274

275+
this.setState(SequencerState.PROPOSER_CHECK, slot);
276+
277277
// Check that the archiver and dependencies have synced to the previous L1 slot at least
278278
// TODO(#14766): Archiver reports L1 timestamp based on L1 blocks seen, which means that a missed L1 block will
279279
// cause the archiver L1 timestamp to fall behind, and cause this sequencer to start processing one L1 slot later.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export type SequencerStateWithSlot =
3737
| SequencerState.INITIALIZING_PROPOSAL
3838
| SequencerState.CREATING_BLOCK
3939
| SequencerState.COLLECTING_ATTESTATIONS
40-
| SequencerState.PUBLISHING_BLOCK;
40+
| SequencerState.PUBLISHING_BLOCK
41+
| SequencerState.PROPOSER_CHECK;
4142

4243
export type SequencerStateCallback = () => SequencerState;
4344

0 commit comments

Comments
 (0)