-
Notifications
You must be signed in to change notification settings - Fork 976
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(kad): add config option for bootstrap interval #4730
Comments
Is "bootstrap" a kademlia term (from the paper)? Maybe we should call it "refresh"? |
Hi, I was looking at this issue. Since a new
Otherwise the interval should be exposed from kademlia in a way to the client code I think |
Yes correct. We will have to have a timer within the |
Makes sense yes. Can I give it a try? |
Previously, users were responsible for calling `bootstrap` on an interval. This was documented but hard to discover for people new to the library. To maintain healthy routing tables, it is advised to regularly call `bootstrap`. By default, we will now do this automatically every 5 minutes and once we add a peer to our routing table, assuming we didn't bootstrap yet. This is especially useful as part of nodes starting up and connecting to bootstrap nodes. Closes: #4730. Pull-Request: #4838. Co-authored-by: stormshield-frb <[email protected]>
Previously, users were responsible for calling `bootstrap` on an interval. This was documented but hard to discover for people new to the library. To maintain healthy routing tables, it is advised to regularly call `bootstrap`. By default, we will now do this automatically every 5 minutes and once we add a peer to our routing table, assuming we didn't bootstrap yet. This is especially useful as part of nodes starting up and connecting to bootstrap nodes. Closes: #4730. Pull-Request: #4838. Co-authored-by: stormshield-frb <[email protected]>
When using
libp2p-kad
it is recommended to regularly callKademlia::bootstrap
to ensure a healthy routing table.rust-libp2p/protocols/kad/src/behaviour.rs
Lines 846 to 865 in fc6efaf
See e.g.
libp2p-server
callingKademlia::bootstrap
on an interval.rust-libp2p/misc/server/src/main.rs
Line 26 in fc6efaf
Instead of requiring each user to setup their own interval on which to call
Kademlia::bootstrap
, provide a new option inlibp2p_kad::Config
. Something along the lines of:/// The configuration for the `Kademlia` behaviour. /// /// The configuration is consumed by [`Behaviour::new`]. #[derive(Debug, Clone)] pub struct Config { + bootstrap_interval(Option<Duration>),
The text was updated successfully, but these errors were encountered: