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

Permit Invalid ENRS to perform FINDNODE? #202

Open
AgeManning opened this issue Jul 18, 2023 · 3 comments
Open

Permit Invalid ENRS to perform FINDNODE? #202

AgeManning opened this issue Jul 18, 2023 · 3 comments

Comments

@AgeManning
Copy link
Member

There are a number of nodes out there that often misconfigure their ENRs or potentially undergo an IP shift.

Currently we simple drop the session and do not respond to the request leaving the node unaware of its mis-configuration.

We could potentially respond to a FINDNODE and not record the ENR in our table (as it is not contactable).

This would allow discovery to function perfectly fine for misconfigured nodes. Potentially this may allow more misconfigurations to exist and go unnoticed however.

@divagant-martian
Copy link
Collaborator

on a quick check I'm thinking one way to do this would be to leverage the one time sessions we already have and instead of dropping the session, downgrading them to a one time one. That way the next request the peer sends is answered without maintaining the invalid session. Would need a bit of work tho.

I'm thinking this as an option to avoid simply dealing with traffic of nodes we -in principle- don't want

@AgeManning
Copy link
Member Author

Yeah that's a good idea.

@emhane
Copy link
Collaborator

emhane commented Apr 19, 2024

imo #250 solves this to a satisfactory degree.

nonetheless, nodes behind NAT in geth for example, will never discover their local node id, and will never get a session. geth sets default IP in enr to localhost if node is started to listen on all interfaces.

if we use this soon to be stable is_reserved method from rust, and treat ENRs that don't verify due to enr-socket != src-socket, as ENRs without a socket, iff they are advertising a reserved IP, then we could safely improve connectivity through out the network.

not sure how geth discv5 treats peers that don't advertise any socket in the ENR, if it lets them have sessions or fails them, based on the assumption that all ENRs contain at least a localhost socket. this would be an unjustified assumption and should be fixed, since what to advertise in the ENR, before IP voting, is not spec'd.

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

No branches or pull requests

3 participants