Skip to content

Commit

Permalink
fix(consensus): invalid block height gossiped to lagging peer
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Mar 13, 2024
1 parent 2fb9bf7 commit 9eeddf9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/consensus/gossip_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,14 @@ func shouldProposalBeGossiped(rs cstypes.RoundState, prs *cstypes.PeerRoundState
}

func shouldBlockPartsBeGossiped(rs cstypes.RoundState, prs *cstypes.PeerRoundState, isValidator bool) bool {
if rs.Height != prs.Height || rs.Round < prs.Round {
return false
}

if isValidator && rs.ProposalBlockParts.HasHeader(prs.ProposalBlockPartSetHeader) {
return true
}

return prs.HasCommit && rs.ProposalBlockParts != nil
}

Expand Down

0 comments on commit 9eeddf9

Please sign in to comment.