libp2p / specs

Technical specifications for the libp2p networking stack
https://libp2p.io
1.56k stars 273 forks source link

relay/DCUtR: Make message type field `required` #375

Closed mxinden closed 2 years ago

mxinden commented 2 years ago

The type field of the DCUtR message definition should not be optional, as a message without a Type is useless. Instead it should be required.

See also circuit relay v2 specification using required for type.

message HopMessage {
  enum Type {
    RESERVE = 0;
    CONNECT = 1;
    STATUS = 2;
  }

  required Type type = 1;
message StopMessage {
  enum Type {
    CONNECT = 0;
    STATUS = 1;
  }

  required Type type = 1;

If I am not mistaken, none of the libp2p implementations have released a DCUtR implementation yet, thus we can still easily make this change. Correct @marten-seemann?