-
Notifications
You must be signed in to change notification settings - Fork 42
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
Protobuf decode absent values as default #921
Comments
Looks like protons did a fix: ipfs/protons#66 so it's just a matter of upgrading to latest version |
Latest update:
Now:
In Waku, we did not pay attention to any of this when defining protocols. Until now. See work done with vacp2p/rfc#552 and vacp2p/rfc#553 Steps:
|
Some recent development (I haven't reviewed yet) ipfs/protons#83 |
Problem
Proto3 language guide states:
We currently use
protons
for protobuf encoding/decoding and its behavior does not match the language guide: ipfs/protons#43Decoding
Because of that, we manually replace an
undefined
value with the default value in some places: https://github.com/status-im/js-waku/blob/d79984fdba57c8e89400fc2a47958d49e0ed9645/src/lib/waku_message/index.ts#L273 as other implementations (go-waku, nwaku), do not encode default values on wire.Encoding
Encoding default values over wire or not do not change the functionality.
Avoiding the encoding would few bytes of bandwith and data storage.
Solution
Best case, ipfs/protons#48, or equivalent gets merged and we use it forward.
if not, then either:
The text was updated successfully, but these errors were encountered: