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

multistream-select implementation used by WebRTC doesn't conform to the spec #75

Open
dmitry-markin opened this issue Apr 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dmitry-markin
Copy link
Collaborator

Currently, we encode and send all protocols at once during multistream-select phase when opening WebRTC stream:

let message = encode_multistream_message(
std::iter::once(protocol.clone())
.chain(fallback_names.clone())
.filter_map(|protocol| Protocol::try_from(protocol.as_ref()).ok())
.map(|protocol| Message::Protocol(protocol)),
)?

This is against libp2p multistream-select spec, which states that protocols should be negotiated one-by-one.

Also, the received protocols are also expected to be sent as a list:

let Message::Protocols(protocols) =
Message::decode(payload.into()).map_err(|_| Error::InvalidData)?

This also doesn't conform to the spec.

Nevertheless, the above works with smoldot. This issue is about fixing the implementation, and, may be, filing a bug to smoldot if it doesn't conform to the spec either.

Originally discussed in #51 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant