Skip to content

Commit c33edc8

Browse files
authored
Beta compiler fix (#5659)
* fix beta compiler compilation * remove unused import * Revert "remove unused import" This reverts commit 0bef36b. * Revert "fix beta compiler compilation" This reverts commit 23152cf. * 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
1 parent 40d4126 commit c33edc8

File tree

8 files changed

+31
-33
lines changed

8 files changed

+31
-33
lines changed

beacon_node/network/src/sync/backfill_sync/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,17 @@ pub enum ProcessResult {
8787
}
8888

8989
/// The ways a backfill sync can fail.
90+
// The info in the enum variants is displayed in logging, clippy thinks it's dead code.
9091
#[derive(Debug)]
9192
pub enum BackFillError {
9293
/// A batch failed to be downloaded.
93-
BatchDownloadFailed(BatchId),
94+
BatchDownloadFailed(#[allow(dead_code)] BatchId),
9495
/// A batch could not be processed.
95-
BatchProcessingFailed(BatchId),
96+
BatchProcessingFailed(#[allow(dead_code)] BatchId),
9697
/// A batch entered an invalid state.
97-
BatchInvalidState(BatchId, String),
98+
BatchInvalidState(#[allow(dead_code)] BatchId, #[allow(dead_code)] String),
9899
/// The sync algorithm entered an invalid state.
99-
InvalidSyncState(String),
100+
InvalidSyncState(#[allow(dead_code)] String),
100101
/// The chain became paused.
101102
Paused,
102103
}

beacon_node/network/src/sync/block_lookups/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ impl<T: BeaconChainTypes> RequestState<T> for BlockRequestState {
245245
}
246246
}
247247

248-
impl<T: BeaconChainTypes> RequestState<T> for BlobRequestState<T::EthSpec> {
248+
impl<T: BeaconChainTypes> RequestState<T> for BlobRequestState {
249249
type RequestType = BlobsByRootSingleBlockRequest;
250250
type VerifiedResponseType = FixedBlobSidecarList<T::EthSpec>;
251251
type ReconstructedResponseType = FixedBlobSidecarList<T::EthSpec>;

beacon_node/network/src/sync/block_lookups/single_block_lookup.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use std::fmt::Debug;
1818
use std::sync::Arc;
1919
use store::Hash256;
2020
use strum::IntoStaticStr;
21-
use types::blob_sidecar::FixedBlobSidecarList;
2221
use types::EthSpec;
2322

2423
#[derive(Debug, PartialEq, Eq, IntoStaticStr)]
@@ -37,7 +36,7 @@ pub struct SingleBlockLookup<T: BeaconChainTypes> {
3736
pub id: Id,
3837
pub lookup_type: LookupType,
3938
pub block_request_state: BlockRequestState,
40-
pub blob_request_state: BlobRequestState<T::EthSpec>,
39+
pub blob_request_state: BlobRequestState,
4140
pub da_checker: Arc<DataAvailabilityChecker<T>>,
4241
/// Only necessary for requests triggered by an `UnknownBlockParent` or `UnknownBlockParent`
4342
/// because any blocks or blobs without parents won't hit the data availability cache.
@@ -304,24 +303,21 @@ impl<T: BeaconChainTypes> SingleBlockLookup<T> {
304303
}
305304

306305
/// The state of the blob request component of a `SingleBlockLookup`.
307-
pub struct BlobRequestState<E: EthSpec> {
306+
pub struct BlobRequestState {
308307
/// The latest picture of which blobs still need to be requested. This includes information
309308
/// from both block/blobs downloaded in the network layer and any blocks/blobs that exist in
310309
/// the data availability checker.
311310
pub requested_ids: MissingBlobs,
312311
pub block_root: Hash256,
313-
/// Where we store blobs until we receive the stream terminator.
314-
pub blob_download_queue: FixedBlobSidecarList<E>,
315312
pub state: SingleLookupRequestState,
316313
}
317314

318-
impl<E: EthSpec> BlobRequestState<E> {
315+
impl BlobRequestState {
319316
pub fn new(block_root: Hash256, peer_source: &[PeerId], is_deneb: bool) -> Self {
320317
let default_ids = MissingBlobs::new_without_block(block_root, is_deneb);
321318
Self {
322319
block_root,
323320
requested_ids: default_ids,
324-
blob_download_queue: <_>::default(),
325321
state: SingleLookupRequestState::new(peer_source),
326322
}
327323
}

beacon_node/network/src/sync/manager.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
627627
),
628628
BlockProcessType::SingleBlob { id } => self
629629
.block_lookups
630-
.single_block_component_processed::<BlobRequestState<T::EthSpec>>(
630+
.single_block_component_processed::<BlobRequestState>(
631631
id,
632632
result,
633633
&mut self.network,
@@ -908,7 +908,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
908908
Ok((blobs, seen_timestamp)) => match id.lookup_type {
909909
LookupType::Current => self
910910
.block_lookups
911-
.single_lookup_response::<BlobRequestState<T::EthSpec>>(
911+
.single_lookup_response::<BlobRequestState>(
912912
id,
913913
peer_id,
914914
blobs,
@@ -917,7 +917,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
917917
),
918918
LookupType::Parent => self
919919
.block_lookups
920-
.parent_lookup_response::<BlobRequestState<T::EthSpec>>(
920+
.parent_lookup_response::<BlobRequestState>(
921921
id,
922922
peer_id,
923923
blobs,
@@ -929,20 +929,20 @@ impl<T: BeaconChainTypes> SyncManager<T> {
929929
Err(error) => match id.lookup_type {
930930
LookupType::Current => self
931931
.block_lookups
932-
.single_block_lookup_failed::<BlobRequestState<T::EthSpec>>(
932+
.single_block_lookup_failed::<BlobRequestState>(
933933
id,
934934
&peer_id,
935935
&mut self.network,
936936
error,
937937
),
938-
LookupType::Parent => self
939-
.block_lookups
940-
.parent_lookup_failed::<BlobRequestState<T::EthSpec>>(
938+
LookupType::Parent => {
939+
self.block_lookups.parent_lookup_failed::<BlobRequestState>(
941940
id,
942941
&peer_id,
943942
&mut self.network,
944943
error,
945-
),
944+
)
945+
}
946946
},
947947
}
948948
}

common/logging/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,14 @@ pub fn create_tracing_layer(base_tracing_log_path: PathBuf) {
256256
return;
257257
};
258258

259-
let (libp2p_non_blocking_writer, libp2p_guard) = NonBlocking::new(libp2p_writer);
260-
let (discv5_non_blocking_writer, discv5_guard) = NonBlocking::new(discv5_writer);
259+
let (libp2p_non_blocking_writer, _libp2p_guard) = NonBlocking::new(libp2p_writer);
260+
let (discv5_non_blocking_writer, _discv5_guard) = NonBlocking::new(discv5_writer);
261261

262262
let custom_layer = LoggingLayer {
263263
libp2p_non_blocking_writer,
264-
libp2p_guard,
264+
_libp2p_guard,
265265
discv5_non_blocking_writer,
266-
discv5_guard,
266+
_discv5_guard,
267267
};
268268

269269
if let Err(e) = tracing_subscriber::fmt()

common/logging/src/tracing_logging_layer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ use tracing_subscriber::Layer;
77

88
pub struct LoggingLayer {
99
pub libp2p_non_blocking_writer: NonBlocking,
10-
pub libp2p_guard: WorkerGuard,
10+
pub _libp2p_guard: WorkerGuard,
1111
pub discv5_non_blocking_writer: NonBlocking,
12-
pub discv5_guard: WorkerGuard,
12+
pub _discv5_guard: WorkerGuard,
1313
}
1414

1515
impl<S> Layer<S> for LoggingLayer

validator_client/src/duties_service.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,15 @@ const _: () = assert!({
8888
/// bringing in the entire crate.
8989
const _: () = assert!(ATTESTATION_SUBSCRIPTION_OFFSETS[0] > 2);
9090

91+
// The info in the enum variants is displayed in logging, clippy thinks it's dead code.
9192
#[derive(Debug)]
9293
pub enum Error {
9394
UnableToReadSlotClock,
94-
FailedToDownloadAttesters(String),
95-
FailedToProduceSelectionProof(ValidatorStoreError),
96-
InvalidModulo(ArithError),
97-
Arith(ArithError),
98-
SyncDutiesNotFound(u64),
95+
FailedToDownloadAttesters(#[allow(dead_code)] String),
96+
FailedToProduceSelectionProof(#[allow(dead_code)] ValidatorStoreError),
97+
InvalidModulo(#[allow(dead_code)] ArithError),
98+
Arith(#[allow(dead_code)] ArithError),
99+
SyncDutiesNotFound(#[allow(dead_code)] u64),
99100
}
100101

101102
impl From<ArithError> for Error {

validator_client/src/http_metrics/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use warp::{http::Response, Filter};
1717

1818
#[derive(Debug)]
1919
pub enum Error {
20-
Warp(warp::Error),
21-
Other(String),
20+
Warp(#[allow(dead_code)] warp::Error),
21+
Other(#[allow(dead_code)] String),
2222
}
2323

2424
impl From<warp::Error> for Error {

0 commit comments

Comments
 (0)