From 09cd105671486f1704f1cf5b7d2c1d1f68142a31 Mon Sep 17 00:00:00 2001 From: Emma Jamieson-Hoare Date: Wed, 11 Feb 2026 18:50:56 -0500 Subject: [PATCH] fix(primitives): move feature-referenced deps from dev-dependencies to optional dependencies (#22103) Co-authored-by: Amp --- .changelog/nice-waves-bow.md | 5 +++++ crates/primitives/Cargo.toml | 9 +++++---- crates/primitives/src/lib.rs | 12 ++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 .changelog/nice-waves-bow.md diff --git a/.changelog/nice-waves-bow.md b/.changelog/nice-waves-bow.md new file mode 100644 index 0000000000..d19df67eca --- /dev/null +++ b/.changelog/nice-waves-bow.md @@ -0,0 +1,5 @@ +--- +reth-primitives: patch +--- + +Moved feature-referenced dependencies from dev-dependencies to optional dependencies to ensure they are available when their corresponding features are enabled. diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 1717cc6ec3..22da1575d9 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -20,27 +20,28 @@ reth-static-file-types.workspace = true # ethereum alloy-consensus.workspace = true +alloy-primitives = { workspace = true, optional = true } +alloy-rlp = { workspace = true, optional = true } +alloy-eips = { workspace = true, optional = true } +alloy-genesis = { workspace = true, optional = true } # for eip-4844 c-kzg = { workspace = true, features = ["serde"], optional = true } # misc once_cell.workspace = true +reth-codecs = { workspace = true, optional = true } [dev-dependencies] # eth reth-primitives-traits = { workspace = true, features = ["arbitrary", "test-utils"] } -alloy-primitives.workspace = true -alloy-rlp.workspace = true alloy-eips = { workspace = true, features = ["arbitrary"] } -alloy-genesis.workspace = true arbitrary = { workspace = true, features = ["derive"] } proptest-arbitrary-interop.workspace = true proptest.workspace = true -reth-codecs.workspace = true criterion.workspace = true diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index 9d4d6da235..d30daa551e 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -18,6 +18,18 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(not(feature = "std"), no_std)] +// These are used as optional dependencies solely for feature forwarding. +#[cfg(feature = "alloy-eips")] +use alloy_eips as _; +#[cfg(feature = "alloy-genesis")] +use alloy_genesis as _; +#[cfg(feature = "alloy-primitives")] +use alloy_primitives as _; +#[cfg(feature = "alloy-rlp")] +use alloy_rlp as _; +#[cfg(feature = "reth-codecs")] +use reth_codecs as _; + mod block; mod receipt; pub use reth_static_file_types as static_file;