mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-16 20:26:12 +00:00
evidence: Add time to evidence params (#69)
* evidence: Add time to evidence params - this pr is grouped together with https://github.com/tendermint/tendermint/pull/4254, once that PR is merged then this one can be as well. Signed-off-by: Marko Baricevic <marbar3778@yahoo.com> * remove note Signed-off-by: Marko Baricevic <marbar3778@yahoo.com> * Apply suggestions from code review Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com> Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
This commit is contained in:
+4
-3
@@ -501,11 +501,12 @@ Commit are included in the header of the next block.
|
||||
### EvidenceParams
|
||||
|
||||
- **Fields**:
|
||||
- `MaxAge (int64)`: Max age of evidence, in blocks. Evidence older than this
|
||||
is considered stale and ignored.
|
||||
- `MaxAgeNumBlocks (int64)`: Max age of evidence, in blocks.
|
||||
- `MaxAgeDuration (time.Duration)`: Max age of evidence, in time.
|
||||
Evidence older than this is considered stale and ignored.
|
||||
|
||||
- This should correspond with an app's "unbonding period" or other
|
||||
similar mechanism for handling Nothing-At-Stake attacks.
|
||||
- NOTE: this should change to time (instead of blocks)!
|
||||
|
||||
### ValidatorParams
|
||||
|
||||
|
||||
@@ -110,7 +110,8 @@ type BlockParams struct {
|
||||
}
|
||||
|
||||
type EvidenceParams struct {
|
||||
MaxAge int64
|
||||
MaxAgeNumBlocks int64
|
||||
MaxAgeDuration time.Duration
|
||||
}
|
||||
|
||||
type ValidatorParams struct {
|
||||
@@ -135,7 +136,8 @@ The minimal time between consecutive blocks is controlled by the
|
||||
For evidence in a block to be valid, it must satisfy:
|
||||
|
||||
```
|
||||
block.Header.Height - evidence.Height < ConsensusParams.Evidence.MaxAge
|
||||
block.Header.Height - evidence.Height < ConsensusParams.Evidence.MaxAgeNumBlocks
|
||||
block.Header.Time - evidence.Time < ConsensusParams.Evidence.MaxAgeDuration
|
||||
```
|
||||
|
||||
#### Validator
|
||||
|
||||
Reference in New Issue
Block a user