Browse Source

evidence: remove validator index verification (#5225)

pull/5231/head
Callum Waters 4 years ago
committed by GitHub
parent
commit
bfcf45a461
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 27 deletions
  1. +0
    -7
      rpc/client/evidence_test.go
  2. +0
    -19
      types/evidence.go
  3. +0
    -1
      types/evidence_test.go

+ 0
- 7
rpc/client/evidence_test.go 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


+ 0
- 19
types/evidence.go 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")
}


+ 0
- 1
types/evidence_test.go 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


Loading…
Cancel
Save