go/storage/mkvs/db/pathbadger: Fix pruning performance#6518
Merged
Conversation
✅ Deploy Preview for oasisprotocol-oasis-core canceled.
|
0aebfe9 to
31648e6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6518 +/- ##
==========================================
- Coverage 63.86% 63.36% -0.51%
==========================================
Files 698 698
Lines 68289 68297 +8
==========================================
- Hits 43615 43275 -340
- Misses 19713 20052 +339
- Partials 4961 4970 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kostko
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6334.
Benchmarks
On the baremetal instance:
3.2Mversions (see Sapphire snapshot) were pruned in around7min. Using the old code it takes20sto prune just one version!Sanity: Runtime state pruning is now as efficient as consensus state pruning even though runtime state is 1000x bigger than the consensus state (looking at the checkpoint size). This still makes sense given that IO state is minimal compared to the EVM state, and that EVM state pruning is only about dropping writelogs and increasing the discard timestamp. The work was already partly done during commit operation by marking the nodes as ready to be removed and we still have a pending compaction (disk not reclaimed automatically).
Considerations:
NoChildRoots: true(IO roots), at versionNwe should eagerly delete all nodes inN-1so that we have better locality and thus less compaction overhead (we are unknowingly using this trick for the state root already).Implications/follow-up
storage prune/compactcommands.storage checkpoint create/importwill most likely be no longer needed