From 2585776aabbd4ae9b00050403b42afb0cee968ec Mon Sep 17 00:00:00 2001 From: James Date: Thu, 27 Feb 2025 07:24:14 +1300 Subject: [PATCH] eth/gasprice: fix eth_feeHistory blobGasRatio (#31246) This change divides BlobGasUsed by MaxBlobGasPerBlock instead of MaxBlobsPerBlock. Dividing by MaxBlobsPerBlock meant the blobGasUsedRatio was an incorrect large number. This bug was introduced by a typo [here](https://github.com/ethereum/go-ethereum/commit/e6f3ce7b168b8f346de621a8f60d2fa57c2ebfb0#diff-3357b2399699d7cf954c543cbfb02ff442eb24491e55f5e813e3cc85829b3e8dR110) Fixes https://github.com/ethereum/go-ethereum/issues/31245 --- eth/gasprice/feehistory.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/gasprice/feehistory.go b/eth/gasprice/feehistory.go index fe84950c50..59830e9fe8 100644 --- a/eth/gasprice/feehistory.go +++ b/eth/gasprice/feehistory.go @@ -107,8 +107,8 @@ func (oracle *Oracle) processBlock(bf *blockFees, percentiles []float64) { // Compute gas used ratio for normal and blob gas. bf.results.gasUsedRatio = float64(bf.header.GasUsed) / float64(bf.header.GasLimit) if blobGasUsed := bf.header.BlobGasUsed; blobGasUsed != nil { - maxBlobs := eip4844.MaxBlobsPerBlock(config, bf.header.Time) - bf.results.blobGasUsedRatio = float64(*blobGasUsed) / float64(maxBlobs) + maxBlobGas := eip4844.MaxBlobGasPerBlock(config, bf.header.Time) + bf.results.blobGasUsedRatio = float64(*blobGasUsed) / float64(maxBlobGas) } if len(percentiles) == 0 {