From 100f33a223ab265e1b030e3d47f3773f181dd5b1 Mon Sep 17 00:00:00 2001 From: Lion - dapplion <35266934+dapplion@users.noreply.github.com> Date: Fri, 30 Aug 2024 04:20:29 +0200 Subject: [PATCH] Remove duplicate should_fetch_blobs check in sync lookup (#6318) * Remove duplicate should_fetch_blobs check in sync lookup --- .../network/src/sync/network_context.rs | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/beacon_node/network/src/sync/network_context.rs b/beacon_node/network/src/sync/network_context.rs index 3da6f92cfed..333c770bd91 100644 --- a/beacon_node/network/src/sync/network_context.rs +++ b/beacon_node/network/src/sync/network_context.rs @@ -28,7 +28,6 @@ use rand::thread_rng; use requests::ActiveDataColumnsByRootRequest; pub use requests::LookupVerifyError; use slog::{debug, error, warn}; -use slot_clock::SlotClock; use std::collections::hash_map::Entry; use std::collections::HashMap; use std::sync::Arc; @@ -595,21 +594,6 @@ impl SyncNetworkContext { block_root: Hash256, downloaded_block: Option>>, ) -> Result { - // Check if we are into deneb, and before peerdas - if !self - .chain - .data_availability_checker - .blobs_required_for_epoch( - // TODO(das): use the block's slot - self.chain - .slot_clock - .now_or_genesis() - .ok_or(RpcRequestSendError::SlotClockError)? - .epoch(T::EthSpec::slots_per_epoch()), - ) - { - return Ok(LookupRequestResult::NoRequestNeeded); - } let Some(block) = downloaded_block.or_else(|| { // If the block is already being processed or fully validated, retrieve how many blobs // it expects. Consider any stage of the block. If the block root has been validated, we @@ -637,7 +621,7 @@ impl SyncNetworkContext { let expected_blobs = block.num_expected_blobs(); let block_epoch = block.slot().epoch(T::EthSpec::slots_per_epoch()); - // Check if we are into peerdas + // Check if we are in deneb, before peerdas and inside da window if !self.chain.should_fetch_blobs(block_epoch) { return Ok(LookupRequestResult::NoRequestNeeded); } @@ -750,7 +734,7 @@ impl SyncNetworkContext { let expected_blobs = block.num_expected_blobs(); let block_epoch = block.slot().epoch(T::EthSpec::slots_per_epoch()); - // Check if we are into peerdas + // Check if we are into peerdas and inside da window if !self.chain.should_fetch_custody_columns(block_epoch) { return Ok(LookupRequestResult::NoRequestNeeded); }