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
Conversation
nisdas
commented
Jan 20, 2020
•
edited
edited
- 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.
Codecov Report
@@ 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 { |
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.
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?
for s.chain.HeadSlot() < highestFinalizedSlot { | |
for s.chain.HeadSlot() < max(highestFinalizedSlot,helpers.StartSlot(s.highestFinalizedEpoch() + 1)) { |
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.
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)
}
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.
missed it. thanks
* 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
* 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