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

Merkle db fix range proof commit bug #2019

Merged
merged 13 commits into from
Sep 15, 2023
Merged

Conversation

dboehm-avalabs
Copy link
Contributor

Range Proofs were only being committed in the sync engine if they had key/values present. This normally isn't an issue, but if a range proof gets returned when a change proof was requested (which occurs when it is for a root that has left the history) and the only changes in that range were deletions, then we would skip committing the range proof, which means that any additional keys present in that range would not be deleted.

Fix involves always checking if the range proof needs committing even when it is empty and including the end of the range in question so that all of the correct keys can be deleted.

x/sync/manager.go Outdated Show resolved Hide resolved
x/merkledb/db_test.go Outdated Show resolved Hide resolved
x/merkledb/db.go Show resolved Hide resolved
x/merkledb/db.go Outdated Show resolved Hide resolved
@danlaine danlaine added bug Something isn't working merkledb labels Sep 15, 2023
@danlaine danlaine merged commit 3366c15 into dev Sep 15, 2023
16 checks passed
@danlaine danlaine deleted the MerkleDBFixRangeProofCommitError branch September 15, 2023 14:15
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