diff --git a/internal/consensus/state.go b/internal/consensus/state.go index c6ffb031e..13ef3ff07 100644 --- a/internal/consensus/state.go +++ b/internal/consensus/state.go @@ -2022,7 +2022,7 @@ func (cs *State) RecordMetrics(height int64, block *types.Block) { for i, val := range cs.LastValidators.Validators { commitSig := block.LastCommit.Signatures[i] - if commitSig.Absent() { + if commitSig.BlockIDFlag == types.BlockIDFlagAbsent { missingValidators++ missingValidatorsPower += val.VotingPower } diff --git a/internal/state/execution.go b/internal/state/execution.go index ea4806c36..fa45b657b 100644 --- a/internal/state/execution.go +++ b/internal/state/execution.go @@ -404,7 +404,7 @@ func buildLastCommitInfo(block *types.Block, store Store, initialHeight int64) a commitSig := block.LastCommit.Signatures[i] votes[i] = abci.VoteInfo{ Validator: types.TM2PB.Validator(val), - SignedLastBlock: !commitSig.Absent(), + SignedLastBlock: commitSig.BlockIDFlag != types.BlockIDFlagAbsent, } } diff --git a/types/block.go b/types/block.go index e2354479b..9f907d559 100644 --- a/types/block.go +++ b/types/block.go @@ -622,11 +622,6 @@ func NewCommitSigAbsent() CommitSig { } } -// Absent returns true if CommitSig is absent. -func (cs CommitSig) Absent() bool { - return cs.BlockIDFlag == BlockIDFlagAbsent -} - // CommitSig returns a string representation of CommitSig. // // 1. first 6 bytes of signature diff --git a/types/validation.go b/types/validation.go index a422f72ab..02d1b0b56 100644 --- a/types/validation.go +++ b/types/validation.go @@ -36,7 +36,7 @@ func VerifyCommit(chainID string, vals *ValidatorSet, blockID BlockID, votingPowerNeeded := vals.TotalVotingPower() * 2 / 3 // ignore all absent signatures - ignore := func(c CommitSig) bool { return c.Absent() } + ignore := func(c CommitSig) bool { return c.BlockIDFlag == BlockIDFlagAbsent } // only count the signatures that are for the block count := func(c CommitSig) bool { return c.BlockIDFlag == BlockIDFlagCommit }