Skip to content
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
merged 14 commits into from Feb 5, 2020
Merged

Sync to highest possible head given the peers available #4570

merged 14 commits into from Feb 5, 2020

Conversation

mcdee
Copy link
Contributor

@mcdee mcdee commented Jan 16, 2020

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.)

@codecov
Copy link

codecov bot commented Jan 17, 2020

Codecov Report

Merging #4570 into master will not change coverage by %.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #4570   +/-   ##
=======================================
  Coverage   43.47%   43.47%           
=======================================
  Files         203      203           
  Lines       15376    15376           
=======================================
  Hits         6685     6685           
  Misses       7563     7563           
  Partials     1128     1128           

@stale
Copy link

stale bot commented Jan 28, 2020

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.

@stale stale bot added the Stale There hasn't been any activity here in some time... label Jan 28, 2020
@0xKiwi 0xKiwi removed the Stale There hasn't been any activity here in some time... label Jan 29, 2020
@rauljordan rauljordan added the Ready For Review A pull request ready for code review label Feb 5, 2020
@rauljordan rauljordan merged commit 945edb6 into prysmaticlabs:master Feb 5, 2020
cryptomental pushed a commit to cryptomental/prysm that referenced this pull request Feb 24, 2020
cryptomental pushed a commit to cryptomental/prysm that referenced this pull request Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants