Skip to content

Commit

Permalink
add: enforce 30gwei for gas related configs in bor
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikspatil024 committed Jun 27, 2024
1 parent 84237fe commit 922ce82
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion erigon-lib/txpool/txpoolcfg/txpoolcfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
)

// BorDefaultTxPoolPriceLimit defines the minimum gas price limit for bor to enforce txs acceptance into the pool.
const BorDefaultTxPoolPriceLimit = 30 * common.GWei
const BorDefaultTxPoolPriceLimit = 25 * common.GWei

type Config struct {
DBDir string
Expand Down
4 changes: 2 additions & 2 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -1726,15 +1726,15 @@ func (s *Ethereum) DataDir() string {
return s.config.Dirs.DataDir
}

// setBorDefaultMinerGasPrice enforces Miner.GasPrice to be equal to BorDefaultMinerGasPrice (30gwei by default)
// setBorDefaultMinerGasPrice enforces Miner.GasPrice to be equal to BorDefaultMinerGasPrice (25gwei by default)
func setBorDefaultMinerGasPrice(chainConfig *chain.Config, config *ethconfig.Config, logger log.Logger) {
if chainConfig.Bor != nil && (config.Miner.GasPrice == nil || config.Miner.GasPrice.Cmp(ethconfig.BorDefaultMinerGasPrice) != 0) {
logger.Warn("Sanitizing invalid bor miner gas price", "provided", config.Miner.GasPrice, "updated", ethconfig.BorDefaultMinerGasPrice)
config.Miner.GasPrice = ethconfig.BorDefaultMinerGasPrice
}
}

// setBorDefaultTxPoolPriceLimit enforces MinFeeCap to be equal to BorDefaultTxPoolPriceLimit (30gwei by default)
// setBorDefaultTxPoolPriceLimit enforces MinFeeCap to be equal to BorDefaultTxPoolPriceLimit (25gwei by default)
func setBorDefaultTxPoolPriceLimit(chainConfig *chain.Config, config txpoolcfg.Config, logger log.Logger) {
if chainConfig.Bor != nil && config.MinFeeCap != txpoolcfg.BorDefaultTxPoolPriceLimit {
logger.Warn("Sanitizing invalid bor min fee cap", "provided", config.MinFeeCap, "updated", txpoolcfg.BorDefaultTxPoolPriceLimit)
Expand Down
2 changes: 1 addition & 1 deletion eth/ethconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import (
)

// BorDefaultMinerGasPrice defines the minimum gas price for bor validators to mine a transaction.
var BorDefaultMinerGasPrice = big.NewInt(30 * params.GWei)
var BorDefaultMinerGasPrice = big.NewInt(25 * params.GWei)

// FullNodeGPO contains default gasprice oracle settings for full node.
var FullNodeGPO = gaspricecfg.Config{
Expand Down
2 changes: 1 addition & 1 deletion eth/gasprice/gasprice.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func (s *sortingHeap) Pop() interface{} {
return x
}

// setBorDefaultGpoIgnorePrice enforces gpo IgnorePrice to be equal to BorDefaultGpoIgnorePrice (30gwei by default)
// setBorDefaultGpoIgnorePrice enforces gpo IgnorePrice to be equal to BorDefaultGpoIgnorePrice (25gwei by default)
func setBorDefaultGpoIgnorePrice(chainConfig *chain.Config, gasPriceConfig gaspricecfg.Config, log log.Logger) {
if chainConfig.Bor != nil && gasPriceConfig.IgnorePrice != gaspricecfg.BorDefaultGpoIgnorePrice {
log.Warn("Sanitizing invalid bor gasprice oracle ignore price", "provided", gasPriceConfig.IgnorePrice, "updated", gaspricecfg.BorDefaultGpoIgnorePrice)
Expand Down
2 changes: 1 addition & 1 deletion eth/gasprice/gaspricecfg/gaspricecfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
var DefaultIgnorePrice = big.NewInt(2 * params.Wei)

// BorDefaultGpoIgnorePrice defines the minimum gas price below which bor gpo will ignore transactions.
var BorDefaultGpoIgnorePrice = big.NewInt(30 * params.Wei)
var BorDefaultGpoIgnorePrice = big.NewInt(25 * params.Wei)

var (
DefaultMaxPrice = big.NewInt(500 * params.GWei)
Expand Down

0 comments on commit 922ce82

Please sign in to comment.