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

Conversation

@tomaka
Copy link
Contributor

@tomaka tomaka commented Jan 27, 2021

This PR attempts to solve the following problem:

The peerset asks to open a substream with a node. The node refuses it. The PSM immediately tries again. Repeat ad vitam eternam.

We do have a reputation decrease when a node refuses a substream, but, since reputations regress towards 0 over time, it takes an infinite amount of attempts to reach the banning threshold. Plus, we don't actually want to reach the banning threshold, as this peer might have other substreams currently open and in use.

After this PR, after a node has refused a substream, it simply removed from the set of "discovered nodes" according to the peerset, meaning that no connection attempt will be tried again until the node is later re-discovered (which will happen sooner or later).
This should only affect the block announces notifications, as it is the only one not relying on reserved nodes.

@tomaka tomaka added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Jan 27, 2021
@tomaka tomaka requested review from mxinden and romanb January 27, 2021 17:37
@tomaka
Copy link
Contributor Author

tomaka commented Jan 29, 2021

bot merge

@ghost
Copy link

ghost commented Jan 29, 2021

Trying merge.

@ghost ghost merged commit ae3dabb into paritytech:master Jan 29, 2021
@tomaka tomaka deleted the peerset-drop-cause branch January 29, 2021 10:02
bkchr pushed a commit that referenced this pull request Jan 29, 2021
* Introduce sc_peerset::DropReason

* Fix peerset tests
s3krit pushed a commit that referenced this pull request Jan 29, 2021
* Introduce sc_peerset::DropReason

* Fix peerset tests
@s3krit s3krit mentioned this pull request Jan 29, 2021
3 tasks
This pull request was closed.
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. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants