use slot so we dont hit the cache twice

This commit is contained in:
Eitan Seri-Levi
2026-05-01 02:54:57 +02:00
parent 378eaedf9c
commit fd1a8e1564
5 changed files with 38 additions and 30 deletions

View File

@@ -1085,15 +1085,17 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
block_root: Hash256,
lookup_peers: Arc<RwLock<HashSet<PeerId>>>,
) -> Result<LookupRequestResult, RpcRequestSendError> {
let slot = self
.chain
.canonical_head
.fork_choice_read_lock()
.get_block(&block_root)
.map(|block| block.slot)
.unwrap_or_else(|| self.chain.slot().unwrap_or_default());
let custody_indexes_imported = self
.chain
.data_availability_checker
.cached_data_column_indexes(&block_root)
.or_else(|| {
self.chain
.pending_payload_cache
.cached_data_column_indexes(&block_root)
})
.cached_data_column_indexes(&block_root, slot)
.unwrap_or_default();
let current_epoch = self.chain.epoch().map_err(|e| {