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

Limit (incoming) connecting peers. #107

Open
kdeme opened this issue Oct 21, 2019 · 2 comments
Open

Limit (incoming) connecting peers. #107

kdeme opened this issue Oct 21, 2019 · 2 comments
Labels

Comments

@kdeme
Copy link
Contributor

kdeme commented Oct 21, 2019

Currently in our implementation, the maximum connected peers limit is only applied on the creation of new outgoing connections.

The listener for incoming connections remains active. This gives a serious risk and should be handled by either:

  1. Being the very friendly peer: allowing the handshake to start and then send a disconnect message with ToManyPeers as DisconnectionReason
  2. Ignore any incoming connections and just disconnect them without any message.
  3. Don't allow the incoming connection at all?

I'm guessing when going from 1. down, the possibility of being seen as a "bad" peer will go up. However, practically, I'm not sure if any client actually cares.

@arnetheduck
Copy link
Member

One thing to consider is that incoming peers should probably be counted separately - there's a well-known attack where you flood a peer with your own connections by connecting to them and eventually eclipsing them - to mitigate this, we want a minimum number of outgoing connections to peers of our own choosing.

@kdeme
Copy link
Contributor Author

kdeme commented Oct 22, 2019

Yeah, good point.
I had the same concern and created #111 because of that. But counting separately might just be enough to mitigate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants