Commit d2ce890a authored by OptimismBot's avatar OptimismBot Committed by GitHub

Merge pull request #7243 from kahuang/stop_sequencer_fix

Cancel any inflight block building when stopping the sequencer, to av…
parents 1c4599cf 1dbcca5f
......@@ -81,6 +81,7 @@ type SequencerIface interface {
PlanNextSequencerAction() time.Duration
RunNextSequencerAction(ctx context.Context) (*eth.ExecutionPayload, error)
BuildingOnto() eth.L2BlockRef
CancelBuildingBlock(ctx context.Context)
}
type Network interface {
......
......@@ -381,6 +381,9 @@ func (s *Driver) eventLoop() {
}
s.log.Warn("Sequencer has been stopped")
s.driverConfig.SequencerStopped = true
// Cancel any inflight block building. If we don't cancel this, we can resume sequencing an old block
// even if we've received new unsafe heads in the interim, causing us to introduce a re-org.
s.sequencer.CancelBuildingBlock(ctx)
respCh <- hashAndError{hash: s.derivation.UnsafeL2Head().Hash}
}
case respCh := <-s.sequencerActive:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment