-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Currently, we encode and send all protocols at once during multistream-select phase when opening WebRTC stream:
litep2p/src/multistream_select/dialer_select.rs
Lines 273 to 278 in 337538f
| 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:
litep2p/src/multistream_select/dialer_select.rs
Lines 294 to 295 in 337538f
| 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).
Metadata
Metadata
Assignees
Labels
Type
Projects
Status