Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport: Create pre-upgrade command. Fix minimum-gas-prices repacking unset. (#1594) #1599

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

SpicyLemon
Copy link
Contributor

@SpicyLemon SpicyLemon commented Jun 20, 2023

Description

Backport of #1594 to release/v1.16.x.


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

…1594)

* Create a new pre_upgrade command that updates the config files. Make it also set the commit timeout if needed. Make it so that stuff that uses the global viper also gets everything that's needed.

* Force the timeout commit to 5s in all cases. Add some comments and info about what cosmovisor expects.

* Undo the PersistentPreRunE extraction change since I ended up not needing it for the unit tests.

* Fix the existing LogIfError functions.

* Tweak errors returned from pre-upgrade to contain more context and still be indicate the desired exit code.

* Allow creation of the root command that won't seal the app config so we can run it multiple times, e.g. from unit tests. Also, add extra handling of ErrorCodes to main since it's sometimes a pointer and sometimes not.

* Add unit tests on the pre-upgrade command.

* Add a unit test for when the config can't be written.

* Add newline to end of success message.

* Move the global min-gas-prices setting stuff into the interceptor so that it happens before the config files are loaded or any defaults are requested.

* For the init cmd test, don't seal the config (so other things that might need to can do so), and use a temp directory instead of the default.

* Update some tests that started failing because the default timeout_commit changed.

* Just pass sealConfig into the SetConfig function instead of optionally calling it.

* For the pre-unpgrade tests, just add the home dir as a flag for the command.

* Add temporary changelog entries.

* Remove some lines added just for debugging.

* When starting a node with a timeout_commit of less than 4 seconds, output a message stating that it should be set to 5s.

* Update the initialization script to put the timeout_commit back to 1s so that make run cuts blocks faster.

* Only issue low timeout_commit warning on mainnet.

* Replace some deprecated stuff and fix some receivers.

* During pre-upgrae Only update the configured value if it's lower than half the default.

* Only log the warning on mainnet and only if it's less than half the default.

* Add the --timeout-commit flag to the init command. If provided, use that. Otherwise, if something other than mainnet or testnet, use 1s. Otherwise, use whatever was previously in their config or the default if it's brand new.

* Update the initialize script to provide the --timeout-commit to init instead of setting it using the config command at the end.

* Upper-case the first letter of all commmand and flag usage strings. Fix the debug pubkey-raw command that had a conflicting shorthand flag being added.

* Fix the --help flag capitalization.

* Undo the usage capitalization stuff. That's a bit too off-topic for this PR.

* In the pre-upgrade command only change the timeout_commit for mainnet nodes.

* Get rid of the global ChainID variable (in cmd/root.go) since it wasn't used before this PR and it wasn't really worthwhile even after setting it due to the package it's in.
@SpicyLemon SpicyLemon requested a review from a team as a code owner June 20, 2023 20:52
@SpicyLemon SpicyLemon enabled auto-merge (squash) June 20, 2023 20:53
@SpicyLemon SpicyLemon merged commit 1b377e8 into release/v1.16.x Jun 20, 2023
34 checks passed
@SpicyLemon SpicyLemon deleted the dwedul/bp-1594-to-1.16 branch June 20, 2023 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants