Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(reth-db): no_std support #9597

Merged
merged 3 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ humantime-serde = "1.1"
rand = "0.8.5"
rustc-hash = { version = "2.0", default-features = false }
schnellru = "0.2"
strum = "0.26"
strum = { version = "0.26", default-features = false }
rayon = "1.7"
itertools = "0.13"
parking_lot = "0.12"
Expand Down
20 changes: 14 additions & 6 deletions crates/storage/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ eyre = { workspace = true, optional = true }
serde = { workspace = true, default-features = false }

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

# misc
bytes.workspace = true
page_size = "0.6.0"
page_size = { version = "0.6.0", optional = true }
thiserror.workspace = true
tempfile = { workspace = true, optional = true }
derive_more.workspace = true
paste.workspace = true
rustc-hash.workspace = true
rustc-hash = { workspace = true, optional = true }
sysinfo = { version = "0.30", default-features = false }

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

[dev-dependencies]
# reth libs with arbitrary
Expand Down Expand Up @@ -77,7 +77,15 @@ assert_matches.workspace = true

[features]
default = ["mdbx"]
mdbx = ["dep:reth-libmdbx", "dep:eyre"]
mdbx = [
"dep:reth-libmdbx",
"dep:eyre",
"dep:page_size",
"reth-metrics",
"dep:metrics",
"dep:strum",
"dep:rustc-hash",
]
test-utils = ["dep:tempfile", "arbitrary"]
bench = []
arbitrary = ["reth-primitives/arbitrary", "reth-db-api/arbitrary"]
Expand Down
3 changes: 3 additions & 0 deletions crates/storage/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@

mod implementation;
pub mod lockfile;
#[cfg(feature = "mdbx")]
mod metrics;
pub mod static_file;
pub mod tables;
#[cfg(feature = "mdbx")]
mod utils;
pub mod version;

Expand All @@ -28,6 +30,7 @@ pub mod mdbx;

pub use reth_storage_errors::db::{DatabaseError, DatabaseWriteOperation};
pub use tables::*;
#[cfg(feature = "mdbx")]
pub use utils::is_database_empty;

#[cfg(feature = "mdbx")]
Expand Down
1 change: 1 addition & 0 deletions crates/storage/db/src/tables/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub mod codecs;
mod raw;
pub use raw::{RawDupSort, RawKey, RawTable, RawValue, TableRawRow};

#[cfg(feature = "mdbx")]
pub(crate) mod utils;

use reth_db_api::{
Expand Down
Loading