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

Optionally notify app of unverifiable enr #250

Merged
merged 5 commits into from
Apr 17, 2024

Conversation

emhane
Copy link
Contributor

@emhane emhane commented Apr 16, 2024

Description

Discv5 is a great library, but to use it with EL some quirks have been needed. The major one being, notifying the app of discovered peers that advertise a socket that doesn't verify against their actual socket.

How a node behaves before it has discovered its WAN reachable socket, is not spec'd out. The go implementation advertises localhost in the ENR, if no WAN reachable socket is set, since it's the least usable address the node can advertise (as opposed to useless no address). This doesn't fit with the rust implementation, which verifies ENRs against their source to mitigate DoS attacks against the advertised address.

Notes & open questions

Adding this event breaks the API. To allow for adding more events in the future without breaking the api, the non_exhaustive attribute is added to Event.

Change checklist

  • Self-review
  • Documentation updates if relevant
  • Tests if relevant

@emhane emhane requested review from jxs, ackintosh and AgeManning and removed request for jxs April 16, 2024 17:57
@emhane emhane mentioned this pull request Apr 16, 2024
3 tasks
Copy link
Member

@AgeManning AgeManning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! LGTM

src/config.rs Outdated Show resolved Hide resolved
@AgeManning
Copy link
Member

Once we get this down, we can make a new minor release, which will also target a new ENR minor release

@emhane emhane requested a review from AgeManning April 17, 2024 13:14
@AgeManning AgeManning merged commit 7aa2913 into sigp:master Apr 17, 2024
6 checks passed
@emhane emhane deleted the event-bad-enr branch April 18, 2024 15:37
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