Dynamic max blobs config (#14911)

* fixing max config helpers to use dynamic values instead of static ones

* changelog
This commit is contained in:
james-prysm
2025-02-11 09:04:22 -06:00
committed by GitHub
parent 8c4ea850ba
commit 0584746815
2 changed files with 5 additions and 2 deletions

View File

@@ -0,0 +1,3 @@
### Fixed
- fixed max and target blob per block from static to dynamic values

View File

@@ -387,7 +387,7 @@ func (b *BeaconChainConfig) MaximumGossipClockDisparityDuration() time.Duration
// TargetBlobsPerBlock returns the target number of blobs per block for the given slot,
// accounting for changes introduced by the Electra fork.
func (b *BeaconChainConfig) TargetBlobsPerBlock(slot primitives.Slot) int {
if primitives.Epoch(slot.DivSlot(32)) >= b.ElectraForkEpoch {
if primitives.Epoch(slot.DivSlot(b.SlotsPerEpoch)) >= b.ElectraForkEpoch {
return b.DeprecatedTargetBlobsPerBlockElectra
}
return b.DeprecatedMaxBlobsPerBlock / 2
@@ -396,7 +396,7 @@ func (b *BeaconChainConfig) TargetBlobsPerBlock(slot primitives.Slot) int {
// MaxBlobsPerBlock returns the maximum number of blobs per block for the given slot,
// adjusting for the Electra fork.
func (b *BeaconChainConfig) MaxBlobsPerBlock(slot primitives.Slot) int {
if primitives.Epoch(slot.DivSlot(32)) >= b.ElectraForkEpoch {
if primitives.Epoch(slot.DivSlot(b.SlotsPerEpoch)) >= b.ElectraForkEpoch {
return b.DeprecatedMaxBlobsPerBlockElectra
}
return b.DeprecatedMaxBlobsPerBlock