-
Notifications
You must be signed in to change notification settings - Fork 56
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
WIP: local as runtime opt #2595
base: main
Are you sure you want to change the base?
Conversation
ac19db4
to
854582a
Compare
88acdd0
to
f3cf215
Compare
Local as runtime opt
@@ -254,7 +253,7 @@ pub(super) struct NodeBehaviour { | |||
pub(super) blocklist: | |||
libp2p::allow_block_list::Behaviour<libp2p::allow_block_list::BlockedPeers>, | |||
pub(super) identify: libp2p::identify::Behaviour, | |||
#[cfg(feature = "local")] | |||
/// mDNS behaviour to use in local mode |
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.
Should we not make this a Toggle
? Then disable it completely with non-local mode to prevent home network noise.
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.
If you look at the implementation I check if we are in local mode before executing anything. But not sure if it does anything else? Not too familiar with how Behaviors work.
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.
If there is no Toggle
mDNS behavior will be activated, thus broadcasting the address on the home network.
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.
So if a public node is running on a home network it will still broadcast its address to a local test network's nodes. Shouldn't be a problem because of different network IDs/identifiers (plus the fact, like you mentioned, that you don't handle the mDNS events), but would still add a lot of noisy logs for those local nodes I presume.
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.
Mmmh I see, that's not ideal. @dirvine mentioned getting rid of mdns all together eventually, maybe it's not worth the effort now if we plan to remove it altogether?
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.
Wouldn't mind getting it out, but Toggle
is fine with me too. You can use the UPnP behavior as an example which is a bunch of lines below mDNS in the build
method.
@@ -684,7 +681,6 @@ impl NetworkBuilder { | |||
request_response, | |||
kademlia, | |||
identify, | |||
#[cfg(feature = "local")] | |||
mdns, |
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.
This is where the mDNS behavior is executed both with and withouth the --local
flag.
No description provided.