Skip to content

Commit

Permalink
Merge branch 'configurable-suggestpriceoptions' of github.com:ava-lab…
Browse files Browse the repository at this point in the history
…s/coreth into configurable-suggestpriceoptions
  • Loading branch information
ceyonur committed Mar 3, 2025
2 parents 43ac8f7 + 5177b30 commit a5e6a4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 4 additions & 5 deletions internal/ethapi/api.coreth.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ import (
)

const (
minBaseFee = etna.MinBaseFee // 1 gwei

minGasTip = 1 // 1 wei
minBaseFee = etna.MinBaseFee // 1 nAVAX
minGasTip = 1 // 1 wei

feeDenominator = 100
)
Expand Down Expand Up @@ -110,9 +109,9 @@ type feeSpeeds struct {
// calculateFeeSpeeds returns the slow, normal, and fast price options for a
// given min, estimate, and max,
//
// slow = max(slowPerc/100 * min(estimate, maxFee), minFee)
// slow = max(slowFeePerc/100 * min(estimate, maxFee), minFee)
// normal = min(estimate, maxFee)
// fast = fastPerc/100 * estimate
// fast = fastFeePerc/100 * estimate
func calculateFeeSpeeds(
minFee *big.Int,
estimate *big.Int,
Expand Down
6 changes: 2 additions & 4 deletions plugin/evm/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ const (
defaultPriceOptionFastFeePercentage = uint64(105)
defaultPriceOptionMaxBaseFee = uint64(100 * utils.GWei)
defaultPriceOptionMaxTip = uint64(20 * utils.GWei)

minAllowedBaseFee = etna.MinBaseFee
)

var (
Expand Down Expand Up @@ -374,8 +372,8 @@ func (c *Config) Validate(networkID uint32) error {
return fmt.Errorf("push-gossip-percent-stake is %f but must be in the range [0, 1]", c.PushGossipPercentStake)
}

if c.PriceOptionMaxBaseFee < minAllowedBaseFee {
return fmt.Errorf("max base fee %d is less than the minimum base fee %d", c.PriceOptionMaxBaseFee, minAllowedBaseFee)
if c.PriceOptionMaxBaseFee < etna.MinBaseFee {
return fmt.Errorf("max base fee %d is less than the minimum base fee %d", c.PriceOptionMaxBaseFee, etna.MinBaseFee)
}
return nil
}
Expand Down

0 comments on commit a5e6a4e

Please sign in to comment.