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

Don't Panic if 0 Peers are Left #4594

Merged
merged 11 commits into from Jan 20, 2020
Merged

Don't Panic if 0 Peers are Left #4594

merged 11 commits into from Jan 20, 2020

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Jan 20, 2020

  • Instead of returning an error and halting the node, we simply the log the error and re-send the request.
  • Use a more static finalized epoch, so it isnt badly affected by a large drop in peers.

@nisdas nisdas added Networking P2P related items Ready For Review A pull request ready for code review labels Jan 20, 2020
@codecov
Copy link

codecov bot commented Jan 20, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@20fef0b). Click here to learn what that means.
The diff coverage is 0%.

@@           Coverage Diff            @@
##             master   #4594   +/-   ##
========================================
  Coverage          ?   6.82%           
========================================
  Files             ?     192           
  Lines             ?   13236           
  Branches          ?       0           
========================================
  Hits              ?     904           
  Misses            ?   12198           
  Partials          ?     134

Co-Authored-By: Raul Jordan <raul@prysmaticlabs.com>
// Step 1 - Sync to end of finalized epoch.
for s.chain.HeadSlot() < helpers.StartSlot(s.highestFinalizedEpoch()+1) {
for s.chain.HeadSlot() < highestFinalizedSlot {
Copy link
Contributor

@shayzluf shayzluf Jan 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the result of this change can be great . as it stays the same epoch throughout initial sync.
the result as i see it will be that the best peer will be requested for all epochs from this initial value that was set at the beginning of sync to the new finalised epoch that is the current one (maybe a day later). this can put a lot of stress on one peer.
maybe something like this can be done to resolve this issue?

Suggested change
for s.chain.HeadSlot() < highestFinalizedSlot {
for s.chain.HeadSlot() < max(highestFinalizedSlot,helpers.StartSlot(s.highestFinalizedEpoch() + 1)) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't stay the same, we just ensure there are a safe amount of peers before updating it . Below there is this piece of code:

	if len(peers) >= flags.Get().MinimumSyncPeers {
			highestFinalizedSlot = helpers.StartSlot(finalizedEpoch + 1)
		}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed it. thanks

@prylabs-bulldozer prylabs-bulldozer bot merged commit 781b7d6 into master Jan 20, 2020
@delete-merged-branch delete-merged-branch bot deleted the dontReturnError branch January 20, 2020 17:12
@AndreMiras AndreMiras mentioned this pull request Jan 21, 2020
cryptomental pushed a commit to cryptomental/prysm that referenced this pull request Feb 24, 2020
* log error
* Merge branch 'master' into dontReturnError
* return blocks
* change back
* Merge branch 'dontReturnError' of https://github.com/prysmaticlabs/geth-sharding into dontReturnError
* use a more static finalized epoch
* Update beacon-chain/sync/initial-sync/round_robin.go

Co-Authored-By: Raul Jordan <raul@prysmaticlabs.com>
* Merge refs/heads/master into dontReturnError
* jim's review
* Merge branch 'dontReturnError' of https://github.com/prysmaticlabs/geth-sharding into dontReturnError
* Update beacon-chain/sync/initial-sync/round_robin.go
cryptomental pushed a commit to cryptomental/prysm that referenced this pull request Feb 28, 2020
* log error
* Merge branch 'master' into dontReturnError
* return blocks
* change back
* Merge branch 'dontReturnError' of https://github.com/prysmaticlabs/geth-sharding into dontReturnError
* use a more static finalized epoch
* Update beacon-chain/sync/initial-sync/round_robin.go

Co-Authored-By: Raul Jordan <raul@prysmaticlabs.com>
* Merge refs/heads/master into dontReturnError
* jim's review
* Merge branch 'dontReturnError' of https://github.com/prysmaticlabs/geth-sharding into dontReturnError
* Update beacon-chain/sync/initial-sync/round_robin.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Networking P2P related items 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

4 participants