Skip to content

discv5: topic discovery spec#270

Open
srene wants to merge 19 commits into
ethereum:masterfrom
datahop:master
Open

discv5: topic discovery spec#270
srene wants to merge 19 commits into
ethereum:masterfrom
datahop:master

Conversation

@srene
Copy link
Copy Markdown

@srene srene commented May 15, 2026

No description provided.

oascigil and others added 10 commits May 14, 2026 09:04
revert back to original version
Added Service discovery (disc-ng)
…; add TOPICNODES

Updates the wire-format spec for DISC-NG service discovery to match the
shape implementations are converging on, following the theory section
added in 7111aa5 ("Added service discovery"). Summary of changes:

- REGTOPIC (0x07) gains a `bucket` list (sender's service-table free
  distances) and drops the "not final" disclaimer.

- The dedicated TICKET response (legacy 0x08) is removed. The ticket
  the registrar issues in response to REGTOPIC is now carried by
  REGCONFIRMATION, distinguished by an empty `ticket` field meaning
  "admitted".

- REGCONFIRMATION (now 0x08) is redefined as the immediate response
  to REGTOPIC, carrying both the admit-or-wait signal (via ticket
  length) and the response-count for the request.

- TOPICQUERY (now 0x09) gains the same `bucket` hint as REGTOPIC.

- TOPICNODES (0x0A) is added as the dedicated response carrying
  registered advertiser ENRs from the recipient's ad cache.
  TOPICQUERY responses are now NODES (auxiliary routing ENRs) +
  TOPICNODES (matching advertisers), serving the two distinct roles.

- NODES (0x04) is documented as also serving REGTOPIC and TOPICQUERY,
  carrying auxiliary ENRs for the requester's service table.

Message type codes after REGTOPIC are shifted down by one to keep IDs
sequential without gaps. The "not final" disclaimers on REGTOPIC /
REGCONFIRMATION / TOPICQUERY are removed since the messages are now
defined consistently with the DISC-NG theory section.

Cross-references to the theory document are added for the parameters
table (Freturn, Flookup), admission control, waiting-time function,
and lookup-response semantics.
…CQUERY

The field carries log2 distances from the topic, not bucket indices.
Aligning the spec terminology with FINDNODE's `distance` parameter
naming makes the meaning unambiguous and matches what the implementation
actually serializes (a slice of uint distances, used by the recipient
to pick aux ENRs at those distances from the topic).

No wire-encoding change — RLP is positional, so the field rename is
documentation-only.
discv5-wire: align REGTOPIC, REGCONFIRMATION, TOPICQUERY with DISC-NG; add TOPICNODES
…lookup responses

The Lookup Responses section says the registrar "may also return
additional ENRs selected from its view of the service table" but
doesn't specify how the selection is made.

Add a recommended algorithm: when the wire-format request carries a
list of topic-distances at which the requester's service table has
free space, the registrar selects at most one ENR per requested
distance from the corresponding bucket of its own B(s), up to an
implementation-defined total cap.

One-per-distance keeps responses compact and spreads coverage across
the requester's free buckets rather than overrepresenting a single
distance.

Companion to the wire-spec definition of the topic-distance list in
REGTOPIC and TOPICQUERY.
…cations

discv5-theory: document topic-distance hint and split lookup/registration responses into matches + auxiliary
@srene srene marked this pull request as draft May 15, 2026 10:16
@fjl fjl changed the title p2p/discv5: topic discovery spec discv5: topic discovery spec May 15, 2026
oascigil and others added 9 commits May 18, 2026 07:53
Added auxiliary ENR selection algorithm and refs to wire protocol messages
…inor fixes

DISC-NG -> TopDisc. Ticket contents revised. Discovery V5 co-existence section updated to use correct terms (Discovery v5 when referring to the legacy discovery protocol).
This feature protects against a single ticket being used for multiple registrations of ads. Binding the ad itself to the ticket solves this problem. 

+ Added a new sections Advertisements to explain what an ad object incluces (topic, enr)
+ adDigest included in the ticket which is signed by the registrar which binds the ticket to a single ad
…covery

Removed topic index and content related to the old radius-based ad search, topic queues, etc.
removed absolute pointers with the full url
include topdisc-related introductory text and pointers
+ minor edits to security goals
+ added a rationale section header before questions/answers
Define enr-entries/topic-discovery.md for the TopDisc topic discovery capability, with version-tagged unsigned-integer value so future non-backwards-compatible revisions can bump in place. Cross-reference the new entry from the ENR known-keys table in enr.md and from the TopDisc Capability section of discv5-theory.md.
@srene srene marked this pull request as ready for review May 19, 2026 10:59
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