Beta compiler fix (#5659)

* fix beta compiler compilation

* remove unused import

* Revert "remove unused import"

This reverts commit 0bef36b05b.

* Revert "fix beta compiler compilation"

This reverts commit 23152cf4cc.

* 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:
realbigsean
2024-04-29 16:45:54 -04:00
committed by GitHub
parent 40d412629e
commit c33edc82eb
8 changed files with 31 additions and 33 deletions

View File

@@ -87,16 +87,17 @@ pub enum ProcessResult {
} }
/// The ways a backfill sync can fail. /// 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)] #[derive(Debug)]
pub enum BackFillError { pub enum BackFillError {
/// A batch failed to be downloaded. /// A batch failed to be downloaded.
BatchDownloadFailed(BatchId), BatchDownloadFailed(#[allow(dead_code)] BatchId),
/// A batch could not be processed. /// A batch could not be processed.
BatchProcessingFailed(BatchId), BatchProcessingFailed(#[allow(dead_code)] BatchId),
/// A batch entered an invalid state. /// 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. /// The sync algorithm entered an invalid state.
InvalidSyncState(String), InvalidSyncState(#[allow(dead_code)] String),
/// The chain became paused. /// The chain became paused.
Paused, Paused,
} }

View File

@@ -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 RequestType = BlobsByRootSingleBlockRequest;
type VerifiedResponseType = FixedBlobSidecarList<T::EthSpec>; type VerifiedResponseType = FixedBlobSidecarList<T::EthSpec>;
type ReconstructedResponseType = FixedBlobSidecarList<T::EthSpec>; type ReconstructedResponseType = FixedBlobSidecarList<T::EthSpec>;

View File

@@ -18,7 +18,6 @@ use std::fmt::Debug;
use std::sync::Arc; use std::sync::Arc;
use store::Hash256; use store::Hash256;
use strum::IntoStaticStr; use strum::IntoStaticStr;
use types::blob_sidecar::FixedBlobSidecarList;
use types::EthSpec; use types::EthSpec;
#[derive(Debug, PartialEq, Eq, IntoStaticStr)] #[derive(Debug, PartialEq, Eq, IntoStaticStr)]
@@ -37,7 +36,7 @@ pub struct SingleBlockLookup<T: BeaconChainTypes> {
pub id: Id, pub id: Id,
pub lookup_type: LookupType, pub lookup_type: LookupType,
pub block_request_state: BlockRequestState, pub block_request_state: BlockRequestState,
pub blob_request_state: BlobRequestState<T::EthSpec>, pub blob_request_state: BlobRequestState,
pub da_checker: Arc<DataAvailabilityChecker<T>>, pub da_checker: Arc<DataAvailabilityChecker<T>>,
/// Only necessary for requests triggered by an `UnknownBlockParent` or `UnknownBlockParent` /// Only necessary for requests triggered by an `UnknownBlockParent` or `UnknownBlockParent`
/// because any blocks or blobs without parents won't hit the data availability cache. /// 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`. /// 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 /// 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 /// from both block/blobs downloaded in the network layer and any blocks/blobs that exist in
/// the data availability checker. /// the data availability checker.
pub requested_ids: MissingBlobs, pub requested_ids: MissingBlobs,
pub block_root: Hash256, pub block_root: Hash256,
/// Where we store blobs until we receive the stream terminator.
pub blob_download_queue: FixedBlobSidecarList<E>,
pub state: SingleLookupRequestState, pub state: SingleLookupRequestState,
} }
impl<E: EthSpec> BlobRequestState<E> { impl BlobRequestState {
pub fn new(block_root: Hash256, peer_source: &[PeerId], is_deneb: bool) -> Self { pub fn new(block_root: Hash256, peer_source: &[PeerId], is_deneb: bool) -> Self {
let default_ids = MissingBlobs::new_without_block(block_root, is_deneb); let default_ids = MissingBlobs::new_without_block(block_root, is_deneb);
Self { Self {
block_root, block_root,
requested_ids: default_ids, requested_ids: default_ids,
blob_download_queue: <_>::default(),
state: SingleLookupRequestState::new(peer_source), state: SingleLookupRequestState::new(peer_source),
} }
} }

View File

@@ -627,7 +627,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
), ),
BlockProcessType::SingleBlob { id } => self BlockProcessType::SingleBlob { id } => self
.block_lookups .block_lookups
.single_block_component_processed::<BlobRequestState<T::EthSpec>>( .single_block_component_processed::<BlobRequestState>(
id, id,
result, result,
&mut self.network, &mut self.network,
@@ -908,7 +908,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
Ok((blobs, seen_timestamp)) => match id.lookup_type { Ok((blobs, seen_timestamp)) => match id.lookup_type {
LookupType::Current => self LookupType::Current => self
.block_lookups .block_lookups
.single_lookup_response::<BlobRequestState<T::EthSpec>>( .single_lookup_response::<BlobRequestState>(
id, id,
peer_id, peer_id,
blobs, blobs,
@@ -917,7 +917,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
), ),
LookupType::Parent => self LookupType::Parent => self
.block_lookups .block_lookups
.parent_lookup_response::<BlobRequestState<T::EthSpec>>( .parent_lookup_response::<BlobRequestState>(
id, id,
peer_id, peer_id,
blobs, blobs,
@@ -929,20 +929,20 @@ impl<T: BeaconChainTypes> SyncManager<T> {
Err(error) => match id.lookup_type { Err(error) => match id.lookup_type {
LookupType::Current => self LookupType::Current => self
.block_lookups .block_lookups
.single_block_lookup_failed::<BlobRequestState<T::EthSpec>>( .single_block_lookup_failed::<BlobRequestState>(
id, id,
&peer_id, &peer_id,
&mut self.network, &mut self.network,
error, error,
), ),
LookupType::Parent => self LookupType::Parent => {
.block_lookups self.block_lookups.parent_lookup_failed::<BlobRequestState>(
.parent_lookup_failed::<BlobRequestState<T::EthSpec>>(
id, id,
&peer_id, &peer_id,
&mut self.network, &mut self.network,
error, error,
), )
}
}, },
} }
} }

View File

@@ -256,14 +256,14 @@ pub fn create_tracing_layer(base_tracing_log_path: PathBuf) {
return; return;
}; };
let (libp2p_non_blocking_writer, libp2p_guard) = NonBlocking::new(libp2p_writer); let (libp2p_non_blocking_writer, _libp2p_guard) = NonBlocking::new(libp2p_writer);
let (discv5_non_blocking_writer, discv5_guard) = NonBlocking::new(discv5_writer); let (discv5_non_blocking_writer, _discv5_guard) = NonBlocking::new(discv5_writer);
let custom_layer = LoggingLayer { let custom_layer = LoggingLayer {
libp2p_non_blocking_writer, libp2p_non_blocking_writer,
libp2p_guard, _libp2p_guard,
discv5_non_blocking_writer, discv5_non_blocking_writer,
discv5_guard, _discv5_guard,
}; };
if let Err(e) = tracing_subscriber::fmt() if let Err(e) = tracing_subscriber::fmt()

View File

@@ -7,9 +7,9 @@ use tracing_subscriber::Layer;
pub struct LoggingLayer { pub struct LoggingLayer {
pub libp2p_non_blocking_writer: NonBlocking, pub libp2p_non_blocking_writer: NonBlocking,
pub libp2p_guard: WorkerGuard, pub _libp2p_guard: WorkerGuard,
pub discv5_non_blocking_writer: NonBlocking, pub discv5_non_blocking_writer: NonBlocking,
pub discv5_guard: WorkerGuard, pub _discv5_guard: WorkerGuard,
} }
impl<S> Layer<S> for LoggingLayer impl<S> Layer<S> for LoggingLayer

View File

@@ -88,14 +88,15 @@ const _: () = assert!({
/// bringing in the entire crate. /// bringing in the entire crate.
const _: () = assert!(ATTESTATION_SUBSCRIPTION_OFFSETS[0] > 2); const _: () = assert!(ATTESTATION_SUBSCRIPTION_OFFSETS[0] > 2);
// The info in the enum variants is displayed in logging, clippy thinks it's dead code.
#[derive(Debug)] #[derive(Debug)]
pub enum Error { pub enum Error {
UnableToReadSlotClock, UnableToReadSlotClock,
FailedToDownloadAttesters(String), FailedToDownloadAttesters(#[allow(dead_code)] String),
FailedToProduceSelectionProof(ValidatorStoreError), FailedToProduceSelectionProof(#[allow(dead_code)] ValidatorStoreError),
InvalidModulo(ArithError), InvalidModulo(#[allow(dead_code)] ArithError),
Arith(ArithError), Arith(#[allow(dead_code)] ArithError),
SyncDutiesNotFound(u64), SyncDutiesNotFound(#[allow(dead_code)] u64),
} }
impl From<ArithError> for Error { impl From<ArithError> for Error {

View File

@@ -17,8 +17,8 @@ use warp::{http::Response, Filter};
#[derive(Debug)] #[derive(Debug)]
pub enum Error { pub enum Error {
Warp(warp::Error), Warp(#[allow(dead_code)] warp::Error),
Other(String), Other(#[allow(dead_code)] String),
} }
impl From<warp::Error> for Error { impl From<warp::Error> for Error {