Check known parent on rpc blob process (#5893)

* Check known parent on rpc blob process

* fix test

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into blob-unknown-parent
This commit is contained in:
Lion - dapplion
2024-09-05 17:24:21 +02:00
committed by GitHub
parent 0e94fe1aa8
commit 369807becc
3 changed files with 40 additions and 13 deletions

View File

@@ -1,4 +1,3 @@
use super::common::ResponseType;
use super::{BlockComponent, PeerId, SINGLE_BLOCK_LOOKUP_MAX_ATTEMPTS};
use crate::sync::block_lookups::common::RequestState;
use crate::sync::network_context::{
@@ -188,7 +187,6 @@ impl<T: BeaconChainTypes> SingleBlockLookup<T> {
.state
.peek_downloaded_data()
.cloned();
let block_is_processed = self.block_request_state.state.is_processed();
let request = R::request_state_mut(self);
// Attempt to progress awaiting downloads
@@ -241,12 +239,7 @@ impl<T: BeaconChainTypes> SingleBlockLookup<T> {
// Otherwise, attempt to progress awaiting processing
// If this request is awaiting a parent lookup to be processed, do not send for processing.
// The request will be rejected with unknown parent error.
//
// TODO: The condition `block_is_processed || Block` can be dropped after checking for
// unknown parent root when import RPC blobs
} else if !awaiting_parent
&& (block_is_processed || matches!(R::response_type(), ResponseType::Block))
{
} else if !awaiting_parent {
// maybe_start_processing returns Some if state == AwaitingProcess. This pattern is
// useful to conditionally access the result data.
if let Some(result) = request.get_state_mut().maybe_start_processing() {