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

[lints]
workspace = true

[dependencies]
# reth
reth-primitives-traits.workspace = true
reth-ethereum-forks.workspace = true
reth-static-file-types.workspace = true
reth-trie-common.workspace = true
revm-primitives = { workspace = true, features = ["serde"] }
reth-chainspec = { workspace = true, optional = true }
reth-codecs = { workspace = true, optional = true }

# ethereum
alloy-primitives = { workspace = true, features = ["rand", "rlp"] }
alloy-rlp = { workspace = true, features = ["arrayvec"] }
alloy-rpc-types = { workspace = true, optional = true }
alloy-genesis.workspace = true
alloy-eips = { workspace = true, features = ["serde"] }

# crypto
secp256k1 = { workspace = true, features = [
    "global-context",
    "recovery",
    "rand",
], optional = true }
k256.workspace = true
# for eip-4844
c-kzg = { workspace = true, features = ["serde"], optional = true }

# misc
bytes.workspace = true
derive_more.workspace = true
modular-bitfield = { workspace = true, optional = true }
once_cell.workspace = true
rayon.workspace = true
serde.workspace = true
tempfile = { workspace = true, optional = true }
thiserror = { workspace = true, optional = true }
zstd = { workspace = true, features = ["experimental"], optional = true }

# arbitrary utils
arbitrary = { workspace = true, features = ["derive"], optional = true }
proptest = { workspace = true, optional = true }

[dev-dependencies]
# eth
reth-primitives-traits = { workspace = true, features = ["arbitrary"] }
revm-primitives = { workspace = true, features = ["arbitrary"] }
reth-chainspec.workspace = true
reth-codecs.workspace = true
alloy-eips = { workspace = true, features = ["arbitrary"] }

assert_matches.workspace = true
arbitrary = { workspace = true, features = ["derive"] }
proptest.workspace = true
proptest-arbitrary-interop.workspace = true
rand.workspace = true
serde_json.workspace = true
test-fuzz.workspace = true
modular-bitfield.workspace = true


criterion.workspace = true
pprof = { workspace = true, features = [
    "flamegraph",
    "frame-pointer",
    "criterion",
] }

[features]
default = ["c-kzg", "alloy-compat", "std", "reth-codec", "secp256k1"]
std = ["thiserror", "reth-primitives-traits/std"]
reth-codec = ["dep:reth-codecs", "dep:zstd", "dep:modular-bitfield", "std"]
asm-keccak = ["alloy-primitives/asm-keccak"]
arbitrary = [
    "reth-primitives-traits/arbitrary",
    "revm-primitives/arbitrary",
    "reth-chainspec?/arbitrary",
    "reth-ethereum-forks/arbitrary",
    "alloy-eips/arbitrary",
    "dep:arbitrary",
    "dep:proptest",
    "reth-codec",
]
secp256k1 = ["dep:secp256k1"]
c-kzg = ["dep:c-kzg", "revm-primitives/c-kzg", "dep:tempfile", "alloy-eips/kzg"]
optimism = [
    "reth-chainspec/optimism",
    "reth-ethereum-forks/optimism",
    "revm-primitives/optimism",
]
alloy-compat = ["reth-primitives-traits/alloy-compat", "dep:alloy-rpc-types"]
test-utils = ["reth-primitives-traits/test-utils"]

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

[[bench]]
name = "validate_blob_tx"
required-features = ["arbitrary", "c-kzg"]
harness = false

