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

[commonware-storage/mmr] Improve forgetting behavior in mem::Mmr #459

Open
roberto-bayardo opened this issue Feb 6, 2025 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@roberto-bayardo
Copy link
Collaborator

mem::MMR currently supports forgetting nodes up to the position of the tallest peak, but in the worst case this still requires we retain almost half of all nodes ever added to the Mmr in memory. We should allow forgetting of old nodes to any point in history, which can be supported by extending in the in-memory MMR to always retain the peak hashes, for example using a map that is independent of the flat nodes vector.

As part of this change we will also want the forgetting functionality to provide proper feedback to the user around how proof generation is affected by returning the index of the oldest-provable element after forgetting. While pruning to the tallest peak allows proving of any remaining element following it, pruning to arbitrary points affects element proving in a less-trivial way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

1 participant