chore: invert p2p and network types dep (#10390)

This commit is contained in:
Matthias Seitz
2024-08-20 09:47:33 +02:00
committed by GitHub
parent 387ce3efae
commit 170a396903
8 changed files with 9 additions and 19 deletions

3
Cargo.lock generated
View File

@ -7592,9 +7592,9 @@ dependencies = [
"reth-consensus",
"reth-eth-wire-types",
"reth-network-peers",
"reth-network-types",
"reth-primitives",
"reth-storage-errors",
"serde",
"tokio",
"tracing",
]
@ -7622,7 +7622,6 @@ dependencies = [
"humantime-serde",
"reth-ethereum-forks",
"reth-net-banlist",
"reth-network-p2p",
"reth-network-peers",
"serde",
"serde_json",

View File

@ -16,9 +16,8 @@ workspace = true
reth-network-peers.workspace = true
reth-net-banlist.workspace = true
reth-ethereum-forks.workspace = true
reth-network-p2p.workspace = true
# io
# misc
serde = { workspace = true, optional = true }
humantime-serde = { workspace = true, optional = true }
serde_json = { workspace = true }
@ -27,5 +26,5 @@ serde_json = { workspace = true }
tracing.workspace = true
[features]
serde = ["dep:serde", "dep:humantime-serde", "reth-network-p2p/serde"]
serde = ["dep:serde", "dep:humantime-serde"]
test-utils = []

View File

@ -19,7 +19,7 @@ pub mod session;
/// [`BackoffKind`] definition.
mod backoff;
pub use reth_network_p2p::reputation::{Reputation, ReputationChangeKind, ReputationChangeWeights};
pub use peers::reputation::{Reputation, ReputationChangeKind, ReputationChangeWeights};
pub use backoff::BackoffKind;
pub use peers::{

View File

@ -1,12 +1,11 @@
pub mod addr;
pub mod config;
pub mod kind;
pub mod reputation;
pub mod state;
pub use reth_network_p2p::reputation;
pub use config::{ConnectionsConfig, PeersConfig};
pub use reputation::ReputationChangeWeights;
pub use reputation::{Reputation, ReputationChange, ReputationChangeKind, ReputationChangeWeights};
use reth_ethereum_forks::ForkId;
use tracing::trace;

View File

@ -16,11 +16,9 @@ reth-primitives.workspace = true
reth-eth-wire-types.workspace = true
reth-consensus.workspace = true
reth-network-peers.workspace = true
reth-network-types.workspace = true
reth-storage-errors.workspace = true
# io
serde = { workspace = true, optional = true }
# async
futures.workspace = true
tokio = { workspace = true, features = ["sync"] }
@ -41,5 +39,4 @@ tokio = { workspace = true, features = ["full"] }
[features]
default = ["std"]
test-utils = ["reth-consensus/test-utils", "parking_lot"]
serde = ["dep:serde"]
std = ["reth-consensus/std"]

View File

@ -1,17 +1,16 @@
use std::ops::RangeInclusive;
use super::headers::client::HeadersRequest;
use derive_more::Display;
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 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

@ -45,11 +45,8 @@ pub mod sync;
#[cfg(any(test, feature = "test-utils"))]
pub mod test_utils;
pub mod reputation;
pub use bodies::client::BodiesClient;
pub use headers::client::HeadersClient;
pub use reputation::{Reputation, ReputationChange, ReputationChangeKind, ReputationChangeWeights};
/// Helper trait that unifies network behaviour needed for fetching blocks.
pub trait BlockClient: HeadersClient + BodiesClient + Unpin + Clone {}