diff --git a/internal/consensus/state_add_vote.go b/internal/consensus/state_add_vote.go index 284964cbb..f7bf18251 100644 --- a/internal/consensus/state_add_vote.go +++ b/internal/consensus/state_add_vote.go @@ -1,6 +1,7 @@ package consensus import ( + "bytes" "context" "errors" @@ -238,6 +239,14 @@ func addVoteVerifyVoteExtensionMw( return next(ctx, stateData, vote) } + // If we already know of this vote, return false to not verify it multiple times + existing := stateData.Votes.GetVoteSet(vote.Round, vote.Type).GetByIndex(vote.ValidatorIndex) + if existing != nil && + bytes.Equal(existing.BlockSignature, vote.BlockSignature) && + bytes.Equal(existing.VoteExtensions.Fingerprint(), vote.VoteExtensions.Fingerprint()) { + return false, nil + } + // The core fields of the vote message were already validated in the // consensus reactor when the vote was received. // Here, we verify the signature of the vote extension included in the vote