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

consensus: check proposal non-nil in prevote message delay metric (backport #7625) #7631

Merged
merged 3 commits into from
Jan 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -2278,11 +2278,17 @@ func (cs *State) checkDoubleSigningRisk(height int64) error {
}

func (cs *State) calculatePrevoteMessageDelayMetrics() {
if cs.Proposal == nil {
return
}

ps := cs.Votes.Prevotes(cs.Round)
pl := ps.List()

sort.Slice(pl, func(i, j int) bool {
return pl[i].Timestamp.Before(pl[j].Timestamp)
})

var votingPowerSeen int64
for _, v := range pl {
_, val := cs.Validators.GetByAddress(v.ValidatorAddress)
Expand Down