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

Replace RocksDB by LMDB #6

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

Asurar0
Copy link
Contributor

@Asurar0 Asurar0 commented Sep 10, 2024

For more information: #5

Initially, MDBX was considered for implementation over LMDB, but the API of the reference bindings underwent significant changes and support began to decline. As a result, I opted to implement LMDB instead, which benefits from extensive support in Rust libraries.

  • Removed RocksDB from Cargo.toml and the database module.
  • Added the heed crate to Cargo.toml.
  • Reimplemented the entire database API to utilize LMDB with tokio blocking tasks.
  • Fixed a potential key calculation bug.
  • Added documentation.
  • Refactored Database::chunk_exists to directly load the queried chunk into the cache if it exists.
  • Refactored Database::batch_insert to avoid querying the database for loading chunks into the cache that the function has already * allocated.

Internal logic changes are denoted by // WARNING: comments.

* Removed RocksDB from Cargo.toml and database module.
* Added `heed` crate to Cargo.toml.
* Reimplemented all the database API to make use of LMDB over tokio blocking tasks.
* Fixed potential key calculation bug.
* Added documentation.
* Refactored `Database::chunk_exists` to directly load the queried chunk into cache if it exists.
* Refactored `Database::batch_insert` to avoid querying database for loading into cache chunks the function already have allocated.
@ReCore-sys
Copy link
Collaborator

Build fails but that's cos of a broken discord webhook, code looks fine.

@ReCore-sys ReCore-sys merged commit 5016f47 into ferrumc-rs:dev Sep 11, 2024
1 check failed
@Sweattypalms Sweattypalms mentioned this pull request Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants