diff --git a/types/genesis.go b/types/genesis.go index f711a7090..26c522638 100644 --- a/types/genesis.go +++ b/types/genesis.go @@ -113,7 +113,10 @@ func (genDoc *GenesisDoc) ValidateAndComplete() error { if genDoc.ConsensusParams == nil { genDoc.ConsensusParams = DefaultConsensusParams() - } else if err := genDoc.ConsensusParams.ValidateConsensusParams(); err != nil { + } + genDoc.ConsensusParams.Complete() + + if err := genDoc.ConsensusParams.ValidateConsensusParams(); err != nil { return err } diff --git a/types/params.go b/types/params.go index 017ac5d15..fc9c4aaad 100644 --- a/types/params.go +++ b/types/params.go @@ -128,11 +128,12 @@ func DefaultVersionParams() VersionParams { } func DefaultSynchronyParams() SynchronyParams { - // TODO(@wbanfield): Determine experimental values for these defaults - // https://github.com/tendermint/tendermint/issues/7202 return SynchronyParams{ - Precision: 500 * time.Millisecond, - MessageDelay: 3 * time.Second, + // 505ms was selected as the default to enable chains that have validators in + // mixed leap-second handling environments. + // For more information, see: https://github.com/tendermint/tendermint/issues/7724 + Precision: 505 * time.Millisecond, + MessageDelay: 12 * time.Second, } } @@ -145,6 +146,12 @@ func (val *ValidatorParams) IsValidPubkeyType(pubkeyType string) bool { return false } +func (params *ConsensusParams) Complete() { + if params.Synchrony == (SynchronyParams{}) { + params.Synchrony = DefaultSynchronyParams() + } +} + // Validate validates the ConsensusParams to ensure all values are within their // allowed limits, and returns an error if they are not. func (params ConsensusParams) ValidateConsensusParams() error {