-
Notifications
You must be signed in to change notification settings - Fork 942
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
kademlia: be louder about the kind of mode we are operating in #4310
Comments
I think the best way to make this newb-friendly would be to add network behavior events that reflect the current state of the kademlia behavior. AFAICT, the kademlia behavior has roughly these states:
I think there are valid transitions from 1 to 2 to 3 to 4 and then from 3 to 1 and 4 to 1 whenever the external address goes away and also 3 to 2 and 4 to 2 whenever the external address changes. All transitions should have kademlia events associated with them so that an app can monitor the status of the peer's kademlia participation and reflect that in the logs/UI. The only way to be 100% certain that a peer is participating in a KAD DHT is to receive KAD messags from external peers. There is no notion of a "session" with confirmation from other peers. So state 4 is important to have as well as an event for the state transition from 3 to 4. |
@thomaseizinger do you have any more specifics about what it would look like to "be louder" about the state of the kademlia behavior? Are my four states the ones that would suffice? |
Perhaps a single event I don't think we should fire that when the mode is set manually. I am also not sure we should fire it initially because the mode technically hasn't changed, we always start in client-mode. So maybe it needs several individual improvements. I am of the opinion that we can expect users to read some documentation. Like what the default mode is and perhaps even how the algorithm works for determining it automatically. Overall, what I find tricky to balance here is:
|
I think it is useful to know when the kademlia behavior switches, both from client to server and back. I guess a single |
In favor of this. Especially since we can then expose the |
I'll update the PR description! |
this would be useful. |
Description
The whole client/server mode functionality is quite involved and hard to understand for newcomers. We should find a way to be loud about it without spamming people's logs.
Are you planning to do it yourself in a pull request?
No but maybe @dhuseby wants to land his first contribution to
rust-libp2p
:)Tasks
The text was updated successfully, but these errors were encountered: