From 1498acb096108764c72681cb977601448c6033bc Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sat, 6 Jul 2024 19:55:08 +0200 Subject: [PATCH] chore: dont enable serde by default for eth-wire (#9339) --- crates/net/eth-wire-types/Cargo.toml | 1 - crates/net/eth-wire-types/src/header.rs | 4 ++-- crates/net/eth-wire/Cargo.toml | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/net/eth-wire-types/Cargo.toml b/crates/net/eth-wire-types/Cargo.toml index bda6a327c..e9d502850 100644 --- a/crates/net/eth-wire-types/Cargo.toml +++ b/crates/net/eth-wire-types/Cargo.toml @@ -43,7 +43,6 @@ proptest-derive.workspace = true rand.workspace = true [features] -default = ["serde"] arbitrary = [ "reth-primitives/arbitrary", "alloy-chains/arbitrary", diff --git a/crates/net/eth-wire-types/src/header.rs b/crates/net/eth-wire-types/src/header.rs index c9589527b..f6b3b8ac4 100644 --- a/crates/net/eth-wire-types/src/header.rs +++ b/crates/net/eth-wire-types/src/header.rs @@ -3,7 +3,6 @@ use alloy_rlp::{Decodable, Encodable}; use bytes::BufMut; use reth_codecs::derive_arbitrary; -use serde::{Deserialize, Serialize}; /// Represents the direction for a headers request depending on the `reverse` field of the request. /// > The response must contain a number of block headers, of rising number when reverse is 0, @@ -16,7 +15,8 @@ use serde::{Deserialize, Serialize}; /// /// See also #[derive_arbitrary(rlp)] -#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Default, Serialize, Deserialize)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Default)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum HeadersDirection { /// Falling block number. Falling, diff --git a/crates/net/eth-wire/Cargo.toml b/crates/net/eth-wire/Cargo.toml index 242c4b0b3..2846c0f7c 100644 --- a/crates/net/eth-wire/Cargo.toml +++ b/crates/net/eth-wire/Cargo.toml @@ -58,15 +58,15 @@ proptest.workspace = true proptest-arbitrary-interop.workspace = true proptest-derive.workspace = true async-stream.workspace = true +serde.workspace = true [features] -default = ["serde"] arbitrary = [ "reth-primitives/arbitrary", "reth-eth-wire-types/arbitrary", "dep:arbitrary", ] -serde = ["dep:serde"] +serde = ["dep:serde", "reth-eth-wire-types/serde"] [[test]] name = "fuzz_roundtrip"