From a46a466c9205b0be93ea643f4bf7c68ed6d319e5 Mon Sep 17 00:00:00 2001 From: kdeme Date: Tue, 26 Nov 2019 06:20:02 +0100 Subject: [PATCH] Add explanation on handshake function of Status message (#50) --- waku.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/waku.md b/waku.md index 00fd665b..6f1ede95 100644 --- a/waku.md +++ b/waku.md @@ -148,9 +148,26 @@ The following message codes are optional, but they are reserved for specific pur The bloom filter paramenter is optional; if it is missing or nil, the node is considered to be full node (i.e. accepts all messages). -Status message should be sent after the RLPx handshake and prior to any other messages. +The Status message serves as a Waku handshake and peers MUST exchange this +message upon connection. It MUST be sent after the RLPx handshake and prior to +any other Waku messages. + +A Waku node MUST await the Status message from a peer before engaging in other +Waku protocol activity with that peer. +When a node does not receive the Status message from a peer, before a +configurable timeout, it SHOULD disconnect from that peer. + +Upon retrieval of the Status message, the node SHOULD validate the message +content and decide whether it is compatible with the Waku version and mode +its peer is advertising. The handshake is completed when the node has sent, +received and validated the Status message. Note that its peer might not be in +the same state. + +When a node is receiving other Waku messages from a peer before a Status +message is received, the node MUST ignore these messages and SHOULD disconnect +from that peer. +Status messages received after the handshake is completed MUST also be ignored. -When a node does not receive the status message from a peer, before a configurable timeout, it MUST disconnect from that peer. **Messages**