mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 04:48:21 +00:00
wrap availability check error
This commit is contained in:
@@ -535,7 +535,8 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
||||
| ParentVerifyError::UnrequestedBlobId
|
||||
| ParentVerifyError::ExtraBlobsReturned
|
||||
| ParentVerifyError::InvalidIndex(_)
|
||||
| ParentVerifyError::AvailabilityCheck => {
|
||||
//TODO(sean) treat this differntly?
|
||||
| ParentVerifyError::AvailabilityCheck(_) => {
|
||||
let e = e.into();
|
||||
warn!(self.log, "Peer sent invalid response to parent request.";
|
||||
"peer_id" => %peer_id, "reason" => %e);
|
||||
@@ -629,7 +630,8 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
||||
| ParentVerifyError::UnrequestedBlobId
|
||||
| ParentVerifyError::ExtraBlobsReturned
|
||||
| ParentVerifyError::InvalidIndex(_)
|
||||
| ParentVerifyError::AvailabilityCheck => {
|
||||
//TODO(sean) treat differently?
|
||||
| ParentVerifyError::AvailabilityCheck(_) => {
|
||||
let e = e.into();
|
||||
warn!(self.log, "Peer sent invalid response to parent request.";
|
||||
"peer_id" => %peer_id, "reason" => %e);
|
||||
|
||||
@@ -45,7 +45,7 @@ pub enum ParentVerifyError {
|
||||
ExtraBlobsReturned,
|
||||
InvalidIndex(u64),
|
||||
PreviousFailure { parent_root: Hash256 },
|
||||
AvailabilityCheck,
|
||||
AvailabilityCheck(String),
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
@@ -357,7 +357,7 @@ impl From<LookupVerifyError> for ParentVerifyError {
|
||||
E::UnrequestedBlobId => ParentVerifyError::UnrequestedBlobId,
|
||||
E::ExtraBlobsReturned => ParentVerifyError::ExtraBlobsReturned,
|
||||
E::InvalidIndex(index) => ParentVerifyError::InvalidIndex(index),
|
||||
E::AvailabilityCheck => ParentVerifyError::AvailabilityCheck,
|
||||
E::AvailabilityCheck(e) => ParentVerifyError::AvailabilityCheck(e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ pub enum LookupVerifyError {
|
||||
UnrequestedBlobId,
|
||||
ExtraBlobsReturned,
|
||||
InvalidIndex(u64),
|
||||
AvailabilityCheck, //TODO(sean) wrap the underlying error
|
||||
AvailabilityCheck(String),
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, IntoStaticStr)]
|
||||
@@ -120,7 +120,7 @@ impl<const MAX_ATTEMPTS: u8, T: BeaconChainTypes> SingleBlockLookup<MAX_ATTEMPTS
|
||||
Err(AvailabilityCheckError::MissingBlobs) => {
|
||||
Ok(LookupDownloadStatus::SearchBlock(block_root))
|
||||
}
|
||||
Err(_e) => Err(LookupVerifyError::AvailabilityCheck),
|
||||
Err(e) => Err(LookupVerifyError::AvailabilityCheck(format!("{e:?}"))),
|
||||
}
|
||||
} else {
|
||||
Ok(LookupDownloadStatus::SearchBlock(block_root))
|
||||
@@ -148,7 +148,7 @@ impl<const MAX_ATTEMPTS: u8, T: BeaconChainTypes> SingleBlockLookup<MAX_ATTEMPTS
|
||||
Err(AvailabilityCheckError::MissingBlobs) => {
|
||||
Ok(LookupDownloadStatus::SearchBlock(block_root))
|
||||
}
|
||||
Err(_e) => Err(LookupVerifyError::AvailabilityCheck),
|
||||
Err(e) => Err(LookupVerifyError::AvailabilityCheck(format!("{e:?}"))),
|
||||
}
|
||||
} else {
|
||||
Ok(LookupDownloadStatus::SearchBlock(block_root))
|
||||
@@ -171,7 +171,7 @@ impl<const MAX_ATTEMPTS: u8, T: BeaconChainTypes> SingleBlockLookup<MAX_ATTEMPTS
|
||||
Err(AvailabilityCheckError::MissingBlobs) => {
|
||||
Ok(LookupDownloadStatus::SearchBlock(block_root))
|
||||
}
|
||||
Err(_e) => Err(LookupVerifyError::AvailabilityCheck),
|
||||
Err(e) => Err(LookupVerifyError::AvailabilityCheck(format!("{e:?}"))),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user