p2p/discover/v5wire: shift DISC-NG message IDs to 0x07-0x0a#67
Open
srene wants to merge 1 commit into
Open
Conversation
Drops the unused REQUEST_TICKET (0x07) and TICKET (0x08) message-type placeholders that were never finalised in the discv5 wire spec and were never wired up in the implementation (no struct types, no handlers, no encoders, no senders — only the iota constants existed). After the shift: REGTOPIC 0x07 (was 0x09) REGCONFIRMATION 0x08 (was 0x0a) TOPICQUERY 0x09 (was 0x0b) TOPICNODES 0x0a (was 0x0c) Sequence is now dense (no gaps) and matches the wire-protocol spec at datahop/devp2p discv5/discv5-wire.md. This is a wire-format change. Any peer using the old (0x09-0x0c) allocation cannot interoperate with one using the new (0x07-0x0a) allocation on these messages. There are no shipped deployments of the old IDs and the DISC-NG messages were still flagged as not-final in the spec, so the disruption is contained to in-development implementations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns the DISC-NG message IDs in
v5wire/msg.gowith the wire-protocol spec by removing the vestigial REQUEST_TICKET / TICKET (0x07 / 0x08) placeholders and shifting REGTOPIC / REGCONFIRMATION / TOPICQUERY / TOPICNODES down by two.Companion to datahop/devp2p#2 (the wire-spec update).
Change
Sequence is now dense (no gaps), matching the spec at https://github.com/datahop/devp2p/blob/master/discv5/discv5-wire.md (after datahop/devp2p#2).
Why
The
RequestTicketMsgandTicketMsgslots existed only asiotaconstants — there are no struct typesRequestTicketorTicket, no encoders, no decoders, no handlers. They were inherited from earlier discv5 spec drafts that envisaged a separate two-step REGTOPIC → TICKET → REGCONFIRMATION flow. The current DISC-NG protocol merges that into a single REGCONFIRMATION response (carrying the ticket + wait-time, or empty-ticket on admission), so the placeholder slots are pure dead code that shift the live messages off the spec's sequence.Compatibility
This is a wire-format change. Peers using the old (0x09–0x0c) allocation cannot interoperate with peers using the new (0x07–0x0a) allocation on these messages.
There are no shipped deployments of the old IDs:
Disruption is contained to in-development implementations.
Test plan
go test ./p2p/discover/v5wire/...passesgo test ./p2p/discover/...passes (full topic test suite)go vet ./p2p/discover/...clean