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:
William Banfield
2022-03-28 17:33:23 -04:00
committed by GitHub
parent 9d56520f76
commit 462c475abc
7 changed files with 260 additions and 184 deletions
+10 -10
View File
@@ -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 {