Skip to content

Commit

Permalink
Revert "chore(rocksdb): getter for inner database handle (#2532)"
Browse files Browse the repository at this point in the history
This reverts commit a25ec26.
  • Loading branch information
rymnc committed Jan 6, 2025
1 parent 8bd4103 commit c89ebdc
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 23 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<BlockHeight>` 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.
Expand Down
14 changes: 1 addition & 13 deletions crates/fuel-core/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,6 @@ where
state_rewind_policy: StateRewindPolicy,
database_config: DatabaseConfig,
) -> Result<Self> {
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<HistoricalRocksDB<Description>> {
use anyhow::Context;

let db = HistoricalRocksDB::<Description>::default_open(
Expand All @@ -234,7 +222,7 @@ where
)
})?;

Ok(db)
Ok(Self::new(Arc::new(db)))
}

/// Converts the regular database to an unchecked database.
Expand Down
4 changes: 0 additions & 4 deletions crates/fuel-core/src/state/historical_rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ where
})
}

pub fn inner(&self) -> &RocksDb<Historical<Description>> {
&self.db
}

pub fn default_open<P: AsRef<Path>>(
path: P,
state_rewind_policy: StateRewindPolicy,
Expand Down
5 changes: 0 additions & 5 deletions crates/fuel-core/src/state/rocks_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ impl<Description> RocksDb<Description>
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<usize>) -> DatabaseResult<Self> {
Self::default_open_temp_with_params(DatabaseConfig {
cache_capacity: capacity,
Expand Down

0 comments on commit c89ebdc

Please sign in to comment.