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

fix(kad): remove default IPFS DHT protocol name #5015

Closed
wants to merge 1 commit into from

Conversation

robin-rrt
Copy link

@robin-rrt robin-rrt commented Dec 18, 2023

Description

Fix #5006

Notes & open questions

Added a parameter for protocol name.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@robin-rrt robin-rrt changed the title kad: remove default IPFS DHT protocol name fix(kad): remove default IPFS DHT protocol name Dec 18, 2023
@@ -181,10 +181,11 @@ pub struct Config {
provider_publication_interval: Option<Duration>,
kbucket_inserts: BucketInserts,
caching: Caching,
protocol_name: String,
Copy link
Member

Choose a reason for hiding this comment

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

Instead of having a new field, we can make use of the protocol_config by using ProtocolConfig::set_protocol_names.

@thomaseizinger
Copy link
Contributor

The current default is set here: https://github.com/robin-rrt/rust-libp2p/blob/c29a844506fe9eb8edb0526d5a4f2c1f2296b129/protocols/kad/src/protocol.rs#L167

That is what needs to be changed :)

@robin-rrt
Copy link
Author

Just to understand. Do we want the Default implementation gone completely? And have a ProtocolConfig::new function?

@thomaseizinger
Copy link
Contributor

Just to understand. Do we want the Default implementation gone completely? And have a ProtocolConfig::new function?

Yes, I think that is what @mxinden meant in #5006.

Now, I am wondering if we couldn't:

  • Leave the Default implementation
  • Make a manual default function that is marked as deprecated
  • Introduce a new function that requires you to pass a protocol name

This might allow us to ship this as a backwards-compatible change. I haven't tested this though. We need to make sure it doesn't cause compile errors for users because of the default function name.

We can't mark the actual Default impl as deprecated but at least for users that call default manually, we can issue a warning. We should also deprecate the set_protocol_names function and refer users to the constructor instead.

@thomaseizinger
Copy link
Contributor

Closing in favor of #5122.

mergify bot pushed a commit that referenced this pull request Feb 19, 2024
guillaumemichel added a commit that referenced this pull request Mar 28, 2024
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.

kad: remove default IPFS DHT protocol name
3 participants