-
Notifications
You must be signed in to change notification settings - Fork 276
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
circuitv2: upgrade definition to proto3 #509
Comments
Is that required? Status is optional so we'll know if it's not set. I don't think we'll want it set but left empty. Are there any on-the-wire changes with this change? |
@MarcoPolo yes, it's required by proto3 https://developers.google.com/protocol-buffers/docs/proto3#enum |
Ah I see. We need to have a 0 value. But we can simply not use it. I would suggest calling the 0 value
The Status is used as So my question is, are there are changes on the wire with this change then? Given that we have this explicit presence. I'm pretty sure the answer is no, but we should confirm. If there are no changes, then this is easy. If there are it breaks backwards compatibility. To answer this question I'd suggest doing something like https://github.com/MarcoPolo/proto2and3-playground (you can fork that and change it). That checks the bytes are equal or, barring that, that each can be decoded to the other. |
@MarcoPolo I've run similar tests for circuit v2 and it doesn't seem to break any backward compatibility. I've used the table as a guide for explicit presence. I'm currently only testing the status field. |
Great. Thanks for that! Those tests make sense to me. I'm for this change. Could you open a PR here in the Specs repo with this change that closes this issue please? |
Some more discussion here around subtleties and the path forward #511 (comment) |
Alright I've run a bunch of experiments: https://github.com/MarcoPolo/proto3-and-2-compat-experiments Lets use the proto3 definition in that repo. |
cc: @thomaseizinger since @mxinden is out. A corresponding change needs to be made to rust-libp2p here https://github.com/libp2p/rust-libp2p/blob/master/protocols/relay/src/message.proto right? |
cc: @Menduist for nim-libp2p considerations |
Yes, thanks for the ping! |
The current protobuf definitions for circuit v2 use proto2. For the new js implementation, it would be preferable to use proto3, since js-libp2p uses proto3 almost everywhere and protons only supports proto3. This change would require adding a default field to the
Status
enum as it is not currently compatible with proto3.Example updated protobuf:
The text was updated successfully, but these errors were encountered: