mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 04:48:21 +00:00
lots of refactoring
This commit is contained in:
@@ -511,7 +511,7 @@ impl<T: EthSpec> TryInto<AvailableBlock<T>> for MaybeAvailableBlock<T> {
|
||||
fn try_into(self) -> Result<AvailableBlock<T>, Self::Error> {
|
||||
match self {
|
||||
Self::Available(block) => Ok(block),
|
||||
Self::AvailabilityPending(block) => Err(AvailabilityCheckError::MissingBlobs),
|
||||
Self::AvailabilityPending(_block) => Err(AvailabilityCheckError::MissingBlobs),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,7 +312,9 @@ pub enum BlockError<T: EthSpec> {
|
||||
ParentExecutionPayloadInvalid {
|
||||
parent_root: Hash256,
|
||||
},
|
||||
/// The blob alone failed validation.
|
||||
BlobValidation(BlobError<T>),
|
||||
/// The block and blob together failed validation.
|
||||
AvailabilityCheck(AvailabilityCheckError),
|
||||
MissingBlockParts(Slot, Hash256),
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ pub enum AvailabilityCheckError {
|
||||
SszTypes(ssz_types::Error),
|
||||
MissingBlobs,
|
||||
NumBlobsMismatch {
|
||||
/// The peer sent us an invalid block, we must penalise harshly.
|
||||
num_kzg_commitments: usize,
|
||||
num_blobs: usize,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user