func VerifyCommitLight(chainID string, vals *ValidatorSet, blockID BlockID,
	height int64, commit *Commit) error {
	if err := verifyBasicValsAndCommit(vals, commit, height, blockID); err != nil {
		return err
	}
	votingPowerNeeded := vals.TotalVotingPower() * 2 / 3
	ignore := func(c CommitSig) bool { return !c.ForBlock() }
	count := func(c CommitSig) bool { return true }
	if shouldBatchVerify(vals, commit) {
		return verifyCommitBatch(chainID, vals, commit,
			votingPowerNeeded, ignore, count, false, true)
	}
	return verifyCommitSingle(chainID, vals, commit, votingPowerNeeded,
		ignore, count, false, true)
}
LIGHT CLIENT VERIFICATION METHODS
VerifyCommitLight verifies +2/3 of the set had signed the given commit.

This method is primarily used by the light client and does not check all the
signatures.
package types
import (
	"errors"
	"fmt"
	"github.com/tendermint/tendermint/crypto/batch"
	"github.com/tendermint/tendermint/crypto/tmhash"
	tmmath "github.com/tendermint/tendermint/libs/math"
)
const batchVerifyThreshold = 2
func shouldBatchVerify(vals *ValidatorSet, commit *Commit) bool {
	return len(commit.Signatures) >= batchVerifyThreshold && batch.SupportsBatchVerifier(vals.GetProposer().PubKey)
}
func VerifyCommit(chainID string, vals *ValidatorSet, blockID BlockID,
	height int64, commit *Commit) error {
	if err := verifyBasicValsAndCommit(vals, commit, height, blockID); err != nil {
		return err
	}
	votingPowerNeeded := vals.TotalVotingPower() * 2 / 3
	ignore := func(c CommitSig) bool { return c.Absent() }
	count := func(c CommitSig) bool { return c.ForBlock() }
	if shouldBatchVerify(vals, commit) {
		return verifyCommitBatch(chainID, vals, commit,
			votingPowerNeeded, ignore, count, true, true)
	}
	return verifyCommitSingle(chainID, vals, commit, votingPowerNeeded,
		ignore, count, true, true)
}