chore(net): Remove dependency reth-network-p2p -> reth-network-types (#9984)

This commit is contained in:
Emilia Hane
2024-08-01 15:10:10 +02:00
committed by GitHub
parent 321032fcda
commit e95ec4cbd5
8 changed files with 23 additions and 13 deletions

3
Cargo.lock generated
View File

@ -7581,9 +7581,9 @@ dependencies = [
"reth-consensus",
"reth-eth-wire-types",
"reth-network-peers",
"reth-network-types",
"reth-primitives",
"reth-storage-errors",
"serde",
"thiserror",
"tokio",
"tracing",
@ -7611,6 +7611,7 @@ version = "1.0.3"
dependencies = [
"humantime-serde",
"reth-net-banlist",
"reth-network-p2p",
"reth-network-peers",
"serde",
"serde_json",

View File

@ -15,6 +15,7 @@ workspace = true
# reth
reth-network-peers.workspace = true
reth-net-banlist.workspace = true
reth-network-p2p.workspace = true
# io
serde = { workspace = true, optional = true }
@ -25,5 +26,5 @@ serde_json = { workspace = true }
tracing.workspace = true
[features]
serde = ["dep:serde", "dep:humantime-serde"]
serde = ["dep:serde", "dep:humantime-serde", "reth-network-p2p/serde"]
test-utils = []

View File

@ -14,10 +14,7 @@
/// Types related to peering.
pub mod peers;
pub use peers::{
reputation::{Reputation, ReputationChangeKind, ReputationChangeWeights},
ConnectionsConfig, PeersConfig,
};
pub use peers::{ConnectionsConfig, PeersConfig};
pub mod session;
pub use session::{SessionLimits, SessionsConfig};
@ -25,3 +22,5 @@ pub use session::{SessionLimits, SessionsConfig};
/// [`BackoffKind`] definition.
mod backoff;
pub use backoff::BackoffKind;
pub use reth_network_p2p::reputation::{Reputation, ReputationChangeKind, ReputationChangeWeights};

View File

@ -1,5 +1,5 @@
pub mod reputation;
pub use reputation::ReputationChangeWeights;
pub mod config;
pub use reth_network_p2p::reputation;
pub use config::{ConnectionsConfig, PeersConfig};

View File

@ -17,7 +17,9 @@ reth-eth-wire-types.workspace = true
reth-consensus.workspace = true
reth-network-peers.workspace = true
reth-storage-errors.workspace = true
reth-network-types.workspace = true
# io
serde = { workspace = true, optional = true }
# async
futures.workspace = true
@ -38,3 +40,4 @@ tokio = { workspace = true, features = ["full"] }
[features]
test-utils = ["reth-consensus/test-utils", "parking_lot"]
serde = ["dep:serde"]

View File

@ -1,15 +1,17 @@
use super::headers::client::HeadersRequest;
use std::ops::RangeInclusive;
use reth_consensus::ConsensusError;
use reth_network_peers::WithPeerId;
use reth_network_types::ReputationChangeKind;
use reth_primitives::{
BlockHashOrNumber, BlockNumber, GotExpected, GotExpectedBoxed, Header, B256,
};
use reth_storage_errors::{db::DatabaseError, provider::ProviderError};
use std::ops::RangeInclusive;
use thiserror::Error;
use tokio::sync::{mpsc, oneshot};
use super::headers::client::HeadersRequest;
use crate::ReputationChangeKind;
/// Result alias for result of a request.
pub type RequestResult<T> = Result<T, RequestError>;

View File

@ -44,3 +44,7 @@ pub mod sync;
/// Common test helpers for mocking out Consensus, Downloaders and Header Clients.
#[cfg(any(test, feature = "test-utils"))]
pub mod test_utils;
pub mod reputation;
pub use reputation::{Reputation, ReputationChange, ReputationChangeKind, ReputationChangeWeights};