Skip to content

Add the possibility to assume that multistream-select will succeed #659

@tomaka

Description

@tomaka

If the connection upgrade only accepts one protocol, we can optimize the multistream-select process by assuming that it works, and closing the connection/substream altogether if later the remote returns "na".

I would suggest modifying dialer_select_proto so that if the size_hint() of the protocols list returns a maximum of 1, immediately succeed after sending the data without waiting for the remote to confirm, and wraps around the returned stream.

The behaviour should also be precisely documented.

Metadata

Metadata

Assignees

Labels

difficulty:moderatepriority:importantThe changes needed are critical for libp2p, or are blocking another project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions