Skip to content

Commit

Permalink
chore: bump go-libp2p v0.22.0 & go1.18&go1.19
Browse files Browse the repository at this point in the history
Fixes: #9225
  • Loading branch information
Jorropo committed Sep 9, 2022
1 parent 82fbb84 commit 196887c
Show file tree
Hide file tree
Showing 106 changed files with 1,330 additions and 1,641 deletions.
10 changes: 5 additions & 5 deletions .circleci/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ default_environment: &default_environment
executors:
golang:
docker:
- image: cimg/go:1.18.5
- image: cimg/go:1.19.1
working_directory: ~/ipfs/kubo
environment:
<<: *default_environment
Expand All @@ -62,7 +62,7 @@ executors:
E2E_IPFSD_TYPE: go
dockerizer:
docker:
- image: cimg/go:1.18.5
- image: cimg/go:1.19.1
environment:
IMAGE_NAME: ipfs/kubo
WIP_IMAGE_TAG: wip
Expand Down Expand Up @@ -156,8 +156,8 @@ jobs:
- run: sudo apt update
- run: |
mkdir ~/localgo && cd ~/localgo
wget https://golang.org/dl/go1.18.5.linux-amd64.tar.gz
tar xfz go1.18.5.linux-amd64.tar.gz
wget https://golang.org/dl/go1.19.1.linux-amd64.tar.gz
tar xfz go1.19.1.linux-amd64.tar.gz
echo "export PATH=$(pwd)/go/bin:\$PATH" >> ~/.bashrc
- run: go version
- run: sudo apt install socat net-tools
Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
- *store_gomod
interop:
docker:
- image: cimg/go:1.18.5-node
- image: cimg/go:1.19.1-node
parallelism: 4
resource_class: large
steps:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/golang-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
submodules: recursive
- uses: actions/setup-go@v2
with:
go-version: "1.18.x"
go-version: "1.19.x"
- name: Check that go.mod is tidy
uses: protocol/multiple-go-modules@v1.2
with:
Expand All @@ -22,12 +22,13 @@ jobs:
exit 1
fi
git diff --exit-code -- go.sum go.mod
- name: gofmt
- name: go fmt
if: always() # run this step even if the previous one failed
run: |
out=$(gofmt -s -l .)
out=$(go fmt ./...)
if [[ -n "$out" ]]; then
echo $out | awk '{print "::error file=" $0 ",line=0,col=0::File is not gofmt-ed."}'
echo "Files are not go-fmt-ed:"
echo "$out"
exit 1
fi
- name: go vet
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Note: when updating the go minor version here, also update the go-channel in snap/snapcraft.yml
FROM golang:1.18.5-buster
FROM golang:1.19.1-buster
LABEL maintainer="Steven Allen <steven@stebalien.com>"

# Install deps
Expand Down Expand Up @@ -114,7 +114,7 @@ ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/start_ipfs"]
# Heathcheck for the container
# QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn is the CID of empty folder
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD ipfs dag stat /ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn || exit 1
CMD ipfs dag stat /ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn || exit 1

# Execute the daemon subcommand by default
CMD ["daemon", "--migrate=true", "--agent-version-suffix=docker"]
2 changes: 1 addition & 1 deletion cmd/ipfs/add_migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/ipfs/kubo/core/coreapi"
"github.com/ipfs/kubo/repo/fsrepo/migrations"
"github.com/ipfs/kubo/repo/fsrepo/migrations/ipfsfetcher"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/peer"
)

// addMigrations adds any migration downloaded by the fetcher to the IPFS node
Expand Down
4 changes: 2 additions & 2 deletions cmd/ipfs/pinmfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"time"

"github.com/libp2p/go-libp2p-core/host"
peer "github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/host"
peer "github.com/libp2p/go-libp2p/core/peer"

cid "github.com/ipfs/go-cid"
ipld "github.com/ipfs/go-ipld-format"
Expand Down
4 changes: 2 additions & 2 deletions cmd/ipfs/pinmfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
ipld "github.com/ipfs/go-ipld-format"
merkledag "github.com/ipfs/go-merkledag"
config "github.com/ipfs/kubo/config"
"github.com/libp2p/go-libp2p-core/host"
peer "github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/host"
peer "github.com/libp2p/go-libp2p/core/peer"
)

type testPinMFSContext struct {
Expand Down
2 changes: 1 addition & 1 deletion config/bootstrap_peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"fmt"

peer "github.com/libp2p/go-libp2p-core/peer"
peer "github.com/libp2p/go-libp2p/core/peer"
ma "github.com/multiformats/go-multiaddr"
)

Expand Down
2 changes: 1 addition & 1 deletion config/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package config
import (
"encoding/base64"

ic "github.com/libp2p/go-libp2p-core/crypto"
ic "github.com/libp2p/go-libp2p/core/crypto"
)

const IdentityTag = "Identity"
Expand Down
4 changes: 2 additions & 2 deletions config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"time"

"github.com/ipfs/interface-go-ipfs-core/options"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/peer"
)

func Init(out io.Writer, nBitsForKeypair int) (*Config, error) {
Expand Down
2 changes: 1 addition & 1 deletion config/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/ipfs/interface-go-ipfs-core/options"
crypto_pb "github.com/libp2p/go-libp2p-core/crypto/pb"
crypto_pb "github.com/libp2p/go-libp2p/core/crypto/pb"
)

func TestCreateIdentity(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion config/peering.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package config

import "github.com/libp2p/go-libp2p-core/peer"
import "github.com/libp2p/go-libp2p/core/peer"

// Peering configures the peering service.
type Peering struct {
Expand Down
6 changes: 3 additions & 3 deletions config/swarm.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package config

import rcmgr "github.com/libp2p/go-libp2p-resource-manager"
import rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager"

type SwarmConfig struct {
// AddrFilters specifies a set libp2p addresses that we should never
Expand Down Expand Up @@ -136,14 +136,14 @@ type ConnMgr struct {
}

// ResourceMgr defines configuration options for the libp2p Network Resource Manager
// <https://github.com/libp2p/go-libp2p-resource-manager#readme>
// <https://github.com/libp2p/go-libp2p/tree/master/p2p/host/resource-manager#readme>
type ResourceMgr struct {
// Enables the Network Resource Manager feature, default to on.
Enabled Flag `json:",omitempty"`
Limits *rcmgr.LimitConfig `json:",omitempty"`
// A list of multiaddrs that can bypass normal system limits (but are still
// limited by the allowlist scope). Convenience config around
// https://pkg.go.dev/github.com/libp2p/go-libp2p-resource-manager#Allowlist.Add
// https://pkg.go.dev/github.com/libp2p/go-libp2p/p2p/host/resource-manager#Allowlist.Add
Allowlist []string `json:",omitempty"`
}

Expand Down
10 changes: 5 additions & 5 deletions core/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"github.com/jbenet/goprocess"
"github.com/jbenet/goprocess/context"
"github.com/jbenet/goprocess/periodic"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/peerstore"
"github.com/libp2p/go-libp2p-core/routing"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/peerstore"
"github.com/libp2p/go-libp2p/core/routing"
)

var log = logging.Logger("bootstrap")
Expand Down
4 changes: 2 additions & 2 deletions core/bootstrap/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package bootstrap
import (
"testing"

"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/test"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/test"
)

func TestSubsetWhenMaxIsGreaterThanLengthOfSlice(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion core/commands/bitswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
decision "github.com/ipfs/go-bitswap/decision"
cidutil "github.com/ipfs/go-cidutil"
cmds "github.com/ipfs/go-ipfs-cmds"
peer "github.com/libp2p/go-libp2p-core/peer"
peer "github.com/libp2p/go-libp2p/core/peer"
)

var BitswapCmd = &cmds.Command{
Expand Down
2 changes: 1 addition & 1 deletion core/commands/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

cmds "github.com/ipfs/go-ipfs-cmds"
config "github.com/ipfs/kubo/config"
peer "github.com/libp2p/go-libp2p-core/peer"
peer "github.com/libp2p/go-libp2p/core/peer"
ma "github.com/multiformats/go-multiaddr"
)

Expand Down
4 changes: 2 additions & 2 deletions core/commands/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

cmds "github.com/ipfs/go-ipfs-cmds"
"github.com/ipfs/kubo/core/commands/cmdenv"
peer "github.com/libp2p/go-libp2p-core/peer"
routing "github.com/libp2p/go-libp2p-core/routing"
peer "github.com/libp2p/go-libp2p/core/peer"
routing "github.com/libp2p/go-libp2p/core/routing"
)

var ErrNotDHT = errors.New("routing service is not a DHT")
Expand Down
2 changes: 1 addition & 1 deletion core/commands/dht_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/ipfs/go-namesys"

ipns "github.com/ipfs/go-ipns"
"github.com/libp2p/go-libp2p-core/test"
"github.com/libp2p/go-libp2p/core/test"
)

func TestKeyTranslation(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions core/commands/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import (

cmds "github.com/ipfs/go-ipfs-cmds"
ke "github.com/ipfs/kubo/core/commands/keyencode"
ic "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/host"
peer "github.com/libp2p/go-libp2p-core/peer"
pstore "github.com/libp2p/go-libp2p-core/peerstore"
kb "github.com/libp2p/go-libp2p-kbucket"
ic "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/host"
peer "github.com/libp2p/go-libp2p/core/peer"
pstore "github.com/libp2p/go-libp2p/core/peerstore"
identify "github.com/libp2p/go-libp2p/p2p/protocol/identify"
)

Expand Down
4 changes: 2 additions & 2 deletions core/commands/keyencode/keyencode.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package keyencode

import (
cmds "github.com/ipfs/go-ipfs-cmds"
peer "github.com/libp2p/go-libp2p-core/peer"
peer "github.com/libp2p/go-libp2p/core/peer"
mbase "github.com/multiformats/go-multibase"
)

Expand All @@ -29,7 +29,7 @@ func KeyEncoderFromString(formatLabel string) (KeyEncoder, error) {

func (enc KeyEncoder) FormatID(id peer.ID) string {
if enc.baseEnc == nil {
return peer.Encode(id)
return id.String()
}
if s, err := peer.ToCid(id).StringOfBase(enc.baseEnc.Encoding()); err != nil {
panic(err)
Expand Down
4 changes: 2 additions & 2 deletions core/commands/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
ke "github.com/ipfs/kubo/core/commands/keyencode"
fsrepo "github.com/ipfs/kubo/repo/fsrepo"
migrations "github.com/ipfs/kubo/repo/fsrepo/migrations"
"github.com/libp2p/go-libp2p-core/crypto"
peer "github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/crypto"
peer "github.com/libp2p/go-libp2p/core/peer"
)

var KeyCmd = &cmds.Command{
Expand Down
4 changes: 2 additions & 2 deletions core/commands/name/ipnsps.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
cmds "github.com/ipfs/go-ipfs-cmds"
"github.com/ipfs/kubo/core/commands/cmdenv"
ke "github.com/ipfs/kubo/core/commands/keyencode"
"github.com/libp2p/go-libp2p-core/peer"
record "github.com/libp2p/go-libp2p-record"
"github.com/libp2p/go-libp2p/core/peer"
)

type ipnsPubsubState struct {
Expand Down Expand Up @@ -100,7 +100,7 @@ var ipnspsSubsCmd = &cmds.Command{
// Not necessarily an error.
continue
}
pid, err := peer.IDFromString(k)
pid, err := peer.IDFromBytes([]byte(k))
if err != nil {
log.Errorf("ipns key not a valid peer ID: %s", err)
continue
Expand Down
2 changes: 1 addition & 1 deletion core/commands/name/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
options "github.com/ipfs/interface-go-ipfs-core/options"
path "github.com/ipfs/interface-go-ipfs-core/path"
ke "github.com/ipfs/kubo/core/commands/keyencode"
peer "github.com/libp2p/go-libp2p-core/peer"
peer "github.com/libp2p/go-libp2p/core/peer"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions core/commands/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
p2p "github.com/ipfs/kubo/p2p"

cmds "github.com/ipfs/go-ipfs-cmds"
peer "github.com/libp2p/go-libp2p-core/peer"
pstore "github.com/libp2p/go-libp2p-core/peerstore"
protocol "github.com/libp2p/go-libp2p-core/protocol"
peer "github.com/libp2p/go-libp2p/core/peer"
pstore "github.com/libp2p/go-libp2p/core/peerstore"
protocol "github.com/libp2p/go-libp2p/core/protocol"
ma "github.com/multiformats/go-multiaddr"
madns "github.com/multiformats/go-multiaddr-dns"
)
Expand Down
4 changes: 2 additions & 2 deletions core/commands/pin/remotepin.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
config "github.com/ipfs/kubo/config"
"github.com/ipfs/kubo/core/commands/cmdenv"
fsrepo "github.com/ipfs/kubo/repo/fsrepo"
"github.com/libp2p/go-libp2p-core/host"
peer "github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/host"
peer "github.com/libp2p/go-libp2p/core/peer"
)

var log = logging.Logger("core/commands/cmdenv")
Expand Down
4 changes: 2 additions & 2 deletions core/commands/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/ipfs/kubo/core/commands/cmdenv"

cmds "github.com/ipfs/go-ipfs-cmds"
peer "github.com/libp2p/go-libp2p-core/peer"
pstore "github.com/libp2p/go-libp2p-core/peerstore"
peer "github.com/libp2p/go-libp2p/core/peer"
pstore "github.com/libp2p/go-libp2p/core/peerstore"
ping "github.com/libp2p/go-libp2p/p2p/protocol/ping"
ma "github.com/multiformats/go-multiaddr"
)
Expand Down
4 changes: 2 additions & 2 deletions core/commands/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
ipld "github.com/ipfs/go-ipld-format"
dag "github.com/ipfs/go-merkledag"
path "github.com/ipfs/go-path"
peer "github.com/libp2p/go-libp2p-core/peer"
routing "github.com/libp2p/go-libp2p-core/routing"
peer "github.com/libp2p/go-libp2p/core/peer"
routing "github.com/libp2p/go-libp2p/core/routing"
)

var RoutingCmd = &cmds.Command{
Expand Down
6 changes: 3 additions & 3 deletions core/commands/stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (

humanize "github.com/dustin/go-humanize"
cmds "github.com/ipfs/go-ipfs-cmds"
metrics "github.com/libp2p/go-libp2p-core/metrics"
peer "github.com/libp2p/go-libp2p-core/peer"
protocol "github.com/libp2p/go-libp2p-core/protocol"
metrics "github.com/libp2p/go-libp2p/core/metrics"
peer "github.com/libp2p/go-libp2p/core/peer"
protocol "github.com/libp2p/go-libp2p/core/protocol"
)

var StatsCmd = &cmds.Command{
Expand Down
4 changes: 2 additions & 2 deletions core/commands/stat_dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
cmdenv "github.com/ipfs/kubo/core/commands/cmdenv"

cmds "github.com/ipfs/go-ipfs-cmds"
"github.com/libp2p/go-libp2p-core/network"
pstore "github.com/libp2p/go-libp2p-core/peerstore"
dht "github.com/libp2p/go-libp2p-kad-dht"
"github.com/libp2p/go-libp2p-kad-dht/fullrt"
kbucket "github.com/libp2p/go-libp2p-kbucket"
"github.com/libp2p/go-libp2p/core/network"
pstore "github.com/libp2p/go-libp2p/core/peerstore"
)

type dhtPeerInfo struct {
Expand Down

0 comments on commit 196887c

Please sign in to comment.