This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
permit slight changes to protocol messages without breaking compatibility #913
Labels
Milestone
Weave protocol messages are represented by a
[]byte
, with the first element being a tag identifying the message type, and the remainder being a payload, which is decoded differently, or not at all, depending on the message type.Here are all the current message types and payloads:
...
indicates an extension point where extra data can be added without breaking the decoding.Note that for gossip messages the entire payload is another gob encoded value stream. The gossip payload - a
[]byte
in turn is typically also a representation of a gob-encode value or value stream.This gob layering is all a bit mad. It's also more prone to compatibility breakage when things change even slightly. The only compatible change is the addition of extra data at the end (the
...
in the above). We can't remove or reorder information. And theProtocolPMTUVerified
is completely fixed.Perhaps we should switch to representing protocol message types as struct types that implement a common (possibly empty) interface. I have experimented with that a bit. This ought to simplify the encoding/decoding and give us all the compatibility benefits built into gob.
The text was updated successfully, but these errors were encountered: