Skip to content

Commit 06c3d15

Browse files
committed
Put responses and notifications in notification packets
1 parent b1e94c9 commit 06c3d15

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

discv5/discv5-wire.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ of `authdata`, which differs depending on the packet type.
110110
### Ordinary Message Packet (`flag = 0`)
111111

112112
For message packets, the `authdata` section is just the source node ID.
113+
[Protocol messages](#protocol-messages) of type request are transported in the
114+
`message` field of this packet.
113115

114116
authdata = src-id
115117
authdata-size = 32
@@ -159,16 +161,19 @@ handshake packet.
159161
Aside from the flag value, this container is identical to a
160162
[message packet](#ordinary-message-packet). Contrary to a message packet, failing to
161163
decrypt a notification packet should not trigger a handshake.
164+
[Protocol messages](#protocol-messages) of type response and notification are transported
165+
in the `message` field of this packet.
162166

163167
## Protocol Messages
164168

165169
This section lists all defined messages which can be sent and received. The hexadecimal
166170
value in parentheses is the `message-type`.
167171

168-
The first element of every `message-data` list is the request ID. `request-id` is an RLP
169-
byte array of length <= 8 bytes. For requests, this value is assigned by the requester.
170-
The recipient of a message must mirror the value in the `request-id` element of the
171-
response. The selection of appropriate values for request IDs is left to the implementation.
172+
For request and response messages, the first element of every `message-data` list is the
173+
request ID. `request-id` is an RLP byte array of length <= 8 bytes. For requests, this value
174+
is assigned by the requester. The recipient of a message must mirror the value in the
175+
`request-id` element of the response. The selection of appropriate values for request IDs is
176+
left to the implementation.
172177

173178
### PING Request (0x01)
174179

@@ -297,20 +302,15 @@ TOPICQUERY requests nodes in the [topic queue] of the given topic. The recipient
297302
request must send one or more NODES messages containing node records registered for the
298303
topic.
299304

300-
## Protocol Notifications
301-
302-
This section lists all defined notifications which can be sent and received. The hexadecimal
303-
value in parentheses is the `notification-type`.
304-
305-
### RELAYINIT (0x01)
305+
### RELAYINIT Notification (0x0B)
306306

307307
message-data = [inr-enr, tgt-id, nonce]
308308
notification-type = 0x01
309309
inr-enr = initiator ENR
310310
tgt-id = 256-bit node ID of target
311311
nonce = uint96 -- nonce of timed out request
312312

313-
### RELAYMSG (0x02)
313+
### RELAYMSG Notification (0x0C)
314314

315315
message-data = [inr-enr, nonce]
316316
notification-type = 0x02

0 commit comments

Comments
 (0)