-
Notifications
You must be signed in to change notification settings - Fork 14
13/14/16/21: Change in timestamp format #483
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the timestamp
changes also affect https://rfc.vac.dev/spec/16/
This is a breaking change in the protocol, so I think we should do a major version bump in the protocol-id
. WDYT @staheri14 @oskarth ? This will also affect the nim-waku
implementation PR, as the protocol-id
is configured as a const
there.
48d4391
to
d988a6a
Compare
In order to sign old commits (and later allow merging) I executed a push force: this unfortunately deleted the file change request by @jm-clius. I however assume that @jm-clius wanted to make https://rfc.vac.dev/spec/16/ consistent with the timestamp refactoring of #842: such (new) commit can be found here. |
@s1fr0 This file also needs to be updated https://rfc.vac.dev/spec/21/ |
Thanks @staheri14 ! Done in 29c89c6. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jm-clius by protocol id what do you mean more precisely?
UPDATE: Pretty sure you meant 2 below, not 1 after re-reading as two separate paragraphs
1) JSON RPC API
If you mean for 16 specifically do you mean "v1" in get_waku_v2_store_v1_messages
? I don't see a specific mention of protocol-id
though.
Technically speaking, https://rfc.vac.dev/spec/16 is still in draft, which means no end users should rely on it. Practically speaking, this might impact some users. At a minimum, it should be communicated as a breaking change in nim-waku changelog.
Is the suggestion to change "v1" to "v2" here? I'd be fine with it, but it seems like if we want to do it properly we'd also keep v1 around (otherwise for end consumers things break regardless), and not sure the overhead for that is justified?
2) Protocol identifier in store protocol
Assuming we mean e.g. Protocol identifier*: /vac/waku/store/2.0.0-beta3
in https://rfc.vac.dev/spec/13/ it is also in draft, but I think we can bump this to beta4
. I don't think a major bump (e.g. 3.0 or 2.1) makes sense given that it still in draft mode. Once store is in stable mode, a new store spec would be a new RFC, and we'd want to give more care to make sure both protocol identifiers are supported by e.g. a single nwaku node.
I don't think the overhead of keepingbeta3
support is justified - easiest would be to drop it completely. Ideally we don't require a coordinated upgrade, so js-waku nodes can keep talking to some old nodes that still support beta3
until they've moved over to use beta4
. I'm not sure we have support for this type of deploy (like green-blue production setup), but perhaps it can be done with test/production fleet? This depends a bit on how much js-waku nodes rely on reliable store operation in production cluster.
wdyt @D4nte re ideal upgrade path for these types of changes.
Updated title to indicate it is a breaking change, refactor seems to point to implementation details not changing interface with different type requirements |
@oskarth, yeah I meant |
content/docs/rfcs/21/README.md
Outdated
+ Timestamp start_time = 5; | ||
+ Timestamp end_time = 6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this to be proto3
I think we have to use proto types, i.e. int64
. It is true that in the nim
client we define a separate Timestamp
type, but when serialising to protobuf, I think we use int64
fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct (in reality we serialize to zint64 when writing protobuffers and read as Timestamp). Unless we alias this type as well in utils/time to pbTimestamp. Let me know what do you think it suits best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Timestamp
is a proto3 type: https://developers.google.com/protocol-buffers/docs/proto3 that is actually a timestamp in string format. Is that the type you wish to use?
Any reason why we are using different types for start_time
, end_time
and timestamp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I apologize for the misunderstanding. The correct proto3 type is indeed sint64
. since I cast our internal Timestamp
type (an alias for int64
) to zigzag encoding before writing it to the buffer, i.e. I cast to zint64
in libp2p miniprotobuf implementation. Changes committed.
@s1fr0 I think your concern is that |
@@ -578,7 +578,7 @@ This method is part of the `store` API and the specific resources to retrieve ar | |||
|
|||
#### Request | |||
|
|||
```curl -d '{"jsonrpc":"2.0","id":"id","method":"get_waku_v2_store_v1_messages", "params":[ "", [{"contentTopic":"/waku/2/default-content/proto"}],{"pageSize":2,"cursor":{"digest":"abcdef","receivedTime":1605887187.00},"forward":false}]}' --header "Content-Type: application/json" http://localhost:8545``` | |||
```curl -d '{"jsonrpc":"2.0","id":"id","method":"get_waku_v2_store_v1_messages", "params":[ "", [{"contentTopic":"/waku/2/default-content/proto"}],{"pageSize":2,"cursor":{"digest":"abcdef","receivedTime":1605887187000000000},"forward":false}]}' --header "Content-Type: application/json" http://localhost:8545``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth taking the opportunity to align the receivedTime
field with the protobuf equivalent receiverTime
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll open a new issue for this.
content/docs/rfcs/21/README.md
Outdated
+ Timestamp start_time = 5; | ||
+ Timestamp end_time = 6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Timestamp
is a proto3 type: https://developers.google.com/protocol-buffers/docs/proto3 that is actually a timestamp in string format. Is that the type you wish to use?
Any reason why we are using different types for start_time
, end_time
and timestamp
?
@staheri14 indeed! Since I use libp2p miniprotobuf |
I think there is no choice but for js-waku to support both protocols at a given time.
tl;dr: Give us enough time between change ready and change deployed for us to get js-waku ready. |
Right. This makes sense to me. @s1fr0 that would likely mean waiting for waku-org/nwaku#849 to be merged and then keeping your changes up to date with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to change the protocol-id
for 13/WAKU2-STORE
to -beta4
. The protocol-id is also listed in 10/WAKU2
and needs to upped there as well.
content/docs/rfcs/14/README.md
Outdated
@@ -50,7 +49,7 @@ message WakuMessage { | |||
bytes payload = 1; | |||
string contentTopic = 2; | |||
uint32 version = 3; | |||
double timestamp = 4; | |||
int64 timestamp = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int64 timestamp = 4; | |
sint64 timestamp = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll change to sint64 when we'll refactor chat2 to use Timestamp type for timestamps
Thanks! just be sure to notify us when the change is ready :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR LGTM, is there any blocker for it to be merged? @s1fr0
Hi @staheri14 , I'm waiting waku-org/nwaku#849 to be merged (see here). |
As a rule of thumb we don't want to block PRs from being merged into master, see https://trunkbaseddevelopment.com/ for methodology we are using. If a hotfix is required this can be dealt with separately as a short-lived branch. Since it seems we've already agreed to block until now we can keep doing so until waku-org/nwaku#849 gets merged, assuming we can do so this week. If that PR requires more spec changes, I suggest we merge this regardless. |
IMHO, this PR can be merged as soon as it is ready. I don't see added value in blocking an RFC PR with a reference implementation PR. Just my 2 cents :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with comments above. I think you can go ahead and merge this, @s1fr0.
One point I am confused about: Shouldn't the version of all protocols that use 14/WAKU-MESSAGE be upgraded? Indeed, Relay, Filter and Lightpush use 14/WAKU-MESSAGE. Until this PR was merged, we expected the How does one know if a peer expect a It may also be relevant to add versioning to the WakuMessage protobuf using the |
After more analysis, I think the best way forward is simply to use a new field on Waku Message. Making the current field deprecated. @s1fr0 |
* master: RFC16: add version call (#505) fix(noise): update RFC to implementation (#508) fixup: 37/WAKU2-NOISE fix images paths (#506) New RFC: 37/WAKU2-NOISE-SESSIONS (#504) 36/WAKU2-BINDINGS-API (#501) docs(16/WAKU2-RPC): add ENR to waku info (#502) Adding 35/WAKU2-NOISE to menu (#500) add RFC33 to index (#499) feat: 32/RLN raw spec New RFC: 35/WAKU2-NOISE (#496) Update on the rln registration figure to match the current spec (#497) 33/WAKU-DISCV5: Add first raw version (#487) Add pubsubTopic field to index (#492) Fix markdown links (#493) Categorize 22 & 31 (#490) Changed PB Timestamp index to 10 (#491) 13/14/16/21: Change in timestamp format (#483) add: RFC31 copyright statement (#489) 17/WAKU-RLN-RELAY: Revise spec for its draft version (#484)
* master: RFC16: add version call (#505) fix(noise): update RFC to implementation (#508) fixup: 37/WAKU2-NOISE fix images paths (#506) New RFC: 37/WAKU2-NOISE-SESSIONS (#504) 36/WAKU2-BINDINGS-API (#501) docs(16/WAKU2-RPC): add ENR to waku info (#502) Adding 35/WAKU2-NOISE to menu (#500) add RFC33 to index (#499) feat: 32/RLN raw spec New RFC: 35/WAKU2-NOISE (#496) Update on the rln registration figure to match the current spec (#497) 33/WAKU-DISCV5: Add first raw version (#487) Add pubsubTopic field to index (#492) Fix markdown links (#493) Categorize 22 & 31 (#490) Changed PB Timestamp index to 10 (#491) 13/14/16/21: Change in timestamp format (#483) add: RFC31 copyright statement (#489) 17/WAKU-RLN-RELAY: Revise spec for its draft version (#484)
In nim-waku PR #842 a new type
Timestamp
for all timestamps in waku v2 is introduced. The typeTimestamp
is currently set to be an alias forint64
(see utils/time) and all times now have nanosecond resolution.This PR reflects these changes in specifications. In particular it addresses the following item of #834:
It further addresses Waku2-RPC and Waku2-FTSTORE specifications.