Skip to content

deps: bump libmdbx to 0.13.6 #15412

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

Merged
merged 10 commits into from
May 12, 2025
Merged

deps: bump libmdbx to 0.13.6 #15412

merged 10 commits into from
May 12, 2025

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Mar 31, 2025

DO NOT MERGE: blocked until we test this PR and Pectra is on mainnet


This bump has breaking changes in cursor behaviour.

  • Cursor no longer positions on the last entry in the table if seek_exact didn't find a matching key
    let _unknown = cursor.seek_exact(ShardedKey::new(real_key, u64::MAX)).unwrap();
    assert_eq!(cursor.seek_exact(key2), Ok(None));
    assert_eq!(
    cursor.delete_current(),
    Err(DatabaseError::Delete(reth_libmdbx::Error::NoData.into()))
    );
  • Deletion of the current key the cursor is positioned at moves the cursor forward, not back
    assert_eq!(
    cursor.get_current().unwrap(),
    Some((Cow::Borrowed(b"key2" as &[u8]), Cow::Borrowed(b"val2" as &[u8])))
    );
    cursor.del(WriteFlags::empty()).unwrap();
    assert_eq!(
    cursor.get_current().unwrap(),
    Some((Cow::Borrowed(b"key3" as &[u8]), Cow::Borrowed(b"val3" as &[u8])))
    );

@shekhirin shekhirin added A-db Related to the database A-dependencies Pull requests or issues that are about dependencies labels Mar 31, 2025
@erthink
Copy link

erthink commented Mar 31, 2025

@shekhirin, Please use the stable branch (where is a regression hotfix and a few minors) instead of exactly the v0.13.5, or wait for the v0.13.6 release.

@shekhirin
Copy link
Collaborator Author

@erthink I see, we will wait for the 0.13.6, thank you! Do you have any estimates when do you plan to release it?

@erthink
Copy link

erthink commented Mar 31, 2025

@erthink I see, we will wait for the 0.13.6, thank you! Do you have any estimates when do you plan to release it?

The 0.13.6 release is expected to be in 3 weeks, i.e. in April. But if you intend to use the 0.13.x branch, then I recommend not waiting for the next release, but achieving the tests now with the stable branch.

This will avoid discovering some kind of flaws immediately after the release (which just a scheduled in time manner).

@erthink
Copy link

erthink commented Mar 31, 2025

@shekhirin, I just noticed that some cursors operation tests are broken.
I assume that the reason is not libmbx, but bindings or tests.

Since version 0.13, libmdbx has additional checks that prohibit operations with the cursor in a undefined/unpredictable state.
For instance, libmdbx prohibits relative-move or delete-current operations after an unsuccessful search, because a cursor position and/or state are not fully defined.

Thus a hidden heisenbugs are revealed.

--

Actually, of course, cursor(s) behavior are fully deterministic.
However, some search operations can be faulted/finished early/uncompelete, and therefore the result cursor position depends on the specific contents of the b-tree and its structure, which are unpredictable from the user's point of view when using the API.

@shekhirin shekhirin changed the title deps: bump libmdbx to 0.13.5 deps: bump libmdbx to 0.13.6 May 6, 2025
@shekhirin shekhirin force-pushed the alexey/bump-mdbx-1 branch from 63a9723 to 85fcd03 Compare May 6, 2025 09:53
@jenpaff jenpaff moved this from Todo to In Progress in Reth Tracker May 6, 2025
@shekhirin shekhirin force-pushed the alexey/bump-mdbx-1 branch from 1f958b4 to 24c8c1d Compare May 6, 2025 10:36
@shekhirin shekhirin marked this pull request as ready for review May 6, 2025 11:04
@shekhirin shekhirin requested a review from joshieDo as a code owner May 6, 2025 11:04
@shekhirin shekhirin changed the title deps: bump libmdbx to 0.13.6 DO NOT MERGE: deps: bump libmdbx to 0.13.6 May 6, 2025
@shekhirin shekhirin marked this pull request as draft May 6, 2025 13:13
@shekhirin shekhirin changed the title DO NOT MERGE: deps: bump libmdbx to 0.13.6 deps: bump libmdbx to 0.13.6 May 12, 2025
@shekhirin shekhirin marked this pull request as ready for review May 12, 2025 14:18
@shekhirin shekhirin added this pull request to the merge queue May 12, 2025
Merged via the queue into main with commit 0dee91f May 12, 2025
47 of 50 checks passed
@shekhirin shekhirin deleted the alexey/bump-mdbx-1 branch May 12, 2025 16:34
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker May 12, 2025
@jenpaff jenpaff moved this from Done to Completed in Reth Tracker May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-db Related to the database A-dependencies Pull requests or issues that are about dependencies
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

3 participants