libp2p / specs

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

Introduce identify v2.0.0 based on signed peer records #350

Closed thomaseizinger closed 2 years ago

thomaseizinger commented 3 years ago

Best reviewed patch-by-patch.

I plan to amend https://github.com/libp2p/specs/commit/1d715ffcb542a5eab9efdff12fbe89bd93a08715 as I work through feedback. Currently a draft PR because of discussion ongoing here.

Stebalien commented 3 years ago

Hm. This is unfortunate. Sending signed peer records has already been implemented in go-libp2p's identify but this was never added to the specs.

The implementation is that we simply added a new field to the identify protobuf that includes the signed peer record. In terms of efficiency, this is less than optimal. But it lets us avoid an extra round-trip for version negotiation.

https://github.com/libp2p/go-libp2p/blob/5d3b015018a34a5875c91c7645ef20f8a91736e3/p2p/protocol/identify/pb/identify.proto#L40-L45

Stebalien commented 3 years ago

Ah, I see the discussion. I'll continue there.