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

feat: ✨ Upgrade trie-db 0.29.1 #66

Merged
merged 2 commits into from
May 15, 2024
Merged

feat: ✨ Upgrade trie-db 0.29.1 #66

merged 2 commits into from
May 15, 2024

Conversation

snowmead
Copy link
Contributor

@snowmead snowmead commented May 15, 2024

There was a bug with the double ended iteration implemented in trie-db which broke the behaviour expected for next_back() to yield either None or the previous leaf node after seek(challenge).

The fix was merged in paritytech/trie#215 with a minor version upgrade from trie-db@0.29.0 to trie-db@0.29.1. Since it is a minor version, we can apply it to our dependencies without requiring sp-trie to upgrade it's sub dependency on trie-db.

Changes:

  • Upgrades trie-db to 0.29.1
  • Removed ignored unit tests that were failing before due to bug in previous trie-db version
  • Remove false check for prev_leaf which can be None now based on fixed double ended trie iteration behaviour
  • Fix broken test to match prev_leaf to be None instead of being equal to next_leaf

@snowmead snowmead requested a review from ffarall May 15, 2024 13:01
@@ -352,7 +352,7 @@ fn commitment_verifier_challenge_key_before_first_key_success() {
// This is due to some inconsistent behaviour in the iterator, that when you seek to a key
// that is less than the first key, it will return the first key as the next_back leaf,
// even if it is not lower than the challenge key.
assert!(prev_leaf == next_leaf && challenged_key_vec < next_leaf.unwrap().unwrap().0);
assert!(prev_leaf.is_none() && challenged_key_vec < next_leaf.unwrap().unwrap().0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change doc comment to:

Assert that challenge_key is below next_leaf and that prev_leaf is None.

@snowmead snowmead merged commit 66a4304 into main May 15, 2024
11 checks passed
@snowmead snowmead deleted the feat/upgrade-trie-db branch May 15, 2024 15:28
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.

3 participants