libp2p / specs

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

identify: Document identify behavior for asymetrical protocols #327

Closed mxinden closed 3 years ago

mxinden commented 3 years ago

Note on asymmetrical protocols: Assume an asymmetrical request-response style protocol foo where some clients only support initiating requests while some servers (only) support responding to requests. To prevent clients from initiating requests to other clients, which given them being clients they fail to respond, clients should not list foo in their protocols list.

Question emerged in https://github.com/libp2p/specs/issues/324.

mxinden commented 3 years ago

@marten-seemann do you have some time to review this pull request?

mxinden commented 3 years ago

This works, but it's a bit confusing. I'd talk about this in terms of inbound streams. E.g.,

A node should only advertise a protocol if it's willing to receive inbound streams on that protocol.

:+1: Adjusted the paragraph with your excerpt at first, followed by a small example.