mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-20 06:18:31 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user