fix(storage-api): gate reth-chain dependency behind std feature

The reth-chain crate is inherently std-only (uses BTreeMap, Arc, etc.)
and was breaking the riscv32imac no_std builds by pulling in serde_core
which doesn't support no_std properly.

This makes reth-chain optional and only enables it when std feature is
active, gating the block_writer module that uses Chain behind std.
This commit is contained in:
Georgios Konstantopoulos
2026-01-17 08:32:10 +00:00
parent c11c13000f
commit d5dc0b27eb
2 changed files with 6 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ workspace = true
[dependencies]
# reth
reth-chain.workspace = true
reth-chain = { workspace = true, optional = true }
reth-db-models.workspace = true
reth-chainspec.workspace = true
reth-db-api = { workspace = true, optional = true }
@@ -38,6 +38,7 @@ serde_json = { workspace = true, optional = true }
[features]
default = ["std"]
std = [
"dep:reth-chain",
"reth-chainspec/std",
"alloy-consensus/std",
"alloy-eips/std",
@@ -61,7 +62,7 @@ db-api = [
]
serde = [
"reth-chain/serde",
"reth-chain?/serde",
"reth-ethereum-primitives/serde",
"reth-db-models/serde",
"reth-execution-types/serde",
@@ -80,7 +81,7 @@ serde-bincode-compat = [
"reth-execution-types/serde-bincode-compat",
"reth-primitives-traits/serde-bincode-compat",
"reth-trie-common/serde-bincode-compat",
"reth-chain/serde-bincode-compat",
"reth-chain?/serde-bincode-compat",
"reth-ethereum-primitives/serde-bincode-compat",
"alloy-eips/serde-bincode-compat",
"alloy-consensus/serde-bincode-compat",

View File

@@ -85,7 +85,9 @@ pub use primitives::*;
mod block_indices;
pub use block_indices::*;
#[cfg(feature = "std")]
mod block_writer;
#[cfg(feature = "std")]
pub use block_writer::*;
mod state_writer;