Skip to content

Commit

Permalink
move processing bitcoin check
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaytonNorthey92 committed Jan 31, 2025
1 parent 96a1dc1 commit b42d194
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions op-conductor/conductor/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ func (oc *OpConductor) action() {
// if follower is not healthy and not sequencing, just log an error
oc.log.Error("server (follower) is not healthy", "server", oc.cons.ServerID())
case !status.leader && !status.healthy && status.active:
// sequencer is not leader, not healthy, not processing bitcoin in the hvm, but it is sequencing, stop it
// sequencer is not leader, not healthy, but it is sequencing, stop it
err = oc.stopSequencer()
case !status.leader && status.healthy && !status.active:
// normal follower, do nothing
Expand All @@ -570,7 +570,7 @@ func (oc *OpConductor) action() {
// 2. for other cases, we should try to transfer leader to another node.
// for example, if follower became a leader and unhealthy at the same time (just unhealthy itself), then we should transfer leadership.
err = oc.transferLeader()
case status.leader && !status.healthy && status.active && !processingBitcoin:
case status.leader && !status.healthy && status.active:
// There are two scenarios we need to handle here:
// 1. we're transitioned from case status.leader && !status.healthy && !status.active, see description above
// then we should continue to sequence blocks and try to bring ourselves back to healthy state.
Expand All @@ -581,6 +581,11 @@ func (oc *OpConductor) action() {
break
}

if processingBitcoin {
err = errors.New("we're processing a large number of bitcoin attributes, refusing to stop sequencer at this time")
break
}

// 2. we're here becasuse an healthy leader became unhealthy itself
// then we should try to stop sequencing locally and transfer leadership.
var result *multierror.Error
Expand Down

0 comments on commit b42d194

Please sign in to comment.