Skip to content
Draft
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
133 changes: 120 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cmd/ethrex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ path = "./lib.rs"

[features]
debug = ["ethrex-vm/debug"]
default = ["rocksdb", "c-kzg", "metrics", "jemalloc", "dev"]
default = ["canopydb", "c-kzg", "metrics", "jemalloc", "dev"]
dev = ["dep:ethrex-dev"]
c-kzg = [
"ethrex-vm/c-kzg",
Expand All @@ -84,6 +84,7 @@ c-kzg = [
]
metrics = ["ethrex-blockchain/metrics", "ethrex-l2?/metrics"]
rocksdb = ["ethrex-storage/rocksdb", "ethrex-p2p/rocksdb", "ethrex-l2?/rocksdb"]
canopydb = ["ethrex-storage/canopydb"]
jemalloc = ["dep:tikv-jemallocator"]
jemalloc_profiling = [
"jemalloc",
Expand Down
4 changes: 3 additions & 1 deletion cmd/ethrex/initializers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use tracing_subscriber::{
};

// Compile-time check to ensure that at least one of the database features is enabled.
#[cfg(not(feature = "rocksdb"))]
#[cfg(all(not(feature = "rocksdb"), not(feature = "canopydb")))]
const _: () = {
compile_error!("Database feature must be enabled (Available: `rocksdb`).");
};
Expand Down Expand Up @@ -120,6 +120,8 @@ pub fn open_store(datadir: &Path) -> Store {
} else {
#[cfg(feature = "rocksdb")]
let engine_type = EngineType::RocksDB;
#[cfg(feature = "canopydb")]
let engine_type = EngineType::CanopyDB;
#[cfg(feature = "metrics")]
ethrex_metrics::metrics_process::set_datadir_path(datadir.to_path_buf());
Store::new(datadir, engine_type).expect("Failed to create Store")
Expand Down
4 changes: 3 additions & 1 deletion cmd/ethrex/l2/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use std::{
use tracing::{debug, info};

// Compile-time check to ensure that at least one of the database features is enabled.
#[cfg(not(feature = "rocksdb"))]
#[cfg(all(not(feature = "rocksdb"), not(feature = "canopydb")))]
const _: () = {
compile_error!("Database feature must be enabled (Available: `rocksdb`).");
};
Expand Down Expand Up @@ -374,6 +374,8 @@ impl Command {
} => {
#[cfg(feature = "rocksdb")]
let store_type = EngineType::RocksDB;
#[cfg(feature = "canopydb")]
let store_type = EngineType::CanopyDB;

#[cfg(feature = "l2-sql")]
let rollup_store_type = ethrex_storage_rollup::EngineTypeRollup::SQL;
Expand Down
3 changes: 3 additions & 0 deletions crates/storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ tokio = { workspace = true, features = ["rt"] }
qfilter = "0.2.5"
rayon.workspace = true

canopydb = { version = "0.2.4", optional = true }

[features]
default = []
rocksdb = ["dep:rocksdb", "ethrex-trie/rocksdb"]
canopydb = ["dep:canopydb"]

[dev-dependencies]
hex.workspace = true
Expand Down
Loading
Loading