Skip to content

Commit

Permalink
chore: upgrade libp2p to v0.22 (#5324)
Browse files Browse the repository at this point in the history
* chore: upgrade libp2p to v0.22

* fix: fix lint
  • Loading branch information
simlecode authored Sep 26, 2022
1 parent 22c91c9 commit 56ae4ae
Show file tree
Hide file tree
Showing 76 changed files with 1,760 additions and 665 deletions.
2 changes: 1 addition & 1 deletion app/node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package node

import (
libp2p "github.com/libp2p/go-libp2p"
ci "github.com/libp2p/go-libp2p-core/crypto"
ci "github.com/libp2p/go-libp2p/core/crypto"
errors "github.com/pkg/errors"

"github.com/filecoin-project/venus/pkg/repo"
Expand Down
2 changes: 1 addition & 1 deletion app/node/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/filecoin-project/venus/pkg/repo/fskeystore"

cbor "github.com/ipfs/go-ipld-cbor"
acrypto "github.com/libp2p/go-libp2p-core/crypto"
acrypto "github.com/libp2p/go-libp2p/core/crypto"
"github.com/pkg/errors"

"github.com/filecoin-project/venus/pkg/crypto"
Expand Down
4 changes: 2 additions & 2 deletions app/node/test/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
ds "github.com/ipfs/go-datastore"
blockstore "github.com/ipfs/go-ipfs-blockstore"
cbor "github.com/ipfs/go-ipld-cbor"
"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"
"github.com/stretchr/testify/require"

"github.com/filecoin-project/go-address"
Expand Down
2 changes: 1 addition & 1 deletion app/submodule/chain/miner_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/filecoin-project/go-state-types/network"
"github.com/ipfs/go-cid"
cbornode "github.com/ipfs/go-ipld-cbor"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/peer"
cbg "github.com/whyrusleeping/cbor-gen"

"github.com/filecoin-project/go-state-types/builtin/v8/miner"
Expand Down
4 changes: 2 additions & 2 deletions app/submodule/mpool/mpool_submodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strconv"
"time"

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

"github.com/filecoin-project/go-address"
logging "github.com/ipfs/go-log"
Expand Down Expand Up @@ -246,7 +246,7 @@ func (mp *MessagePoolSubmodule) Stop(ctx context.Context) {
}
}

//API create a new mpool api implement
// API create a new mpool api implement
func (mp *MessagePoolSubmodule) API() v1api.IMessagePool {
pushLocks := messagepool.NewMpoolLocker()
return &MessagePoolAPI{mp: mp, pushLocks: pushLocks}
Expand Down
20 changes: 10 additions & 10 deletions app/submodule/network/libp2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ import (

"github.com/go-errors/errors"
"github.com/jbenet/goprocess"
"github.com/libp2p/go-eventbus"
"github.com/libp2p/go-libp2p-core/connmgr"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/event"
net "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/protocol"
"github.com/libp2p/go-libp2p-peerstore/pstoremem"
"github.com/libp2p/go-libp2p/core/connmgr"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/event"
net "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/protocol"
"github.com/libp2p/go-libp2p/p2p/host/eventbus"
"github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem"
"github.com/multiformats/go-multiaddr"
)

type noopLibP2PHost struct {
peerId peer.ID //nolint
}

//nolint
// nolint
func NewNoopLibP2PHost() noopLibP2PHost {
pk, _, _ := crypto.GenerateEd25519Key(rand.Reader) //nolint
pid, _ := peer.IDFromPrivateKey(pk)
Expand Down
8 changes: 4 additions & 4 deletions app/submodule/network/network_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"github.com/filecoin-project/venus/venus-shared/types"

"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
"github.com/libp2p/go-libp2p/core/metrics"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/protocol"

v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1"
)
Expand Down
12 changes: 6 additions & 6 deletions app/submodule/network/network_submodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ import (
cbor "github.com/ipfs/go-ipld-cbor"
logging "github.com/ipfs/go-log"
"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p-core/host"
p2pmetrics "github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/routing"
dht "github.com/libp2p/go-libp2p-kad-dht"
libp2pps "github.com/libp2p/go-libp2p-pubsub"
pubsub_pb "github.com/libp2p/go-libp2p-pubsub/pb"
yamux "github.com/libp2p/go-libp2p-yamux"
"github.com/libp2p/go-libp2p/core/host"
p2pmetrics "github.com/libp2p/go-libp2p/core/metrics"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/routing"
routedhost "github.com/libp2p/go-libp2p/p2p/host/routed"
yamux "github.com/libp2p/go-libp2p/p2p/muxer/yamux"
ma "github.com/multiformats/go-multiaddr"
"github.com/pkg/errors"

Expand Down Expand Up @@ -89,7 +89,7 @@ type NetworkSubmodule struct { //nolint
cfg networkConfig
}

//API create a new network implement
// API create a new network implement
func (networkSubmodule *NetworkSubmodule) API() v1api.INetwork {
return &networkAPI{network: networkSubmodule}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/miner_actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner"
cmds "github.com/ipfs/go-ipfs-cmds"
cbor "github.com/ipfs/go-ipld-cbor"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/peer"
ma "github.com/multiformats/go-multiaddr"

builtintypes "github.com/filecoin-project/go-state-types/builtin"
Expand Down
6 changes: 3 additions & 3 deletions cmd/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"github.com/ipfs/go-cid"
cmds "github.com/ipfs/go-ipfs-cmds"
logging "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
"github.com/libp2p/go-libp2p-core/routing"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/protocol"
"github.com/libp2p/go-libp2p/core/routing"
ma "github.com/multiformats/go-multiaddr"

"github.com/filecoin-project/venus/app/node"
Expand Down
Loading

0 comments on commit 56ae4ae

Please sign in to comment.