diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 5c42cc4039..fbf2847595 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -146,7 +146,9 @@ var ( utils.FakePoWFlag, utils.NoCompactionFlag, utils.GpoBlocksFlag, + utils.GpoLegacyBlocksFlag, utils.GpoPercentileFlag, + utils.GpoLegacyPercentileFlag, utils.EWASMInterpreterFlag, utils.EVMInterpreterFlag, configFileFlag, diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index 57eee29b50..06b687cec0 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -259,6 +259,8 @@ var AppHelpFlagGroups = []flagGroup{ utils.RPCLegacyCORSDomainFlag, utils.RPCLegacyVirtualHostsFlag, utils.RPCLegacyApiFlag, + utils.GpoLegacyBlocksFlag, + utils.GpoLegacyPercentileFlag, }, debug.DeprecatedFlags...), }, { diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 0aae6836d0..70143988ca 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -714,15 +714,25 @@ var ( // Gas price oracle settings GpoBlocksFlag = cli.IntFlag{ - Name: "gpoblocks", + Name: "gpo.blocks", Usage: "Number of recent blocks to check for gas prices", Value: eth.DefaultConfig.GPO.Blocks, } + GpoLegacyBlocksFlag = cli.IntFlag{ + Name: "gpoblocks", + Usage: "Number of recent blocks to check for gas prices (deprecated, use --gpo.blocks)", + Value: eth.DefaultConfig.GPO.Blocks, + } GpoPercentileFlag = cli.IntFlag{ - Name: "gpopercentile", + Name: "gpo.percentile", Usage: "Suggested gas price is the given percentile of a set of recent transaction gas prices", Value: eth.DefaultConfig.GPO.Percentile, } + GpoLegacyPercentileFlag = cli.IntFlag{ + Name: "gpopercentile", + Usage: "Suggested gas price is the given percentile of a set of recent transaction gas prices (deprecated, use --gpo.percentile)", + Value: eth.DefaultConfig.GPO.Percentile, + } WhisperEnabledFlag = cli.BoolFlag{ Name: "shh", Usage: "Enable Whisper", @@ -1310,9 +1320,16 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) { } func setGPO(ctx *cli.Context, cfg *gasprice.Config) { + if ctx.GlobalIsSet(GpoLegacyBlocksFlag.Name) { + cfg.Blocks = ctx.GlobalInt(GpoLegacyBlocksFlag.Name) + } if ctx.GlobalIsSet(GpoBlocksFlag.Name) { cfg.Blocks = ctx.GlobalInt(GpoBlocksFlag.Name) } + + if ctx.GlobalIsSet(GpoLegacyPercentileFlag.Name) { + cfg.Percentile = ctx.GlobalInt(GpoLegacyPercentileFlag.Name) + } if ctx.GlobalIsSet(GpoPercentileFlag.Name) { cfg.Percentile = ctx.GlobalInt(GpoPercentileFlag.Name) }