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

Restore Merkle tree pruning for the wallet #353

Merged
merged 13 commits into from
Jun 12, 2023
Merged

Conversation

SupremoUGH
Copy link
Contributor

@SupremoUGH SupremoUGH commented Jun 5, 2023

Reenables the Merkle tree pruning functionality for the wallet, this time as a BTreeMap instead of vec, which allows for almost 100% saved space (as opposed to 50%). Fixes some things in fork which were incompatible with pruning, as well as some indexing issues which were incompatible with the branches.

Should also speed up sync time because of the batch optimization when merging a branch into its trunk. Not now, see the issue: #354

Goes together with: Manta-Network/sdk#133

Note for reviewers

When reviewing, please make sure that the indexing is right, meaning: indexes in the Partial Merkle tree and indexes in its leaf map are off by self.starting_leaf_index(). Make sure each function is using the right index, depending on whether they are interacting with the tree or just with its LeafMap.


Before we can merge this PR, please make sure that all the following items have been checked off:

  • Linked to an issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Added one line describing your change in CHANGELOG.md and added the appropriate changelog label to the PR.
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Checked that changes and commits conform to the standards outlined in CONTRIBUTING.md.

@SupremoUGH SupremoUGH self-assigned this Jun 5, 2023
@SupremoUGH SupremoUGH added the changelog:added Changelog: add these changes to the `added` section of the changelog label Jun 5, 2023
@SupremoUGH SupremoUGH changed the title Reinstore pruning good Restore Merkle tree pruning for the wallet Jun 5, 2023
@SupremoUGH SupremoUGH marked this pull request as ready for review June 5, 2023 18:04
@SupremoUGH SupremoUGH requested a review from Apokalip June 6, 2023 15:35
Apokalip
Apokalip previously approved these changes Jun 8, 2023
Copy link
Contributor

@Apokalip Apokalip left a comment

Choose a reason for hiding this comment

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

lgmt, I dont know if its not a bad idea to have tests for the leaf indexes(reviewer note)

@SupremoUGH SupremoUGH requested a review from zqhxuyuan June 8, 2023 15:35
@SupremoUGH SupremoUGH mentioned this pull request Jun 9, 2023
4 tasks
@SupremoUGH SupremoUGH merged commit 2f5b8d0 into main Jun 12, 2023
@SupremoUGH SupremoUGH deleted the reinstore_pruning_good branch June 12, 2023 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:added Changelog: add these changes to the `added` section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants