Skip to content

Commit a627dcd

Browse files
authored
chore: no_std in reth-codec (paradigmxyz#9587)
1 parent 8417473 commit a627dcd

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ alloy-primitives = "0.7.2"
390390
alloy-dyn-abi = "0.7.2"
391391
alloy-sol-types = "0.7.2"
392392
alloy-rlp = "0.3.4"
393-
alloy-trie = "0.4"
393+
alloy-trie = { version = "0.4", default-features = false }
394394
alloy-rpc-types = { version = "0.2", default-features = false, features = [
395395
"eth",
396396
] }

crates/storage/codecs/Cargo.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ alloy-consensus = { workspace = true, optional = true }
1919
alloy-eips = { workspace = true, optional = true }
2020
alloy-genesis = { workspace = true, optional = true }
2121
alloy-primitives.workspace = true
22-
alloy-trie.workspace = true
22+
alloy-trie = { workspace = true, optional = true }
2323

2424
# misc
2525
bytes.workspace = true
2626
modular-bitfield = { workspace = true, optional = true }
27-
serde.workspace = true
27+
serde = { workspace = true, optional = true }
2828

2929
[dev-dependencies]
3030
alloy-eips = { workspace = true, default-features = false, features = [
@@ -43,10 +43,11 @@ proptest-arbitrary-interop.workspace = true
4343

4444
[features]
4545
default = ["std", "alloy"]
46-
std = ["alloy-primitives/std", "bytes/std"]
46+
std = ["alloy-primitives/std", "bytes/std", "serde/std"]
4747
alloy = [
4848
"dep:alloy-consensus",
4949
"dep:alloy-eips",
5050
"dep:alloy-genesis",
5151
"dep:modular-bitfield",
52+
"dep:alloy-trie",
5253
]

crates/storage/codecs/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ pub use reth_codecs_derive::*;
2222
use alloy_primitives::{Address, Bloom, Bytes, FixedBytes, U256};
2323
use bytes::Buf;
2424

25+
#[cfg(not(feature = "std"))]
26+
extern crate alloc;
27+
#[cfg(not(feature = "std"))]
28+
use alloc::vec::Vec;
29+
2530
#[cfg(any(test, feature = "alloy"))]
2631
mod alloy;
2732

0 commit comments

Comments
 (0)