forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 719
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
[Net] Addrman offline attempts #1453
Merged
furszy
merged 2 commits into
PIVX-Project:master
from
Fuzzbawls:2020_addrman-offline-attempts
Mar 27, 2020
Merged
[Net] Addrman offline attempts #1453
furszy
merged 2 commits into
PIVX-Project:master
from
Fuzzbawls:2020_addrman-offline-attempts
Mar 27, 2020
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
If a node is offline failed outbound connection attempts will crank up the addrman counter and effectively blow away our state. This change reduces the problem by only counting attempts made while the node believes it has outbound connections to at least two netgroups. Connect and addnode connections are also not counted, as there is no reason to unequally penalize them for their more frequent connections -- though there should be no real effect from this unless their addnode configureation is later removed. Wasteful repeated connection attempts while only a few connections are up are avoided via nLastTry. This is still somewhat incomplete protection because our outbound peers could be down but not timed out or might all be on 'local' networks (although the requirement for multiple netgroups helps).
This slows the increase of the nAttempts in addrman while partitioned, even if the node hasn't yet noticed the partitioning.
21 tasks
random-zebra
approved these changes
Mar 26, 2020
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.
ACK 40e4116
furszy
approved these changes
Mar 26, 2020
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.
utACK 40e4116
akshaynexus
pushed a commit
to ZENZO-Ecosystem/ZENZO-Core
that referenced
this pull request
Mar 30, 2020
40e4116 Do not increment nAttempts by more than one for every Good connection. (Gregory Maxwell) b988ce6 Avoid counting failed connect attempts when probably offline. (Gregory Maxwell) Pull request description: Backport of bitcoin#8065 > If a node is offline failed outbound connection attempts will crank up > the addrman counter and effectively blow away our state. > > This change reduces the problem by only counting attempts made while > the node believes it has outbound connections to at least two > netgroups. > > Connect and addnode connections are also not counted, as there is no > reason to unequally penalize them for their more frequent > connections -- though there should be no real effect from this > unless their addnode configureation is later removed. > > Wasteful repeated connection attempts while only a few connections are > up are avoided via nLastTry. > > This is still somewhat incomplete protection because our outbound > peers could be down but not timed out or might all be on 'local' > networks (although the requirement for multiple netgroups helps). Note: A future PR will focus on refactoring the layer 2 (masternode) methods to stop using `ConnectNode()` directly ACKs for top commit: random-zebra: ACK 40e4116 furszy: utACK 40e4116 Tree-SHA512: 96adadea1d214a2afcf5e43c13a4409ca3de1d81ae51225bda74eabda6a3435a7678c3826e3c3930e543b084de1f28a4a5a102ccd1e3ad3c01da4937f312941b
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport of bitcoin#8065
Note: A future PR will focus on refactoring the layer 2 (masternode) methods to stop using
ConnectNode()
directly