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

fix: concurrent concurrent Merkle tree subtree updates #703

Merged
merged 2 commits into from
May 13, 2024

Conversation

ananas-block
Copy link
Contributor

@ananas-block ananas-block commented May 11, 2024

Issue:

  • The Concurrent Merkle trees prior logic to update the subtrees after an update didn't cover all edge cases.

Solution:

  • Filled subtrees are the Merkle proof of the the leaf at next_index, the first zero bytes leaf that has not been updated yet.
  • Thus, we can use the changelog method update proof to update the filled subtrees with the changes from the latest changelog.

Changes:

  • replace update subtrees with update proof

Note:

  • it is not necessary to handle the case leaf_index == changelog_entry.index because it is not possible to update self.next_index with the update method

@ananas-block ananas-block requested a review from vadorovsky as a code owner May 11, 2024 21:32
@ananas-block ananas-block force-pushed the jorrit/fix-mt-subtree-updates branch from d21dabd to dd9173a Compare May 11, 2024 22:55
@vadorovsky vadorovsky merged commit ff4760e into main May 13, 2024
13 checks passed
@vadorovsky vadorovsky deleted the jorrit/fix-mt-subtree-updates branch May 13, 2024 10:36
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.

2 participants