Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relay/DCUtR: Make message type field required #375

Merged
merged 1 commit into from
Nov 22, 2021

Conversation

mxinden
Copy link
Member

@mxinden mxinden commented Nov 20, 2021

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?

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`.

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

  required Type type = 1;
```

```protobuf
message StopMessage {
  enum Type {
    CONNECT = 0;
    STATUS = 1;
  }

  required Type type = 1;
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants