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

Make LibP2PVersion configurable and dedup with UserAgent #714

Closed
raulk opened this issue Aug 28, 2019 · 3 comments
Closed

Make LibP2PVersion configurable and dedup with UserAgent #714

raulk opened this issue Aug 28, 2019 · 3 comments

Comments

@raulk
Copy link
Member

raulk commented Aug 28, 2019

See:

const LibP2PVersion = "ipfs/0.1.0"

As explained in the following comment introduced in #702, IPFS needs this value to stay fixed, but libp2p is an independent project and many downstream users don't care about IPFS compatibility:

XXX: Don't change this till 2020. You'll break all go-ipfs versions prior to
0.4.17 which asserted an exact version match.

Proposed path forward:

  1. Deduplicate ClientVersion/UserAgent and LibP2PVersion. Right now it's not clear what the purpose of each is.
  2. LibP2PVersion signals the go-libp2p version, and it's overridable but discouraged to do so. Only used by IPFS to force the backwards compatibility they need.
  3. UserAgent announces the name/version of the application using libp2p. It is strongly encouraged for the application to set it, and it defaults to LibP2PVersion if unset.
@raulk raulk changed the title Make LibP2PVersion configurable Make LibP2PVersion configurable and dedup with UserAgent Aug 28, 2019
@Stebalien
Copy link
Member

IPFS needs this value to stay fixed, but libp2p is an independent project and many downstream users don't care about IPFS compatibility:

This would also break DHT compatibility with any such nodes. This isn't an ipfs issue, it's a libp2p gx/6.0.20 (October 2018) issue.

Proposed path forward:

I believe the idea was to have one set by the application to identify the application and one set by libp2p to identify the libp2p protocol version. It could be used, e.g., to signal support for certain libp2p features (multistream etc.).

@Stebalien
Copy link
Member

Ok, all old nodes have been kicked off the network as SECIO has been removed. So, this can now (finally) move forward.

tshakalekholoane pushed a commit to NethermindEth/go-libp2p that referenced this issue Aug 29, 2022
Allows the protocolVersion field of the Idenfity protocol to be
configured on the host. The current value is fixed for what appears to
be for backwards compatibility with IPFS which makes it difficult for
non-IPFS protocols to use the library.

References:
  - libp2p#714
  - libp2p#1137
  - https://github.com/libp2p/rust-libp2p/blob/6855ab943bd7427a2135b46ad3d08f48fbf10872/protocols/identify/src/identify.rs#L125-L127
marten-seemann pushed a commit that referenced this issue Sep 2, 2022
* Configure protocolVersion for Identify protocol

Allows the protocolVersion field of the Idenfity protocol to be
configured on the host. The current value is fixed for what appears to
be for backwards compatibility with IPFS which makes it difficult for
non-IPFS protocols to use the library.

References:
  - #714
  - #1137
  - https://github.com/libp2p/rust-libp2p/blob/6855ab943bd7427a2135b46ad3d08f48fbf10872/protocols/identify/src/identify.rs#L125-L127

* Fix protocol version assignment

Fix an issue where the protocolVersion string for the Identify protocol
was wrongly being assigned the agentVersion string.

* Delete trailing whitespace
@marten-seemann
Copy link
Contributor

This is now configurable via identify.UserAgent.

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 a pull request may close this issue.

3 participants