evidence: remove validator index verification (#5225)

This commit is contained in:
Callum Waters
2020-08-11 15:32:32 +02:00
committed by GitHub
parent 312c4f8fe1
commit bfcf45a461
3 changed files with 0 additions and 27 deletions

View File

@@ -78,13 +78,6 @@ func makeEvidences(
fakes = append(fakes, newEvidence(t, val, &vote, &v, chainID))
}
// different index
{
v := vote2
v.ValidatorIndex = vote.ValidatorIndex + 1
fakes = append(fakes, newEvidence(t, val, &vote, &v, chainID))
}
// different height
{
v := vote2

View File

@@ -273,15 +273,6 @@ func (dve *DuplicateVoteEvidence) Verify(chainID string, pubKey crypto.PubKey) e
)
}
// Index must be the same
if dve.VoteA.ValidatorIndex != dve.VoteB.ValidatorIndex {
return fmt.Errorf(
"validator indices do not match: %d and %d",
dve.VoteA.ValidatorIndex,
dve.VoteB.ValidatorIndex,
)
}
// BlockIDs must be different
if dve.VoteA.BlockID.Equals(dve.VoteB.BlockID) {
return fmt.Errorf(
@@ -1016,16 +1007,6 @@ func (e *PotentialAmnesiaEvidence) ValidateBasic() error {
)
}
// Index must be the same
// https://github.com/tendermint/tendermint/issues/4619
if e.VoteA.ValidatorIndex != e.VoteB.ValidatorIndex {
return fmt.Errorf(
"duplicateVoteEvidence Error: Validator indices do not match. Got %d and %d",
e.VoteA.ValidatorIndex,
e.VoteB.ValidatorIndex,
)
}
if e.VoteA.BlockID.IsZero() {
return errors.New("first vote is for a nil block - voter hasn't locked on a block")
}

View File

@@ -52,7 +52,6 @@ func TestDuplicateVoteEvidence(t *testing.T) {
{vote1, makeVote(t, val, chainID, 0, 10, 2, 1, blockID4, defaultVoteTime), true},
{vote1, makeVote(t, val, chainID, 0, 10, 2, 1, blockID, defaultVoteTime), false}, // wrong block id
{vote1, makeVote(t, val, "mychain2", 0, 10, 2, 1, blockID2, defaultVoteTime), false}, // wrong chain id
{vote1, makeVote(t, val, chainID, 1, 10, 2, 1, blockID2, defaultVoteTime), false}, // wrong val index
{vote1, makeVote(t, val, chainID, 0, 11, 2, 1, blockID2, defaultVoteTime), false}, // wrong height
{vote1, makeVote(t, val, chainID, 0, 10, 3, 1, blockID2, defaultVoteTime), false}, // wrong round
{vote1, makeVote(t, val, chainID, 0, 10, 2, 2, blockID2, defaultVoteTime), false}, // wrong step