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

fix: Don't error on startup if min-gas-price is empty #9621

Merged
merged 5 commits into from
Jul 2, 2021

Conversation

amaury1093
Copy link
Contributor

@amaury1093 amaury1093 commented Jul 2, 2021

Description

We introduced throwing an error when min-gas-price was empty in #9371 in 0.43. It seems like it may be too big of a CLI breaking change too soon. Internally at Regen we discussed of showing a warning in 0.43, and throwing the error in 0.44


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@amaury1093 amaury1093 marked this pull request as ready for review July 2, 2021 13:47
@@ -132,7 +132,6 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [\#8628](https://github.com/cosmos/cosmos-sdk/issues/8628) Commands no longer print outputs using `stderr` by default
* [\#9134](https://github.com/cosmos/cosmos-sdk/pull/9134) Renamed the CLI flag `--memo` to `--note`.
* [\#9291](https://github.com/cosmos/cosmos-sdk/pull/9291) Migration scripts prior to v0.38 have been removed from the CLI `migrate` command. The oldest supported migration is v0.39->v0.42.
* [\#9371](https://github.com/cosmos/cosmos-sdk/pull/9371) Non-zero default fees/Server will error if there's an empty value for min-gas-price in app.toml
Copy link
Contributor Author

@amaury1093 amaury1093 Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add this line to the "Unreleased" section in #9592

edit: done

server/start.go Outdated Show resolved Hide resolved
server/start.go Outdated Show resolved Hide resolved
server/start.go Outdated
@@ -247,7 +247,9 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App

config := config.GetConfig(ctx.Viper)
if err := config.ValidateBasic(); err != nil {
return err
ctx.Logger.Info("The minimum-gas-prices config in app.toml is set to the empty string. "+
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do Logger.Error or will that cause a panic?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ctx.Logger.Info("The minimum-gas-prices config in app.toml is set to the empty string. "+
ctx.Logger.Info("WARNING: The minimum-gas-prices config in app.toml is set to the empty string. "+

Copy link
Contributor Author

@amaury1093 amaury1093 Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to error, it doesn't panic:

Screenshot 2021-07-02 at 17 17 20

Too bad the logger doesn't have a .Warn that's yellow, that would be the most accurate

amaury1093 and others added 2 commits July 2, 2021 17:15
Co-authored-by: Aaron Craelius <aaron@regen.network>
@amaury1093 amaury1093 added the A:automerge Automatically merge PR once all prerequisites pass. label Jul 2, 2021
Copy link
Collaborator

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@@ -247,7 +247,9 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App

config := config.GetConfig(ctx.Viper)
if err := config.ValidateBasic(); err != nil {
return err
ctx.Logger.Error("WARNING: The minimum-gas-prices config in app.toml is set to the empty string. " +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, we don't have Warn method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add it to the interface. ERR is fine for now IMHO.

@amaury1093 amaury1093 merged commit 3a28c34 into release/v0.43.x Jul 2, 2021
@amaury1093 amaury1093 deleted the am/min-gas-no-error branch July 2, 2021 15:35
evan-forbes pushed a commit to evan-forbes/cosmos-sdk that referenced this pull request Oct 12, 2021
* fix: Don't error on startup if min-gas-price is empty

* remove test

* Update server/start.go

* Update server/start.go

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Switch to error

Co-authored-by: Aaron Craelius <aaron@regen.network>
evan-forbes pushed a commit to evan-forbes/cosmos-sdk that referenced this pull request Nov 1, 2021
* fix: Don't error on startup if min-gas-price is empty

* remove test

* Update server/start.go

* Update server/start.go

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Switch to error

Co-authored-by: Aaron Craelius <aaron@regen.network>
zakir-code pushed a commit to PundiAI/cosmos-sdk that referenced this pull request Apr 14, 2022
* fix: Don't error on startup if min-gas-price is empty

* remove test

* Update server/start.go

* Update server/start.go

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Switch to error

Co-authored-by: Aaron Craelius <aaron@regen.network>
JeancarloBarrios pushed a commit to agoric-labs/cosmos-sdk that referenced this pull request Sep 28, 2024
* fix: Don't error on startup if min-gas-price is empty

* remove test

* Update server/start.go

* Update server/start.go

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Switch to error

Co-authored-by: Aaron Craelius <aaron@regen.network>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants