mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 23:14:37 +00:00
consensus: timeout params in toml used as overrides (#8186)
Replaces the set of timeout parameters in the config.toml file with unsafe-*override versions of the corresponding ConsensusParams.Timeout field. These fields can be used for the duration of v0.36 to override the consensus param in case of emergency. Adds a set to the ./internal/consensus/State type for correctly calculating the value of each timeout based on the set of overrides specified.
This commit is contained in:
+10
-10
@@ -247,24 +247,24 @@ func (params ConsensusParams) ValidateConsensusParams() error {
|
||||
params.Synchrony.Precision)
|
||||
}
|
||||
|
||||
if params.Timeout.Propose < 0 {
|
||||
return fmt.Errorf("timeout.ProposeDelta must not be negative. Got: %d", params.Timeout.Propose)
|
||||
if params.Timeout.Propose <= 0 {
|
||||
return fmt.Errorf("timeout.ProposeDelta must be greater than 0. Got: %d", params.Timeout.Propose)
|
||||
}
|
||||
|
||||
if params.Timeout.ProposeDelta < 0 {
|
||||
return fmt.Errorf("timeout.ProposeDelta must not be negative. Got: %d", params.Timeout.ProposeDelta)
|
||||
if params.Timeout.ProposeDelta <= 0 {
|
||||
return fmt.Errorf("timeout.ProposeDelta must be greater than 0. Got: %d", params.Timeout.ProposeDelta)
|
||||
}
|
||||
|
||||
if params.Timeout.Vote < 0 {
|
||||
return fmt.Errorf("timeout.Vote must not be negative. Got: %d", params.Timeout.Vote)
|
||||
if params.Timeout.Vote <= 0 {
|
||||
return fmt.Errorf("timeout.Vote must be greater than 0. Got: %d", params.Timeout.Vote)
|
||||
}
|
||||
|
||||
if params.Timeout.VoteDelta < 0 {
|
||||
return fmt.Errorf("timeout.VoteDelta must not be negative. Got: %d", params.Timeout.VoteDelta)
|
||||
if params.Timeout.VoteDelta <= 0 {
|
||||
return fmt.Errorf("timeout.VoteDelta must be greater than 0. Got: %d", params.Timeout.VoteDelta)
|
||||
}
|
||||
|
||||
if params.Timeout.Commit < 0 {
|
||||
return fmt.Errorf("timeout.Commit must not be negative. Got: %d", params.Timeout.Commit)
|
||||
if params.Timeout.Commit <= 0 {
|
||||
return fmt.Errorf("timeout.Commit must be greater than 0. Got: %d", params.Timeout.Commit)
|
||||
}
|
||||
|
||||
if len(params.Validator.PubKeyTypes) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user