Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Improve 14/WAKU2-MESSAGE RFC format etc #553

Merged
merged 1 commit into from
Nov 15, 2022
Merged

Conversation

LNSD
Copy link
Contributor

@LNSD LNSD commented Nov 10, 2022

The goal is to stabilize the 14/WAKU2-MESSAGE RFC making it comply with VAC's RFC template.

From @oskarth comment:

There's a lot of things going on here and I'm not sure I fully understand the purpose of some of the changes...

I'd separate out:

  • making it compliant with format (formatting)
  • functional change
  • promotion to stable (this should be a one line PR once everything has been stable for long time)

This PR touches a lot of things right now

This PR covers the first item. It improves formatting/compliance with the RFC template and some style improvements and paraphrasing for clarity.

This PR resolves #551

@LNSD LNSD added the track:waku-specs Waku specs track (RAD) label Nov 10, 2022
@LNSD LNSD self-assigned this Nov 10, 2022
status: draft
name: Waku v2 message RFC
status: stable
category: Standards Track
Copy link
Contributor Author

@LNSD LNSD Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if I picked the correct category for this RFC. Is this the right category for this RFC?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where one can find descriptions of these categories?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you can find the template, but I cannot find the different categories description

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think this is correct but defer to @kaiserd

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add a category description to the COSS.

Comment on lines 56 to 79
```protobuf
syntax = "proto3";

message WakuMessage {
bytes payload = 1;
string contentTopic = 2;
string content_topic = 2;
uint32 version = 3;
sint64 timestamp = 10;
bool ephemeral = 31;
}
```
Copy link
Contributor Author

@LNSD LNSD Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TO-DO:

  • Add this protobuf to the Waku protocol buffers' repository

Copy link
Contributor Author

@LNSD LNSD Nov 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR opened here: waku-org/waku-proto#1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Shouldn't field names be under_score based on https://developers.google.com/protocol-buffers/docs/style?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't field names be under_score based on developers.google.com/protocol-buffers/docs/style?

Yes, this is what I did here: contentTopic -> content_topic

Comment on lines 100 to 133
# References

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
TBD
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unsure exactly what to put here 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say the links you have already put in the text.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be summarized links that are in text

Copy link
Contributor

@staheri14 staheri14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

content/docs/rfcs/14/README.md Outdated Show resolved Hide resolved
status: draft
name: Waku v2 message RFC
status: stable
category: Standards Track
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where one can find descriptions of these categories?

content/docs/rfcs/14/README.md Outdated Show resolved Hide resolved
content/docs/rfcs/14/README.md Show resolved Hide resolved
content/docs/rfcs/14/README.md Outdated Show resolved Hide resolved

### Version 1
- **Version 0:** The payload SHOULD be interpreted as unencrypted; additionally, it CAN indicate that the message payload has been encrypted at the application layer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Version 0:** The payload SHOULD be interpreted as unencrypted; additionally, it CAN indicate that the message payload has been encrypted at the application layer.
- **Version 0:** The `payload` SHOULD be interpreted as unencrypted; additionally, it CAN indicate that the message payload has been encrypted at the application layer.


### Version 1
- **Version 0:** The payload SHOULD be interpreted as unencrypted; additionally, it CAN indicate that the message payload has been encrypted at the application layer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not MUST? i.e., MUST be interpreted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question for you, why not SHOULD? Can you elaborate?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sure; for reference, based on https://rfc.vac.dev/spec/1/#language and the document referred therein https://www.rfc-editor.org/rfc/rfc2119, the term SHOULD indicates recommendation whereas MUST indicates an absolute requirement. So in here, when the version is 0 (or 1), to me, the payload is absolutely unencrypted (or encrypted), i.e., there is no doubt. Hence the term MUST looks more appropriate.

Copy link
Contributor

@jm-clius jm-clius Nov 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I agree, @staheri14. When version is 0 it simply means that Waku is not enforcing some encryption scheme. Applications are free to encrypt the payload as they wish (and most do). SHOULD is therefore more appropriate, IMO.

Copy link
Contributor

@staheri14 staheri14 Nov 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applications are free to encrypt the payload as they wish (and most do). SHOULD is therefore more appropriate, IMO.

I see what you mean, right, for version 0 it makes sense to use SHOULD. But in the other cases i.e., version value of 1 and 2, I think that needs to be updated to MUST following my previous reasoning.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, are we going to argue that if the version is e.g., 1, the application still can decide to use a different encryption scheme or none at all? @jm-clius if that is the case, then SHOULD is appropriate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. I don't think from an RFC perspective we can force applications to use version in a certain way, although it's clearly recommended.

- **Version 0:** The payload SHOULD be interpreted as unencrypted; additionally, it CAN indicate that the message payload has been encrypted at the application layer.
- **Version 1:** The payload SHOULD be encrypted using Waku v1 payload encryption. [26/WAKU-PAYLOAD](/spec/26).
This provides asymmetric and symmetric encryption. The key agreement is performed out of band. And provides an encrypted signature and padding for some form of unlinkability.
- **Version 2:** The payload SHOULD be encrypted using [35/WAKU2-NOISE](/spec/35).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto about SHOULD vs MUST here

Comment on lines 100 to 133
# References

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
TBD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say the links you have already put in the text.

content/docs/rfcs/14/README.md Show resolved Hide resolved
@LNSD
Copy link
Contributor Author

LNSD commented Nov 11, 2022

@staheri14 I see some of your questions as too vague.

What do you expect me to do there? Could you be more precise about what you are suggesting? Or the things that are unclear to you?

For the sake of time, please let's try to be more concise in our review comments.

@staheri14
Copy link
Contributor

What do you expect me to do there? Could you be more precise about what you are suggesting? Or the things that are unclear to you?

@LNSD

I am not sure which comment needs more clarification. let me know, and I will be happy to explain. :)

@staheri14
Copy link
Contributor

staheri14 commented Nov 11, 2022

@LNSD added further clarifications to my comments as I saw fit.

content/docs/rfcs/14/README.md Outdated Show resolved Hide resolved
status: draft
name: Waku v2 message RFC
status: stable
category: Standards Track
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think this is correct but defer to @kaiserd

content/docs/rfcs/14/README.md Outdated Show resolved Hide resolved
content/docs/rfcs/14/README.md Outdated Show resolved Hide resolved
Comment on lines 56 to 79
```protobuf
syntax = "proto3";

message WakuMessage {
bytes payload = 1;
string contentTopic = 2;
string content_topic = 2;
uint32 version = 3;
sint64 timestamp = 10;
bool ephemeral = 31;
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Shouldn't field names be under_score based on https://developers.google.com/protocol-buffers/docs/style?

content/docs/rfcs/14/README.md Show resolved Hide resolved

This indicates that the payload SHOULD be either unencrypted or that encryption is done at a separate layer outside of Waku.
The waku message payload MAY be encrypted. The message `version` attribute indicates the schema used to encrypt the payload data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh diff is confusing, this line is no longer referring to version 0?

content/docs/rfcs/14/README.md Show resolved Hide resolved

## Reliability of the WakuMessage timestamp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not removed, but with the format changes, it seems that the diff is not detecting it. Check line 113.

Comment on lines 100 to 133
# References

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
TBD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be summarized links that are in text

@oskarth
Copy link
Contributor

oskarth commented Nov 11, 2022

There's a lot of things going on here and I'm not sure I fully understand the purpose of some of the changes...

I'd separate out:

  • making it compliant with format (formatting)
  • functional change
  • promotion to stable (this should be a one line PR once everything has been stable for long time)

This PR touches a lot of things right now

Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think this is on track to getting our message spec to stable. See my comments below. I agree that this spec should be decoupled from other protocol specs (because it is the foundational one), but it may be worth still adding concrete examples to clarify concepts such as ephemeral.

content/docs/rfcs/14/README.md Outdated Show resolved Hide resolved
content/docs/rfcs/14/README.md Outdated Show resolved Hide resolved

See [13/WAKU2-STORE](/spec/13) for more details.
The `timestamp` attribute signifies the time at which the message was generated by its sender. This field SHOULD contain the Unix epoch time in nanoseconds. If the attribute is omitted, it SHOULD be interpreted as timestamp 0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the attribute is omitted, it SHOULD be interpreted as timestamp 0.

I'm not sure why this clause is necessary? Couldn't it also be interpreted as unset to the same effect by some clients?


## Payloads
The `ephemeral` attribute signifies the transient nature of the message. If this field is set to `true`, the message SHOULD be interpreted as ephemeral. Else, if the field is omitted or set to `false`, the message SHOULD be interpreted as non-ephemeral.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that we probably don't want any coupling between this spec and the store specification, but I think it's OK to have an example here of what ephemeral MAY imply. Something like:
For example, nodes interested in storing historical messages MAY choose to ignore ephemeral messages.


### Version 1
- **Version 0:** The payload SHOULD be interpreted as unencrypted; additionally, it CAN indicate that the message payload has been encrypted at the application layer.
Copy link
Contributor

@jm-clius jm-clius Nov 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I agree, @staheri14. When version is 0 it simply means that Waku is not enforcing some encryption scheme. Applications are free to encrypt the payload as they wish (and most do). SHOULD is therefore more appropriate, IMO.


### Version 1
- **Version 0:** The payload SHOULD be interpreted as unencrypted; additionally, it CAN indicate that the message payload has been encrypted at the application layer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Version 0:** The payload SHOULD be interpreted as unencrypted; additionally, it CAN indicate that the message payload has been encrypted at the application layer.
- **Version 0:** The payload SHOULD be interpreted as unencrypted; additionally, it MAY indicate that the message payload has been encrypted at the application layer.

CAN is not a recognised RFC keyword.

content/docs/rfcs/14/README.md Outdated Show resolved Hide resolved
content/docs/rfcs/14/README.md Outdated Show resolved Hide resolved
content/docs/rfcs/14/README.md Outdated Show resolved Hide resolved
content/docs/rfcs/14/README.md Outdated Show resolved Hide resolved
@LNSD LNSD force-pushed the stabilize-14-waku-message branch 5 times, most recently from 10b6605 to c701d23 Compare November 14, 2022 12:06
@LNSD LNSD force-pushed the stabilize-14-waku-message branch 3 times, most recently from 1ac49dd to c918ed2 Compare November 14, 2022 15:12
Copy link
Contributor

@s1fr0 s1fr0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! Left some comments/nitpick

Copy link
Contributor

@staheri14 staheri14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

@oskarth oskarth merged commit 5b798cc into master Nov 15, 2022
@oskarth oskarth deleted the stabilize-14-waku-message branch November 15, 2022 02:12
@oskarth oskarth changed the title Promote 14/WAKU2-MESSAGE RFC to stable state Improve 14/WAKU2-MESSAGE RFC format etc Nov 15, 2022
Copy link
Contributor

@kaiserd kaiserd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍
I'd change some of the wording, especially the "One may" list.
I'll do an editing pass addressing that in a separate PR.
Generally, I suggest adding an editing pass by an editor (position we need to fill) before a PR can enter the stabalization phase.
As @oskarth suggested, the actual stabilization PR should just change the status, and it should be done after the respective RFC has been with out changes for a while.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
track:waku-specs Waku specs track (RAD)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Promote 14/WAKU2-MESSAGE RFC to stable state
6 participants