libp2p/js-libp2p-mplex

fix stream ids to match mplex protocol spec

Closed this issue · 7 comments

In regards to ipfs/js-ipfs#1601, it looks like streams id's are being set incorrectly. We need to make sure that stream id's match the spec, where initiator ids are odd and receiver id's are even. The js implementation currently has them backwards.

Spec: https://github.com/libp2p/mplex#protocol

@jacobheun, there is already an issue documenting it here - libp2p/mplex#3. I'm not sure why the fix to the spec wasn't merged (wording?). Bottom line, the spec was incorrect, since it was reverse engineered from the existing js code, and the id sequencing was interpreted incorrectly. I believe this fix has been already applied to the Go implementation (the js one is correct).

Also, I've heard that this fixes the multiple interop issues with Go (@Stebalien is this the still the case?).

This should have been fixed and I believe the release has been fixed. Is this still an issue?

Ah, I need to merge that spec PR (and possibly update it). I'll take a look.

Thanks, I think we never nailed down the correct wording, happy to wrap that up if its still an issue.

I merged that PR and submitted a new one with some final edits. Mind taking a look? libp2p/mplex#5

@dryajov ah, that's great, thanks! Closing this.