Skip to content
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

implement the new mDNS spec, run both implementations in parallel #1125

Closed
wants to merge 2 commits into from

Conversation

marten-seemann
Copy link
Contributor

@marten-seemann marten-seemann commented Jul 6, 2021

No description provided.

@marten-seemann marten-seemann force-pushed the mdns branch 3 times, most recently from 623bfd9 to c84d427 Compare July 6, 2021 03:22
@marten-seemann marten-seemann force-pushed the mdns branch 8 times, most recently from 426446b to 53aaaec Compare August 16, 2021 17:07
@marten-seemann marten-seemann marked this pull request as ready for review August 16, 2021 17:14
return out, nil
}

func NewMdnsServiceLegacy(ctx context.Context, peerhost host.Host, interval time.Duration) (Service, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this private?

lk sync.Mutex
notifees []Notifee
interval time.Duration
func NewMdnsServiceNew(host host.Host) *mdnsService {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and this one as well?

@marten-seemann marten-seemann mentioned this pull request Aug 16, 2021
37 tasks
@Stebalien Stebalien requested review from mxinden and removed request for mxinden August 16, 2021 18:11
@Stebalien
Copy link
Member

So, I guess the question is, do we even need the "muxer" type? I'd consider:

  1. Having both an mdns and an mdns_legacy package.
  2. Instantiating both in go-ipfs (separately).
  3. Not having the muxer.

@mxinden
Copy link
Member

mxinden commented Aug 17, 2021

@marten-seemann what is the easiest way for me to build a Golang binary that is running these changes to test interoperability with the Rust implementation?

@marten-seemann
Copy link
Contributor Author

@Stebalien

So, I guess the question is, do we even need the "muxer" type? I'd consider:

  1. Having both an mdns and an mdns_legacy package.
  2. Instantiating both in go-ipfs (separately).
  3. Not having the muxer.

It's definitely cleaner code-wise, but it's also more disruptive. libp2p users will have to actively change their code if they want to maintain compatibility with libp2p instances that haven't updated yet. Assuming that people will have similar rollout and adoption rates as we're seeing in the IPFS network, they won't have to worry at all about this change.

@Stebalien
Copy link
Member

It's definitely cleaner code-wise, but it's also more disruptive. libp2p users will have to actively change their code if they want to maintain compatibility with libp2p instances that haven't updated yet. Assuming that people will have similar rollout and adoption rates as we're seeing in the IPFS network, they won't have to worry at all about this change.

We're already breaking the constructor, right? This is one of those cases where I'd rather have users make an explicit/informed choice. That way, users can choose when they want to deprecate the old method.


Also with respect to breaking changes, I didn't look too closely before but it looks like we're removing the "service" string. That could be an issue for some upstream users.

@marten-seemann
Copy link
Contributor Author

Also with respect to breaking changes, I didn't look too closely before but it looks like we're removing the "service" string. That could be an issue for some upstream users.

Yes, that is intentional. We're now implementing the spec, and the spec defines what the service name is: https://github.com/libp2p/specs/blob/master/discovery/mdns.md#definitions. If there are use cases where users might want to set the service name to something different, we might want to update the spec.

@Stebalien
Copy link
Member

we might want to update the spec.

I think we might. Take a look at https://grep.app/search?q=github.com/libp2p/go-libp2p/p2p/discovery. It looks like most systems set a custom tag. This is actually pretty reasonable because one usually wants to find like-services, not random libp2p nodes. If we release as-is, all of these services are going to be unhappy.

@marten-seemann
Copy link
Contributor Author

Good point. We'll update the spec. #1161 implements the solution suggested by @Stebalien.

@mxinden
Copy link
Member

mxinden commented Aug 24, 2021

@marten-seemann does the spec still need an update in regards to the service name?

@mxinden
Copy link
Member

mxinden commented Sep 10, 2021

@marten-seemann does the spec still need an update in regards to the service name?

Friendly ping @marten-seemann.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants