From 91f898cb985a7586783b5ac77f37e92d4b90f82d Mon Sep 17 00:00:00 2001 From: William Banfield <4561443+williambanfield@users.noreply.github.com> Date: Wed, 2 Feb 2022 10:21:09 -0500 Subject: [PATCH] proto: merge the proposer-based timestamps parameters (#393) --- proto/tendermint/types/params.proto | 16 +++++++ spec/abci/abci.md | 1 + spec/core/data_structures.md | 72 ++++++++++++++++------------- 3 files changed, 57 insertions(+), 32 deletions(-) diff --git a/proto/tendermint/types/params.proto b/proto/tendermint/types/params.proto index b8a37a23e..c308de611 100644 --- a/proto/tendermint/types/params.proto +++ b/proto/tendermint/types/params.proto @@ -13,6 +13,7 @@ message ConsensusParams { EvidenceParams evidence = 2; ValidatorParams validator = 3; VersionParams version = 4; + SynchronyParams synchrony = 5; } // BlockParams contains limits on the block size. @@ -65,3 +66,18 @@ message HashedParams { int64 block_max_bytes = 1; int64 block_max_gas = 2; } + +// SynchronyParams configure the bounds under which a proposed block's timestamp is considered valid. +// These parameters are part of the proposer-based timestamps algorithm. For more information, +// see the specification of proposer-based timestamps: +// https://github.com/tendermint/spec/tree/master/spec/consensus/proposer-based-timestamp +message SynchronyParams { + // message_delay bounds how long a proposal message may take to reach all validators on a newtork + // and still be considered valid. + google.protobuf.Duration message_delay = 1 + [(gogoproto.stdduration) = true]; + // precision bounds how skewed a proposer's clock may be from any validator + // on the network while still producing valid proposals. + google.protobuf.Duration precision = 2 + [(gogoproto.stdduration) = true]; +} diff --git a/spec/abci/abci.md b/spec/abci/abci.md index 5d0332a2e..24dff2248 100644 --- a/spec/abci/abci.md +++ b/spec/abci/abci.md @@ -737,6 +737,7 @@ Most of the data structures used in ABCI are shared [common data structures](../ | evidence | [EvidenceParams](../core/data_structures.md#evidenceparams) | Parameters limiting the validity of evidence of byzantine behaviour. | 2 | | validator | [ValidatorParams](../core/data_structures.md#validatorparams) | Parameters limiting the types of public keys validators can use. | 3 | | version | [VersionsParams](../core/data_structures.md#versionparams) | The ABCI application version. | 4 | + | synchrony | [SynchronyParams](../core/data_structures.md#synchronyparams) | Parameters that determine the bounds under which a proposed block's timestamp is considered valid. | 4 | ### ProofOps diff --git a/spec/core/data_structures.md b/spec/core/data_structures.md index 87bea298f..e80a50874 100644 --- a/spec/core/data_structures.md +++ b/spec/core/data_structures.md @@ -5,38 +5,39 @@ Here we describe the data structures in the Tendermint blockchain and the rules The Tendermint blockchains consists of a short list of data types: - [Data Structures](#data-structures) - - [Block](#block) - - [Execution](#execution) - - [Header](#header) - - [Version](#version) - - [BlockID](#blockid) - - [PartSetHeader](#partsetheader) - - [Part](#part) - - [Time](#time) - - [Data](#data) - - [Commit](#commit) - - [CommitSig](#commitsig) - - [BlockIDFlag](#blockidflag) - - [Vote](#vote) - - [CanonicalVote](#canonicalvote) - - [Proposal](#proposal) - - [SignedMsgType](#signedmsgtype) - - [Signature](#signature) - - [EvidenceList](#evidencelist) - - [Evidence](#evidence) - - [DuplicateVoteEvidence](#duplicatevoteevidence) - - [LightClientAttackEvidence](#lightclientattackevidence) - - [LightBlock](#lightblock) - - [SignedHeader](#signedheader) - - [ValidatorSet](#validatorset) - - [Validator](#validator) - - [Address](#address) - - [ConsensusParams](#consensusparams) - - [BlockParams](#blockparams) - - [EvidenceParams](#evidenceparams) - - [ValidatorParams](#validatorparams) - - [VersionParams](#versionparams) - - [Proof](#proof) + - [Block](#block) + - [Execution](#execution) + - [Header](#header) + - [Version](#version) + - [BlockID](#blockid) + - [PartSetHeader](#partsetheader) + - [Part](#part) + - [Time](#time) + - [Data](#data) + - [Commit](#commit) + - [CommitSig](#commitsig) + - [BlockIDFlag](#blockidflag) + - [Vote](#vote) + - [CanonicalVote](#canonicalvote) + - [Proposal](#proposal) + - [SignedMsgType](#signedmsgtype) + - [Signature](#signature) + - [EvidenceList](#evidencelist) + - [Evidence](#evidence) + - [DuplicateVoteEvidence](#duplicatevoteevidence) + - [LightClientAttackEvidence](#lightclientattackevidence) + - [LightBlock](#lightblock) + - [SignedHeader](#signedheader) + - [ValidatorSet](#validatorset) + - [Validator](#validator) + - [Address](#address) + - [ConsensusParams](#consensusparams) + - [BlockParams](#blockparams) + - [EvidenceParams](#evidenceparams) + - [ValidatorParams](#validatorparams) + - [VersionParams](#versionparams) + - [SynchronyParams](#synchronyparams) + - [Proof](#proof) ## Block @@ -446,6 +447,13 @@ func SumTruncated(bz []byte) []byte { |-------------|--------|-------------------------------|--------------| | app_version | uint64 | The ABCI application version. | 1 | +### SynchronyParams + +| Name | Type | Description | Field Number | +|---------------|--------|-------------------------------|--------------| +| message_delay | [google.protobuf.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration) | Bound for how long a proposal message may take to reach all validators on a newtork and still be considered valid. | 1 | +| precision | [google.protobuf.Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration) | Bound for how skewed a proposer's clock may be from any validator on the network while still producing valid proposals. | 2 | + ## Proof | Name | Type | Description | Field Number |