diff --git a/crates/storage/db/Cargo.toml b/crates/storage/db/Cargo.toml index 428290317743..63c750ce8a99 100644 --- a/crates/storage/db/Cargo.toml +++ b/crates/storage/db/Cargo.toml @@ -78,7 +78,6 @@ mdbx = ["reth-libmdbx"] bench = [] arbitrary = ["reth-primitives/arbitrary", "reth-db-api/arbitrary"] optimism = [] -disable_lock = [] [[bench]] name = "hash_keys" diff --git a/crates/storage/db/src/lockfile.rs b/crates/storage/db/src/lockfile.rs index 76c1a4aa1116..5f764d894caf 100644 --- a/crates/storage/db/src/lockfile.rs +++ b/crates/storage/db/src/lockfile.rs @@ -1,7 +1,5 @@ //! Storage lock utils. -#![cfg_attr(feature = "disable_lock", allow(dead_code))] - use reth_storage_errors::lockfile::StorageLockError; use reth_tracing::tracing::error; use std::{ @@ -31,23 +29,13 @@ impl StorageLock { /// with the same PID), it will succeed. pub fn try_acquire(path: &Path) -> Result { let file_path = path.join(LOCKFILE_NAME); - - #[cfg(feature = "disable_lock")] - { - // Too expensive for ef-tests to write/read lock to/from disk. - Ok(Self(Arc::new(StorageLockInner { file_path }))) - } - - #[cfg(not(feature = "disable_lock"))] - { - if let Some(process_lock) = ProcessUID::parse(&file_path)? { - if process_lock.pid != (process::id() as usize) && process_lock.is_active() { - return Err(StorageLockError::Taken(process_lock.pid)) - } + if let Some(process_lock) = ProcessUID::parse(&file_path)? { + if process_lock.pid != (process::id() as usize) && process_lock.is_active() { + return Err(StorageLockError::Taken(process_lock.pid)) } - - Ok(Self(Arc::new(StorageLockInner::new(file_path)?))) } + + Ok(Self(Arc::new(StorageLockInner::new(file_path)?))) } } diff --git a/testing/ef-tests/Cargo.toml b/testing/ef-tests/Cargo.toml index 0453892c96dc..ecacc0a67f7c 100644 --- a/testing/ef-tests/Cargo.toml +++ b/testing/ef-tests/Cargo.toml @@ -17,7 +17,7 @@ asm-keccak = ["reth-primitives/asm-keccak"] [dependencies] reth-primitives.workspace = true -reth-db = { workspace = true, features = ["mdbx", "test-utils", "disable_lock"] } +reth-db = { workspace = true, features = ["mdbx", "test-utils"] } reth-db-api.workspace = true reth-provider = { workspace = true, features = ["test-utils"] } reth-stages.workspace = true