-
Notifications
You must be signed in to change notification settings - Fork 110
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
feat(lib/blocktree): Prune
returns ordered pruned forks
#3050
Closed
Conversation
This file contains 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
qdm12
requested review from
noot,
edwardmack,
timwu20,
EclesioMeloJunior,
jimjbrettj and
kishansagathiya
as code owners
January 17, 2023 14:08
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## development #3050 +/- ##
===============================================
+ Coverage 51.01% 51.06% +0.05%
===============================================
Files 224 224
Lines 28103 28127 +24
===============================================
+ Hits 14336 14364 +28
+ Misses 12385 12380 -5
- Partials 1382 1383 +1 |
qdm12
force-pushed
the
qdm12/lib/blocktree/prune-forks
branch
2 times, most recently
from
January 24, 2023 14:41
0ece6da
to
1b0f3b1
Compare
qdm12
force-pushed
the
qdm12/lib/blocktree/prune-forks
branch
2 times, most recently
from
January 25, 2023 13:50
51e79e9
to
d297833
Compare
@qdm12 is this still required given we're removing the online pruner? |
EclesioMeloJunior
approved these changes
Mar 2, 2023
qdm12
force-pushed
the
qdm12/lib/blocktree/prune-forks
branch
from
March 11, 2023 10:43
d297833
to
a0487a9
Compare
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.
Changes
The blocktree
Prune
method returns a mapping from fork origin block hash (part of the canonical chain) to an ordered slice of block hashes forming the now-dropped forked chain of blocks.This allows the pruner to be 'fork-aware' and to find which deltas can be deleted safely from each fork, on finalisation. For example if a dropped fork chain inserted database key XYZ, we should remove it BUT we need to ensure this same key was not inserted by a block on the canonical chain as well. To do this, we need all the dropped forks ordered to work with their deltas and compare them with the canonical chain.
Tests
go test -tags integration github.com/ChainSafe/gossamer/lib/blocktree
Issues
Needed for PR #2831
Primary Reviewer
@timwu20