Skip to content

Commit

Permalink
Merge pull request bnb-chain#129 from ethereum-optimism/jg/configurab…
Browse files Browse the repository at this point in the history
…le_min_suggested_fee

Decrease GPO min suggested fee & make it configurable
  • Loading branch information
trianglesphere authored Sep 8, 2023
2 parents 0fb8208 + 1396492 commit 3cea832
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ var (
utils.GpoPercentileFlag,
utils.GpoMaxGasPriceFlag,
utils.GpoIgnoreGasPriceFlag,
utils.GpoMinSuggestedPriorityFeeFlag,
utils.RollupSequencerHTTPFlag,
utils.RollupHistoricalRPCFlag,
utils.RollupHistoricalRPCTimeoutFlag,
Expand Down
9 changes: 9 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,12 @@ var (
Value: ethconfig.Defaults.GPO.IgnorePrice.Int64(),
Category: flags.GasPriceCategory,
}
GpoMinSuggestedPriorityFeeFlag = &cli.Int64Flag{
Name: "gpo.minsuggestedpriorityfee",
Usage: "Minimum transaction priority fee to suggest. Used on OP chains when blocks are not full.",
Value: ethconfig.Defaults.GPO.MinSuggestedPriorityFee.Int64(),
Category: flags.GasPriceCategory,
}

// Rollup Flags
RollupSequencerHTTPFlag = &cli.StringFlag{
Expand Down Expand Up @@ -1558,6 +1564,9 @@ func setGPO(ctx *cli.Context, cfg *gasprice.Config, light bool) {
if ctx.IsSet(GpoIgnoreGasPriceFlag.Name) {
cfg.IgnorePrice = big.NewInt(ctx.Int64(GpoIgnoreGasPriceFlag.Name))
}
if ctx.IsSet(GpoMinSuggestedPriorityFeeFlag.Name) {
cfg.MinSuggestedPriorityFee = big.NewInt(ctx.Int64(GpoMinSuggestedPriorityFeeFlag.Name))
}
}

func setTxPool(ctx *cli.Context, cfg *txpool.Config) {
Expand Down
13 changes: 7 additions & 6 deletions eth/ethconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ import (

// FullNodeGPO contains default gasprice oracle settings for full node.
var FullNodeGPO = gasprice.Config{
Blocks: 20,
Percentile: 60,
MaxHeaderHistory: 1024,
MaxBlockHistory: 1024,
MaxPrice: gasprice.DefaultMaxPrice,
IgnorePrice: gasprice.DefaultIgnorePrice,
Blocks: 20,
Percentile: 60,
MaxHeaderHistory: 1024,
MaxBlockHistory: 1024,
MaxPrice: gasprice.DefaultMaxPrice,
IgnorePrice: gasprice.DefaultIgnorePrice,
MinSuggestedPriorityFee: gasprice.DefaultMinSuggestedPriorityFee,
}

// LightClientGPO contains default gasprice oracle settings for light client.
Expand Down
2 changes: 1 addition & 1 deletion eth/gasprice/gasprice.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var (
DefaultMaxPrice = big.NewInt(500 * params.GWei)
DefaultIgnorePrice = big.NewInt(2 * params.Wei)

DefaultMinSuggestedPriorityFee = big.NewInt(1e8 * params.Wei) // 0.1 gwei, for Optimism fee suggestion
DefaultMinSuggestedPriorityFee = big.NewInt(1e6 * params.Wei) // 0.001 gwei, for Optimism fee suggestion
)

type Config struct {
Expand Down

0 comments on commit 3cea832

Please sign in to comment.