mirror of
https://github.com/tendermint/tendermint.git
synced 2025-12-23 06:15:19 +00:00
evidence: remove validator index verification (#5225)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user