swarm
swarm copied to clipboard
swarm handshake: detect tracing automagically
since recent changes to our bzz protocol handshake, tracing nodes (running with the --tracing
flag) cannot complete a handshake with non tracing nodes.
this infers a configuration imperative that is restrictive to our deployment configuration (bootnode must be configured with --tracing
if the other nodes in the cluster are tracing and vice versa). this also means we can't run tracing on our open cluster.
the handshake should autodetect if the other peer we are handshaking with is tracing or not and act accordingly
This is actually not possible with the current design of RLP. Since the RLP Payload
is an io.Reader
, if we first try to decode the message as a message with a context, we cannot fallback to a normal message since we cannot seek the reader to the beginning of the data stream.
The alternative (and very ugly solution) while maintaining the current context implementation would be to read the payload data, reconstruct the devp2p message using the original message, try to decode it, then fall back to the previously read data.
The other would be to reimplement context propagation in a way which is compatible with devp2p messages.
cc @zelig @nonsense
We ran into this bug when launching the RIF Storage testnet