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

Respond to requests from peers with invalid ENRs #265

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AgeManning
Copy link
Member

It can be the case that peers have invalid ENRs (i.e report socket addresses that do not match the socket src of the packet).

Previously discovery would drop packets from these peers and log a warning. This PR shifts this logic to instead respond to the src socket but exclude the ENR from reaching our routing table.

We will not advertise these peers, but we will respond to them.

I think this change will improve overall connectivity.

There are some legitimate cases where an ENR can be invalid, such as the external IP address changing or some funky NATs.

@ackintosh
Copy link
Member

I'm testing this change with the ip-change test case. I'll let you know when it's done.

@AgeManning
Copy link
Member Author

Awesome. Thanks @ackintosh 🙏

@ackintosh
Copy link
Member

@AgeManning During the testing, I noticed that the FINDNODE request (which is initiated from here) is timing out. Please see the attached image below. What do you think?

image

@ackintosh
Copy link
Member

For reference, the issue I mentioned above doesn’t happen in the current implementation, which uses a one-time session:

image

@AgeManning
Copy link
Member Author

@ackintosh

Awesome!! Thanks for catching this!

I was thinking in the transition its probably best to simply remove the transitioning peer from the local routing table. There is likely some time between us noticing it has changed its IP and it actually adjusting its IP. In the meantime we probably should prioritize better peers.

I suspect also if we remove it from the table, when it does eventually update, it can then have a second chance of getting back in there.

I've made this change. I'm hoping it now fixes the issue you've found.

Thanks again!

@ackintosh
Copy link
Member

@AgeManning I have tested it again. The updated ENR doesn't get back into Node B's routing table unless the session has expired. 🤔

image

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

Successfully merging this pull request may close these issues.

2 participants