diff --git a/core/commands/id.go b/core/commands/id.go index ba40a699d7c..3446fc267cd 100644 --- a/core/commands/id.go +++ b/core/commands/id.go @@ -26,12 +26,11 @@ import ( const offlineIDErrorMessage = "'ipfs id' cannot query information on remote peers without a running daemon; if you only want to convert --peerid-base, pass --offline option" type IdOutput struct { // nolint - ID string - PublicKey string - Addresses []string - AgentVersion string - ProtocolVersion string - Protocols []protocol.ID + ID string + PublicKey string + Addresses []string + AgentVersion string + Protocols []protocol.ID } const ( @@ -126,7 +125,6 @@ EXAMPLE: output := format output = strings.Replace(output, "", out.ID, -1) output = strings.Replace(output, "", out.AgentVersion, -1) - output = strings.Replace(output, "", out.ProtocolVersion, -1) output = strings.Replace(output, "", out.PublicKey, -1) output = strings.Replace(output, "", strings.Join(out.Addresses, "\n"), -1) output = strings.Replace(output, "", strings.Join(protocol.ConvertToStrings(out.Protocols), "\n"), -1) @@ -178,11 +176,6 @@ func printPeer(keyEnc ke.KeyEncoder, ps pstore.Peerstore, p peer.ID) (interface{ info.Protocols = append(info.Protocols, protocols...) sort.Slice(info.Protocols, func(i, j int) bool { return info.Protocols[i] < info.Protocols[j] }) - if v, err := ps.Get(p, "ProtocolVersion"); err == nil { - if vs, ok := v.(string); ok { - info.ProtocolVersion = vs - } - } if v, err := ps.Get(p, "AgentVersion"); err == nil { if vs, ok := v.(string); ok { info.AgentVersion = vs diff --git a/core/commands/swarm.go b/core/commands/swarm.go index 3d2adb7575d..0e28c71754c 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -490,11 +490,6 @@ func (ci *connInfo) identifyPeer(ps pstore.Peerstore, p peer.ID) (IdOutput, erro sort.Slice(info.Protocols, func(i, j int) bool { return info.Protocols[i] < info.Protocols[j] }) } - if v, err := ps.Get(p, "ProtocolVersion"); err == nil { - if vs, ok := v.(string); ok { - info.ProtocolVersion = vs - } - } if v, err := ps.Get(p, "AgentVersion"); err == nil { if vs, ok := v.(string); ok { info.AgentVersion = vs diff --git a/docs/changelogs/v0.22.md b/docs/changelogs/v0.22.md index b1cac453277..366244346db 100644 --- a/docs/changelogs/v0.22.md +++ b/docs/changelogs/v0.22.md @@ -9,6 +9,7 @@ - [Gateway: support for `order=` and `dups=` parameters (IPIP-412)](#gateway-support-for-order-and-dups-parameters-ipip-412) - [`ipfs name publish` now supports V2 only IPNS records](#ipfs-name-publish-now-supports-v2-only-ipns-records) - [IPNS name resolution has been fixed](#ipns-name-resolution-has-been-fixed) + - [go-libp2p v0.29.0 update with smart dialing](#go-libp2p-v0.29.0-update-with-smart-dialing) - [๐Ÿ“ Changelog](#-changelog) - [๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Contributors](#-contributors) @@ -55,6 +56,12 @@ This has been fixed and as before will give the best record from either the DHT For details see [#9927](https://github.com/ipfs/kubo/issues/9927) and [#10020](https://github.com/ipfs/kubo/pull/10020). +# go-libp2p v0.29.0 update with smart dialing + +We updated from [go-libp2p](https://github.com/libp2p/go-libp2p) [v0.27.7](https://github.com/libp2p/go-libp2p/releases/tag/v0.27.7) to [v0.29.0](https://github.com/libp2p/go-libp2p/releases/tag/v0.29.0). This release includes smart dialing, which is a prioritization algorithm that will try to rank addresses and protocols rather than attempting all options in parallel. Anecdotally, we have observed [Kubo nodes make 30% less dials](https://github.com/libp2p/go-libp2p/issues/2326#issuecomment-1644332863) with no to low latency impact. + +This includes a breaking change to `ipfs id` and some of the `ipfs swarm` commands. We no longer report `ProtocolVersion`. This used to be hardcoded as `ipfs/0.1.0` and sent to other peers but was not providing any distinguishing value. See [libp2p/go-libp2p#2294](https://github.com/libp2p/go-libp2p/issues/2294) for more information. + ### ๐Ÿ“ Changelog ### ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Contributors diff --git a/test/cli/swarm_test.go b/test/cli/swarm_test.go index d1a4b5c6ca3..920d310baa2 100644 --- a/test/cli/swarm_test.go +++ b/test/cli/swarm_test.go @@ -13,12 +13,11 @@ import ( // TODO: Migrate the rest of the sharness swarm test. func TestSwarm(t *testing.T) { type identifyType struct { - ID string - PublicKey string - Addresses []string - AgentVersion string - ProtocolVersion string - Protocols []string + ID string + PublicKey string + Addresses []string + AgentVersion string + Protocols []string } type peer struct { Identify identifyType @@ -53,7 +52,6 @@ func TestSwarm(t *testing.T) { actualPublicKey := output.Peers[0].Identify.PublicKey actualAgentVersion := output.Peers[0].Identify.AgentVersion actualAdresses := output.Peers[0].Identify.Addresses - actualProtocolVersion := output.Peers[0].Identify.ProtocolVersion actualProtocols := output.Peers[0].Identify.Protocols expectedID := otherNode.PeerID().String() @@ -62,7 +60,6 @@ func TestSwarm(t *testing.T) { assert.Equal(t, actualID, expectedID) assert.NotNil(t, actualPublicKey) assert.NotNil(t, actualAgentVersion) - assert.NotNil(t, actualProtocolVersion) assert.Len(t, actualAdresses, 1) assert.Equal(t, expectedAddresses[0], actualAdresses[0]) assert.Greater(t, len(actualProtocols), 0) @@ -89,7 +86,6 @@ func TestSwarm(t *testing.T) { assert.Equal(t, outputIdentify.ID, otherNodeIDOutput.ID) assert.Equal(t, outputIdentify.PublicKey, otherNodeIDOutput.PublicKey) assert.Equal(t, outputIdentify.AgentVersion, otherNodeIDOutput.AgentVersion) - assert.Equal(t, outputIdentify.ProtocolVersion, otherNodeIDOutput.ProtocolVersion) assert.ElementsMatch(t, outputIdentify.Addresses, otherNodeIDOutput.Addresses) assert.ElementsMatch(t, outputIdentify.Protocols, otherNodeIDOutput.Protocols)