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

spec/fix-rpl-abnf #52

Merged
merged 6 commits into from
Dec 5, 2019
Merged

spec/fix-rpl-abnf #52

merged 6 commits into from
Dec 5, 2019

Conversation

decanus
Copy link
Contributor

@decanus decanus commented Nov 26, 2019

No description provided.

@decanus decanus requested a review from oskarth November 26, 2019 18:03
@decanus
Copy link
Contributor Author

decanus commented Nov 26, 2019

the spec still isn't fully done @oskarth, but this brings in the first couple of fixes.

waku.md Outdated

; packet-format needs to be paired with its corresponding packet-format
packet = "[" required-packet / [ optional-packet ] "]"
packet-code = 0 / 1 / 2 / 3 / [ x4-127 ]
Copy link
Contributor

Choose a reason for hiding this comment

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

I know I wrote this initially, but this isn't the proper way of doing number ranges in abnf

Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC the way ISO8601 datetimes are documented is that they are 1-3DIGITS, and then they have a separate constraints section that indicates '0-127' are reserved. That would work too imo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I looked at ISO8601, what it does is add 1*3DIGIT meaning 1-3 Digits but does not actually set a constraint.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean this Restrictions section here: https://tools.ietf.org/html/rfc3339#section-5.7

They also do some stuff in-line if it is very small, e.g. date-month = 2DIGIT ; 01-12

packet-format = "[" packet-code packet-format "]"

status = "[" version pow-requirement [ bloom-filter ] [ light-node ] "]"
status = "[" version pow-requirement [ bloom-filter ] [ light-node ] "]"
Copy link
Contributor

Choose a reason for hiding this comment

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

two optionals seems a bit ambiguous, might want to clarify in a comment


p2p-request = waku-envelope
light-node = BIT
Copy link
Contributor

Choose a reason for hiding this comment

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

fwiw this works for me in Panini, it expect 0 or 1

waku.md Show resolved Hide resolved
waku.md Outdated
nonce = bytes
nonce = 8*OCTET

messages = *waku-envelope
Copy link
Contributor

Choose a reason for hiding this comment

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

is 0 messages legal?

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 marked it as not.

waku.md Outdated

p2p-request = waku-envelope

p2p-message = waku-envelope
Copy link
Contributor

Choose a reason for hiding this comment

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

what about multiple envelopes here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do we allow multiple envelopes here?

Copy link
Contributor

Choose a reason for hiding this comment

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

you reviewed the mailserver spec...

Copy link
Contributor

Choose a reason for hiding this comment

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

Historic messages MUST be sent to a peer as a packet with a P2P Message code (0x7f) followed by an array of Waku envelopes. It is incompatible with the original Whisper spec (EIP-627) because it allows only a single envelope, however, an array of envelopes is much more performant. In order to stay compatible with EIP-627, a peer receiving historic message MUST handle both cases.

you literally merged this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@oskarth
Copy link
Contributor

oskarth commented Dec 2, 2019

Ping (wrong button)

@oskarth oskarth closed this Dec 2, 2019
@oskarth oskarth reopened this Dec 2, 2019
@oskarth
Copy link
Contributor

oskarth commented Dec 2, 2019

There's also a weird section with whisper envelope double specified that should probably be removed in this PR

@oskarth
Copy link
Contributor

oskarth commented Dec 2, 2019

image
It also scrolls weird, we should ensure it stays within 80 (?) characters so we don't get horizontal scrolls in pre field. This likely requires moving out the floating point additional constraint to a section below, and use line breaks more.

@decanus
Copy link
Contributor Author

decanus commented Dec 3, 2019

@oskarth I feel this addresses most issues.

@decanus decanus requested a review from oskarth December 3, 2019 15:08

p2p-request = waku-envelope

p2p-message = waku-envelope
p2p-message = 1*waku-envelope
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it encoded differently? IIRC it is either waku-envelope OR an rlp list of waku envelopes. @adambabik ?

@@ -53,7 +53,7 @@ Using [Augmented Backus-Naur form (ABNF)](https://tools.ietf.org/html/rfc5234) w

```
; Packet codes 0 - 127 are reserved for Waku protocol
packet-code = 0 / 1 / 2 / 3 / [ x4-127 ]
packet-code = 1*3DIGIT
Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT about section below with additional constraints, where we mention 0-127?


envelope = flags auxiliary-field payload padding [signature] salt
envelope = flags auxiliary-field payload padding [signature] [salt]
Copy link
Contributor

Choose a reason for hiding this comment

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

two optionals here may seem fishy, but it makes sense with additional constraints (flag indicated) - perhaps we can pull this out into additional constraints section to keep the abnf more tight?

@oskarth
Copy link
Contributor

oskarth commented Dec 5, 2019

PR been open too long, it blocks/makes other things more complicated. Issues above are still issues but can be addressed in follow up issues/PRs. Lets make sure we get these types of PRs merged faster than a week+

@oskarth oskarth merged commit 70e8c06 into master Dec 5, 2019
@oskarth oskarth deleted the spec/fix-rpl-abnf branch December 5, 2019 04:13
@oskarth oskarth mentioned this pull request Dec 5, 2019
7 tasks
@oskarth
Copy link
Contributor

oskarth commented Dec 5, 2019

#43 see issues

kdeme pushed a commit that referenced this pull request May 18, 2020
* fixes

* indent

* rearranged

* Update waku.md

* commit
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants