Skip to content

p2p/discover: require bond for ping endpoint statements - #23609

Merged
AskAlexSharov merged 3 commits into
mainfrom
p2p/discover-bond-endpoint-statements
Aug 28, 2026
Merged

p2p/discover: require bond for ping endpoint statements#23609
AskAlexSharov merged 3 commits into
mainfrom
p2p/discover-bond-endpoint-statements

Conversation

@yperbasis

@yperbasis yperbasis commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

  • require a recent discv4 endpoint proof before accepting a PING statement about the local UDP endpoint
  • keep PONG replies and normal bond establishment for unknown nodes unchanged
  • cover the attack path with signed, unbonded PINGs from ten distinct source addresses
  • confirm a bonded PING still updates the local endpoint predictor

An unbonded PING can no longer feed its claimed To address into the local endpoint predictor. Once a recent PONG proves return reachability, PING endpoint statements continue to work as before.

Closes ethereum-bounty/erigon#31.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Hardens discv4 endpoint prediction against unbonded PING statements.

Changes:

  • Requires recent endpoint proof before accepting PING endpoint claims.
  • Adds coverage for spoofed claims from multiple unbonded senders.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
p2p/discover/v4_udp.go Gates PING endpoint statements on bond status.
p2p/discover/v4_udp_test.go Tests rejection of unbonded endpoint claims.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread p2p/discover/v4_udp.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Send more than iptrackMinStatements so the unbonded test cannot pass vacuously if the predictor threshold changes, and give the bonded test a long PingInterval so table revalidation does not log after it returns.
@yperbasis
yperbasis marked this pull request as ready for review August 27, 2026 08:15
@yperbasis yperbasis added this to the 3.7.0 milestone Aug 27, 2026
@AskAlexSharov
AskAlexSharov added this pull request to the merge queue Aug 28, 2026
Merged via the queue into main with commit c785adb Aug 28, 2026
138 of 140 checks passed
@AskAlexSharov
AskAlexSharov deleted the p2p/discover-bond-endpoint-statements branch August 28, 2026 06:43
@yperbasis yperbasis removed this from the 3.7.0 milestone Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants