diff --git a/consensus/dummy/dynamic_fees.go b/consensus/dummy/dynamic_fees.go index e6f957cc5a..9898e8f27b 100644 --- a/consensus/dummy/dynamic_fees.go +++ b/consensus/dummy/dynamic_fees.go @@ -97,11 +97,12 @@ func CalcBaseFee(config *params.ChainConfig, feeConfig commontype.FeeConfig, par // If [timestamp] is less than the timestamp of [parent], then it uses the same timestamp as parent. // Warning: This function should only be used in estimation and should not be used when calculating the canonical // base fee for a subsequent block. -func EstimateNextBaseFee(config *params.ChainConfig, feeConfig commontype.FeeConfig, parent *types.Header, timestamp uint64) ([]byte, *big.Int, error) { +func EstimateNextBaseFee(config *params.ChainConfig, feeConfig commontype.FeeConfig, parent *types.Header, timestamp uint64) (*big.Int, error) { if timestamp < parent.Time { timestamp = parent.Time } - return CalcBaseFee(config, feeConfig, parent, timestamp) + _, baseFee, err := CalcBaseFee(config, feeConfig, parent, timestamp) + return baseFee, err } // selectBigWithinBounds returns [value] if it is within the bounds: diff --git a/core/txpool/blobpool/blobpool.go b/core/txpool/blobpool/blobpool.go index 470a2b4e39..3dc6ab8439 100644 --- a/core/txpool/blobpool/blobpool.go +++ b/core/txpool/blobpool/blobpool.go @@ -415,7 +415,7 @@ func (p *BlobPool) Init(gasTip uint64, head *types.Header, reserve txpool.Addres p.Close() return err } - _, baseFee, err := dummy.EstimateNextBaseFee( + baseFee, err := dummy.EstimateNextBaseFee( p.chain.Config(), feeConfig, p.head, @@ -851,7 +851,7 @@ func (p *BlobPool) Reset(oldHead, newHead *types.Header) { log.Error("Failed to get fee config to reset blobpool fees", "err", err) return } - _, baseFeeBig, err := dummy.EstimateNextBaseFee( + baseFeeBig, err := dummy.EstimateNextBaseFee( p.chain.Config(), feeConfig, p.head, diff --git a/core/txpool/legacypool/legacypool.go b/core/txpool/legacypool/legacypool.go index 11256937db..47ddf2632b 100644 --- a/core/txpool/legacypool/legacypool.go +++ b/core/txpool/legacypool/legacypool.go @@ -1834,7 +1834,7 @@ func (pool *LegacyPool) updateBaseFeeAt(head *types.Header) error { if err != nil { return err } - _, baseFeeEstimate, err := dummy.EstimateNextBaseFee(pool.chainconfig, feeConfig, head, uint64(time.Now().Unix())) + baseFeeEstimate, err := dummy.EstimateNextBaseFee(pool.chainconfig, feeConfig, head, uint64(time.Now().Unix())) if err != nil { return err } diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index 899c2eba0e..818c4623f1 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -268,8 +268,7 @@ func (oracle *Oracle) estimateNextBaseFee(ctx context.Context) (*big.Int, error) // If the block does have a baseFee, calculate the next base fee // based on the current time and add it to the tip to estimate the // total gas price estimate. - _, nextBaseFee, err := dummy.EstimateNextBaseFee(oracle.backend.ChainConfig(), feeConfig, header, oracle.clock.Unix()) - return nextBaseFee, err + return dummy.EstimateNextBaseFee(oracle.backend.ChainConfig(), feeConfig, header, oracle.clock.Unix()) } // SuggestPrice returns an estimated price for legacy transactions.