-
Notifications
You must be signed in to change notification settings - Fork 949
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
protocols/mdns: Use a random string as peer-name #2285
Comments
Is varying size needed? libp2p/go-libp2p#1222 (review) |
I am fine either way. Given that you already implemented varying size strings, would you mind adding a comment to your patch pointing to the discussion linked? I didn't find it very intuitive, thus might stumble across this in the future. |
As promised, here is a more detailed follow up to #2311 (comment): The latest release of rust-libp2p/protocols/mdns/src/query.rs Lines 162 to 176 in 012287a
The above implies that peers not running #2311 will discard any responses send by peers that are running #2311, as they will try to to parse the peer name which will fail in most cases as it is not a valid peer ID. I see two ways moving forward:
I am leaning towards (1) as I don't know any libp2p users that depend on Any comments? //CC @jochasinga |
Since mDNS use case is local updating to a breaking change (1) shouldn't be a big deal. |
@mxinden did you mean "Include the peer name in each multiaddr"? (the random string in #2311 vs the current base58 peer id) |
I think he means the peer id. e.g. the multiaddr that is in the txt field should be of the form:
I'm kind of curious what the staged rollout actually looks like in practice. Do we use feature flags here? What does our process look like for these kinds changes? are they documented? (release.md doesn't have anything) This could be a useful low-risk exercise to create this process. |
We use consecutive versions, e.g. see
Would be great to have this documented for sure. I am happy to help, though I don't have the capacity to drive this myself at the moment. |
For the record, looking at a wireshark dump of the Golang implementation, this is already the case in go-libp2p. |
Ah so this is already leading to disconnects in rust <-> go interactions then? I'm happy to document the process (although looking at the example, it's as simple as I expected – some flags that get incrementally changed over versions), but it also seems fine to make the breaking change. I have a slight preference to just making the breaking change which would bring this part level with the Go implementation. But I'll defer to @mxinden to pick how they want this resolved. |
Yes, given that Go already uses a random string as the peer name. Given that the peer name and the peer id in each multiaddr do not match, Rust will discard any Go packet. The above discussion is about whether to break compatibility within Rust and not with Rust and Go. The latter ship has already sailed. My bad.
👍 same preference for me. We just need to call it out very prominently in our changelog. In case anyone needs a non-breaking roll out, they can still contribute a patch version that they can then ship beforehand. @jochasinga #2311 would only need to update the parsing logic and add a changelog description. |
You meant Go already uses the peer name in libp2p/go-libp2p#1222, and by introducing #2311 here newer Rust will become compatible with Go. |
@mxinden @MarcoPolo seems like rust-libp2p/protocols/mdns/src/query.rs Lines 256 to 267 in 220f84a
|
I think we should:
What do you think? |
I agree.
I like the idea of parsing a peer ID out of the first multiaddr, then filter out those with different peer IDs. Curve ball: what if a peer ID is malformed? Do we keep iterating until we find a plausible peer ID and use it as the base or do we ignore it entirely?
How about instead of removing the whole parsing logic, we parse the peer name and just assert that its length is between 32 - 64 characters, and return
sounds good to me. |
I would suggest the following:
|
FYI I don't think it's ok to just go breaking things because PL has a brainfart. There is no reason that the rust implementation had to break backwards compatibility here. |
cc @rkuhn as this probably affects you |
Hmm, I missed this ping somehow and saw the change now in the 0.42 change log. @dvc94ch With the reasoning given at the top, it does seem that compatibility will have to be broken at some point due to the mDNS protocol constraints. At that point Actyx would be broken for other reasons, though, so it would make things easier for more static deployments if the breaking change only happened at that distant future point in time. @mxinden The three-step rollout strategy for breaking changes sounds nice in theory, but in practice it depends on everyone following the step by step instructions without skipping some. We’re using libp2p in places where changes occur once every few years, so it is very likely that incompatible versions will be in the same swarm. Not sure how to reconcile this with the current scheme of protocol evolution, other than saying “only forward and backward compatible changes, ever” and adding new protocols instead of changing old ones. Perhaps this might be a good topic for a community call — I’ll try to attend the next one. In this particular case, I think I’ve seen the ramifications of the Go vs. Rust incompatibility, which was fixed by adding bootstrap nodes (we call them initial peers) in the settings. Since we recommend this approach in any case (as assumed by Max regarding mDNS not being the only discovery mechanism), I think in practice the one-step breaking change is the right choice here. |
With libp2p/specs#368 the definition of the peer name changed in the mDNS specification.
https://github.com/libp2p/specs/blob/master/discovery/mdns.md
libp2p-mdns
should be adjusted accordingly.Also see libp2p/go-libp2p#1222 for the corresponding change on the Golang side.
The text was updated successfully, but these errors were encountered: