-
Notifications
You must be signed in to change notification settings - Fork 965
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(swarm): use NotDialing condition by default #4185
Conversation
5d0f1f9
to
09d4431
Compare
A comment I made earlier (source):
Perhaps there is some more thought that should go into this, like being able to specify both conditions. Why wouldn't we want to default to both conditions? Current, before dialing we can only manually call |
I have always wondered why As for kad, i recall it dialing a peer if its disconnected in which case if it fails to dial it would remove the addresses from the routing table (would have to confirm that though). |
One of my questions is: when are multiple connections desired? I kind of thought that libp2p is supposed to efficiently use connections by multiplexing. This means we only need one connection (or two, for both directions).
As far as I know, that is the case, yes. I wonder what kind of scenarios there are when dialing. What's the intent of a dial (from a behavior)? |
I made another PR that supersedes this: #4189 |
In general there is no need for more than two connections between two peers. Though there are some special cases:
|
As discussed in today's open maintainers call (#4209) I suggest we make two changes: The first change would be non-breaking, i.e. can be released as a patch release. Here we would change The second change would be a breaking change, i.e. would need to wait for https://github.com/libp2p/rust-libp2p/milestone/7. Similar to #4189 we would add a 4th variant to the |
See #4224
See #4225 |
It appears to be the case that
kad
behavior is dialing multiple times to the same peer (not sure of the reason). By changing the default dial condition, this behavior can be inhibited at least in that case.