Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Reputation penalty for sending empty block response #5814

Merged
merged 3 commits into from
Apr 29, 2020

Conversation

arkpar
Copy link
Member

@arkpar arkpar commented Apr 28, 2020

This handles the following scenario:

  1. We've learned that a peer has some older fork though block announcement or consensus gossip.
  2. We request that block from that peer and they don't send it back.
    Currently there's no penalty and the same request will be issues again.

@arkpar arkpar added the A0-please_review Pull request needs code review. label Apr 28, 2020
@@ -696,6 +699,10 @@ impl<B: BlockT> ChainSync<B> {
}
PeerSyncState::DownloadingStale(_) => {
peer.state = PeerSyncState::Available;
if blocks.is_empty() {
Copy link
Member

Choose a reason for hiding this comment

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

Why are we not doing this for the other states as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

When doing full sync it is not that critical, as we'll get new blocks from other peers eventually.

Copy link
Contributor

@gnunicorn gnunicorn left a comment

Choose a reason for hiding this comment

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

lgtm

@gnunicorn
Copy link
Contributor

bot merge

@ghost
Copy link

ghost commented Apr 29, 2020

Cannot merge; please ensure the pull request is mergeable and has approval from the project owner or at least 2 core devs.

@ghost
Copy link

ghost commented Apr 29, 2020

bot merge cancel

@gnunicorn
Copy link
Contributor

bot merge

@ghost
Copy link

ghost commented Apr 29, 2020

Cannot merge; please ensure the pull request is mergeable and has approval from the project owner or at least 2 core devs.

@ghost
Copy link

ghost commented Apr 29, 2020

bot merge cancel

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants