From 0fb7ce1999e6b8f4d39e78787525e236e007948f Mon Sep 17 00:00:00 2001 From: jeff <113397187+cyberhorsey@users.noreply.github.com> Date: Sun, 26 May 2024 20:13:01 -0700 Subject: [PATCH] feat(eth): add default gpo price flag (#258) * default flag * default max price * comments --- cmd/geth/main.go | 2 ++ cmd/utils/flags.go | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 6a0fd50a020f..1d9c439ff8cb 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -143,6 +143,8 @@ var ( utils.GpoPercentileFlag, utils.GpoMaxGasPriceFlag, utils.GpoIgnoreGasPriceFlag, + // CHANGE(taiko): use default gas price flag + utils.GpoDefaultGasPriceFlag, configFileFlag, utils.LogDebugFlag, utils.LogBacktraceAtFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 342455bcde6c..0ff166a1f938 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -813,6 +813,12 @@ var ( Value: ethconfig.Defaults.GPO.IgnorePrice.Int64(), Category: flags.GasPriceCategory, } + // CHANGE(taiko): use default gas price flag + GpoDefaultGasPriceFlag = &cli.Int64Flag{ + Name: "gpo.defaultprice", + Usage: "Default gas price", + Category: flags.GasPriceCategory, + } // Metrics flags MetricsEnabledFlag = &cli.BoolFlag{ @@ -1450,6 +1456,10 @@ func setGPO(ctx *cli.Context, cfg *gasprice.Config) { if ctx.IsSet(GpoIgnoreGasPriceFlag.Name) { cfg.IgnorePrice = big.NewInt(ctx.Int64(GpoIgnoreGasPriceFlag.Name)) } + // CHANGE(taiko): use flag + if ctx.IsSet(GpoDefaultGasPriceFlag.Name) { + cfg.Default = big.NewInt(ctx.Int64(GpoDefaultGasPriceFlag.Name)) + } } func setTxPool(ctx *cli.Context, cfg *legacypool.Config) {