chore(deps): rm reth-rpc-types dep from reth-network (#9023)

This commit is contained in:
Matthias Seitz
2024-06-21 23:47:03 +02:00
committed by GitHub
parent 17c5121b50
commit a34e41c275
10 changed files with 24 additions and 21 deletions

3
Cargo.lock generated
View File

@ -7273,7 +7273,6 @@ dependencies = [
"reth-network-peers", "reth-network-peers",
"reth-primitives", "reth-primitives",
"reth-provider", "reth-provider",
"reth-rpc-types",
"reth-tasks", "reth-tasks",
"reth-tokio-util", "reth-tokio-util",
"reth-tracing", "reth-tracing",
@ -7298,10 +7297,10 @@ name = "reth-network-api"
version = "1.0.0-rc.2" version = "1.0.0-rc.2"
dependencies = [ dependencies = [
"alloy-primitives", "alloy-primitives",
"alloy-rpc-types-admin",
"enr", "enr",
"reth-eth-wire", "reth-eth-wire",
"reth-network-peers", "reth-network-peers",
"reth-rpc-types",
"serde", "serde",
"thiserror", "thiserror",
"tokio", "tokio",

View File

@ -14,7 +14,7 @@ workspace = true
[dependencies] [dependencies]
# reth # reth
reth-eth-wire.workspace = true reth-eth-wire.workspace = true
reth-rpc-types.workspace = true alloy-rpc-types-admin.workspace = true
reth-network-peers.workspace = true reth-network-peers.workspace = true
# ethereum # ethereum

View File

@ -13,13 +13,13 @@
)] )]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
use reth_eth_wire::{capability::Capabilities, DisconnectReason, EthVersion, Status}; pub use alloy_rpc_types_admin::EthProtocolInfo;
use reth_rpc_types::NetworkStatus;
use std::{future::Future, net::SocketAddr, sync::Arc, time::Instant};
pub use error::NetworkError; pub use error::NetworkError;
pub use reputation::{Reputation, ReputationChangeKind}; pub use reputation::{Reputation, ReputationChangeKind};
use reth_eth_wire::{capability::Capabilities, DisconnectReason, EthVersion, Status};
use reth_network_peers::NodeRecord; use reth_network_peers::NodeRecord;
use serde::{Deserialize, Serialize};
use std::{future::Future, net::SocketAddr, sync::Arc, time::Instant};
/// The `PeerId` type. /// The `PeerId` type.
pub type PeerId = alloy_primitives::B512; pub type PeerId = alloy_primitives::B512;
@ -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,
}

View File

@ -4,13 +4,13 @@
//! generic over it. //! generic over it.
use crate::{ use crate::{
NetworkError, NetworkInfo, PeerId, PeerInfo, PeerKind, Peers, PeersInfo, Reputation, NetworkError, NetworkInfo, NetworkStatus, PeerId, PeerInfo, PeerKind, Peers, PeersInfo,
ReputationChangeKind, Reputation, ReputationChangeKind,
}; };
use alloy_rpc_types_admin::EthProtocolInfo;
use enr::{secp256k1::SecretKey, Enr}; use enr::{secp256k1::SecretKey, Enr};
use reth_eth_wire::{DisconnectReason, ProtocolVersion}; use reth_eth_wire::{DisconnectReason, ProtocolVersion};
use reth_network_peers::NodeRecord; use reth_network_peers::NodeRecord;
use reth_rpc_types::{admin::EthProtocolInfo, NetworkStatus};
use std::net::{IpAddr, SocketAddr}; use std::net::{IpAddr, SocketAddr};
/// A type that implements all network trait that does nothing. /// A type that implements all network trait that does nothing.

View File

@ -26,7 +26,6 @@ reth-ecies.workspace = true
reth-tasks.workspace = true reth-tasks.workspace = true
reth-transaction-pool.workspace = true reth-transaction-pool.workspace = true
reth-provider.workspace = true reth-provider.workspace = true
reth-rpc-types.workspace = true
reth-tokio-util.workspace = true reth-tokio-util.workspace = true
reth-consensus.workspace = true reth-consensus.workspace = true
reth-network-peers.workspace = true reth-network-peers.workspace = true

View File

@ -42,11 +42,10 @@ use reth_eth_wire::{
DisconnectReason, EthVersion, Status, DisconnectReason, EthVersion, Status,
}; };
use reth_metrics::common::mpsc::UnboundedMeteredSender; 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_network_peers::{NodeRecord, PeerId};
use reth_primitives::ForkId; use reth_primitives::ForkId;
use reth_provider::{BlockNumReader, BlockReader}; use reth_provider::{BlockNumReader, BlockReader};
use reth_rpc_types::{admin::EthProtocolInfo, NetworkStatus};
use reth_tasks::shutdown::GracefulShutdown; use reth_tasks::shutdown::GracefulShutdown;
use reth_tokio_util::EventSender; use reth_tokio_util::EventSender;
use secp256k1::SecretKey; use secp256k1::SecretKey;

View File

@ -8,13 +8,12 @@ use parking_lot::Mutex;
use reth_discv4::Discv4; use reth_discv4::Discv4;
use reth_eth_wire::{DisconnectReason, NewBlock, NewPooledTransactionHashes, SharedTransactions}; use reth_eth_wire::{DisconnectReason, NewBlock, NewPooledTransactionHashes, SharedTransactions};
use reth_network_api::{ use reth_network_api::{
NetworkError, NetworkInfo, PeerInfo, PeerKind, Peers, PeersInfo, Reputation, NetworkError, NetworkInfo, NetworkStatus, PeerInfo, PeerKind, Peers, PeersInfo, Reputation,
ReputationChangeKind, ReputationChangeKind,
}; };
use reth_network_p2p::sync::{NetworkSyncUpdater, SyncState, SyncStateProvider}; use reth_network_p2p::sync::{NetworkSyncUpdater, SyncState, SyncStateProvider};
use reth_network_peers::{NodeRecord, PeerId}; use reth_network_peers::{NodeRecord, PeerId};
use reth_primitives::{Head, TransactionSigned, B256}; use reth_primitives::{Head, TransactionSigned, B256};
use reth_rpc_types::NetworkStatus;
use reth_tokio_util::{EventSender, EventStream}; use reth_tokio_util::{EventSender, EventStream};
use secp256k1::SecretKey; use secp256k1::SecretKey;
use std::{ use std::{

View File

@ -6,9 +6,8 @@ use futures::Stream;
use reth_eth_wire::{ use reth_eth_wire::{
capability::SharedCapabilities, multiplex::ProtocolConnection, protocol::Protocol, capability::SharedCapabilities, multiplex::ProtocolConnection, protocol::Protocol,
}; };
use reth_network_api::Direction; use reth_network_api::{Direction, PeerId};
use reth_primitives::BytesMut; use reth_primitives::BytesMut;
use reth_rpc_types::PeerId;
use std::{ use std::{
fmt, fmt,
net::SocketAddr, net::SocketAddr,

View File

@ -10,10 +10,9 @@ use reth_network::{
protocol::{ConnectionHandler, OnNotSupported, ProtocolHandler}, protocol::{ConnectionHandler, OnNotSupported, ProtocolHandler},
test_utils::Testnet, test_utils::Testnet,
}; };
use reth_network_api::Direction; use reth_network_api::{Direction, PeerId};
use reth_primitives::BytesMut; use reth_primitives::BytesMut;
use reth_provider::test_utils::MockEthProvider; use reth_provider::test_utils::MockEthProvider;
use reth_rpc_types::PeerId;
use std::{ use std::{
net::SocketAddr, net::SocketAddr,
pin::Pin, pin::Pin,

View File

@ -12,7 +12,6 @@
#[allow(hidden_glob_reexports)] #[allow(hidden_glob_reexports)]
mod eth; mod eth;
mod mev; mod mev;
mod net;
mod peer; mod peer;
mod rpc; mod rpc;
@ -53,6 +52,5 @@ pub use eth::{
}; };
pub use mev::*; pub use mev::*;
pub use net::*;
pub use peer::*; pub use peer::*;
pub use rpc::*; pub use rpc::*;