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 Merkle tree stores #1237

Merged
merged 3 commits into from
Mar 28, 2023
Merged

Prune Merkle tree stores #1237

merged 3 commits into from
Mar 28, 2023

Conversation

yito88
Copy link
Member

@yito88 yito88 commented Mar 20, 2023

Depends on #1113

Prune the Merkle tree stores at a height: The height is the starting height of the previous epoch before the epoch including the oldest query height (= last_committed_height - storage_read_post_hegiht_limit).
The tree stores of the epoch might be used for rebuilding the tree stores at a query height. That's why we can prune the stores of the previous epoch.

I want to add the batch of these deletes into other batches in a future PR.

@yito88 yito88 added the storage label Mar 20, 2023
@yito88 yito88 requested review from tzemanovic and juped March 21, 2023 15:58
@yito88 yito88 marked this pull request as ready for review March 21, 2023 15:59
.block
.pred_epochs
.get_start_height_of_epoch(epoch.prev())
{
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it might not be better to have the interface prune by epoch rather than block? i.e., prune_merkle_tree_stores(10) to prune all of epoch 10's blocks (moving the logic in get_start_height_of_epoch() to prune_merkle_tree_stores()).

Copy link
Member Author

Choose a reason for hiding this comment

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

It sounds better. Thanks!

juped added a commit that referenced this pull request Mar 23, 2023
…into maint-0.14

* namada/yuji/prune_tree_stores:
  DB prune function given an epoch
  prune older merkle tree stores
Base automatically changed from yuji/write_tree_stores_less_often to main March 28, 2023 12:52
@juped juped merged commit a93a77f into main Mar 28, 2023
@juped juped deleted the yuji/prune_tree_stores branch March 28, 2023 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants