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:
Marko
2020-02-23 14:09:58 +01:00
committed by GitHub
co-authored by Anton Kaliaev
parent 56ffcf709a
commit b0f35a64d9
2 changed files with 8 additions and 5 deletions
+4 -3
View File
@@ -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
+4 -2
View File
@@ -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