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

eth/downloader: return invalid chain (peer drop) on import fails #2801

Merged
merged 1 commit into from
Jul 12, 2016

Conversation

karalabe
Copy link
Member

If block processing fails in the downloader, it is currently bubbling up that particular error up to the very top of the sync cycle. However, the sync cycle only handles downloader specific errors correctly with regards to peer drops, it doesn't know about other errors. This causes block import failures to be silently discarded as "some random unimportant error", whereas it's very important: the origin peer tried to feed us something bad that we couldn't handle.

In our current network this doesn't really happen, because there isn't a heavy bad chin present. With the DAO hard-fork on the other hand, depending on which side of the fork you're on, there will be a heavy "other" chain, the members of which we'd like to drop.

This PR changes the bubbled up error from the random error type returned from blockchain to the downloader specific errInvalidChain, signalling that the chain being processed is very bad and its originator peer should be dropped.

Chalk one up for hive.

@robotally
Copy link

robotally commented Jul 11, 2016

Vote Count Reviewers
👍 1 @fjl
👎 0

Updated: Tue Jul 12 12:01:19 UTC 2016

@fjl
Copy link
Contributor

fjl commented Jul 12, 2016

👍

@karalabe karalabe merged commit 7596b33 into ethereum:develop Jul 12, 2016
@obscuren obscuren removed the review label Jul 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants