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
Sync to highest possible head given the peers available #4570
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
Codecov Report
@@ Coverage Diff @@
## master #4570 +/- ##
=======================================
Coverage 43.47% 43.47%
=======================================
Files 203 203
Lines 15376 15376
=======================================
Hits 6685 6685
Misses 7563 7563
Partials 1128 1128 |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
rauljordan
approved these changes
Feb 5, 2020
cryptomental
pushed a commit
to cryptomental/prysm
that referenced
this pull request
Feb 24, 2020
…s#4570) Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
cryptomental
pushed a commit
to cryptomental/prysm
that referenced
this pull request
Feb 28, 2020
…s#4570) Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
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.
Step 2 of the initial sync process looks for a peer with a finalized epoch of the local node's latest head slot. This is okay if at least one peer is fully up-to-date, but if not it causes a problem because no peer is able to serve the node any blocks and the code stays in the loop.
This PR changes step 2 to fetch blocks from the peer with the latest finalized epoch regardless of where it is in absolute terms. This ensures that step 2 of the initial sync process will definitely be able to proceed.
(Note that there is a general issue with both old and new code that if none of the peers to which this node is connected is up-to-date the node will, unsurprisingly, fail to sync to head. This will resolve itself eventually if the peers are themselves connected to up-to-date nodes, but the node could take more active measures to find up-to-date peers. This is something to explore later.)