diff --git a/beacon_node/network/src/sync/block_lookups/common.rs b/beacon_node/network/src/sync/block_lookups/common.rs index 78b10473d..d989fbb33 100644 --- a/beacon_node/network/src/sync/block_lookups/common.rs +++ b/beacon_node/network/src/sync/block_lookups/common.rs @@ -101,11 +101,10 @@ pub trait RequestState { fn build_request_and_send( &mut self, id: Id, - already_downloaded: bool, cx: &SyncNetworkContext, ) -> Result<(), LookupRequestError> { // Check if request is necessary. - if already_downloaded || !matches!(self.get_state().state, State::AwaitingDownload) { + if !matches!(self.get_state().state, State::AwaitingDownload) { return Ok(()); } diff --git a/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs b/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs index 59931fadd..8c60621f1 100644 --- a/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs +++ b/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs @@ -114,19 +114,18 @@ impl SingleBlockLookup { &mut self, cx: &SyncNetworkContext, ) -> Result<(), LookupRequestError> { - let block_root = self.block_root(); let block_already_downloaded = self.block_already_downloaded(); let blobs_already_downloaded = self.blobs_already_downloaded(); - if block_already_downloaded && blobs_already_downloaded { - trace!(cx.log, "Lookup request already completed"; "block_root"=> ?block_root); - return Ok(()); + if !block_already_downloaded { + self.block_request_state + .build_request_and_send(self.id, cx)?; } - let id = self.id; - self.block_request_state - .build_request_and_send(id, block_already_downloaded, cx)?; - self.blob_request_state - .build_request_and_send(id, blobs_already_downloaded, cx) + if !blobs_already_downloaded { + self.blob_request_state + .build_request_and_send(self.id, cx)?; + } + Ok(()) } /// Returns a `CachedChild`, which is a wrapper around a `RpcBlock` that is either: