diff --git a/crates/net/network/src/eth_requests.rs b/crates/net/network/src/eth_requests.rs index 4fa34eba5f..a6e4c94630 100644 --- a/crates/net/network/src/eth_requests.rs +++ b/crates/net/network/src/eth_requests.rs @@ -13,9 +13,7 @@ use reth_interfaces::p2p::error::RequestResult; use reth_primitives::{BlockBody, BlockHashOrNumber, Header, HeadersDirection, PeerId}; use reth_provider::{BlockReader, HeaderProvider, ReceiptProvider}; use std::{ - borrow::Borrow, future::Future, - hash::Hash, pin::Pin, task::{Context, Poll}, }; @@ -275,21 +273,6 @@ where } } -/// Represents a handled [`GetBlockHeaders`] requests -/// -/// This is the key type for spam detection cache. The counter is ignored during `PartialEq` and -/// `Hash`. -#[derive(Debug, PartialEq, Hash)] -struct RespondedGetBlockHeaders { - req: (PeerId, GetBlockHeaders), -} - -impl Borrow<(PeerId, GetBlockHeaders)> for RespondedGetBlockHeaders { - fn borrow(&self) -> &(PeerId, GetBlockHeaders) { - &self.req - } -} - /// All `eth` request related to blocks delegated by the network. #[derive(Debug)] pub enum IncomingEthRequest { diff --git a/crates/stages/src/stages/bodies.rs b/crates/stages/src/stages/bodies.rs index 1f304afb7d..d3f4554666 100644 --- a/crates/stages/src/stages/bodies.rs +++ b/crates/stages/src/stages/bodies.rs @@ -587,13 +587,10 @@ mod tests { use reth_interfaces::{ p2p::{ bodies::{ - client::{BodiesClient, BodiesFut}, downloader::{BodyDownloader, BodyDownloaderResult}, response::BlockResponse, }, - download::DownloadClient, error::DownloadResult, - priority::Priority, }, test_utils::{ generators, @@ -844,32 +841,6 @@ mod tests { } } - /// A [BodiesClient] that should not be called. - #[derive(Debug)] - pub(crate) struct NoopClient; - - impl DownloadClient for NoopClient { - fn report_bad_message(&self, _: reth_primitives::PeerId) { - panic!("Noop client should not be called") - } - - fn num_connected_peers(&self) -> usize { - panic!("Noop client should not be called") - } - } - - impl BodiesClient for NoopClient { - type Output = BodiesFut; - - fn get_block_bodies_with_priority( - &self, - _hashes: Vec, - _priority: Priority, - ) -> Self::Output { - panic!("Noop client should not be called") - } - } - /// A [BodyDownloader] that is backed by an internal [HashMap] for testing. #[derive(Debug)] pub(crate) struct TestBodyDownloader {