libp2p / specs

Technical specifications for the libp2p networking stack
https://libp2p.io
1.56k stars 273 forks source link

Be explicit about use of protobuf version 2 #281

Closed oskarth closed 3 years ago

oskarth commented 4 years ago

Problem

Protobuf2 and 3 are different protocols with different semantics. From reading the specs, it is not obvious which version is used. The same is true looking at the docs site https://docs.libp2p.io/concepts/protocols/

Looking at e.g. https://github.com/libp2p/go-libp2p/blob/master/p2p/protocol/identify/pb/identify.proto#L1 one can infer that protobuf2 is used.

Potential solutions

  1. Docs site should be explicit about use of protobuf2 unless otherwise mentioned
  2. It could be mentioned in the beginning of each spec
  3. It could be mentioned in a meta spec (e.g. lifecycle document, or style guide)
  4. syntax = "proto2"; could be added to every protobuf field in line

As an example, at Status we specify proto3 in the main spec once: https://specs.status.im/spec/1#protobuf

Notes and related links

sinkingsugar commented 4 years ago

I'd like to point out also that 2 implementations of the noise spec are using proto3 Not strictly connected to this issue but to not forget, keep track and investigate.

oskarth commented 3 years ago

Closed in https://github.com/libp2p/specs/pull/282