Skip to content

Commit

Permalink
fix cpu spikes in the eventloop
Browse files Browse the repository at this point in the history
  • Loading branch information
charithabandi authored and jchappelow committed Dec 17, 2024
1 parent 3056c75 commit fea88e2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions node/consensus/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,6 @@ func (ce *ConsensusEngine) runConsensusEventLoop(ctx context.Context) error {

case <-blkPropTicker.C:
ce.rebroadcastBlkProposal(ctx)

default:
params := ce.blockProcessor.ConsensusParams() // status check, validators halt here
if params != nil && params.MigrationStatus == ktypes.MigrationCompleted {
ce.haltChan <- "Network halted due to migration"
return nil
}
}
}
}
Expand Down Expand Up @@ -608,6 +601,13 @@ func (ce *ConsensusEngine) rebroadcastBlkProposal(ctx context.Context) {
}

func (ce *ConsensusEngine) doCatchup(ctx context.Context) error {
// status check, nodes halt here if the migration is completed
params := ce.blockProcessor.ConsensusParams()
if params != nil && params.MigrationStatus == ktypes.MigrationCompleted {
ce.haltChan <- "Network halted due to migration"
return nil
}

ce.state.mtx.Lock()
defer ce.state.mtx.Unlock()

Expand Down

0 comments on commit fea88e2

Please sign in to comment.