Skip to content

merkledb -- fix findNextKey #1653

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 4 commits into from
Jun 27, 2023
Merged

merkledb -- fix findNextKey #1653

merged 4 commits into from
Jun 27, 2023

Conversation

danlaine
Copy link

Why this should be merged

Fixes a bug.

How this works

It's possible for the endProof passed into findNextKey to be length 0. In this case we panic on if !proofKeyPath.HasPrefix(receivedProofNodes[len(receivedProofNodes)-1].KeyPath) {

This PR fixes the bug by handling this case.

Also improves comment on findNextKey.

How this was tested

New UT, also separate merkledb testing tool

@danlaine danlaine self-assigned this Jun 26, 2023
@danlaine danlaine added bug Something isn't working merkledb labels Jun 26, 2023
@danlaine danlaine merged commit fd05f6c into dev Jun 27, 2023
@danlaine danlaine deleted the merkledb-fix-findnextkey branch June 27, 2023 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working merkledb
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants