From 23152cf4cc1ee627b76585a013d093f14e45ab14 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 29 Apr 2024 15:25:17 -0400 Subject: [PATCH 1/9] fix beta compiler compilation --- common/logging/src/lib.rs | 6 ++---- common/logging/src/tracing_logging_layer.rs | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/common/logging/src/lib.rs b/common/logging/src/lib.rs index 3a5a5209b02..4d3ac83c8e5 100644 --- a/common/logging/src/lib.rs +++ b/common/logging/src/lib.rs @@ -256,14 +256,12 @@ 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, _) = NonBlocking::new(libp2p_writer); + let (discv5_non_blocking_writer, _) = NonBlocking::new(discv5_writer); let custom_layer = LoggingLayer { libp2p_non_blocking_writer, - libp2p_guard, discv5_non_blocking_writer, - discv5_guard, }; if let Err(e) = tracing_subscriber::fmt() diff --git a/common/logging/src/tracing_logging_layer.rs b/common/logging/src/tracing_logging_layer.rs index aabb6ddd0c9..ece6c4d80c6 100644 --- a/common/logging/src/tracing_logging_layer.rs +++ b/common/logging/src/tracing_logging_layer.rs @@ -7,9 +7,7 @@ use tracing_subscriber::Layer; pub struct LoggingLayer { pub libp2p_non_blocking_writer: NonBlocking, - pub libp2p_guard: WorkerGuard, pub discv5_non_blocking_writer: NonBlocking, - pub discv5_guard: WorkerGuard, } impl Layer for LoggingLayer From 0bef36b05bb146cfcc4a2e0b77ddbd8852e3bf9f Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 29 Apr 2024 15:27:54 -0400 Subject: [PATCH 2/9] remove unused import --- common/logging/src/tracing_logging_layer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/logging/src/tracing_logging_layer.rs b/common/logging/src/tracing_logging_layer.rs index ece6c4d80c6..634e8a7d711 100644 --- a/common/logging/src/tracing_logging_layer.rs +++ b/common/logging/src/tracing_logging_layer.rs @@ -1,7 +1,7 @@ use chrono::prelude::*; use std::io::Write; use tracing::Subscriber; -use tracing_appender::non_blocking::{NonBlocking, WorkerGuard}; +use tracing_appender::non_blocking::NonBlocking; use tracing_subscriber::layer::Context; use tracing_subscriber::Layer; From b22f84b22eb39501bc768a40b389eb507fb40ab2 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 29 Apr 2024 15:38:53 -0400 Subject: [PATCH 3/9] Revert "remove unused import" This reverts commit 0bef36b05bb146cfcc4a2e0b77ddbd8852e3bf9f. --- common/logging/src/tracing_logging_layer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/logging/src/tracing_logging_layer.rs b/common/logging/src/tracing_logging_layer.rs index 634e8a7d711..ece6c4d80c6 100644 --- a/common/logging/src/tracing_logging_layer.rs +++ b/common/logging/src/tracing_logging_layer.rs @@ -1,7 +1,7 @@ use chrono::prelude::*; use std::io::Write; use tracing::Subscriber; -use tracing_appender::non_blocking::NonBlocking; +use tracing_appender::non_blocking::{NonBlocking, WorkerGuard}; use tracing_subscriber::layer::Context; use tracing_subscriber::Layer; From db1e778cf5e1bdbbb8d799ca2c37e7e770e5dac9 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 29 Apr 2024 15:39:04 -0400 Subject: [PATCH 4/9] Revert "fix beta compiler compilation" This reverts commit 23152cf4cc1ee627b76585a013d093f14e45ab14. --- common/logging/src/lib.rs | 6 ++++-- common/logging/src/tracing_logging_layer.rs | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/logging/src/lib.rs b/common/logging/src/lib.rs index 4d3ac83c8e5..3a5a5209b02 100644 --- a/common/logging/src/lib.rs +++ b/common/logging/src/lib.rs @@ -256,12 +256,14 @@ pub fn create_tracing_layer(base_tracing_log_path: PathBuf) { return; }; - let (libp2p_non_blocking_writer, _) = NonBlocking::new(libp2p_writer); - let (discv5_non_blocking_writer, _) = 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, discv5_non_blocking_writer, + discv5_guard, }; if let Err(e) = tracing_subscriber::fmt() diff --git a/common/logging/src/tracing_logging_layer.rs b/common/logging/src/tracing_logging_layer.rs index ece6c4d80c6..aabb6ddd0c9 100644 --- a/common/logging/src/tracing_logging_layer.rs +++ b/common/logging/src/tracing_logging_layer.rs @@ -7,7 +7,9 @@ use tracing_subscriber::Layer; pub struct LoggingLayer { pub libp2p_non_blocking_writer: NonBlocking, + pub libp2p_guard: WorkerGuard, pub discv5_non_blocking_writer: NonBlocking, + pub discv5_guard: WorkerGuard, } impl Layer for LoggingLayer From cc49a39f41ad215174b848aeec4c8873e21bd93a Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 29 Apr 2024 15:42:33 -0400 Subject: [PATCH 5/9] rename ununsed fields --- common/logging/src/lib.rs | 8 ++++---- common/logging/src/tracing_logging_layer.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/logging/src/lib.rs b/common/logging/src/lib.rs index 3a5a5209b02..b0e1da00e97 100644 --- a/common/logging/src/lib.rs +++ b/common/logging/src/lib.rs @@ -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() diff --git a/common/logging/src/tracing_logging_layer.rs b/common/logging/src/tracing_logging_layer.rs index aabb6ddd0c9..a9ddae828ae 100644 --- a/common/logging/src/tracing_logging_layer.rs +++ b/common/logging/src/tracing_logging_layer.rs @@ -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 Layer for LoggingLayer From 4cd420446dabcec876e7b2745b7247fa339496e7 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 29 Apr 2024 15:55:51 -0400 Subject: [PATCH 6/9] allow dead code on some error variants --- beacon_node/network/src/sync/backfill_sync/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/beacon_node/network/src/sync/backfill_sync/mod.rs b/beacon_node/network/src/sync/backfill_sync/mod.rs index 67fe871accf..08a6186f2b8 100644 --- a/beacon_node/network/src/sync/backfill_sync/mod.rs +++ b/beacon_node/network/src/sync/backfill_sync/mod.rs @@ -87,16 +87,16 @@ pub enum ProcessResult { } /// The ways a backfill sync can fail. -#[derive(Debug)] +// The info in the enum variants is displayed in logging, clippy thinks it's dead code. 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, String), /// The sync algorithm entered an invalid state. - InvalidSyncState(String), + InvalidSyncState(#[allow(dead_code)] String), /// The chain became paused. Paused, } From b16c55461d850abdec829553cb919743f607f908 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 29 Apr 2024 16:05:16 -0400 Subject: [PATCH 7/9] remove unused blob download queue --- .../network/src/sync/block_lookups/common.rs | 2 +- .../sync/block_lookups/single_block_lookup.rs | 10 +++------- beacon_node/network/src/sync/manager.rs | 16 ++++++++-------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/beacon_node/network/src/sync/block_lookups/common.rs b/beacon_node/network/src/sync/block_lookups/common.rs index 7193dd6e216..9d1af0cb813 100644 --- a/beacon_node/network/src/sync/block_lookups/common.rs +++ b/beacon_node/network/src/sync/block_lookups/common.rs @@ -245,7 +245,7 @@ impl RequestState for BlockRequestState { } } -impl RequestState for BlobRequestState { +impl RequestState for BlobRequestState { type RequestType = BlobsByRootSingleBlockRequest; type VerifiedResponseType = FixedBlobSidecarList; type ReconstructedResponseType = FixedBlobSidecarList; diff --git a/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs b/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs index 077af7c3d19..49ef1dd15bf 100644 --- a/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs +++ b/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs @@ -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 { pub id: Id, pub lookup_type: LookupType, pub block_request_state: BlockRequestState, - pub blob_request_state: BlobRequestState, + pub blob_request_state: BlobRequestState, pub da_checker: Arc>, /// 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 SingleBlockLookup { } /// The state of the blob request component of a `SingleBlockLookup`. -pub struct BlobRequestState { +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, pub state: SingleLookupRequestState, } -impl BlobRequestState { +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), } } diff --git a/beacon_node/network/src/sync/manager.rs b/beacon_node/network/src/sync/manager.rs index 9c17c6a1512..15b96c52b10 100644 --- a/beacon_node/network/src/sync/manager.rs +++ b/beacon_node/network/src/sync/manager.rs @@ -627,7 +627,7 @@ impl SyncManager { ), BlockProcessType::SingleBlob { id } => self .block_lookups - .single_block_component_processed::>( + .single_block_component_processed::( id, result, &mut self.network, @@ -908,7 +908,7 @@ impl SyncManager { Ok((blobs, seen_timestamp)) => match id.lookup_type { LookupType::Current => self .block_lookups - .single_lookup_response::>( + .single_lookup_response::( id, peer_id, blobs, @@ -917,7 +917,7 @@ impl SyncManager { ), LookupType::Parent => self .block_lookups - .parent_lookup_response::>( + .parent_lookup_response::( id, peer_id, blobs, @@ -929,20 +929,20 @@ impl SyncManager { Err(error) => match id.lookup_type { LookupType::Current => self .block_lookups - .single_block_lookup_failed::>( + .single_block_lookup_failed::( id, &peer_id, &mut self.network, error, ), - LookupType::Parent => self - .block_lookups - .parent_lookup_failed::>( + LookupType::Parent => { + self.block_lookups.parent_lookup_failed::( id, &peer_id, &mut self.network, error, - ), + ) + } }, } } From e63d9c18ff1b5e712685cf591e16244981cd76e6 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 29 Apr 2024 16:08:58 -0400 Subject: [PATCH 8/9] add back debug to backfill error --- beacon_node/network/src/sync/backfill_sync/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/beacon_node/network/src/sync/backfill_sync/mod.rs b/beacon_node/network/src/sync/backfill_sync/mod.rs index 08a6186f2b8..acee56da8c6 100644 --- a/beacon_node/network/src/sync/backfill_sync/mod.rs +++ b/beacon_node/network/src/sync/backfill_sync/mod.rs @@ -88,6 +88,7 @@ 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(#[allow(dead_code)] BatchId), From 3679ce4d25fce37549eb0ed711171960bf31e095 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 29 Apr 2024 16:14:48 -0400 Subject: [PATCH 9/9] more allow dead code on errors --- beacon_node/network/src/sync/backfill_sync/mod.rs | 2 +- validator_client/src/duties_service.rs | 11 ++++++----- validator_client/src/http_metrics/mod.rs | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/beacon_node/network/src/sync/backfill_sync/mod.rs b/beacon_node/network/src/sync/backfill_sync/mod.rs index acee56da8c6..9075bb15f08 100644 --- a/beacon_node/network/src/sync/backfill_sync/mod.rs +++ b/beacon_node/network/src/sync/backfill_sync/mod.rs @@ -95,7 +95,7 @@ pub enum BackFillError { /// A batch could not be processed. BatchProcessingFailed(#[allow(dead_code)] BatchId), /// A batch entered an invalid state. - BatchInvalidState(#[allow(dead_code)] BatchId, String), + BatchInvalidState(#[allow(dead_code)] BatchId, #[allow(dead_code)] String), /// The sync algorithm entered an invalid state. InvalidSyncState(#[allow(dead_code)] String), /// The chain became paused. diff --git a/validator_client/src/duties_service.rs b/validator_client/src/duties_service.rs index b5b56943c4b..15e5c45e0d5 100644 --- a/validator_client/src/duties_service.rs +++ b/validator_client/src/duties_service.rs @@ -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 for Error { diff --git a/validator_client/src/http_metrics/mod.rs b/validator_client/src/http_metrics/mod.rs index de6c06437b4..67cab2bdc37 100644 --- a/validator_client/src/http_metrics/mod.rs +++ b/validator_client/src/http_metrics/mod.rs @@ -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 for Error {