Skip to content
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

protocols/kad: Default maximum message size not matching with Golang #1622

Closed
mxinden opened this issue Jun 19, 2020 · 2 comments
Closed

protocols/kad: Default maximum message size not matching with Golang #1622

mxinden opened this issue Jun 19, 2020 · 2 comments

Comments

@mxinden
Copy link
Member

mxinden commented Jun 19, 2020

The Kademlia Golang implementation configures its VarintReader with a maximum message size of 4 MB whereas the the Kademlia Rust implementation configures its UviBytes with a maximum message size of 4096 B.

4096 B might be a bit conservative as a default. E.g. when connecting to the IPFS DHT with https://github.com/mxinden/kademlia-exporter it oftentimes runs into the issue:

[2020-04-11T22:45:24Z DEBUG libp2p_kad::behaviour] Request to PeerId("") in query QueryId(0) Failed with Io(Custom { kind: PermissionDenied, error: "len > max" })

This limit was introduced in #920 and is motivated by paritytech/substrate#1645.

I would suggest quadrupling the value (16384 B) as doubling it seems to work fine for discovery usage with the Golang implementation leaving some additional head-space.

Thoughts?

@romanb
Copy link
Contributor

romanb commented Jun 22, 2020

Increasing the default for better interoperability sounds good to me. If the 4KiB limit is still desired for substrate, we can set it there, since this limit is already configurable.

romanb pushed a commit to romanb/rust-libp2p that referenced this issue Sep 7, 2020
For better interoperability by default, picking up the
suggestion in libp2p#1622.
romanb added a commit that referenced this issue Sep 8, 2020
* libp2p-kad: Increase default max packet size.

For better interoperability by default, picking up the
suggestion in #1622.

* Update changelog.
@romanb
Copy link
Contributor

romanb commented Sep 8, 2020

Closed by #1730.

@romanb romanb closed this as completed Sep 8, 2020
santos227 pushed a commit to santos227/rustlib that referenced this issue Jun 20, 2022
* libp2p-kad: Increase default max packet size.

For better interoperability by default, picking up the
suggestion in libp2p/rust-libp2p#1622.

* Update changelog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants