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

[NC-2180] Wait for a peer with an estimated chain height before selecting a pivot block #772

Merged
merged 3 commits into from
Feb 5, 2019

Conversation

ajsutton
Copy link
Contributor

@ajsutton ajsutton commented Feb 5, 2019

PR description

When selecting a pivot block we need to ensure the estimated chain height for at least one peer is actually available. This may fail because the chain header block hasn't yet been retrieved from the peer or because the peer connected, causing the wait for peer task to complete, but then disconnected before we could select a pivot block. This change updates FastSyncActions.selectPivotBlock to ignore peers without a chain height estimate and retry if a peer isn't available.

…ot block and handle peers that disconnect between the wait and pivot block selection.
parentHeader.getHash()));
}
return result;
} catch (Throwable t) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious - why do you need this try / catch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh we shouldn't need it and I've removed it again. That said, somewhere we're swallowing exceptions silently so will need to track that down and fix separately.

@ajsutton ajsutton merged commit 3c3c38d into PegaSysEng:master Feb 5, 2019
@ajsutton ajsutton deleted the wait-for-estimated-height branch February 5, 2019 20:18
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