Skip to content

Conversation

@haikoschol
Copy link

This PR changes how multistream-select messages received on an opening outbound substream are handled on webrtc connections. For details please see the issue description.

The PR builds on top of #441 for the str0m update. But looking at it again I realized that it also made changes to multistream-select handling. I'll look into what those are and how they relate to my changes. In any case, I believe my changes bring the implementation closer to compliance with the multistream-select spec and enable interoperability with smoldot.

fixes #464

@haikoschol haikoschol force-pushed the haiko-webrtc-outbound-multistream-nego-fix branch from 93e6151 to 85fae21 Compare November 5, 2025 13:43
protocol: protocol.to_string(),
});

// self.rtc.channel(channel_id).unwrap().set_buffered_amount_low_threshold(1024);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

event = self.handles.next() => match event {
None => unreachable!(),
Some((channel_id, None | Some(SubstreamEvent::Close))) => {
Some((_, None)) => {}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a superficial fix for another unrelated issue which I haven't investigated yet. Without this change, a "channel closed" event is fired repeatedly after a while. I believe this is caused by SubstreamHandle::tx being dropped, presumably when the substream(/channel?) is closed. The fact that the event continues firing suggests that SubstreamHandle::rx continues to be polled. Maybe the handle simply needs to be removed from self.handles?

I've also seen this happen when briefly testing with a rust-libp2p dialer, so this is not related to smoldot interop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

webrtc: multistream-select negotiation not fully spec compliant

2 participants