diff --git a/Cargo.lock b/Cargo.lock index fd89ca705..59d764a9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -214,15 +214,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - [[package]] name = "bit-set" version = "0.8.0" @@ -756,7 +747,6 @@ dependencies = [ "bytemuck", "bytes", "cfg-if", - "heed", "page_size", "paste", "redb", @@ -1330,15 +1320,6 @@ dependencies = [ "syn 2.0.101", ] -[[package]] -name = "doxygen-rs" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "415b6ec780d34dcf624666747194393603d0373b7141eef01d12ee58881507d9" -dependencies = [ - "phf", -] - [[package]] name = "either" version = "1.15.0" @@ -1604,44 +1585,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "heed" -version = "0.20.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d4f449bab7320c56003d37732a917e18798e2f1709d80263face2b4f9436ddb" -dependencies = [ - "bitflags 2.9.0", - "byteorder", - "heed-traits", - "heed-types", - "libc", - "lmdb-master-sys", - "once_cell", - "page_size", - "serde", - "synchronoise", - "url", -] - -[[package]] -name = "heed-traits" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3130048d404c57ce5a1ac61a903696e8fcde7e8c2991e9fcfc1f27c3ef74ff" - -[[package]] -name = "heed-types" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d3f528b053a6d700b2734eabcd0fd49cb8230647aa72958467527b0b7917114" -dependencies = [ - "bincode", - "byteorder", - "heed-traits", - "serde", - "serde_json", -] - [[package]] name = "hex" version = "0.4.3" @@ -2015,17 +1958,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" -[[package]] -name = "lmdb-master-sys" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864808e0b19fb6dd3b70ba94ee671b82fce17554cf80aeb0a155c65bb08027df" -dependencies = [ - "cc", - "doxygen-rs", - "libc", -] - [[package]] name = "lock_api" version = "0.4.12" @@ -2363,48 +2295,6 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "phf" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" -dependencies = [ - "phf_macros", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" -dependencies = [ - "phf_shared", - "rand", -] - -[[package]] -name = "phf_macros" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn 2.0.101", -] - -[[package]] -name = "phf_shared" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" -dependencies = [ - "siphasher", -] - [[package]] name = "pin-project" version = "1.1.10" @@ -2975,12 +2865,6 @@ dependencies = [ "tower-service 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - [[package]] name = "skein" version = "0.1.1" @@ -3105,15 +2989,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" -[[package]] -name = "synchronoise" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dbc01390fc626ce8d1cffe3376ded2b72a11bb70e1c75f404a210e4daa4def2" -dependencies = [ - "crossbeam-queue", -] - [[package]] name = "synstructure" version = "0.13.2" diff --git a/storage/blockchain/Cargo.toml b/storage/blockchain/Cargo.toml index 34324ebc1..6ab13f412 100644 --- a/storage/blockchain/Cargo.toml +++ b/storage/blockchain/Cargo.toml @@ -9,12 +9,12 @@ repository = "https://github.com/Cuprate/cuprate/tree/main/storage/cuprate-bloc keywords = ["cuprate", "blockchain", "database"] [features] -default = ["heed"] +default = [] # default = ["redb", "service"] # default = ["redb-memory", "service"] -heed = ["cuprate-database/heed"] -redb = ["cuprate-database/redb"] -redb-memory = ["cuprate-database/redb-memory"] +# heed = ["cuprate-database/heed"] +# redb = ["cuprate-database/redb"] +# redb-memory = ["cuprate-database/redb-memory"] serde = ["dep:serde", "cuprate-database/serde", "cuprate-database-service/serde", "cuprate-helper/serde"] [dependencies] diff --git a/storage/database/Cargo.toml b/storage/database/Cargo.toml index 28ec07c7c..c29ff331d 100644 --- a/storage/database/Cargo.toml +++ b/storage/database/Cargo.toml @@ -9,12 +9,10 @@ repository = "https://github.com/Cuprate/cuprate/tree/main/storage/database" keywords = ["cuprate", "database"] [features] -default = ["heed"] +default = [] # default = ["redb"] # default = ["redb-memory"] -heed = [] -redb = ["dep:redb"] -redb-memory = ["redb"] +# heed = [] [dependencies] bytemuck = { version = "1.18.0", features = ["must_cast", "derive", "min_const_generics", "extern_crate_alloc"] } @@ -26,8 +24,8 @@ thiserror = { workspace = true } tracing = { workspace = true } # Optional features. -heed = { version = "0.20.5", features = ["read-txn-no-tls"] } -redb = { version = "2.1.3", optional = true } +# heed = { version = "0.20.5", features = ["read-txn-no-tls"] } +redb = { version = "2.1.3" } serde = { workspace = true, optional = true } [dev-dependencies] diff --git a/storage/database/src/backend/mod.rs b/storage/database/src/backend/mod.rs index ebe12d860..8ea76e901 100644 --- a/storage/database/src/backend/mod.rs +++ b/storage/database/src/backend/mod.rs @@ -1,18 +1,7 @@ //! Database backends. -cfg_if::cfg_if! { - // If both backends are enabled, fallback to `heed`. - // This is useful when using `--all-features`. - if #[cfg(all(feature = "redb", not(feature = "heed")))] { - use heed as _; - - mod redb; - pub use redb::ConcreteEnv; - } else { - mod heed; - pub use heed::ConcreteEnv; - } -} +mod redb; +pub use redb::ConcreteEnv; #[cfg(test)] mod tests; diff --git a/storage/database/src/constants.rs b/storage/database/src/constants.rs index 6460d6939..d7f606e47 100644 --- a/storage/database/src/constants.rs +++ b/storage/database/src/constants.rs @@ -27,15 +27,7 @@ If this happens frequently, consider using the `Safe` sync mode."; /// |---------|-------| /// | `heed` | `"heed"` /// | `redb` | `"redb"` -pub const DATABASE_BACKEND: &str = { - cfg_if! { - if #[cfg(all(feature = "redb", not(feature = "heed")))] { - "redb" - } else { - "heed" - } - } -}; +pub const DATABASE_BACKEND: &str = "redb"; /// Cuprate's database filename. /// @@ -45,15 +37,7 @@ pub const DATABASE_BACKEND: &str = { /// |---------|-------| /// | `heed` | `"data.mdb"` /// | `redb` | `"data.redb"` -pub const DATABASE_DATA_FILENAME: &str = { - cfg_if! { - if #[cfg(all(feature = "redb", not(feature = "heed")))] { - "data.redb" - } else { - "data.mdb" - } - } -}; +pub const DATABASE_DATA_FILENAME: &str = "data.redb"; /// Cuprate's database lock filename. /// @@ -61,15 +45,7 @@ pub const DATABASE_DATA_FILENAME: &str = { /// |---------|-------| /// | `heed` | `Some("lock.mdb")` /// | `redb` | `None` (redb doesn't use a file lock) -pub const DATABASE_LOCK_FILENAME: Option<&str> = { - cfg_if! { - if #[cfg(all(feature = "redb", not(feature = "heed")))] { - None - } else { - Some("lock.mdb") - } - } -}; +pub const DATABASE_LOCK_FILENAME: Option<&str> = None; //---------------------------------------------------------------------------------------------------- Tests #[cfg(test)] diff --git a/storage/database/src/lib.rs b/storage/database/src/lib.rs index 8e48fca0d..478fbaa59 100644 --- a/storage/database/src/lib.rs +++ b/storage/database/src/lib.rs @@ -63,13 +63,3 @@ pub(crate) mod tests; // Used inside public facing macros. #[doc(hidden)] pub use paste; - -//---------------------------------------------------------------------------------------------------- -// HACK: needed to satisfy the `unused_crate_dependencies` lint. -cfg_if::cfg_if! { - if #[cfg(feature = "redb")] { - use redb as _; - } else { - use heed as _; - } -} diff --git a/storage/service/Cargo.toml b/storage/service/Cargo.toml index 9e35e28f1..36b6a1d9d 100644 --- a/storage/service/Cargo.toml +++ b/storage/service/Cargo.toml @@ -9,10 +9,10 @@ repository = "https://github.com/Cuprate/cuprate/tree/main/storage/service" keywords = ["cuprate", "service", "database"] [features] -default = ["heed"] -heed = ["cuprate-database/heed"] -redb = ["cuprate-database/redb"] -redb-memory = ["cuprate-database/redb-memory"] +default = [] +# heed = ["cuprate-database/heed"] +# redb = ["cuprate-database/redb"] +# redb-memory = ["cuprate-database/redb-memory"] [dependencies] cuprate-database = { workspace = true } diff --git a/storage/txpool/Cargo.toml b/storage/txpool/Cargo.toml index 63d55578e..03bdeb460 100644 --- a/storage/txpool/Cargo.toml +++ b/storage/txpool/Cargo.toml @@ -9,16 +9,16 @@ repository = "https://github.com/Cuprate/cuprate/tree/main/storage/txpool" keywords = ["cuprate", "txpool", "transaction", "pool", "database"] [features] -default = ["heed"] +default = [] # default = ["redb", "service"] # default = ["redb-memory", "service"] -heed = ["cuprate-database/heed"] -redb = ["cuprate-database/redb"] -redb-memory = ["cuprate-database/redb-memory"] +# heed = ["cuprate-database/heed"] +# redb = ["cuprate-database/redb"] +# redb-memory = ["cuprate-database/redb-memory"] serde = ["dep:serde", "cuprate-database/serde", "cuprate-database-service/serde", "cuprate-helper/serde"] [dependencies] -cuprate-database = { workspace = true, features = ["heed"] } +cuprate-database = { workspace = true } cuprate-database-service = { workspace = true } cuprate-types = { workspace = true, features = ["rpc"] } cuprate-helper = { workspace = true, default-features = false, features = ["constants"] }