Skip to content

Commit

Permalink
dbft: log err details on invalid commit
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Shaleva <[email protected]>
  • Loading branch information
AnnaShaleva committed Nov 27, 2024
1 parent 2d84710 commit 815155a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dbft.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,12 +591,13 @@ func (d *DBFT[H]) onCommit(msg ConsensusPayload[H]) {
header := d.MakeHeader()
if header != nil {
pub := d.Validators[msg.ValidatorIndex()]
if header.Verify(pub, msg.GetCommit().Signature()) == nil {
if err := header.Verify(pub, msg.GetCommit().Signature()); err == nil {
d.checkCommit()
} else {
d.CommitPayloads[msg.ValidatorIndex()] = nil
d.Logger.Warn("invalid commit signature",
zap.Uint("validator", uint(msg.ValidatorIndex())),
zap.Error(err),
)
}
}
Expand Down

0 comments on commit 815155a

Please sign in to comment.