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

Allow customizing the Kademlia maximum packet size #1502

Merged
merged 2 commits into from
Mar 19, 2020

Conversation

tomaka
Copy link
Member

@tomaka tomaka commented Mar 19, 2020

No description provided.

@tomaka tomaka requested a review from romanb March 19, 2020 16:11
@@ -115,6 +119,7 @@ impl Default for KademliaConfig {
provider_publication_interval: Some(Duration::from_secs(12 * 60 * 60)),
provider_record_ttl: Some(Duration::from_secs(24 * 60 * 60)),
connection_idle_timeout: Duration::from_secs(10),
max_protocol_packet_size: 4096,
Copy link
Contributor

@romanb romanb Mar 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be an idea to replace protocol_name_override and max_protocol_packet_size with directly embedding a KademliaProtocolConfig in the KademliaConfig (e.g. like it is done with QueryConfig)? It may simplify things a bit, now and for the future if more options are added. For example, the default packet size would not be duplicated but only exist in the Default impl for KademliaProtocolConfig. One step further would be to even embed the KademliaHandlerConfig in the KademliaConfig. These embeddings are implementation details, of course, the KademliaConfig has the public API, but it keeps the number of potentially duplicated fields to a minimum, e.g. the embedded configs can be moved into fields of the behaviour on construction as a whole.

@tomaka tomaka merged commit 92ce5d6 into libp2p:master Mar 19, 2020
@tomaka tomaka deleted the custom-packet-size branch March 19, 2020 20:24
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

Successfully merging this pull request may close these issues.

2 participants