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

[ETCM-198] Update fastsync to request headers only from peers with be… #761

Merged
merged 3 commits into from
Oct 28, 2020

Conversation

mmrozek
Copy link
Contributor

@mmrozek mmrozek commented Oct 27, 2020

…st block >= pivot block

Description

Request headers from peers having best block higher than our pivot block should decrease the possibility of following the wrong fork

@mmrozek mmrozek requested a review from KonradStaniec October 27, 2020 12:26
@mmrozek mmrozek force-pushed the etcm-198-fast-sync-stuck-issue branch from 6684885 to bfd810d Compare October 28, 2020 08:24
@mmrozek mmrozek force-pushed the etcm-198-fast-sync-stuck-issue branch from bfd810d to b09854f Compare October 28, 2020 08:26
@mmrozek mmrozek marked this pull request as ready for review October 28, 2020 08:26
@mmrozek mmrozek requested review from ntallar and kapke October 28, 2020 08:26
@mmrozek
Copy link
Contributor Author

mmrozek commented Oct 28, 2020

PR tested. Mantis synced with etc mainnet without problems

peers
.take(maxConcurrentRequests - assignedHandlers.size)
.toSeq
.sortBy(_.ref.toString())
.sortBy(_.info.maxBlockNumber)(Ordering[BigInt].reverse)
.foreach(assignBlockchainWork)
Copy link
Contributor

Choose a reason for hiding this comment

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

Very minor - why not adding the block height condition here?

Copy link
Contributor

@kapke kapke left a comment

Choose a reason for hiding this comment

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

LGTM!

@mmrozek mmrozek merged commit 635f002 into develop Oct 28, 2020
@mmrozek mmrozek deleted the etcm-198-fast-sync-stuck-issue branch October 28, 2020 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants