Skip to content

Commit 1b49bf5

Browse files
eth/gasprice: fix eth_feeHistory blobGasRatio (ethereum#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](ethereum@e6f3ce7#diff-3357b2399699d7cf954c543cbfb02ff442eb24491e55f5e813e3cc85829b3e8dR110) Fixes ethereum#31245
1 parent d964a54 commit 1b49bf5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

eth/gasprice/feehistory.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ func (oracle *Oracle) processBlock(bf *blockFees, percentiles []float64) {
107107
// Compute gas used ratio for normal and blob gas.
108108
bf.results.gasUsedRatio = float64(bf.header.GasUsed) / float64(bf.header.GasLimit)
109109
if blobGasUsed := bf.header.BlobGasUsed; blobGasUsed != nil {
110-
maxBlobs := eip4844.MaxBlobsPerBlock(config, bf.header.Time)
111-
bf.results.blobGasUsedRatio = float64(*blobGasUsed) / float64(maxBlobs)
110+
maxBlobGas := eip4844.MaxBlobGasPerBlock(config, bf.header.Time)
111+
bf.results.blobGasUsedRatio = float64(*blobGasUsed) / float64(maxBlobGas)
112112
}
113113

114114
if len(percentiles) == 0 {

0 commit comments

Comments
 (0)