Skip to content

Commit

Permalink
discv5: improve FINDNODE, NODES text
Browse files Browse the repository at this point in the history
  • Loading branch information
fjl committed Jul 29, 2020
1 parent e858700 commit 0675791
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions discv5/discv5-wire.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ PONG is the reply to PING.

message-data = [request-id, distance₁, distance₂, ..., distanceₙ]
message-type = 0x03
distance = the requested log2 distance, a positive integer
distanceₙ = requested log2 distance, a positive integer

FINDNODE queries for nodes at the given logarithmic distances from the recipient's node ID.
The recipient should create a result set containing nodes from its local node table.

A request with distance `0` should return the recipient's current record as the result.
A request with distance `0` should return the recipient's current record as the only result.

### NODES Response (0x04)

Expand All @@ -181,6 +181,9 @@ A request with distance `0` should return the recipient's current record as the
NODES is the response to a FINDNODE or TOPICQUERY message. Multiple NODES messages may be
sent as responses to a single query.

When handling NODES as a response to FINDNODE, the recipient should verify that the
received nodes match the requested distances.

### TALKREQ Request (0x05)

message-data = [request-id, protocol, request]
Expand Down

0 comments on commit 0675791

Please sign in to comment.