From 60fcc9d2639b3ca8348073f525dca832a1b6c9f3 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Sun, 26 May 2024 19:19:41 -0700 Subject: [PATCH 1/5] default flag --- cmd/geth/main.go | 1 + cmd/utils/flags.go | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 6a0fd50a020f..866e05ee9c31 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -143,6 +143,7 @@ var ( utils.GpoPercentileFlag, utils.GpoMaxGasPriceFlag, utils.GpoIgnoreGasPriceFlag, + utils.GpoDefaultGasPriceFlag, configFileFlag, utils.LogDebugFlag, utils.LogBacktraceAtFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 342455bcde6c..aa8088a19611 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, } + GpoDefaultGasPriceFlag = &cli.Int64Flag{ + Name: "gpo.defaultprice", + Usage: "Defaul gas price", + Value: ethconfig.Defaults.GPO.Default.Int64(), + 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)) } + + if ctx.IsSet(GpoIgnoreGasPriceFlag.Name) { + cfg.Default = big.NewInt(ctx.Int64(GpoDefaultGasPriceFlag.Name)) + } } func setTxPool(ctx *cli.Context, cfg *legacypool.Config) { From befafd48983235694e9069d2d81aa5d75f2e1d72 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Sun, 26 May 2024 19:22:35 -0700 Subject: [PATCH 2/5] default max price --- cmd/geth/main.go | 1 + cmd/utils/flags.go | 8 ++++---- eth/ethconfig/config.go | 1 + eth/gasprice/gasprice.go | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 866e05ee9c31..1d9c439ff8cb 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -143,6 +143,7 @@ var ( utils.GpoPercentileFlag, utils.GpoMaxGasPriceFlag, utils.GpoIgnoreGasPriceFlag, + // CHANGE(taiko): use default gas price flag utils.GpoDefaultGasPriceFlag, configFileFlag, utils.LogDebugFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index aa8088a19611..63082f2114c2 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -810,12 +810,12 @@ var ( GpoIgnoreGasPriceFlag = &cli.Int64Flag{ Name: "gpo.ignoreprice", Usage: "Gas price below which gpo will ignore transactions", - Value: ethconfig.Defaults.GPO.IgnorePrice.Int64(), Category: flags.GasPriceCategory, } + // CHANGE(taiko): use default gas price flag GpoDefaultGasPriceFlag = &cli.Int64Flag{ Name: "gpo.defaultprice", - Usage: "Defaul gas price", + Usage: "Default gas price", Value: ethconfig.Defaults.GPO.Default.Int64(), Category: flags.GasPriceCategory, } @@ -1456,8 +1456,8 @@ func setGPO(ctx *cli.Context, cfg *gasprice.Config) { if ctx.IsSet(GpoIgnoreGasPriceFlag.Name) { cfg.IgnorePrice = big.NewInt(ctx.Int64(GpoIgnoreGasPriceFlag.Name)) } - - if ctx.IsSet(GpoIgnoreGasPriceFlag.Name) { + // CHANGE(taiko): use flag + if ctx.IsSet(GpoDefaultGasPriceFlag.Name) { cfg.Default = big.NewInt(ctx.Int64(GpoDefaultGasPriceFlag.Name)) } } diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index a26d5adedaf4..571605419405 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -45,6 +45,7 @@ var FullNodeGPO = gasprice.Config{ MaxBlockHistory: 1024, MaxPrice: gasprice.DefaultMaxPrice, IgnorePrice: gasprice.DefaultIgnorePrice, + Default: gasprice.DefaultGasPrice, } // Defaults contains default settings for use on the Ethereum main net. diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index b71964981145..4455e4efa1c6 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -37,6 +37,7 @@ const sampleNumber = 3 // Number of transactions sampled in a block var ( DefaultMaxPrice = big.NewInt(500 * params.GWei) DefaultIgnorePrice = big.NewInt(2 * params.Wei) + DefaultGasPrice = big.NewInt(10000000 * params.Wei) ) type Config struct { From 853a0df4fca2da8f728bd0fe62d4a9cfb2371be3 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Sun, 26 May 2024 19:23:50 -0700 Subject: [PATCH 3/5] comments --- eth/ethconfig/config.go | 3 ++- eth/gasprice/gasprice.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 571605419405..53eee77cba41 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -45,7 +45,8 @@ var FullNodeGPO = gasprice.Config{ MaxBlockHistory: 1024, MaxPrice: gasprice.DefaultMaxPrice, IgnorePrice: gasprice.DefaultIgnorePrice, - Default: gasprice.DefaultGasPrice, + // CHANGE(taiko): use default gas price + Default: gasprice.DefaultGasPrice, } // Defaults contains default settings for use on the Ethereum main net. diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index 4455e4efa1c6..7e23915e329c 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -37,7 +37,8 @@ const sampleNumber = 3 // Number of transactions sampled in a block var ( DefaultMaxPrice = big.NewInt(500 * params.GWei) DefaultIgnorePrice = big.NewInt(2 * params.Wei) - DefaultGasPrice = big.NewInt(10000000 * params.Wei) + // CHANGE(taiko): default gas price 0.01 gwei + DefaultGasPrice = big.NewInt(10000000 * params.Wei) ) type Config struct { From 55cc7b14be2d984a49bdfa844fb29519a8b665f0 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Sun, 26 May 2024 19:25:41 -0700 Subject: [PATCH 4/5] fix --- cmd/utils/flags.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 63082f2114c2..eaab9585d52c 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -810,6 +810,7 @@ var ( GpoIgnoreGasPriceFlag = &cli.Int64Flag{ Name: "gpo.ignoreprice", Usage: "Gas price below which gpo will ignore transactions", + Value: ethconfig.Defaults.GPO.IgnorePrice.Int64(), Category: flags.GasPriceCategory, } // CHANGE(taiko): use default gas price flag From d8e1b9c2953c8b5957e11e2876d01f910681d97a Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Sun, 26 May 2024 19:58:09 -0700 Subject: [PATCH 5/5] no default --- cmd/utils/flags.go | 1 - eth/ethconfig/config.go | 2 -- eth/gasprice/gasprice.go | 2 -- 3 files changed, 5 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index eaab9585d52c..0ff166a1f938 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -817,7 +817,6 @@ var ( GpoDefaultGasPriceFlag = &cli.Int64Flag{ Name: "gpo.defaultprice", Usage: "Default gas price", - Value: ethconfig.Defaults.GPO.Default.Int64(), Category: flags.GasPriceCategory, } diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 53eee77cba41..a26d5adedaf4 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -45,8 +45,6 @@ var FullNodeGPO = gasprice.Config{ MaxBlockHistory: 1024, MaxPrice: gasprice.DefaultMaxPrice, IgnorePrice: gasprice.DefaultIgnorePrice, - // CHANGE(taiko): use default gas price - Default: gasprice.DefaultGasPrice, } // Defaults contains default settings for use on the Ethereum main net. diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index 7e23915e329c..b71964981145 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -37,8 +37,6 @@ const sampleNumber = 3 // Number of transactions sampled in a block var ( DefaultMaxPrice = big.NewInt(500 * params.GWei) DefaultIgnorePrice = big.NewInt(2 * params.Wei) - // CHANGE(taiko): default gas price 0.01 gwei - DefaultGasPrice = big.NewInt(10000000 * params.Wei) ) type Config struct {