Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Disconnect peers before the pivot block while fast syncing #1139

Merged
merged 4 commits into from
Mar 20, 2019

Conversation

ajsutton
Copy link
Contributor

PR description

Automatically configure the trailing peers limit during a fast sync to consider any peer with a chain height below the pivot block to be a trailing peer and having a trailing peer limit of 0. ie disconnect any peers that haven't reached the pivot block because they're useless to us.

After fast sync completes we revert back to the current unlimited trailing peer configuration.

@@ -62,6 +66,12 @@ public FastSyncDownloader(

private FastSyncState storeState(final FastSyncState state) {
fastSyncStateStorage.storeState(state);
if (state.getPivotBlockNumber().isPresent()) {
trailingPeerRequirements =
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a little unexpected in a "storeState" method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking along the lines of storing the new trailing peer requirements was storing state but probably is clearer to just have its own method.

@ajsutton ajsutton merged commit c6edd4f into PegaSysEng:master Mar 20, 2019
@ajsutton ajsutton deleted the max-trailing-peers branch March 20, 2019 19:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants