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.6k
Stop keeping track of epoch changes for the sync gap #13127
Merged
Merged
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
C1-low
PR touches the given topic and has a low impact on builders.
A0-please_review
Pull request needs code review.
and removed
A0-please_review
Pull request needs code review.
labels
Jan 11, 2023
melekes
approved these changes
Jan 12, 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.
👍 (code-wise; don't know enough to reason about business logic)
bkchr
approved these changes
Jan 12, 2023
Co-authored-by: Bastian Köcher <git@kchr.de>
rossbulat
pushed a commit
that referenced
this pull request
Feb 3, 2023
* Stop keeping track of epoch changes data within the sync gap * Fix docs * Apply suggestions from code review Co-authored-by: Bastian Köcher <git@kchr.de> * Fix typo Co-authored-by: Bastian Köcher <git@kchr.de>
ltfschoen
pushed a commit
to ltfschoen/substrate
that referenced
this pull request
Feb 22, 2023
* Stop keeping track of epoch changes data within the sync gap * Fix docs * Apply suggestions from code review Co-authored-by: Bastian Köcher <git@kchr.de> * Fix typo Co-authored-by: Bastian Köcher <git@kchr.de>
This was referenced Feb 22, 2023
ark0f
pushed a commit
to gear-tech/substrate
that referenced
this pull request
Feb 27, 2023
* Stop keeping track of epoch changes data within the sync gap * Fix docs * Apply suggestions from code review Co-authored-by: Bastian Köcher <git@kchr.de> * Fix typo Co-authored-by: Bastian Köcher <git@kchr.de>
2 tasks
bkchr
added
B1-note_worthy
Changes should be noted in the release notes
E1-database_migration
PR introduces code that does a one-way migration of the database.
T0-node
This PR/Issue is related to the topic “node”.
and removed
B0-silent
Changes should not be mentioned in any release notes
labels
Apr 6, 2023
6 tasks
15 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
A0-please_review
Pull request needs code review.
B1-note_worthy
Changes should be noted in the release notes
C1-low
PR touches the given topic and has a low impact on builders.
E1-database_migration
PR introduces code that does a one-way migration of the database.
T0-node
This PR/Issue is related to the topic “node”.
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.
Epoch changes data for the gap (i.e. the blocks below the warp sync point) was used to verify the blocks imported after a warp sync.
Currently this verification is not really required since all our security depends on the last finalized block.
Once the last finalized block is imported (i.e. the warp sync point) then we start importing all the previous blocks and we can detect a bad history only after we finished importing the block before the warp sync point.
We may think that in this way we may be tricked by a malicious full node into downloading an history of blocks that in the end we find out to not be good WRT the finalized block we warp synced to. However, the same type of attack can be performed by one of the initial authorities by feeding an history that is coherently signed together with a crafted dummy authority set changes.
Thus our only stable grip is the last finalized block anyway. This is the point that in the end will allow us to distinguish between a good history from a bad one.
Note. In the future we may think to early detect this type of annoyance by downloading the blocks in reverse order. In this way, for each block we can immediately check if the header hash is equal to the parent of the block that follows.
Fixes zombienet test 0003 in #13078