Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[Do not merge] Implement Waku mode PoC #114
This are currently purely the Whisper changes.
It would also require some forced setting to only connect with 1 other (trusted) waku node. And thus don't run additional discovery or listen for incoming connections.
Next to that, it would be best if we could have backwards compatibility with Whisper versions not having the Waku mode, but we would need this: #116
Another, more ugly, way making sure we have backwards compatibility would be to not put the
We already have incompatible number of arguments in Whisper handshake with regards to EIP-627:
From our fork of Whisper, I assume that we can handle that gracefully, i.e. if there is no additional param, ignore the error (https://github.com/status-im/whisper/blob/master/whisperv6/peer.go#L141-L144). It needs to be confirmed whether EIP-627 compatible node will handle properly a handshake with more params but it looks like it will.
In the Waku mode spec (status-im/specs#54), there are two problems: (1) adding a new packet code, (2) identifying as a waku node.
In my opinion, identifying as a Waku Node might be put into the handshake. It is very close logically to identifying as a Light Node. Generally, this light node identification could be extend to be an enum informing about the Whisper node mode (light, waku, possibly others). Alternatively, we can rely on the peers discovery mechanism. A peer would seek for Whisper nodes advertising themselves as Waku nodes, do a handshake and finally verify whether the advertisement is correct using a special packet or by examining its interface.
Adding a new packet is already explored by our Whisper fork, for example, packets to do the sync between mailservers.
So, there is a possibility to do everything we want by just introducing new packets and utilizing peers discovery mechanism and avoid changing the handshake at all.
I did not know about this change in the handshake. Only knew about the added
I agree on the identification in the handshake. The code change in this PR does that. It adds a
Having peer capability (supported protocols) checking in discovery would in general be better yes. But for us this is not yet possible. This would mean we need to implement discovery v5 or at least the ENR mechanism.