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

Prune more Merkle tree snapshots #4043

Merged
merged 3 commits into from
Nov 19, 2024
Merged

Conversation

yito88
Copy link
Member

@yito88 yito88 commented Nov 18, 2024

Describe your changes

The old Merkle tree snapshots for NoDiff and CommitData don't need to be saved.
The storage space was occupied by NoDiff Merkle tree snapshots.

This PR prunes the previous snapshots at every block commit.

  • prune_merkle_tree_stores prunes subtree snapshots which are saved every block
    • Other snapshots which are saved every epoch are pruned as before
  • read_merkle_tree_stores returns incomplete Merkle tree if the store type isn't specified i.e. if it is requested to restore all subtrees. (When the store type is specified, it returns an error if the store type snapshot doesn't exist.) get_merkle_tree will rebuild the incomplete subtrees.

Checklist before merging

  • If this PR has some consensus breaking changes, I added the corresponding breaking:: labels
    • This will require 2 reviewers to approve the changes
  • If this PR requires changes to the docs or specs, a corresponding PR is opened in the namada-docs repo
    • Relevant PR if applies:
  • If this PR affects services such as namada-indexer or namada-masp-indexer, a corresponding PR is opened in that repo
    • Relevant PR if applies:

Copy link

codecov bot commented Nov 18, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 74.25%. Comparing base (47fc912) to head (ddecdfe).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
crates/storage/src/mockdb.rs 63.63% 4 Missing ⚠️
crates/node/src/storage/mod.rs 92.30% 2 Missing ⚠️
crates/node/src/storage/rocksdb.rs 80.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4043   +/-   ##
=======================================
  Coverage   74.25%   74.25%           
=======================================
  Files         341      341           
  Lines      107271   107325   +54     
=======================================
+ Hits        79651    79694   +43     
- Misses      27620    27631   +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@yito88 yito88 requested review from tzemanovic and grarco November 18, 2024 13:22
Copy link
Collaborator

@grarco grarco left a comment

Choose a reason for hiding this comment

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

lgtm, thank you!

@brentstone brentstone added this to the v0.46.0 milestone Nov 18, 2024
@tzemanovic tzemanovic added the merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass label Nov 19, 2024
@mergify mergify bot merged commit fb3a7cd into main Nov 19, 2024
24 checks passed
@mergify mergify bot deleted the yuji/prune-more-subtree-snapshots branch November 19, 2024 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge Ready to merge - mergifyio bot will add the PR to merge queue when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants