-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hard-code consensus.timeout_commit to 3.5s for mainnet. (#2196)
* [2121]: Change the default consensus timeout value to 3.5 seconds. * [2121]: Hard-code the consensus.timeout_commit value. * [2121]: Fix TestIsTestnetFlagSet to not be affected by existing env vars. * [2121]: Fix a couple unit tests that broke when I changed the default commit timout. * [2121]: Only hard-code the timeout commit on non-testnets. * [2121]: Change the default back to 1.5s for faster default testnets. * [2121]: Fix the TestPreUpgradeCmd that broke because of the hard-coded timeout commit. * [2121]: Add some unit tests that make sure the consensus timeout commit value is behaving as expected. * [2121]: Add changelog entry. * [2121]: When forcing the timeout_commit to be 3.5 seconds, also force the skip flag to be false. * [2121]: Update warnAboutSettings: Evaluate the timeout commit and skip-timeout-commit fields separately. Issue a warning if skip-timeout-commit is true. Issue a warning if the timeout commit is not exactly what we want it to be.
- Loading branch information
1 parent
63676a5
commit bf5b825
Showing
6 changed files
with
175 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Hard code the mainnet `consensus.timeout_commit` config value to 3.5s [#2121](https://github.com/provenance-io/provenance/issues/2121). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package testutil | ||
|
||
import "os" | ||
|
||
const TestnetEnvVar = "PIO_TESTNET" | ||
|
||
// UnsetTestnetEnvVar will unset the PIO_TESTNET environment variable and return a deferrable that will put it back. | ||
// | ||
// Go runs tests inside an environment that might already have some environment variables defined. E.g. if you | ||
// have `export PIO_TESTNET=true` in your environment, and run `make test`, then, when a test runs, it will | ||
// start with a `PIO_TESTNET` value of `true`. But that can mess up some tests that expect to start without a | ||
// PIO_TESTNET env var set. | ||
// | ||
// For individual test cases, you should use t.Setenv for changing environment variables. | ||
// This exists because t.Setenv can't be used to unset an environment variable. | ||
// | ||
// Standard usage: defer testutil.UnsetTestnetEnvVar()() | ||
func UnsetTestnetEnvVar() func() { | ||
if origVal, ok := os.LookupEnv(TestnetEnvVar); ok { | ||
os.Unsetenv(TestnetEnvVar) | ||
return func() { | ||
os.Setenv(TestnetEnvVar, origVal) | ||
} | ||
} | ||
return func() { | ||
os.Unsetenv(TestnetEnvVar) | ||
} | ||
} |