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

feat(l1): add support for a QMDB engine store #1716

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
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
218 changes: 200 additions & 18 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ tracing-subscriber = { version = "0.3.0", features = ["env-filter"] }
ethereum-types = { version = "0.15.1", features = ["serialize"] }
serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.117"
libmdbx = { version = "0.5.0", features = ["orm"] }
libmdbx = { version = "0.5.3", features = ["orm"] }
bytes = { version = "1.6.0", features = ["serde"] }
tokio = { version = "1.41.1", features = ["full"] }
thiserror = "2.0.9"
Expand All @@ -73,3 +73,4 @@ secp256k1 = { version = "0.29", default-features = false, features = [
] }
keccak-hash = "0.11.0"
axum = "0.8.1"
qmdb = { git = "https://github.com/LayerZero-Labs/qmdb", package = "qmdb" }
2 changes: 2 additions & 0 deletions cmd/ethrex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ local-ip-address = "0.6"
tokio-util.workspace = true
libmdbx = { workspace = true, optional = true }
redb = { workspace = true, optional = true }
qmdb = { workspace = true, optional = true }
lazy_static.workspace = true

cfg-if = "1.0.0"
Expand All @@ -47,5 +48,6 @@ dev = ["dep:ethrex-dev"]
metrics = ["ethrex-blockchain/metrics", "ethrex-l2/metrics"]
libmdbx = ["dep:libmdbx", "ethrex-storage/libmdbx"]
redb = ["dep:redb", "ethrex-storage/redb"]
qmdb = ["dep:qmdb", "ethrex-storage/qmdb"]
l2 = ["dep:ethrex-l2", "ethrex-vm/l2"]
levm = ["default", "ethrex-vm/levm", "ethrex-blockchain/levm"]
2 changes: 2 additions & 0 deletions cmd/ethrex/ethrex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ async fn main() {
let store = Store::new(&data_dir, EngineType::RedB).expect("Failed to create Store");
} else if #[cfg(feature = "libmdbx")] {
let store = Store::new(&data_dir, EngineType::Libmdbx).expect("Failed to create Store");
} else if #[cfg(feature = "qmdb")] {
let store = Store::new(&data_dir, EngineType::Qmdb).expect("Failed to create QMDB Store");
} else {
let store = Store::new(&data_dir, EngineType::InMemory).expect("Failed to create Store");
}
Expand Down
6 changes: 5 additions & 1 deletion crates/storage/store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.117"
libmdbx = { workspace = true, optional = true }
redb = { workspace = true, optional = true }
qmdb = { workspace = true, optional = true }


[features]
default = []
# FIXME: Remove qmdb from the defaults before merging to main
default = ["qmdb"]
libmdbx = ["dep:libmdbx", "ethrex-trie/libmdbx", "ethrex-core/libmdbx"]
redb = ["dep:redb", "ethrex-trie/redb", "ethrex-core/redb"]
qmdb = ["dep:qmdb"]

[dev-dependencies]
hex.workspace = true
Expand Down
2 changes: 2 additions & 0 deletions crates/storage/store/engines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ pub mod api;
pub mod in_memory;
#[cfg(feature = "libmdbx")]
pub mod libmdbx;
#[cfg(feature = "qmdb")]
pub mod qmdb;
#[cfg(feature = "redb")]
pub mod redb;
mod utils;
Loading
Loading