mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 18:21:45 +00:00
Beta compiler fix (#5659)
* fix beta compiler compilation * remove unused import * Revert "remove unused import" This reverts commit0bef36b05b. * Revert "fix beta compiler compilation" This reverts commit23152cf4cc. * rename ununsed fields * allow dead code on some error variants * remove unused blob download queue * add back debug to backfill error * more allow dead code on errors
This commit is contained in:
@@ -87,16 +87,17 @@ pub enum ProcessResult {
|
||||
}
|
||||
|
||||
/// The ways a backfill sync can fail.
|
||||
// The info in the enum variants is displayed in logging, clippy thinks it's dead code.
|
||||
#[derive(Debug)]
|
||||
pub enum BackFillError {
|
||||
/// A batch failed to be downloaded.
|
||||
BatchDownloadFailed(BatchId),
|
||||
BatchDownloadFailed(#[allow(dead_code)] BatchId),
|
||||
/// A batch could not be processed.
|
||||
BatchProcessingFailed(BatchId),
|
||||
BatchProcessingFailed(#[allow(dead_code)] BatchId),
|
||||
/// A batch entered an invalid state.
|
||||
BatchInvalidState(BatchId, String),
|
||||
BatchInvalidState(#[allow(dead_code)] BatchId, #[allow(dead_code)] String),
|
||||
/// The sync algorithm entered an invalid state.
|
||||
InvalidSyncState(String),
|
||||
InvalidSyncState(#[allow(dead_code)] String),
|
||||
/// The chain became paused.
|
||||
Paused,
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ impl<T: BeaconChainTypes> RequestState<T> for BlockRequestState {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: BeaconChainTypes> RequestState<T> for BlobRequestState<T::EthSpec> {
|
||||
impl<T: BeaconChainTypes> RequestState<T> for BlobRequestState {
|
||||
type RequestType = BlobsByRootSingleBlockRequest;
|
||||
type VerifiedResponseType = FixedBlobSidecarList<T::EthSpec>;
|
||||
type ReconstructedResponseType = FixedBlobSidecarList<T::EthSpec>;
|
||||
|
||||
@@ -18,7 +18,6 @@ use std::fmt::Debug;
|
||||
use std::sync::Arc;
|
||||
use store::Hash256;
|
||||
use strum::IntoStaticStr;
|
||||
use types::blob_sidecar::FixedBlobSidecarList;
|
||||
use types::EthSpec;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, IntoStaticStr)]
|
||||
@@ -37,7 +36,7 @@ pub struct SingleBlockLookup<T: BeaconChainTypes> {
|
||||
pub id: Id,
|
||||
pub lookup_type: LookupType,
|
||||
pub block_request_state: BlockRequestState,
|
||||
pub blob_request_state: BlobRequestState<T::EthSpec>,
|
||||
pub blob_request_state: BlobRequestState,
|
||||
pub da_checker: Arc<DataAvailabilityChecker<T>>,
|
||||
/// Only necessary for requests triggered by an `UnknownBlockParent` or `UnknownBlockParent`
|
||||
/// because any blocks or blobs without parents won't hit the data availability cache.
|
||||
@@ -304,24 +303,21 @@ impl<T: BeaconChainTypes> SingleBlockLookup<T> {
|
||||
}
|
||||
|
||||
/// The state of the blob request component of a `SingleBlockLookup`.
|
||||
pub struct BlobRequestState<E: EthSpec> {
|
||||
pub struct BlobRequestState {
|
||||
/// The latest picture of which blobs still need to be requested. This includes information
|
||||
/// from both block/blobs downloaded in the network layer and any blocks/blobs that exist in
|
||||
/// the data availability checker.
|
||||
pub requested_ids: MissingBlobs,
|
||||
pub block_root: Hash256,
|
||||
/// Where we store blobs until we receive the stream terminator.
|
||||
pub blob_download_queue: FixedBlobSidecarList<E>,
|
||||
pub state: SingleLookupRequestState,
|
||||
}
|
||||
|
||||
impl<E: EthSpec> BlobRequestState<E> {
|
||||
impl BlobRequestState {
|
||||
pub fn new(block_root: Hash256, peer_source: &[PeerId], is_deneb: bool) -> Self {
|
||||
let default_ids = MissingBlobs::new_without_block(block_root, is_deneb);
|
||||
Self {
|
||||
block_root,
|
||||
requested_ids: default_ids,
|
||||
blob_download_queue: <_>::default(),
|
||||
state: SingleLookupRequestState::new(peer_source),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -627,7 +627,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
|
||||
),
|
||||
BlockProcessType::SingleBlob { id } => self
|
||||
.block_lookups
|
||||
.single_block_component_processed::<BlobRequestState<T::EthSpec>>(
|
||||
.single_block_component_processed::<BlobRequestState>(
|
||||
id,
|
||||
result,
|
||||
&mut self.network,
|
||||
@@ -908,7 +908,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
|
||||
Ok((blobs, seen_timestamp)) => match id.lookup_type {
|
||||
LookupType::Current => self
|
||||
.block_lookups
|
||||
.single_lookup_response::<BlobRequestState<T::EthSpec>>(
|
||||
.single_lookup_response::<BlobRequestState>(
|
||||
id,
|
||||
peer_id,
|
||||
blobs,
|
||||
@@ -917,7 +917,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
|
||||
),
|
||||
LookupType::Parent => self
|
||||
.block_lookups
|
||||
.parent_lookup_response::<BlobRequestState<T::EthSpec>>(
|
||||
.parent_lookup_response::<BlobRequestState>(
|
||||
id,
|
||||
peer_id,
|
||||
blobs,
|
||||
@@ -929,20 +929,20 @@ impl<T: BeaconChainTypes> SyncManager<T> {
|
||||
Err(error) => match id.lookup_type {
|
||||
LookupType::Current => self
|
||||
.block_lookups
|
||||
.single_block_lookup_failed::<BlobRequestState<T::EthSpec>>(
|
||||
.single_block_lookup_failed::<BlobRequestState>(
|
||||
id,
|
||||
&peer_id,
|
||||
&mut self.network,
|
||||
error,
|
||||
),
|
||||
LookupType::Parent => self
|
||||
.block_lookups
|
||||
.parent_lookup_failed::<BlobRequestState<T::EthSpec>>(
|
||||
LookupType::Parent => {
|
||||
self.block_lookups.parent_lookup_failed::<BlobRequestState>(
|
||||
id,
|
||||
&peer_id,
|
||||
&mut self.network,
|
||||
error,
|
||||
),
|
||||
)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user