From bc209cadabbedbefc31f0a9846cd95d2039b971b Mon Sep 17 00:00:00 2001 From: Justin Traglia <95511699+jtraglia@users.noreply.github.com> Date: Wed, 23 Jul 2025 08:35:27 -0500 Subject: [PATCH] Use `MinEpochsForDataColumnSidecarsRequest` in `WithinDAPeriod` for Fulu (#15522) * Use MinEpochsForDataColumnSidecarsRequest in WithinDAPeriod for Fulu * Make fixes * Add blank line --- beacon-chain/blockchain/process_block.go | 3 +-- changelog/jtraglia_update-within-da-period.md | 3 +++ config/params/config.go | 6 +++++- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 changelog/jtraglia_update-within-da-period.md diff --git a/beacon-chain/blockchain/process_block.go b/beacon-chain/blockchain/process_block.go index c74e5efe67..607633e843 100644 --- a/beacon-chain/blockchain/process_block.go +++ b/beacon-chain/blockchain/process_block.go @@ -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 } diff --git a/changelog/jtraglia_update-within-da-period.md b/changelog/jtraglia_update-within-da-period.md new file mode 100644 index 0000000000..2879a0aa25 --- /dev/null +++ b/changelog/jtraglia_update-within-da-period.md @@ -0,0 +1,3 @@ +### Fixed + +- Use `MinEpochsForDataColumnSidecarsRequest` in `WithinDAPeriod` when in Fulu diff --git a/config/params/config.go b/config/params/config.go index ff777832f4..e05ea531cd 100644 --- a/config/params/config.go +++ b/config/params/config.go @@ -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 }