mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
consensus/misc/eip4844: update
This commit is contained in:
parent
f21a1e9781
commit
660bbee5d4
1 changed files with 4 additions and 2 deletions
|
|
@ -80,12 +80,14 @@ func CalcExcessBlobGas(config *params.ChainConfig, parent *types.Header, headTim
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
if !config.IsOsaka(config.LondonBlock, headTimestamp) {
|
if !config.IsOsaka(config.LondonBlock, headTimestamp) {
|
||||||
|
// Pre-Osaka, we use the formula defined by EIP-4844.
|
||||||
return excessBlobGas - targetGas
|
return excessBlobGas - targetGas
|
||||||
}
|
}
|
||||||
|
|
||||||
// EIP-7918 (post-Osaka).
|
// EIP-7918 (post-Osaka) introduces a different formula for computing excess.
|
||||||
var (
|
var (
|
||||||
reservePrice = new(big.Int).Mul(parent.BaseFee, big.NewInt(params.BlobBaseCost))
|
baseCost = big.NewInt(params.BlobBaseCost)
|
||||||
|
reservePrice = baseCost.Mul(baseCost, parent.BaseFee)
|
||||||
blobPrice = calcBlobPrice(config, parent)
|
blobPrice = calcBlobPrice(config, parent)
|
||||||
)
|
)
|
||||||
if reservePrice.Cmp(blobPrice) > 0 {
|
if reservePrice.Cmp(blobPrice) > 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue