diff --git a/core/types/dynamic_fee_tx.go b/core/types/dynamic_fee_tx.go index 4b040e7e867..08d15f94b42 100644 --- a/core/types/dynamic_fee_tx.go +++ b/core/types/dynamic_fee_tx.go @@ -49,7 +49,7 @@ func (tx DynamicFeeTransaction) GetEffectiveGasTip(baseFee *uint256.Int) *uint25 if gasFeeCap.Lt(baseFee) { return uint256.NewInt(0) } - effectiveFee := gasFeeCap.Sub(gasFeeCap, baseFee) + effectiveFee := new(uint256.Int).Sub(gasFeeCap, baseFee) if tx.GetTip().Lt(effectiveFee) { return tx.GetTip() } else { diff --git a/core/types/legacy_tx.go b/core/types/legacy_tx.go index 9cb478fe06e..36f8566d815 100644 --- a/core/types/legacy_tx.go +++ b/core/types/legacy_tx.go @@ -77,7 +77,7 @@ func (tx LegacyTx) GetEffectiveGasTip(baseFee *uint256.Int) *uint256.Int { if gasFeeCap.Lt(baseFee) { return uint256.NewInt(0) } - effectiveFee := gasFeeCap.Sub(gasFeeCap, baseFee) + effectiveFee := new(uint256.Int).Sub(gasFeeCap, baseFee) if tx.GetTip().Lt(effectiveFee) { return tx.GetTip() } else { diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index e102297e98a..f673d8f150e 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -152,6 +152,9 @@ func (gpo *Oracle) SuggestPrice(ctx context.Context) (*big.Int, error) { if price.Cmp(gpo.maxPrice) > 0 { price = new(big.Int).Set(gpo.maxPrice) } + if head.BaseFee != nil { + price.Add(price, head.BaseFee) + } gpo.cacheLock.Lock() gpo.lastHead = headHash gpo.lastPrice = price