-
Notifications
You must be signed in to change notification settings - Fork 277
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
ABNF packets #139
Comments
Yes! That's a very nice idea. We should use that for all specs. Maybe we could even define a nice RLP extension for ABNF and add it as a meta spec. |
@fjl would be fun to work on that, am happy to help. I made the demo PR mainly to show. |
currently wondering if it makes sense at all for RLP or only for packets. |
If there is a neat way to describe RLP with ABNF, let's go for it. Right now we use |
@fjl might make sense to first describe the packets and then attempt to do RLP later on. Would be a good first step imo. |
Yes, sounds good to me. Maybe pick one of the specs and convert it to ABNF so we can see what that looks like. |
I've looked at a bunch of ways to describe binary data in the last couple weeks, and the option I liked the most is the notation used in the QUIC spec drafts: https://quicwg.org/base-drafts/draft-ietf-quic-transport.html#section-1.3 This notation works great for binary layout descriptions. I like it because it's very 'vertical', unlike the ABNF variants, which are closer to the 'concatenation formula' style we have now. Example:
While this works for many things, we still need to keep the formula-style notation for crypto pseudocode. We also still need a way to describe RLP structures in a sane way. The notation we have for RLP purposes is this kind:
It looks very clean, but is always a bit of a challenge because there is no good way to put type/size information into this notation. We also have an RLP notation with types, which we use in the eth protocol spec:
But that one was never formally described anywhere and I don't even remember what all the letters mean. |
At vac we've started defining packets using ABNF, it might make sense to do this in the devp2p specifications too. https://specs.vac.dev/specs/waku/waku.html#abnf-specification
The text was updated successfully, but these errors were encountered: