mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 07:37:20 +00:00
consensus/misc/eip4844: expose TargetBlobsPerBlock (#32991)
Rollups may want to use these to dynamically adjust blobs posted after BPO forks.
This commit is contained in:
parent
ebc7dc9e37
commit
7755ee3e4f
1 changed files with 9 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue