From c89ebdc7212880d5f693a69d9bb7cb0449e223f0 Mon Sep 17 00:00:00 2001 From: rymnc <43716372+rymnc@users.noreply.github.com> Date: Mon, 6 Jan 2025 23:20:40 +0530 Subject: [PATCH] Revert "chore(rocksdb): getter for inner database handle (#2532)" This reverts commit a25ec261c1661e1c263c7a8ffb1a89f699ddeb9c. --- CHANGELOG.md | 1 - crates/fuel-core/src/database.rs | 14 +------------- crates/fuel-core/src/state/historical_rocksdb.rs | 4 ---- crates/fuel-core/src/state/rocks_db.rs | 5 ----- 4 files changed, 1 insertion(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87c510b898..d8c0176d1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - [2033](https://github.com/FuelLabs/fuel-core/pull/2033): Remove `Option` in favor of `BlockHeightQuery` where applicable. - [2472](https://github.com/FuelLabs/fuel-core/pull/2472): Added the `amountU128` field to the `Balance` GraphQL schema, providing the total balance as a `U128`. The existing `amount` field clamps any balance exceeding `U64` to `u64::MAX`. - [2526](https://github.com/FuelLabs/fuel-core/pull/2526): Add possibility to not have any cache set for RocksDB. Add an option to either load the RocksDB columns families on creation of the database or when the column is used. -- [2532](https://github.com/FuelLabs/fuel-core/pull/2532): Getters for inner rocksdb database handles. ### Fixed - [2365](https://github.com/FuelLabs/fuel-core/pull/2365): Fixed the error during dry run in the case of race condition. diff --git a/crates/fuel-core/src/database.rs b/crates/fuel-core/src/database.rs index 3886062e4f..7def87dd3f 100644 --- a/crates/fuel-core/src/database.rs +++ b/crates/fuel-core/src/database.rs @@ -207,18 +207,6 @@ where state_rewind_policy: StateRewindPolicy, database_config: DatabaseConfig, ) -> Result { - let db = - Self::open_as_historical_rocksdb(path, state_rewind_policy, database_config)?; - - Ok(Self::new(Arc::new(db))) - } - - #[cfg(feature = "rocksdb")] - pub fn open_as_historical_rocksdb( - path: &Path, - state_rewind_policy: StateRewindPolicy, - database_config: DatabaseConfig, - ) -> Result> { use anyhow::Context; let db = HistoricalRocksDB::::default_open( @@ -234,7 +222,7 @@ where ) })?; - Ok(db) + Ok(Self::new(Arc::new(db))) } /// Converts the regular database to an unchecked database. diff --git a/crates/fuel-core/src/state/historical_rocksdb.rs b/crates/fuel-core/src/state/historical_rocksdb.rs index 6422e2a1c4..371ca99cce 100644 --- a/crates/fuel-core/src/state/historical_rocksdb.rs +++ b/crates/fuel-core/src/state/historical_rocksdb.rs @@ -106,10 +106,6 @@ where }) } - pub fn inner(&self) -> &RocksDb> { - &self.db - } - pub fn default_open>( path: P, state_rewind_policy: StateRewindPolicy, diff --git a/crates/fuel-core/src/state/rocks_db.rs b/crates/fuel-core/src/state/rocks_db.rs index 3f43333c15..518ff6590c 100644 --- a/crates/fuel-core/src/state/rocks_db.rs +++ b/crates/fuel-core/src/state/rocks_db.rs @@ -155,11 +155,6 @@ impl RocksDb where Description: DatabaseDescription, { - /// Allows consumers to get the inner db handle - pub fn inner(&self) -> &DB { - &self.db - } - pub fn default_open_temp(capacity: Option) -> DatabaseResult { Self::default_open_temp_with_params(DatabaseConfig { cache_capacity: capacity,