consensus/misc/eip4844: expose TargetBlobsPerBlock (#32991)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

Rollups may want to use these to dynamically adjust blobs posted after
BPO forks.
This commit is contained in:
Tristan-Wilson 2025-11-10 09:38:28 +01:00 committed by GitHub
parent ebc7dc9e37
commit 7755ee3e4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -200,6 +200,15 @@ func LatestMaxBlobsPerBlock(cfg *params.ChainConfig) int {
return bcfg.Max
}
// TargetBlobsPerBlock returns the target blobs per block for a block at the given timestamp.
func TargetBlobsPerBlock(cfg *params.ChainConfig, time uint64) int {
blobConfig := latestBlobConfig(cfg, time)
if blobConfig == nil {
return 0
}
return blobConfig.Target
}
// fakeExponential approximates factor * e ** (numerator / denominator) using
// Taylor expansion.
func fakeExponential(factor, numerator, denominator *big.Int) *big.Int {