diff --git a/consensus/misc/eip4844/eip4844.go b/consensus/misc/eip4844/eip4844.go index 10bc48d9c8..632f6c9d90 100644 --- a/consensus/misc/eip4844/eip4844.go +++ b/consensus/misc/eip4844/eip4844.go @@ -76,8 +76,14 @@ func CalcExcessBlobGas(config *params.ChainConfig, parent *types.Header, headTim if excessBlobGas < targetGas { return 0 } - if config.IsOsaka(new(big.Int).Add(parent.Number, big.NewInt(1)), headTimestamp) { - return excessBlobGas / 3 + + isOsaka := config.IsOsaka(new(big.Int).Add(parent.Number, big.NewInt(1)), headTimestamp) + if isOsaka { + executionBaseFeePaid := new(big.Int).Mul(parent.BaseFee, big.NewInt(int64(params.TxGas))) + blobBaseFeePaid := new(big.Int).Mul(big.NewInt(int64(targetGas)), CalcBlobFee(config, parent)) + if executionBaseFeePaid.Cmp(blobBaseFeePaid) > 0 { + return excessBlobGas / 3 + } } return excessBlobGas - targetGas }