-
Notifications
You must be signed in to change notification settings - Fork 984
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): configurable bucket size #5414
Conversation
/CC @mxinden |
I am not opposed to this change in specific, but want to warn you of introducing yet another configuration option, and thus yet another dimension in which bugs can occur. Instead of introducing more nobs for users to tweak, I suggest improving the existing, alleviating users from the need to tune nobs in the first place.
|
@mxinden Unfortunately this issue cannot be tackled by any existing nob. The upside of this change is to allow users to modify the bucket size, which is a system parameter. Currently, it is set to the hardcoded The issue originated in #5371. TL;DR changing the bucket size can help debug other problems in the network. Would it help to add to the documentation that this is an advanced nob? |
If there is no objections to it, it might be best to document it, but I also do agree that we should also improve what we have too. libp2p spec doesnt restrict us to just a bucket size of 20 as it is the recommended size, but there could be other use cases to increase or decrease it (assuming the end-user knows what they are doing) |
I rewrite what I wrote in #5501 here. To facilitate the discussion, I would like to add a little bit of what we have researched. First, in an environment with K_VALUE of 20, one node gets approximately maxed 5K neighbors. It is useful in large IPFS-like environments where at least thousands of nodes communicate, but in small environments, including libp2p alone, when the total number of nodes is significantly less than 5K, a dense P2P network is formed that is meaningless with DHT. It is thought that these networks can especially hinder the participation of small-sized researchers like us, who use libp2p to create and study nodes with their own server for a small scale, and in fact, we are currently considering a transfer to the Go language. We started working with Rust, loved it, and would love to continue. I think these modifications will be useful to make people like us more interested in rust-libp2p. Thanks for reading :) |
I agree. It seems users find this useful and different kad systems are using different bucket configurations. It seems like making this configurable will extend the use of rust-libp2p to these discovery mechanisms, I think its a good addition. |
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.
LGTM! Thanks Gui
Making bucket size configurable. Currently `K_VALUE` is used by default, and the only way to change the bucket size is to edit the const. Resolves libp2p#5389 Pull-Request: libp2p#5414.
Description
Making bucket size configurable. Currently
K_VALUE
is used by default, and the only way to change the bucket size is to edit the const.Resolves #5389
Change checklist