mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +00:00
Ignored sync jobs 2 (#3317)
## Issue Addressed Duplicate of #3269. Making this since @divagant-martian opened the previous PR and she can't approve her own PR 😄 Co-authored-by: Diva M <divma@protonmail.com>
This commit is contained in:
@@ -117,7 +117,7 @@ pub enum SyncMessage<T: EthSpec> {
|
||||
/// Block processed
|
||||
BlockProcessed {
|
||||
process_type: BlockProcessType,
|
||||
result: Result<(), BlockError<T>>,
|
||||
result: BlockProcessResult<T>,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -128,6 +128,13 @@ pub enum BlockProcessType {
|
||||
ParentLookup { chain_hash: Hash256 },
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum BlockProcessResult<T: EthSpec> {
|
||||
Ok,
|
||||
Err(BlockError<T>),
|
||||
Ignored,
|
||||
}
|
||||
|
||||
/// The result of processing multiple blocks (a chain segment).
|
||||
#[derive(Debug)]
|
||||
pub enum BatchProcessResult {
|
||||
@@ -620,3 +627,18 @@ impl<T: BeaconChainTypes> SyncManager<T> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<IgnoredOkVal, T: EthSpec> From<Result<IgnoredOkVal, BlockError<T>>> for BlockProcessResult<T> {
|
||||
fn from(result: Result<IgnoredOkVal, BlockError<T>>) -> Self {
|
||||
match result {
|
||||
Ok(_) => BlockProcessResult::Ok,
|
||||
Err(e) => e.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: EthSpec> From<BlockError<T>> for BlockProcessResult<T> {
|
||||
fn from(e: BlockError<T>) -> Self {
|
||||
BlockProcessResult::Err(e)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user