-
Notifications
You must be signed in to change notification settings - Fork 996
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] Listener conformity for failed negotiations. #1871
Conversation
When `V1Lazy` is used and the listener does not support the optimistic (and singular) proposal of the dialer, it currently happens that dialer and listener get a different outcome of the negotiation. The dialer eventually detects the failed negotiation as soon as it tries to read from the stream, but the listener either encounters an invalid message or unexpected premature EOF, depending on the payload that the dialer sent prematurely after its protocol proposal. In these cases the listener must be lenient and fail the negotiation "normally", i.e. not with a protocol violation or an I/O error.
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 patch!
Nevertheless it would be good to get final confirmation by testing paritytech/substrate#7478 with this branch.
Working on this right now.
The issue described in paritytech/substrate#7478 (comment) is resolved when using this branch. |
Co-authored-by: Max Inden <[email protected]>
Only be lenient with garbage or sudden EOF when reading just after having sent a protocol rejection.
Co-authored-by: Max Inden <[email protected]>
I will publish this as |
Published, also via |
Thanks. I can do the update on Substrate later today. Will do this as a separate pull request given that paritytech/substrate#7478 might not be merged any time soon and given that others might run into this issue as well. |
Context: paritytech/substrate#7478 (comment)
When
V1Lazy
is used and the listener does not support the optimistic (and singular) proposal of the dialer, it currently happens that dialer and listener get a different outcome of the negotiation. The dialer eventually detects the failed negotiation as soon as it tries to read from the stream, but the listener either encounters an invalid message or unexpected premature EOF, depending on the payload that the dialer sent prematurely after its protocol proposal. In these cases the listener must be lenient and fail the negotiation "normally", i.e. not with a protocol violation or an I/O error. The tests have been expanded to make sure both versions behave uniformly in this manner w.r.t. failed negotiations. Nevertheless it would be good to get final confirmation by testing paritytech/substrate#7478 with this branch. This qualifies for a patch release ofmultistream-select
.