mimblewimble / grin

Minimal implementation of the Mimblewimble protocol.
https://grin.mw/
Apache License 2.0
5.04k stars 990 forks source link

Retire pruned cache #3573

Closed antiochp closed 3 years ago

antiochp commented 3 years ago

Our "prune list" implementation maintains an internal "prune cache".

We can improve this without needing to maintain an internal cache.

To check if a pos is pruned we can look for the "next" pruned subtree and check if pos is beneath it. We only need to consider the "next" subtree due to the append-only PMMR semantics. If the next subtree does not include pos then we know that no other subtree will either.