-
Notifications
You must be signed in to change notification settings - Fork 957
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
muxers/mplex: Allow up to 60 bit long stream IDs #2094
Conversation
for resolving issue: libp2p#2061
Yes please, that would be great! |
Hi @mxinden, |
Does that help @whereistejas? |
753c05d
to
2b1b5d0
Compare
Hi @mxinden , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test looks great. Just a couple of smaller suggestions.
Would you mind including a changelog entry in muxers/mplex/CHANGELOG.md
?
Are we currently on version 0.39.0? I'm asking so that I may add the version in the change logs. |
muxers/mplex/CHANGELOG.md
Outdated
@@ -1,3 +1,7 @@ | |||
# 0.39.0 [unreleased] | |||
|
|||
- Increased the lenght of Stream ID to 60 bits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this line under the # 0.29.0 [...]
section below the - Update dependencies
line.
muxers/mplex/src/codec.rs
Outdated
@@ -18,14 +18,10 @@ | |||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |||
// DEALINGS IN THE SOFTWARE. | |||
|
|||
use asynchronous_codec::{Decoder, Encoder}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, we are pretty much finished. I would love to take up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the help @whereistejas.
Thanks @mxinden! :) Can we close this PR now? |
Hi! |
@senden9 @mxinden can you please help out here? Also, I think it makes sense to add a test, that fails if we try to use a stream ID greater than 60bits. |
Right. It seams that the first three bits are reserved for flags. And the lowest three bits are shifted away in encoding. So Anyway as I want introduce any more "noise" in the notification inboxes of the people of this PR: I will think a bit about that and then create a new Discussion or Issue if anything seems strange to me. Thanks for the fast reply @whereistejas |
Feedback is always welcome, no matter what status the pull request is in ;)
Correct. You can still call On the other hand:
All that said, the goal of this pull request is to support stream IDs of up to 60 bit coming from a remote peer. Using a This is the relevant excerpt from the specification:
https://github.com/libp2p/specs/blob/master/mplex/README.md#message-format @senden9 does the above make sense? |
@mxinden yes, thanks for the explanation. The "Internal construct only"-part is also a good argument for why it isn't too bad to not block the constructing or reaching of that invalid state. |
hi @mxinden,
I have opened this PR for closing issue: #2061
Do we also need write a test to check if we can actually use 60 bit stream ID?