libp2p / specs

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

[identify] Handling of asymetrical protocols #324

Closed D4nte closed 3 years ago

D4nte commented 3 years ago

Given an asymmetrical protocol foo/bar where Alice only supports initiating a query to Bob and Bob only supports responding to a request of said protocol.

Currently, the identify protocol does not include valuable information. Indeed, the specs reads:

protocols This is a list of protocols supported by the peer.

In the case of Carole, who only support initiating query of foo/bar protocol. Once she finishes the identify protocol with Alice, both Carole and Alice may think they can initiate the query with the other, when it is not the fact.

One idea I had was simply for Alice and Carole to not include foo/bar in the Identify message they send. I am not sure of the ramifications of such design.

What are your thoughts on the matter?

mxinden commented 3 years ago

One idea I had was simply for Alice and Carole to not include foo/bar in the Identify message they send. I am not sure of the ramifications of such design.

Yes, this is the libp2p best practice. Implementations doing this today:

Does the above make sense to you @D4nte? If so, would you mind sending in a patch to update the identify protocol specification in this repository?

D4nte commented 3 years ago

Great answer, thank you very much.

D4nte commented 3 years ago

Closing, will reopen if further questions arise.