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

Search for ForkId in PeerTable when handling incoming connection in RlpxAgent #5273

Closed
pinges opened this issue Mar 28, 2023 · 1 comment
Closed
Assignees
Labels
peering TeamRevenant GH issues worked on by Revenant Team

Comments

@pinges
Copy link
Contributor

pinges commented Mar 28, 2023

Description

When a peer is initiating a connection with us (RlpxAgent handleIncomingConnection() there is a very good chance that they have gone through the bonding process in the discovery layer. When filter on ForkId is enabled there is a good chance that we have received the ForkId from that peer. That ForkId should be used to check whether that peer is on the same chain and whether we want to connect to it

This task is related to #5272

Alternatively we could try to find the peer in the PeerTable before we are doing the Handshake. The Handshake for inbound connections is started in NettyConnectionInitializer, in the method inboundChannelInitializer()
The problem with that is that we do not know the peer id at that point, only the IP address. We could search the PeerTable using the IP address, but there could potentially be multiple nodes using the same IP address.
The benefit of doing that would be that we potentially don't do a handshake with a peer on a different chain. Handshake uses ECIES, which is expensive.

@pinges pinges added the TeamRevenant GH issues worked on by Revenant Team label Mar 28, 2023
@non-fungible-nelson
Copy link
Contributor

#5628 PR

@pinges pinges closed this as completed Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
peering TeamRevenant GH issues worked on by Revenant Team
Projects
None yet
Development

No branches or pull requests

2 participants