-
Notifications
You must be signed in to change notification settings - Fork 974
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
feat(multistream-select): Use Version::V1Lazy by default #3749
Conversation
There are still several places in the code where |
As far as I understand, in this situation, with
|
This is interesting. The point of the test |
I don't have enough experience with the lib to confirm that there is a bug here. But here is my opinion:
match this.version {
Version::V1 => *this.state = State::FlushProtocol { io, protocol },
// This is the only effect that `V1Lazy` has compared to `V1`:
// Optimistically settling on the only protocol that
// the dialer supports for this negotiation. Notably,
// the dialer expects a regular `V1` response.
Version::V1Lazy => {
log::debug!("Dialer: Expecting proposed protocol: {}", p);
let hl = HeaderLine::from(Version::V1Lazy);
let io = Negotiated::expecting(io.into_reader(), p, Some(hl));
return Poll::Ready(Ok((protocol, io)));
}
}
What do you think? |
As @mxinden wrote in #3563 (comment), I think the ideal way of implementing this is to remove the The "footguns" documented in the docs of the variant should be able to be worked around with as an implementation of It is a bit more involved than just changing the enum around but it'd be much appreciated. I'd probably start by writing some more tests for |
Got it, I can work on this topic. So if I understand correctly, the interest here is to always use the
Regarding the approach, you indicate to start by adding more tests in
|
Yep, you are fully on point. The main issue is described here: multiformats/go-multistream#20 I think it would be good to construct a test that reproduces this edge-case. To fix it, we'd have to internally listen for the It'd be cool if you could tackle this! It is quite involved so I think the best thing would be in a first iteration, to not make a breaking API change but instead offer a new API on Let me know if you are still up for that! |
This pull request has merge conflicts. Could you please resolve them @tcoratger? 🙏 |
Agreed to all above. Meta level: Thanks @tcoratger and @thomaseizinger for the work here. I am sure a lot of future newcomers will appreciate it, even though I guess they will lively never know as the option will then be gone 🙂. |
Closing this as stale. The conversation in here is valuable though so I'll reference it in the issue. |
That is the case today. In
Does that address your request @thomaseizinger?
If I recall correctly, the unsoundness can only occur on directly nested protocol negotiation (see also multiformats/go-multistream#20 (comment)). In other words, this is only unsound when one first negotiates protocol A and then directly thereafter without any other protocol-A specific message negotiates protocol A1. I am not aware of a scenario where this can occur today. I am not aware of any directly-nested multistream-select usage. Are you @thomaseizinger? With the above in mind, I don't think we need to address the (theoretical) unsoundness documented in multiformats/go-multistream#20. |
Removes multistream-select version selection. Instead the mechanism of `Version::V1Lazy` is always used. See also libp2p#3563 and libp2p#3749.
Description
To fulfill #3563,
Version::V1Lazy
is set asdefault
.Notes & open questions
Change checklist