Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Custom Gas Price Configurations Greater Than Default Limits #1376

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/txpool/legacypool/legacypool.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (config *Config) sanitize() Config {
conf.Rejournal = time.Second
}
// PIP-35: Enforce min price limit to 25 gwei
if conf.PriceLimit != params.BorDefaultTxPoolPriceLimit {
if conf.PriceLimit < params.BorDefaultTxPoolPriceLimit {
log.Warn("Sanitizing invalid txpool price limit", "provided", conf.PriceLimit, "updated", DefaultConfig.PriceLimit)
conf.PriceLimit = DefaultConfig.PriceLimit
}
Expand Down
2 changes: 1 addition & 1 deletion eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
}

// PIP-35: Enforce min gas price to 25 gwei
if config.Miner.GasPrice == nil || config.Miner.GasPrice.Cmp(big.NewInt(params.BorDefaultMinerGasPrice)) != 0 {
if config.Miner.GasPrice == nil || config.Miner.GasPrice.Cmp(big.NewInt(params.BorDefaultMinerGasPrice)) < 0 {
log.Warn("Sanitizing invalid miner gas price", "provided", config.Miner.GasPrice, "updated", ethconfig.Defaults.Miner.GasPrice)
config.Miner.GasPrice = ethconfig.Defaults.Miner.GasPrice
}
Expand Down
2 changes: 1 addition & 1 deletion eth/gasprice/gasprice.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func NewOracle(backend OracleBackend, params Config) *Oracle {

// PIP-35: Enforce the ignore price to 25 gwei
ignorePrice := params.IgnorePrice
if ignorePrice == nil || ignorePrice.Int64() != DefaultIgnorePrice.Int64() {
if ignorePrice == nil || ignorePrice.Int64() < DefaultIgnorePrice.Int64() {
ignorePrice = DefaultIgnorePrice
log.Warn("Sanitizing invalid gasprice oracle ignore price", "provided", params.IgnorePrice, "updated", ignorePrice)
} else {
Expand Down
Loading