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

[lints]
workspace = true

[dependencies]
# reth
reth-db-api.workspace = true
reth-primitives = { workspace = true, features = ["reth-codec"] }
reth-fs-util.workspace = true
reth-storage-errors.workspace = true
reth-nippy-jar.workspace = true
reth-tracing.workspace = true

# ethereum
alloy-primitives.workspace = true

# mdbx
reth-libmdbx = { workspace = true, optional = true, features = ["return-borrowed", "read-tx-timeouts"] }
eyre = { workspace = true, optional = true }

# metrics
reth-metrics = { workspace = true, optional = true }
metrics = { workspace = true, optional = true }

# misc
page_size = { version = "0.6.0", optional = true }
thiserror.workspace = true
tempfile = { workspace = true, optional = true }
derive_more.workspace = true
rustc-hash = { workspace = true, optional = true }
sysinfo = { version = "0.33", default-features = false, features = ["system"] }
parking_lot = { workspace = true, optional = true }

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

[dev-dependencies]
# reth libs with arbitrary
reth-primitives = { workspace = true, features = ["arbitrary"] }
reth-primitives-traits = { workspace = true, features = ["reth-codec"] }
serde_json.workspace = true
tempfile.workspace = true
parking_lot.workspace = true

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

arbitrary = { workspace = true, features = ["derive"] }
proptest.workspace = true

assert_matches.workspace = true

[features]
default = ["mdbx"]
mdbx = [
    "dep:reth-libmdbx",
    "dep:eyre",
    "dep:page_size",
    "reth-metrics",
    "dep:metrics",
    "dep:strum",
    "dep:rustc-hash",
]
test-utils = [
    "dep:tempfile",
    "mdbx",
    "arbitrary",
    "parking_lot",
    "reth-primitives/test-utils",
    "reth-db-api/test-utils",
    "reth-nippy-jar/test-utils",
    "reth-primitives-traits/test-utils",
]
bench = ["reth-db-api/bench"]
arbitrary = [
    "reth-primitives/arbitrary",
    "reth-db-api/arbitrary",
    "alloy-primitives/arbitrary",
    "alloy-consensus/arbitrary",
    "reth-primitives-traits/arbitrary",
]
op = [
    "reth-db-api/op",
    "reth-primitives-traits/op",
]
disable-lock = []

[[bench]]
name = "hash_keys"
required-features = ["test-utils"]
harness = false

[[bench]]
name = "criterion"
required-features = ["test-utils"]
harness = false

[[bench]]
name = "get"
required-features = ["test-utils"]
harness = false
