This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
sync: retry different peer after empty subchain heads response #9753
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ascjones
added
A0-pleasereview 🤓
Pull request needs code review.
M4-core ⛓
Core client code / Rust.
labels
Oct 15, 2018
I'm still experiencing this error:
|
@eduadiez the fix hasn't been backported to stable (you are using |
ngotchac
reviewed
Oct 25, 2018
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.
Nice find! Small grumble, LGTM otherwise
ethcore/sync/src/block_sync.rs
Outdated
@@ -327,6 +327,9 @@ impl BlockDownloader { | |||
if self.limit_reorg && best > last && (last == 0 || last < oldest_reorg) { | |||
trace_sync!(self, "No common block, disabling peer"); | |||
return Err(BlockDownloaderImportError::Invalid); | |||
} else if !self.limit_reorg { |
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.
So this ensures that it's downloading OldBlocks, right? Can't we use a more specific name or fn
?
ngotchac
approved these changes
Oct 25, 2018
ordian
approved these changes
Oct 25, 2018
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.
Does this need to be backported to beta?
ordian
added
A8-looksgood 🦄
Pull request is reviewed well.
B1-patch-beta 🕷🕷
and removed
A0-pleasereview 🤓
Pull request needs code review.
labels
Oct 25, 2018
@ordian yes. |
5chdn
pushed a commit
that referenced
this pull request
Oct 26, 2018
* If no subchain heads then try a different peer * Add log when useless chain head * Restrict ChainHead useless peer to ancient blocks * sync: replace `limit_reorg` with `block_set` condition
5chdn
added a commit
that referenced
this pull request
Oct 28, 2018
* version: bump parity beta to 2.1.4 * ethcore: bump ropsten forkblock checkpoint (#9775) * ethcore: handle vm exception when estimating gas (#9615) * removed "rustup" & added new runner tag (#9731) * removed "rustup" & added new runner tag * exchanged tag "rust-windows" with "windows" * revert windows tag change * sync: retry different peer after empty subchain heads response (#9753) * If no subchain heads then try a different peer * Add log when useless chain head * Restrict ChainHead useless peer to ancient blocks * sync: replace `limit_reorg` with `block_set` condition * update jsonrpc-core to a1b2bb742ce16d1168669ffb13ffe856e8131228 * Allow zero chain id in EIP155 signing process (#9792) * Allow zero chain id in EIP155 signing process * Rename test * Fix test failure * Insert dev account before unlocking (#9813)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Further to #9531, I've experienced another intermittent cause of the ancient block sync retracting:
blocks
is empty)Ok
, which will end up giving the request to the same peer againblocks
is empty and we didn't download any blocks this round, we retract a block for the next round (and later exponentially)Fix is to return
Err(BlockDownloaderImportError::Useless)
in this case, which will result in that peer being deactivated for this round.Edit: this appears to have been causing the behaviour detailed here: #9306 (comment)
Have tested this with full ancient block sync successfully twice.