Add more info about why lookup is in AwaitingDownload (#5838)

* Add more info about why lookup is in AwaitingDownload

* Review comments

* Merge branch 'unstable' into awaiting-download-context

* Merge branch 'unstable' of https://github.com/sigp/lighthouse into awaiting-download-context

* cargo fmt
This commit is contained in:
Lion - dapplion
2024-05-28 04:48:37 +02:00
committed by GitHub
parent 7f8b600f2a
commit 6a7305a487
2 changed files with 30 additions and 15 deletions

View File

@@ -105,7 +105,7 @@ pub enum LookupRequestResult {
/// that makes progress on the request. For example: request is processing from a different
/// source (i.e. block received from gossip) and sync MUST receive an event with that processing
/// result.
Pending,
Pending(&'static str),
}
/// Wraps a Network channel to employ various RPC related network functionality for the Sync manager. This includes management of a global RPC request Id.
@@ -342,7 +342,9 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
BlockProcessStatus::Unknown => {}
// Block is known are currently processing, expect a future event with the result of
// processing.
BlockProcessStatus::NotValidated { .. } => return Ok(LookupRequestResult::Pending),
BlockProcessStatus::NotValidated { .. } => {
return Ok(LookupRequestResult::Pending("block in processing cache"))
}
// Block is fully validated. If it's not yet imported it's waiting for missing block
// components. Consider this request completed and do nothing.
BlockProcessStatus::ExecutionValidated { .. } => {
@@ -406,7 +408,7 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
// latter handle the case where if the peer sent no blobs, penalize.
// - if `downloaded_block_expected_blobs` is Some = block is downloading or processing.
// - if `num_expected_blobs` returns Some = block is processed.
return Ok(LookupRequestResult::Pending);
return Ok(LookupRequestResult::Pending("waiting for block download"));
};
let imported_blob_indexes = self