From b5440f740d1c4b54a0cc5586950d59838986e734 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Tue, 25 Apr 2023 09:30:16 -0400 Subject: [PATCH] fix lints --- beacon_node/network/src/sync/block_lookups/mod.rs | 9 +++++---- .../src/sync/block_lookups/single_block_lookup.rs | 2 +- beacon_node/network/src/sync/network_context.rs | 5 +---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/beacon_node/network/src/sync/block_lookups/mod.rs b/beacon_node/network/src/sync/block_lookups/mod.rs index 8f7efd0354..7d909a90cc 100644 --- a/beacon_node/network/src/sync/block_lookups/mod.rs +++ b/beacon_node/network/src/sync/block_lookups/mod.rs @@ -715,6 +715,7 @@ impl BlockLookups { cx: &mut SyncNetworkContext, error: RPCError, ) { + let msg = error.as_static_str(); if let Some(pos) = self .parent_lookups .iter() @@ -722,11 +723,11 @@ impl BlockLookups { { let mut parent_lookup = self.parent_lookups.remove(pos); parent_lookup.block_download_failed(); - trace!(self.log, "Parent lookup block request failed"; &parent_lookup); + trace!(self.log, "Parent lookup block request failed"; &parent_lookup, "error" => msg); self.request_parent_block(parent_lookup, cx); } else { - return debug!(self.log, "RPC failure for a block parent lookup request that was not found"; "peer_id" => %peer_id); + return debug!(self.log, "RPC failure for a block parent lookup request that was not found"; "peer_id" => %peer_id, "error" => msg); }; if let Some(pos) = self @@ -736,11 +737,11 @@ impl BlockLookups { { let mut parent_lookup = self.parent_lookups.remove(pos); parent_lookup.blob_download_failed(); - trace!(self.log, "Parent lookup blobs request failed"; &parent_lookup); + trace!(self.log, "Parent lookup blobs request failed"; &parent_lookup, "error" => msg); self.request_parent_blob(parent_lookup, cx); } else { - return debug!(self.log, "RPC failure for a blobs parent lookup request that was not found"; "peer_id" => %peer_id); + return debug!(self.log, "RPC failure for a blobs parent lookup request that was not found"; "peer_id" => %peer_id, "error" => msg); }; metrics::set_gauge( &metrics::SYNC_PARENT_BLOCK_LOOKUPS, 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 183915c3ee..968d000482 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 @@ -461,7 +461,7 @@ impl slog::Value { fn serialize( &self, - record: &slog::Record, + _record: &slog::Record, key: slog::Key, serializer: &mut dyn slog::Serializer, ) -> slog::Result { diff --git a/beacon_node/network/src/sync/network_context.rs b/beacon_node/network/src/sync/network_context.rs index e86499e91c..a328fa74bf 100644 --- a/beacon_node/network/src/sync/network_context.rs +++ b/beacon_node/network/src/sync/network_context.rs @@ -4,7 +4,6 @@ use super::block_sidecar_coupling::BlocksAndBlobsRequestInfo; use super::manager::{Id, RequestId as SyncRequestId}; use super::range_sync::{BatchId, ByRangeRequestType, ChainId}; -use crate::beacon_processor::Work::BlobsByRootsRequest; use crate::beacon_processor::WorkEvent; use crate::service::{NetworkMessage, RequestId}; use crate::status::ToStatusMessage; @@ -15,12 +14,10 @@ use lighthouse_network::rpc::methods::{BlobsByRangeRequest, BlobsByRootRequest}; use lighthouse_network::rpc::{BlocksByRangeRequest, BlocksByRootRequest, GoodbyeReason}; use lighthouse_network::{Client, NetworkGlobals, PeerAction, PeerId, ReportSource, Request}; use slog::{debug, trace, warn}; -use ssz_types::VariableList; use std::collections::hash_map::Entry; use std::sync::Arc; use tokio::sync::mpsc; -use types::blob_sidecar::BlobIdentifier; -use types::{BlobSidecar, EthSpec, Hash256, SignedBeaconBlock}; +use types::{BlobSidecar, EthSpec, SignedBeaconBlock}; pub struct BlocksAndBlobsByRangeResponse { pub batch_id: BatchId,