mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-26 01:44:16 +00:00
evidence: introduction of LightClientAttackEvidence and refactor of evidence lifecycle (#5361)
evidence: modify evidence types (#5342) light: detect light client attacks (#5344) evidence: refactor evidence pool (#5345) abci: application evidence prepared by evidence pool (#5354)
This commit is contained in:
+2
-18
@@ -96,7 +96,7 @@ func validateBlock(evidencePool EvidencePool, state State, block *types.Block) e
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: We can't actually verify it's the right proposer because we dont
|
||||
// NOTE: We can't actually verify it's the right proposer because we don't
|
||||
// know what round the block was first proposed. So just check that it's
|
||||
// a legit address and a known validator.
|
||||
if len(block.ProposerAddress) != crypto.AddressSize {
|
||||
@@ -148,21 +148,5 @@ func validateBlock(evidencePool EvidencePool, state State, block *types.Block) e
|
||||
}
|
||||
|
||||
// Validate all evidence.
|
||||
for idx, ev := range block.Evidence.Evidence {
|
||||
// Check that no evidence has been submitted more than once
|
||||
for i := idx + 1; i < len(block.Evidence.Evidence); i++ {
|
||||
if ev.Equal(block.Evidence.Evidence[i]) {
|
||||
return types.NewErrEvidenceInvalid(ev, errors.New("evidence was submitted twice"))
|
||||
}
|
||||
}
|
||||
|
||||
// Verify evidence using the evidence pool
|
||||
err := evidencePool.Verify(ev)
|
||||
if err != nil {
|
||||
return types.NewErrEvidenceInvalid(ev, err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
return evidencePool.CheckEvidence(block.Evidence.Evidence)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user