Add sync lookup custody request state (#6257)

* Add sync lookup custody request state

* Review PR

* clippy

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into peerdas-network-lookup
This commit is contained in:
Lion - dapplion
2024-08-15 18:26:39 +02:00
committed by GitHub
parent 5169e03721
commit 9fc0a662c3
9 changed files with 239 additions and 34 deletions

View File

@@ -6852,6 +6852,24 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
self.data_availability_checker.data_availability_boundary()
}
/// Returns true if epoch is within the data availability boundary
pub fn da_check_required_for_epoch(&self, epoch: Epoch) -> bool {
self.data_availability_checker
.da_check_required_for_epoch(epoch)
}
/// Returns true if we should fetch blobs for this block
pub fn should_fetch_blobs(&self, block_epoch: Epoch) -> bool {
self.da_check_required_for_epoch(block_epoch)
&& !self.spec.is_peer_das_enabled_for_epoch(block_epoch)
}
/// Returns true if we should fetch custody columns for this block
pub fn should_fetch_custody_columns(&self, block_epoch: Epoch) -> bool {
self.da_check_required_for_epoch(block_epoch)
&& self.spec.is_peer_das_enabled_for_epoch(block_epoch)
}
pub fn logger(&self) -> &Logger {
&self.log
}