[package]
name = "reth-trie-common"
version.workspace = true
edition.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
description = "Commonly used types for trie usage in reth."

[lints]
workspace = true

[dependencies]
# alloy
alloy-primitives.workspace = true
alloy-rlp = { workspace = true, features = ["arrayvec"] }
alloy-trie = { workspace = true, features = ["ethereum"] }
alloy-consensus.workspace = true
reth-primitives-traits.workspace = true
reth-codecs = { workspace = true, optional = true }

alloy-rpc-types-eth = { workspace = true, optional = true }
alloy-serde = { workspace = true, optional = true }

bytes = { workspace = true, optional = true }
derive_more.workspace = true
itertools = { workspace = true, features = ["use_alloc"] }
nybbles = { workspace = true, features = ["rlp"] }

# `serde` feature
serde = { workspace = true, optional = true }

serde_with = { workspace = true, optional = true }

# `test-utils` feature
hash-db = { version = "=0.15.2", optional = true }
plain_hasher = { version = "0.2", optional = true }
arbitrary = { workspace = true, features = ["derive"], optional = true }

[dev-dependencies]
reth-primitives-traits = { workspace = true, features = ["serde"] }
reth-codecs.workspace = true
alloy-genesis.workspace = true

alloy-primitives = { workspace = true, features = ["getrandom"] }
alloy-trie = { workspace = true, features = ["arbitrary", "serde"] }
bytes.workspace = true
hash-db = "=0.15.2"
plain_hasher = "0.2"
arbitrary = { workspace = true, features = ["derive"] }
proptest.workspace = true
proptest-arbitrary-interop.workspace = true
criterion.workspace = true
bincode.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_with.workspace = true

[features]
default = ["std"]
std = [
    "alloy-consensus/std",
    "alloy-genesis/std",
    "alloy-primitives/std",
    "alloy-rlp/std",
    "alloy-rpc-types-eth?/std",
    "alloy-serde?/std",
    "alloy-trie/std",
    "bytes?/std",
    "derive_more/std",
    "nybbles/std",
    "reth-primitives-traits/std",
    "serde?/std",
    "serde_with?/std",
    "serde_json/std",
]
eip1186 = [
    "alloy-rpc-types-eth/serde",
    "dep:alloy-serde",
]
serde = [
    "dep:serde",
    "bytes?/serde",
    "nybbles/serde",
    "alloy-primitives/serde",
    "alloy-consensus/serde",
    "alloy-trie/serde",
    "alloy-rpc-types-eth?/serde",
    "reth-primitives-traits/serde",
    "reth-codecs?/serde",
]
reth-codec = [
    "dep:reth-codecs",
    "dep:bytes",
]
serde-bincode-compat = [
    "serde",
    "reth-primitives-traits/serde-bincode-compat",
    "alloy-consensus/serde-bincode-compat",
    "dep:serde_with",
]
test-utils = [
    "dep:plain_hasher",
    "dep:hash-db",
    "arbitrary",
    "reth-primitives-traits/test-utils",
    "reth-codecs/test-utils",
]
arbitrary = [
    "std",
    "dep:reth-codecs",
    "alloy-trie/arbitrary",
    "dep:arbitrary",
    "alloy-serde?/arbitrary",
    "reth-primitives-traits/arbitrary",
    "alloy-consensus/arbitrary",
    "alloy-primitives/arbitrary",
    "nybbles/arbitrary",
    "reth-codecs/arbitrary",
    "alloy-rpc-types-eth?/arbitrary",
]

[[bench]]
name = "prefix_set"
harness = false
