Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

op-node: Fix stop sequencer deadlock in op-conductor deployments #13806

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions op-node/rollup/sequencing/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,17 @@ func (d *Sequencer) Stop(ctx context.Context) (common.Hash, error) {

// ensure latestHead has been updated to the latest sealed/gossiped block before stopping the sequencer
for d.latestHead.Hash != d.latestSealed.Hash {

// if we are not the leader, latestSealed will never be updated and we will wait forever
if isLeader, err := d.conductor.Leader(ctx); err != nil {
d.log.Warn("Could not determine leadership while stopping. Skipping wait.", "err", err)
break
} else if !isLeader {
d.log.Info("Not leader anymore, skipping head sync wait")
break

}

latestHeadSet := make(chan struct{})
d.latestHeadSet = latestHeadSet
d.l.Unlock()
Expand Down