Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta compiler fix #5659

Merged
merged 9 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions beacon_node/network/src/sync/backfill_sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/network/src/sync/block_lookups/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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.
Expand Down Expand Up @@ -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),
}
}
Expand Down
16 changes: 8 additions & 8 deletions beacon_node/network/src/sync/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
),
)
}
},
}
}
Expand Down
8 changes: 4 additions & 4 deletions common/logging/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ pub fn create_tracing_layer(base_tracing_log_path: PathBuf) {
return;
};

let (libp2p_non_blocking_writer, libp2p_guard) = NonBlocking::new(libp2p_writer);
let (discv5_non_blocking_writer, discv5_guard) = NonBlocking::new(discv5_writer);
let (libp2p_non_blocking_writer, _libp2p_guard) = NonBlocking::new(libp2p_writer);
let (discv5_non_blocking_writer, _discv5_guard) = NonBlocking::new(discv5_writer);

let custom_layer = LoggingLayer {
libp2p_non_blocking_writer,
libp2p_guard,
_libp2p_guard,
discv5_non_blocking_writer,
discv5_guard,
_discv5_guard,
};

if let Err(e) = tracing_subscriber::fmt()
Expand Down
4 changes: 2 additions & 2 deletions common/logging/src/tracing_logging_layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use tracing_subscriber::Layer;

pub struct LoggingLayer {
pub libp2p_non_blocking_writer: NonBlocking,
pub libp2p_guard: WorkerGuard,
pub _libp2p_guard: WorkerGuard,
pub discv5_non_blocking_writer: NonBlocking,
pub discv5_guard: WorkerGuard,
pub _discv5_guard: WorkerGuard,
}

impl<S> Layer<S> for LoggingLayer
Expand Down
11 changes: 6 additions & 5 deletions validator_client/src/duties_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,15 @@ const _: () = assert!({
/// bringing in the entire crate.
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)]
pub enum Error {
UnableToReadSlotClock,
FailedToDownloadAttesters(String),
FailedToProduceSelectionProof(ValidatorStoreError),
InvalidModulo(ArithError),
Arith(ArithError),
SyncDutiesNotFound(u64),
FailedToDownloadAttesters(#[allow(dead_code)] String),
FailedToProduceSelectionProof(#[allow(dead_code)] ValidatorStoreError),
InvalidModulo(#[allow(dead_code)] ArithError),
Arith(#[allow(dead_code)] ArithError),
SyncDutiesNotFound(#[allow(dead_code)] u64),
}

impl From<ArithError> for Error {
Expand Down
4 changes: 2 additions & 2 deletions validator_client/src/http_metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use warp::{http::Response, Filter};

#[derive(Debug)]
pub enum Error {
Warp(warp::Error),
Other(String),
Warp(#[allow(dead_code)] warp::Error),
Other(#[allow(dead_code)] String),
}

impl From<warp::Error> for Error {
Expand Down