This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 456
Inbound peer eviction method - Closes #3721 #3824
Merged
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
mitsuaki-u
force-pushed
the
3721_peer_eviction
branch
from
June 19, 2019 14:02
0a072df
to
a58631d
Compare
mitsuaki-u
force-pushed
the
3721_peer_eviction
branch
from
June 20, 2019 08:44
a58631d
to
5bb51fe
Compare
mitsuaki-u
force-pushed
the
3721_peer_eviction
branch
from
June 20, 2019 08:45
5bb51fe
to
f480399
Compare
jondubois
previously requested changes
Jun 20, 2019
jondubois
previously requested changes
Jun 20, 2019
diego-G
suggested changes
Jun 21, 2019
diego-G
previously requested changes
Jun 24, 2019
shuse2
previously requested changes
Jun 25, 2019
diego-G
previously requested changes
Jun 25, 2019
jondubois
previously requested changes
Jun 25, 2019
jondubois
approved these changes
Jun 26, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What was the problem?
In the current implementation, when the maximum number of inbound peers are connected and a new peer attempts to connect to the node, we randomly select and remove an ongoing inbound peer connection.
How did I fix it?
In the new protocol, we use the strategy of protecting a number of peers for several distinct characteristics for increased security.
Netgroups: We calculate a randomized value
keyedNetgroup
based on IP group for each eviction candidate. We protect 4 peers with the smallestkeyedNetgroup
values. An attacker cannot predict which netgroups will be protected.Peer latency: We protect a number of peers with optimal latency. An attacker cannot manipulate this metric without physically moving nodes closer to the target.
Useful work: We protect peers who perform useful work, such as peers who have recently sent blocks and transactions. An attacker cannot manipulate this metric without performing useful work.
Connection time: We protect half of the remaining nodes who have been connected the longest. This precludes attacks that start later.
Review checklist