diff --git a/Cargo.toml b/Cargo.toml index 1c470f72e..be300f7d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -318,7 +318,7 @@ reth-codecs = { path = "crates/storage/codecs" } reth-codecs-derive = { path = "crates/storage/codecs/derive" } reth-config = { path = "crates/config" } reth-consensus = { path = "crates/consensus/consensus", default-features = false } -reth-consensus-common = { path = "crates/consensus/common" } +reth-consensus-common = { path = "crates/consensus/common", default-features = false } reth-consensus-debug-client = { path = "crates/consensus/debug-client" } reth-db = { path = "crates/storage/db", default-features = false } reth-db-api = { path = "crates/storage/db-api" } diff --git a/crates/consensus/common/Cargo.toml b/crates/consensus/common/Cargo.toml index e551c64cc..448b3a168 100644 --- a/crates/consensus/common/Cargo.toml +++ b/crates/consensus/common/Cargo.toml @@ -26,3 +26,14 @@ alloy-eips.workspace = true alloy-consensus.workspace = true rand.workspace = true +[features] +default = ["std"] +std = [ + "alloy-consensus/std", + "alloy-eips/std", + "alloy-primitives/std", + "reth-chainspec/std", + "reth-consensus/std", + "reth-primitives/std", + "reth-primitives-traits/std" +] diff --git a/crates/consensus/common/src/lib.rs b/crates/consensus/common/src/lib.rs index e3503656b..9e5eb2aaf 100644 --- a/crates/consensus/common/src/lib.rs +++ b/crates/consensus/common/src/lib.rs @@ -7,6 +7,7 @@ )] #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(not(feature = "std"), no_std)] /// Collection of consensus validation methods. pub mod validation; diff --git a/crates/evm/Cargo.toml b/crates/evm/Cargo.toml index 0d9bc26c0..8f58e8241 100644 --- a/crates/evm/Cargo.toml +++ b/crates/evm/Cargo.toml @@ -58,7 +58,8 @@ std = [ "revm-primitives/std", "revm/std", "reth-ethereum-forks/std", - "reth-chainspec/std" + "reth-chainspec/std", + "reth-consensus-common/std" ] test-utils = [ "dep:parking_lot", diff --git a/crates/optimism/evm/Cargo.toml b/crates/optimism/evm/Cargo.toml index 190b5d4f9..e2ec79401 100644 --- a/crates/optimism/evm/Cargo.toml +++ b/crates/optimism/evm/Cargo.toml @@ -73,7 +73,8 @@ std = [ "reth-optimism-forks/std", "thiserror/std", "op-alloy-consensus/std", - "reth-chainspec/std" + "reth-chainspec/std", + "reth-consensus-common/std" ] optimism = [ "reth-primitives/optimism",