Use MinEpochsForDataColumnSidecarsRequest in WithinDAPeriod for Fulu (#15522)

* Use MinEpochsForDataColumnSidecarsRequest in WithinDAPeriod for Fulu

* Make fixes

* Add blank line
This commit is contained in:
Justin Traglia
2025-07-23 08:35:27 -05:00
committed by GitHub
parent 856742ff68
commit bc209cadab
3 changed files with 9 additions and 3 deletions

View File

@@ -666,10 +666,9 @@ func (s *Service) areDataColumnsAvailable(
root [fieldparams.RootLength]byte,
block interfaces.ReadOnlyBeaconBlock,
) error {
// We are only required to check within MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS
// We are only required to check within MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS.
blockSlot, currentSlot := block.Slot(), s.CurrentSlot()
blockEpoch, currentEpoch := slots.ToEpoch(blockSlot), slots.ToEpoch(currentSlot)
if !params.WithinDAPeriod(blockEpoch, currentEpoch) {
return nil
}

View File

@@ -0,0 +1,3 @@
### Fixed
- Use `MinEpochsForDataColumnSidecarsRequest` in `WithinDAPeriod` when in Fulu

View File

@@ -498,7 +498,11 @@ func FuluEnabled() bool {
return BeaconConfig().FuluForkEpoch < math.MaxUint64
}
// WithinDAPeriod checks if the block epoch is within MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS of the given current epoch.
// WithinDAPeriod checks if the block epoch is within the data availability retention period.
func WithinDAPeriod(block, current primitives.Epoch) bool {
if block >= BeaconConfig().FuluForkEpoch {
return block+BeaconConfig().MinEpochsForDataColumnSidecarsRequest >= current
}
return block+BeaconConfig().MinEpochsForBlobsSidecarsRequest >= current
}