diff --git a/Cargo.lock b/Cargo.lock index c4279630..b7eb7a48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -551,7 +551,6 @@ version = "0.1.0" dependencies = [ "borsh", "cuprate-constants", - "cuprate-helper", "cuprate-p2p-core", "cuprate-pruning", "cuprate-test-utils", @@ -881,7 +880,6 @@ dependencies = [ "futures", "hex", "hex-literal", - "serde", "thiserror", "tokio", "tokio-stream", diff --git a/binaries/cuprated/Cargo.toml b/binaries/cuprated/Cargo.toml index af50acc8..acf8827b 100644 --- a/binaries/cuprated/Cargo.toml +++ b/binaries/cuprated/Cargo.toml @@ -20,7 +20,7 @@ cuprate-fixed-bytes = { workspace = true } cuprate-levin = { workspace = true } cuprate-wire = { workspace = true } cuprate-p2p = { workspace = true } -cuprate-p2p-core = { workspace = true, features = ["serde"] } +cuprate-p2p-core = { workspace = true } cuprate-dandelion-tower = { workspace = true, features = ["txpool"] } cuprate-async-buffer = { workspace = true } cuprate-address-book = { workspace = true } diff --git a/binaries/cuprated/src/config/p2p.rs b/binaries/cuprated/src/config/p2p.rs index 749355bd..aaf7dda7 100644 --- a/binaries/cuprated/src/config/p2p.rs +++ b/binaries/cuprated/src/config/p2p.rs @@ -1,9 +1,12 @@ -use cuprate_helper::fs::addressbook_path; -use cuprate_helper::network::Network; +use std::{ + net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr}, + path::Path, + time::Duration, +}; + use serde::{Deserialize, Serialize}; -use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr}; -use std::path::Path; -use std::time::Duration; + +use cuprate_helper::{fs::addressbook_path, network::Network}; /// P2P config. #[derive(Default, Deserialize, Serialize)] diff --git a/binaries/cuprated/src/config/storage.rs b/binaries/cuprated/src/config/storage.rs index 99b8e202..b3e3c1f4 100644 --- a/binaries/cuprated/src/config/storage.rs +++ b/binaries/cuprated/src/config/storage.rs @@ -1,6 +1,7 @@ -use serde::{Deserialize, Serialize}; use std::path::PathBuf; +use serde::{Deserialize, Serialize}; + use cuprate_database::config::SyncMode; use cuprate_database_service::ReaderThreads; use cuprate_helper::fs::CUPRATE_DATA_DIR; diff --git a/p2p/address-book/Cargo.toml b/p2p/address-book/Cargo.toml index aa7e3c57..d57cfded 100644 --- a/p2p/address-book/Cargo.toml +++ b/p2p/address-book/Cargo.toml @@ -8,7 +8,6 @@ authors = ["Boog900"] [dependencies] cuprate-constants = { workspace = true } -cuprate-helper = { workspace = true, features = ["std"], optional = true } cuprate-pruning = { workspace = true } cuprate-p2p-core = { workspace = true, features = ["borsh"] } diff --git a/p2p/p2p-core/Cargo.toml b/p2p/p2p-core/Cargo.toml index 7fa919c6..bc6c8335 100644 --- a/p2p/p2p-core/Cargo.toml +++ b/p2p/p2p-core/Cargo.toml @@ -28,7 +28,6 @@ tracing = { workspace = true, features = ["std", "attributes"] } hex-literal = { workspace = true } borsh = { workspace = true, features = ["derive", "std"], optional = true } -serde = { workspace = true, features = ["derive", "std"], optional = true } [dev-dependencies] cuprate-test-utils = { workspace = true } diff --git a/p2p/p2p-core/src/network_zones/clear.rs b/p2p/p2p-core/src/network_zones/clear.rs index bff7b1ed..cb3c5592 100644 --- a/p2p/p2p-core/src/network_zones/clear.rs +++ b/p2p/p2p-core/src/network_zones/clear.rs @@ -1,5 +1,5 @@ use std::{ - net::{IpAddr, Ipv4Addr, SocketAddr}, + net::{IpAddr, SocketAddr}, pin::Pin, task::{Context, Poll}, }; @@ -38,20 +38,10 @@ impl NetZoneAddress for SocketAddr { } #[derive(Debug, Clone)] -#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] -#[cfg_attr(feature = "serde", serde(deny_unknown_fields))] pub struct ClearNetServerCfg { pub ip: IpAddr, } -impl Default for ClearNetServerCfg { - fn default() -> Self { - Self { - ip: IpAddr::V4(Ipv4Addr::UNSPECIFIED), - } - } -} - #[derive(Clone, Copy)] pub enum ClearNet {}