Skip to content
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

Pipelined identify protocol "negotiation" #903

Closed
Stebalien opened this issue Apr 30, 2020 · 5 comments
Closed

Pipelined identify protocol "negotiation" #903

Stebalien opened this issue Apr 30, 2020 · 5 comments
Assignees
Labels
kind/enhancement A net-new feature or improvement to an existing feature

Comments

@Stebalien
Copy link
Member

Now that we're going to introduce multiple identify protocols, we'll need to negotiate to pick the right one. This could cost us multiple round-trips.

However, there's a simple hack to work around this: just send all protocols we speak up-front!

That is, instead of:

> /multistream/1.0.0\n
> /p2p/id/1.1.0
< /multistream/1.0.0\n
< na
> /ipfs/id/1.0.0\n
< /ipfs/id/1.0.0\n
< Identify Message

Send all protocols we speak together:

> /multistream/1.0.0\n
> /p2p/id/1.1.0
> /ipfs/id/1.0.0\n
< /multistream/1.0.0\n
< na
< /ipfs/id/1.0.0\n
< Identify Message

The trick here is that the receiver will ignore any data from the initiator of the identify request.

@Stebalien Stebalien added the kind/enhancement A net-new feature or improvement to an existing feature label Apr 30, 2020
@raulk
Copy link
Member

raulk commented Apr 30, 2020

Can't we just make the identify message for /p2p/id/1.1.0 backwards compatible? Unless I'm missing something (which I probably am), it should be easily doable with Protobuf.

@Stebalien
Copy link
Member Author

We can. But in that case, we'd need to keep the same protocol name.

@Stebalien
Copy link
Member Author

(i.e., /ipfs/id/1.0.0)

@raulk
Copy link
Member

raulk commented May 1, 2020

Exactly, that’s precisely what I mean. Versioning protocols by outer protocol identifiers is one way to version protocol. It’s practicable when it’s accompanied by an efficient protocol negotiation scheme. Multistream-select 1.0 is not that, it’s pretty wasteful, and working around it with a bespoke flow is something I’d like to avoid. Let’s version the protocol from inside the protocol in this case. When we introduce a HELLO message in ms2.0, all this will become much better.

@Stebalien
Copy link
Member Author

This is no longer an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants