diff --git a/CHANGELOG.md b/CHANGELOG.md index a022187ac35a..5a0c8a246202 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ### Improvements diff --git a/server/start.go b/server/start.go index 8257f5d8f594..79e7bee28304 100644 --- a/server/start.go +++ b/server/start.go @@ -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. " + + "This defaults to 0 in the current version, but will error in the next version " + + "(SDK v0.44). Please explicitly put the desired minimum-gas-prices in your app.toml.") } app := appCreator(ctx.Logger, db, traceWriter, ctx.Viper) diff --git a/server/util_test.go b/server/util_test.go index b83531f562e5..0d70a891e1dd 100644 --- a/server/util_test.go +++ b/server/util_test.go @@ -11,15 +11,9 @@ import ( "testing" "github.com/spf13/cobra" - "github.com/stretchr/testify/require" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" - "github.com/cosmos/cosmos-sdk/server/config" - "github.com/cosmos/cosmos-sdk/simapp" - genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) var cancelledInPreRun = errors.New("Cancelled in prerun") @@ -406,34 +400,3 @@ func TestInterceptConfigsWithBadPermissions(t *testing.T) { t.Fatalf("Failed to catch permissions error, got: [%T] %v", err, err) } } - -func TestEmptyMinGasPrices(t *testing.T) { - tempDir := t.TempDir() - err := os.Mkdir(filepath.Join(tempDir, "config"), os.ModePerm) - require.NoError(t, err) - encCfg := simapp.MakeTestEncodingConfig() - - // Run InitCmd to create necessary config files. - clientCtx := client.Context{}.WithHomeDir(tempDir).WithJSONCodec(encCfg.Marshaler) - serverCtx := server.NewDefaultContext() - ctx := context.WithValue(context.Background(), server.ServerContextKey, serverCtx) - ctx = context.WithValue(ctx, client.ClientContextKey, &clientCtx) - cmd := genutilcli.InitCmd(simapp.ModuleBasics, tempDir) - cmd.SetArgs([]string{"appnode-test"}) - err = cmd.ExecuteContext(ctx) - require.NoError(t, err) - - // Modify app.toml. - appCfgTempFilePath := filepath.Join(tempDir, "config", "app.toml") - appConf := config.DefaultConfig() - appConf.BaseConfig.MinGasPrices = "" - config.WriteConfigFile(appCfgTempFilePath, appConf) - - // Run StartCmd. - cmd = server.StartCmd(nil, tempDir) - cmd.PreRunE = func(cmd *cobra.Command, _ []string) error { - return server.InterceptConfigsPreRunHandler(cmd, "", nil) - } - err = cmd.ExecuteContext(ctx) - require.Errorf(t, err, sdkerrors.ErrAppConfig.Error()) -}