signet-libmdbx
Rust bindings for libmdbx.
Forked from reth-libmdbx, which was
forked from an earlier Apache licenced version of the libmdbx-rs crate.
NOTE: Most of the repo came from lmdb-rs bindings.
Differences from reth-libmdbx
- Improve documentation :)
- Add [
TxUnsync] type for single-threaded transactions.- These may be up to 3x faster than the thread-safe versions.
- Rename [
Transaction] to [TxSync] for clarity. - Improve support for custom
TableObjecttypes.- Added
TableObjectOwnedtrait to represent types that can be deserialized from a database table without borrowing. - Added
ReadErrorerror type to represent errors that can occur when reading from the database. This captures MDBX errors as well as codec specific errors.
- Added
- More-accurate lifetime semantics
- Cursors now have lifetimes tied to the transaction they were created from.
- Cursors CANNOT hold transactions open.
- All DB reads borrow from the transaction when available.
- API consistency review
iteranditer_dupnow have consistent behavior (previously,iterwould start at the next key, whileiter_dupwould start at the current key).- Iteration methods that reposition the cursor now do so BEFORE returning the iterator.
- Module layout changes
sys- Environment and transaction management.tx- module contains transactions, cursors, and iterators
Updating the libmdbx Version
To update the libmdbx version you must clone it and copy the dist/ folder in
mdbx-sys/.
Make sure to follow the building steps.
# clone libmdbx to a repository outside at specific tag
# copy the `libmdbx/dist/` folder just created into `mdbx-sys/libmdbx`
# add the changes to the next commit you will make
Linux Testing
Run tests in a Linux environment (Ubuntu 24.04):
# Build the test image
# Run full checks (fmt, clippy, tests)
# Run specific commands