From b0f35a64d9ab146b0510c73a0bf111960fb5f7e4 Mon Sep 17 00:00:00 2001 From: Marko Date: Sun, 23 Feb 2020 14:09:58 +0100 Subject: [PATCH] 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 * remove note Signed-off-by: Marko Baricevic * Apply suggestions from code review Co-Authored-By: Anton Kaliaev Co-authored-by: Anton Kaliaev --- spec/abci/abci.md | 7 ++++--- spec/blockchain/state.md | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/spec/abci/abci.md b/spec/abci/abci.md index 492629dbb..74cf4d0c4 100644 --- a/spec/abci/abci.md +++ b/spec/abci/abci.md @@ -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 diff --git a/spec/blockchain/state.md b/spec/blockchain/state.md index 0430819fa..535eee8b2 100644 --- a/spec/blockchain/state.md +++ b/spec/blockchain/state.md @@ -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