Skip to content

Commit

Permalink
chore(deps): rm reth-rpc-types dep from reth-network (#9023)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jun 21, 2024
1 parent 17c5121 commit a34e41c
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 21 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/net/network-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ workspace = true
[dependencies]
# reth
reth-eth-wire.workspace = true
reth-rpc-types.workspace = true
alloy-rpc-types-admin.workspace = true
reth-network-peers.workspace = true

# ethereum
Expand Down
19 changes: 15 additions & 4 deletions crates/net/network-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

use reth_eth_wire::{capability::Capabilities, DisconnectReason, EthVersion, Status};
use reth_rpc_types::NetworkStatus;
use std::{future::Future, net::SocketAddr, sync::Arc, time::Instant};

pub use alloy_rpc_types_admin::EthProtocolInfo;
pub use error::NetworkError;
pub use reputation::{Reputation, ReputationChangeKind};
use reth_eth_wire::{capability::Capabilities, DisconnectReason, EthVersion, Status};
use reth_network_peers::NodeRecord;
use serde::{Deserialize, Serialize};
use std::{future::Future, net::SocketAddr, sync::Arc, time::Instant};

/// The `PeerId` type.
pub type PeerId = alloy_primitives::B512;
Expand Down Expand Up @@ -215,3 +215,14 @@ impl std::fmt::Display for Direction {
}
}
}

/// The status of the network being ran by the local node.
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct NetworkStatus {
/// The local node client version.
pub client_version: String,
/// The current ethereum protocol version
pub protocol_version: u64,
/// Information about the Ethereum Wire Protocol.
pub eth_protocol_info: EthProtocolInfo,
}
6 changes: 3 additions & 3 deletions crates/net/network-api/src/noop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
//! generic over it.

use crate::{
NetworkError, NetworkInfo, PeerId, PeerInfo, PeerKind, Peers, PeersInfo, Reputation,
ReputationChangeKind,
NetworkError, NetworkInfo, NetworkStatus, PeerId, PeerInfo, PeerKind, Peers, PeersInfo,
Reputation, ReputationChangeKind,
};
use alloy_rpc_types_admin::EthProtocolInfo;
use enr::{secp256k1::SecretKey, Enr};
use reth_eth_wire::{DisconnectReason, ProtocolVersion};
use reth_network_peers::NodeRecord;
use reth_rpc_types::{admin::EthProtocolInfo, NetworkStatus};
use std::net::{IpAddr, SocketAddr};

/// A type that implements all network trait that does nothing.
Expand Down
1 change: 0 additions & 1 deletion crates/net/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ reth-ecies.workspace = true
reth-tasks.workspace = true
reth-transaction-pool.workspace = true
reth-provider.workspace = true
reth-rpc-types.workspace = true
reth-tokio-util.workspace = true
reth-consensus.workspace = true
reth-network-peers.workspace = true
Expand Down
3 changes: 1 addition & 2 deletions crates/net/network/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ use reth_eth_wire::{
DisconnectReason, EthVersion, Status,
};
use reth_metrics::common::mpsc::UnboundedMeteredSender;
use reth_network_api::ReputationChangeKind;
use reth_network_api::{EthProtocolInfo, NetworkStatus, ReputationChangeKind};
use reth_network_peers::{NodeRecord, PeerId};
use reth_primitives::ForkId;
use reth_provider::{BlockNumReader, BlockReader};
use reth_rpc_types::{admin::EthProtocolInfo, NetworkStatus};
use reth_tasks::shutdown::GracefulShutdown;
use reth_tokio_util::EventSender;
use secp256k1::SecretKey;
Expand Down
3 changes: 1 addition & 2 deletions crates/net/network/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ use parking_lot::Mutex;
use reth_discv4::Discv4;
use reth_eth_wire::{DisconnectReason, NewBlock, NewPooledTransactionHashes, SharedTransactions};
use reth_network_api::{
NetworkError, NetworkInfo, PeerInfo, PeerKind, Peers, PeersInfo, Reputation,
NetworkError, NetworkInfo, NetworkStatus, PeerInfo, PeerKind, Peers, PeersInfo, Reputation,
ReputationChangeKind,
};
use reth_network_p2p::sync::{NetworkSyncUpdater, SyncState, SyncStateProvider};
use reth_network_peers::{NodeRecord, PeerId};
use reth_primitives::{Head, TransactionSigned, B256};
use reth_rpc_types::NetworkStatus;
use reth_tokio_util::{EventSender, EventStream};
use secp256k1::SecretKey;
use std::{
Expand Down
3 changes: 1 addition & 2 deletions crates/net/network/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ use futures::Stream;
use reth_eth_wire::{
capability::SharedCapabilities, multiplex::ProtocolConnection, protocol::Protocol,
};
use reth_network_api::Direction;
use reth_network_api::{Direction, PeerId};
use reth_primitives::BytesMut;
use reth_rpc_types::PeerId;
use std::{
fmt,
net::SocketAddr,
Expand Down
3 changes: 1 addition & 2 deletions crates/net/network/tests/it/multiplex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ use reth_network::{
protocol::{ConnectionHandler, OnNotSupported, ProtocolHandler},
test_utils::Testnet,
};
use reth_network_api::Direction;
use reth_network_api::{Direction, PeerId};
use reth_primitives::BytesMut;
use reth_provider::test_utils::MockEthProvider;
use reth_rpc_types::PeerId;
use std::{
net::SocketAddr,
pin::Pin,
Expand Down
2 changes: 0 additions & 2 deletions crates/rpc/rpc-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#[allow(hidden_glob_reexports)]
mod eth;
mod mev;
mod net;
mod peer;
mod rpc;

Expand Down Expand Up @@ -53,6 +52,5 @@ pub use eth::{
};

pub use mev::*;
pub use net::*;
pub use peer::*;
pub use rpc::*;

0 comments on commit a34e41c

Please sign in to comment.