Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: invert p2p and network types dep #10390

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions crates/net/network-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ workspace = true
reth-network-peers.workspace = true
reth-net-banlist.workspace = true
reth-ethereum-forks.workspace = true
reth-network-p2p.workspace = true

# io
serde = { workspace = true, optional = true }
Expand All @@ -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 = []
2 changes: 1 addition & 1 deletion crates/net/network-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
5 changes: 2 additions & 3 deletions crates/net/network-types/src/peers/mod.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 1 addition & 0 deletions crates/net/p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ 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
Expand Down
5 changes: 2 additions & 3 deletions crates/net/p2p/src/error.rs
Original file line number Diff line number Diff line change
@@ -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>;

Expand Down
3 changes: 0 additions & 3 deletions crates/net/p2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down
Loading