Skip to content

Commit

Permalink
Proposer logging for HasQuorum function fixed (#1310)
Browse files Browse the repository at this point in the history
  • Loading branch information
stana-miric committed Mar 22, 2023
1 parent c615d0c commit 722926b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion consensus/polybft/consensus_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,9 @@ func (c *consensusRuntime) HasQuorum(

propAddress, err := c.fsm.proposerSnapshot.GetLatestProposer(messages[0].View.Round, height)
if err != nil {
c.logger.Warn("HasQuorum has been called but proposer is not set", "error", err)
// This can happen if e.g. node runs sequence on lower height and proposer calculator updated
// to a newer count as a consequence of inserting block from syncer
c.logger.Debug("HasQuorum has been called but proposer could not be retrieved", "error", err)

return false
}
Expand Down
2 changes: 2 additions & 0 deletions consensus/polybft/polybft.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ func (p *Polybft) startConsensusProtocol() {
// The blockchain notification system can eventually deliver
// stale block notifications. These should be ignored
if ev.Source == "syncer" && ev.NewChain[0].Number >= p.blockchain.CurrentHeader().Number {
p.logger.Info("sync block notification received", "block height", ev.NewChain[0].Number,
"current height", p.blockchain.CurrentHeader().Number)
syncerBlockCh <- struct{}{}
}
}
Expand Down

0 comments on commit 722926b

Please sign in to comment.