Skip to content

Commit

Permalink
eth/gasprice: fix eth_feeHistory blobGasRatio (#31246)
Browse files Browse the repository at this point in the history
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](ethereum/go-ethereum@e6f3ce7#diff-3357b2399699d7cf954c543cbfb02ff442eb24491e55f5e813e3cc85829b3e8dR110)

Fixes ethereum/go-ethereum#31245
  • Loading branch information
jamesstanleystewart authored and Donk3ys committed Mar 4, 2025
1 parent 5fa33e4 commit 0ce7bf6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eth/gasprice/feehistory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0ce7bf6

Please sign in to comment.