Skip to content

Commit

Permalink
fix default min gas price
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianElvis committed Oct 1, 2024
1 parent 1cdb4da commit 084a934
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions cmd/babylond/cmd/custom_babylon_config.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package cmd

import (
"fmt"

wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

sdkmath "cosmossdk.io/math"
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
sdk "github.com/cosmos/cosmos-sdk/types"

appparams "github.com/babylonlabs-io/babylon/app/params"
bbn "github.com/babylonlabs-io/babylon/types"
Expand All @@ -31,19 +31,9 @@ type BabylonAppConfig struct {

func DefaultBabylonAppConfig() *BabylonAppConfig {
baseConfig := *serverconfig.DefaultConfig()
// The SDK's default minimum gas price is set to "" (empty value) inside
// app.toml. If left empty by validators, the node will halt on startup.
// However, the chain developer can set a default app.toml value for their
// validators here.
//
// In summary:
// - if you leave srvCfg.MinGasPrices = "", all validators MUST tweak their
// own app.toml config,
// - if you set srvCfg.MinGasPrices non-empty, validators CAN tweak their
// own app.toml to override, or use this default value.
//
// In app, we set the min gas prices to 0.
baseConfig.MinGasPrices = sdk.NewCoin(appparams.BaseCoinUnit, sdkmath.NewInt(1)).String()
// The SDK's default minimum gas price is set to "0.002ubbn" (empty value) inside
// app.toml, in order to avoid spamming attacks due to transactions with 0 gas price.
baseConfig.MinGasPrices = fmt.Sprintf("%f%s", appparams.GlobalMinGasPrice, appparams.BaseCoinUnit)
return &BabylonAppConfig{
Config: baseConfig,
Wasm: wasmtypes.DefaultWasmConfig(),
Expand Down

0 comments on commit 084a934

Please sign in to comment.