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

View File

@ -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

View File

@ -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;
@ -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.
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.

View File

@ -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

View File

@ -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;

View File

@ -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::{

View File

@ -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,

View File

@ -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,

View File

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