This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fork tree prune assumptions removal v2 #13327
Merged
davxy
merged 11 commits into
paritytech:master
from
davxy:fork-tree-prune-assumptions-removal-v2
Feb 15, 2023
Merged
Fork tree prune assumptions removal v2 #13327
davxy
merged 11 commits into
paritytech:master
from
davxy:fork-tree-prune-assumptions-removal-v2
Feb 15, 2023
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
davxy
added
B0-silent
Changes should not be mentioned in any release notes
A1-needs_burnin
Pull request needs to be tested on a live validator node before merge. DevOps is notified via matrix
C1-low
and removed
C3-medium
labels
Feb 7, 2023
andresilva
approved these changes
Feb 7, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, good catch
@@ -32,7 +32,7 @@ pub enum Error<E> { | |||
UnfinalizedAncestor, | |||
/// Imported or finalized node that is an ancestor of previously finalized node. | |||
Revert, | |||
/// Error throw by client when checking for node ancestry. | |||
/// Error thrown by user when checking for node ancestry. | |||
Client(E), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename this to Ancestry(E)
? Or something else if someone has a better suggestion.
Co-authored-by: André Silva <[email protected]>
skunert
approved these changes
Feb 7, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice readability improvements over the last PR
melekes
reviewed
Feb 8, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
davxy
added
C1-low
PR touches the given topic and has a low impact on builders.
D3-trivial 🧸
PR contains trivial changes in a runtime directory that do not require an audit
and removed
C1-low
PR touches the given topic and has a low impact on builders.
C1-low
labels
Feb 8, 2023
rossbulat
pushed a commit
that referenced
this pull request
Feb 19, 2023
* Removed assumptions about ancestry from fork tree prune method * Tests improvement * Fork tree prune refactory * Code refactory * Correctly handle borderline, but legit, case * Apply suggestions from code review Co-authored-by: André Silva <[email protected]> * Removed duplicated test --------- Co-authored-by: André Silva <[email protected]>
rossbulat
pushed a commit
that referenced
this pull request
Feb 19, 2023
This reverts commit 1669659.
ltfschoen
pushed a commit
to ltfschoen/substrate
that referenced
this pull request
Feb 22, 2023
* Removed assumptions about ancestry from fork tree prune method * Tests improvement * Fork tree prune refactory * Code refactory * Correctly handle borderline, but legit, case * Apply suggestions from code review Co-authored-by: André Silva <[email protected]> * Removed duplicated test --------- Co-authored-by: André Silva <[email protected]>
ark0f
pushed a commit
to gear-tech/substrate
that referenced
this pull request
Feb 27, 2023
* Removed assumptions about ancestry from fork tree prune method * Tests improvement * Fork tree prune refactory * Code refactory * Correctly handle borderline, but legit, case * Apply suggestions from code review Co-authored-by: André Silva <[email protected]> * Removed duplicated test --------- Co-authored-by: André Silva <[email protected]>
Ank4n
pushed a commit
that referenced
this pull request
Feb 28, 2023
* Removed assumptions about ancestry from fork tree prune method * Tests improvement * Fork tree prune refactory * Code refactory * Correctly handle borderline, but legit, case * Apply suggestions from code review Co-authored-by: André Silva <[email protected]> * Removed duplicated test --------- Co-authored-by: André Silva <[email protected]>
ukint-vs
pushed a commit
to gear-tech/substrate
that referenced
this pull request
Apr 10, 2023
* Removed assumptions about ancestry from fork tree prune method * Tests improvement * Fork tree prune refactory * Code refactory * Correctly handle borderline, but legit, case * Apply suggestions from code review Co-authored-by: André Silva <[email protected]> * Removed duplicated test --------- Co-authored-by: André Silva <[email protected]>
15 tasks
nathanwhit
pushed a commit
to nathanwhit/substrate
that referenced
this pull request
Jul 19, 2023
* Removed assumptions about ancestry from fork tree prune method * Tests improvement * Fork tree prune refactory * Code refactory * Correctly handle borderline, but legit, case * Apply suggestions from code review Co-authored-by: André Silva <[email protected]> * Removed duplicated test --------- Co-authored-by: André Silva <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
A1-needs_burnin
Pull request needs to be tested on a live validator node before merge. DevOps is notified via matrix
B0-silent
Changes should not be mentioned in any release notes
C1-low
PR touches the given topic and has a low impact on builders.
D3-trivial 🧸
PR contains trivial changes in a runtime directory that do not require an audit
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.
Superseeds #12778
Fork tree prune method was assuming that the user's
predicate
closure makes thefind_node_index_where
to NOT return the tree node immediately preceding thehash
parameter (according tois_descendent_of
closure).Up to date the only users of this structure are GRANDPA and BABE to keep a tree of epoch changes announcements AND according to their
predicate
, the assumption is satisfied.But this is a time-bomb
If at some point the struct is used in a context where the predicate doesn't satisfy the assumption, the tree would break and we loose part of the tree due to how
prune
logic is implemented.(indeed this assumption was the cause of #12758 bug)
This PR removes the assumption and makes the tree more resilient and independent for any use case.