From fda7b5a7e8cf70e0090193e8b2d49cc90b14e17a Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Fri, 2 May 2025 19:42:15 +0800 Subject: [PATCH] fix it --- consensus/misc/eip4844/eip4844.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 }