Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions consensus/types/src/core/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,14 +821,19 @@ impl ChainSpec {

/// Returns the min epoch for blob / data column sidecar requests based on the current epoch.
/// Switch to use the column sidecar config once the `blob_retention_epoch` has passed Fulu fork epoch.
/// Never uses the `blob_retention_epoch` for networks that started with Fulu enabled.
pub fn min_epoch_data_availability_boundary(&self, current_epoch: Epoch) -> Option<Epoch> {
let fork_epoch = self.deneb_fork_epoch?;
let blob_retention_epoch =
current_epoch.saturating_sub(self.min_epochs_for_blob_sidecars_requests);
match self.fulu_fork_epoch {
Some(fulu_fork_epoch) if blob_retention_epoch > fulu_fork_epoch => Some(
current_epoch.saturating_sub(self.min_epochs_for_data_column_sidecars_requests),
),
Some(fulu_fork_epoch)
if blob_retention_epoch > fulu_fork_epoch || fulu_fork_epoch == Epoch::new(0) =>
{
Some(
current_epoch.saturating_sub(self.min_epochs_for_data_column_sidecars_requests),
)
}
_ => Some(std::cmp::max(fork_epoch, blob_retention_epoch)),
}
}
Expand Down