chore(deps): shrink some deps (#8376)

This commit is contained in:
Matthias Seitz
2024-05-23 23:05:00 +02:00
committed by GitHub
parent 1287bbcac7
commit d7172b6605
4 changed files with 16 additions and 16 deletions

3
Cargo.lock generated
View File

@ -7208,11 +7208,10 @@ dependencies = [
name = "reth-network-api" name = "reth-network-api"
version = "0.2.0-beta.7" version = "0.2.0-beta.7"
dependencies = [ dependencies = [
"alloy-primitives",
"enr", "enr",
"reth-discv4",
"reth-eth-wire", "reth-eth-wire",
"reth-network-types", "reth-network-types",
"reth-primitives",
"reth-rpc-types", "reth-rpc-types",
"serde", "serde",
"thiserror", "thiserror",

View File

@ -6,19 +6,20 @@ rust-version.workspace = true
license.workspace = true license.workspace = true
homepage.workspace = true homepage.workspace = true
repository.workspace = true repository.workspace = true
description = "Network interfaces" description = "Network interfaces and commonly used types"
[lints] [lints]
workspace = true workspace = true
[dependencies] [dependencies]
# reth # reth
reth-primitives.workspace = true
reth-eth-wire.workspace = true reth-eth-wire.workspace = true
reth-rpc-types.workspace = true reth-rpc-types.workspace = true
reth-discv4.workspace = true
reth-network-types.workspace = true reth-network-types.workspace = true
# ethereum
alloy-primitives.workspace = true
# eth # eth
enr = { workspace = true, default-features = false, features = ["rust-secp256k1"] } enr = { workspace = true, default-features = false, features = ["rust-secp256k1"] }

View File

@ -13,15 +13,16 @@
)] )]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
use reth_eth_wire::{DisconnectReason, EthVersion, Status}; use reth_eth_wire::{capability::Capabilities, DisconnectReason, EthVersion, Status};
use reth_network_types::PeerId; use reth_rpc_types::NetworkStatus;
use reth_primitives::NodeRecord;
use std::{future::Future, net::SocketAddr, sync::Arc, time::Instant}; 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; use reth_network_types::NodeRecord;
use reth_rpc_types::NetworkStatus;
/// The PeerId type.
pub type PeerId = alloy_primitives::B512;
/// Network Error /// Network Error
pub mod error; pub mod error;

View File

@ -4,14 +4,12 @@
//! generic over it. //! generic over it.
use crate::{ use crate::{
NetworkError, NetworkInfo, PeerInfo, PeerKind, Peers, PeersInfo, Reputation, NetworkError, NetworkInfo, PeerId, PeerInfo, PeerKind, Peers, PeersInfo, Reputation,
ReputationChangeKind, ReputationChangeKind,
}; };
use enr::{secp256k1::SecretKey, Enr}; use enr::{secp256k1::SecretKey, Enr};
use reth_discv4::DEFAULT_DISCOVERY_PORT;
use reth_eth_wire::{DisconnectReason, ProtocolVersion}; use reth_eth_wire::{DisconnectReason, ProtocolVersion};
use reth_network_types::PeerId; use reth_network_types::NodeRecord;
use reth_primitives::{Chain, NodeRecord};
use reth_rpc_types::{admin::EthProtocolInfo, NetworkStatus}; use reth_rpc_types::{admin::EthProtocolInfo, NetworkStatus};
use std::net::{IpAddr, SocketAddr}; use std::net::{IpAddr, SocketAddr};
@ -24,7 +22,7 @@ pub struct NoopNetwork;
impl NetworkInfo for NoopNetwork { impl NetworkInfo for NoopNetwork {
fn local_addr(&self) -> SocketAddr { fn local_addr(&self) -> SocketAddr {
(IpAddr::from(std::net::Ipv4Addr::UNSPECIFIED), DEFAULT_DISCOVERY_PORT).into() (IpAddr::from(std::net::Ipv4Addr::UNSPECIFIED), 30303).into()
} }
async fn network_status(&self) -> Result<NetworkStatus, NetworkError> { async fn network_status(&self) -> Result<NetworkStatus, NetworkError> {
@ -42,7 +40,8 @@ impl NetworkInfo for NoopNetwork {
} }
fn chain_id(&self) -> u64 { fn chain_id(&self) -> u64 {
Chain::mainnet().into() // mainnet
1
} }
fn is_syncing(&self) -> bool { fn is_syncing(&self) -> bool {