Skip to content

Commit

Permalink
chore: more debug
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Jan 12, 2024
1 parent 1f0e9d9 commit 5b2a393
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/consensus/state_prevoter.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,13 @@ func (p *prevoter) checkPrevoteMaj23(rs cstypes.RoundState) bool {
*/
blockID, ok := rs.Votes.Prevotes(rs.Proposal.POLRound).TwoThirdsMajority()
if !ok {
p.logger.Trace("prevote step: no 2/3 majority for proposal block", "POLRound", rs.Proposal.POLRound)
return false
}
if !rs.ProposalBlock.HashesTo(blockID.Hash) {
p.logger.Trace("prevote step: proposal block does not match 2/3 majority", "POLRound", rs.Proposal.POLRound,
"proposal_block_hash", rs.ProposalBlock.Hash(),
"majority_block_hash", blockID.Hash)
return false
}
if rs.Proposal.POLRound < 0 {
Expand All @@ -161,9 +165,14 @@ func (p *prevoter) checkPrevoteMaj23(rs cstypes.RoundState) bool {
return true
}
if rs.ProposalBlock.HashesTo(rs.LockedBlock.Hash()) {
p.logger.Debug("prevote step: ProposalBlock is valid and matches our locked block; prevoting the proposal")
p.logger.Debug("prevote step: ProposalBlock is valid and matches our locked block",
"outcome", "prevoting the proposal")
return true
}
p.logger.Debug("prevote step: ProposalBlock does not match our locked block",
"proposal_block_hash", rs.ProposalBlock.Hash(),
"majority_block_hash", blockID.Hash)

return false
}

Expand Down

0 comments on commit 5b2a393

Please sign in to comment.