Skip to content

Commit

Permalink
Merge pull request #788 from libp2p/update-deps
Browse files Browse the repository at this point in the history
update go-libp2p to v0.22.0, release v0.18.0
  • Loading branch information
MarcoPolo committed Aug 30, 2022
2 parents 52d59d0 + 7d734e1 commit dae5a9a
Show file tree
Hide file tree
Showing 43 changed files with 200 additions and 228 deletions.
8 changes: 4 additions & 4 deletions crawler/crawler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"sync"
"time"

"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/protocol"
"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/protocol"

logging "github.com/ipfs/go-log"
"github.com/libp2p/go-msgio/protoio"
Expand Down
2 changes: 1 addition & 1 deletion crawler/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package crawler
import (
"time"

"github.com/libp2p/go-libp2p-core/protocol"
"github.com/libp2p/go-libp2p/core/protocol"
)

// Option DHT Crawler option type.
Expand Down
14 changes: 7 additions & 7 deletions dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"sync"
"time"

"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/protocol"
"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/protocol"
"github.com/libp2p/go-libp2p/core/routing"

"github.com/libp2p/go-libp2p-kad-dht/internal"
dhtcfg "github.com/libp2p/go-libp2p-kad-dht/internal/config"
Expand Down Expand Up @@ -307,7 +307,7 @@ func makeDHT(ctx context.Context, h host.Host, cfg dhtcfg.Config) (*IpfsDHT, err
// To grok the Math Wizardy that produced these exact equations, please be patient as a document explaining it will
// be published soon.
if cfg.Concurrency < cfg.BucketSize { // (alpha < K)
l1 := math.Log(float64(1) / float64(cfg.BucketSize)) //(Log(1/K))
l1 := math.Log(float64(1) / float64(cfg.BucketSize)) // (Log(1/K))
l2 := math.Log(float64(1) - (float64(cfg.Concurrency) / float64(cfg.BucketSize))) // Log(1 - (alpha / K))
maxLastSuccessfulOutboundThreshold = time.Duration(l1 / l2 * float64(cfg.RoutingTable.RefreshInterval))
} else {
Expand Down
2 changes: 1 addition & 1 deletion dht_bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"time"

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

"github.com/multiformats/go-multiaddr"
)
Expand Down
4 changes: 2 additions & 2 deletions dht_bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"testing"
"time"

"github.com/libp2p/go-libp2p-core/event"
"github.com/libp2p/go-libp2p-core/peer"
kb "github.com/libp2p/go-libp2p-kbucket"
"github.com/libp2p/go-libp2p/core/event"
"github.com/libp2p/go-libp2p/core/peer"

"github.com/stretchr/testify/require"
)
Expand Down
6 changes: 3 additions & 3 deletions dht_filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"sync"
"time"

"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/host"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"

"github.com/google/gopacket/routing"
netroute "github.com/libp2p/go-netroute"
Expand Down
6 changes: 3 additions & 3 deletions dht_filters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"net"
"testing"

ic "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
ic "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
ma "github.com/multiformats/go-multiaddr"
manet "github.com/multiformats/go-multiaddr/net"
)
Expand Down
2 changes: 1 addition & 1 deletion dht_net.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"io"
"time"

"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p/core/network"

"github.com/libp2p/go-libp2p-kad-dht/internal/net"
"github.com/libp2p/go-libp2p-kad-dht/metrics"
Expand Down
4 changes: 2 additions & 2 deletions dht_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"testing"
"time"

"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
dhtcfg "github.com/libp2p/go-libp2p-kad-dht/internal/config"
"github.com/libp2p/go-libp2p-kad-dht/providers"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/protocol"

"github.com/libp2p/go-libp2p-kbucket/peerdiversity"
record "github.com/libp2p/go-libp2p-record"
Expand Down
16 changes: 8 additions & 8 deletions dht_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
"testing"
"time"

"github.com/libp2p/go-libp2p-core/event"
"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/event"
"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"
ma "github.com/multiformats/go-multiaddr"
"github.com/multiformats/go-multihash"
"github.com/multiformats/go-multistream"
Expand Down Expand Up @@ -614,7 +614,7 @@ func waitForWellFormedTables(t *testing.T, dhts []*IpfsDHT, minPeers, avgPeers i
rtlen := dht.routingTable.Size()
totalPeers += rtlen
if minPeers > 0 && rtlen < minPeers {
//t.Logf("routing table for %s only has %d peers (should have >%d)", dht.self, rtlen, minPeers)
// t.Logf("routing table for %s only has %d peers (should have >%d)", dht.self, rtlen, minPeers)
return false
}
}
Expand Down Expand Up @@ -1957,7 +1957,7 @@ func TestBootStrapWhenRTIsEmpty(t *testing.T) {

{

//----------------
// ----------------
// We will initialize a DHT with 1 bootstrapper, connect it to another DHT,
// then remove the latter from the Routing Table
// This should add the bootstrap peer and the peer that the bootstrap peer is conencted to
Expand Down Expand Up @@ -1997,7 +1997,7 @@ func TestBootStrapWhenRTIsEmpty(t *testing.T) {

{

//----------------
// ----------------
// We will initialize a DHT with 2 bootstrappers, connect it to another DHT,
// then remove the DHT handler from the other DHT which should make the first DHT's
// routing table empty.
Expand Down
10 changes: 5 additions & 5 deletions dual/dual.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
dht "github.com/libp2p/go-libp2p-kad-dht"

"github.com/ipfs/go-cid"
ci "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
"github.com/libp2p/go-libp2p-core/routing"
kb "github.com/libp2p/go-libp2p-kbucket"
"github.com/libp2p/go-libp2p-kbucket/peerdiversity"
helper "github.com/libp2p/go-libp2p-routing-helpers"
ci "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/host"
"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/hashicorp/go-multierror"
Expand Down
8 changes: 4 additions & 4 deletions dual/dual_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (

"github.com/ipfs/go-cid"
u "github.com/ipfs/go-ipfs-util"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
peerstore "github.com/libp2p/go-libp2p-core/peerstore"
dht "github.com/libp2p/go-libp2p-kad-dht"
test "github.com/libp2p/go-libp2p-kad-dht/internal/testing"
record "github.com/libp2p/go-libp2p-record"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/peer"
peerstore "github.com/libp2p/go-libp2p/core/peerstore"
bhost "github.com/libp2p/go-libp2p/p2p/host/basic"
swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing"
"github.com/multiformats/go-multiaddr"
Expand Down Expand Up @@ -127,7 +127,7 @@ func connect(ctx context.Context, t *testing.T, a, b *dht.IpfsDHT) {
func wait(ctx context.Context, t *testing.T, a, b *dht.IpfsDHT) {
t.Helper()
for a.RoutingTable().Find(b.PeerID()) == "" {
//fmt.Fprintf(os.Stderr, "%v\n", a.RoutingTable().GetPeerInfos())
// fmt.Fprintf(os.Stderr, "%v\n", a.RoutingTable().GetPeerInfos())
select {
case <-ctx.Done():
t.Fatal(ctx.Err())
Expand Down
2 changes: 1 addition & 1 deletion events.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/google/uuid"

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

// KeyKadID contains the Kademlia key in string and binary form.
Expand Down
16 changes: 8 additions & 8 deletions ext_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"testing"
"time"

"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-core/routing"
"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/core/routing"
"github.com/stretchr/testify/require"

record "github.com/libp2p/go-libp2p-record"
Expand Down Expand Up @@ -308,7 +308,7 @@ func TestNotFound(t *testing.T) {
// make sure we didn't just disconnect
t.Fatal("expected peers in the routing table")
}
//Success!
// Success!
return
case u.ErrTimeout:
t.Fatal("Should not have gotten timeout!")
Expand Down Expand Up @@ -382,7 +382,7 @@ func TestLessThanKResponses(t *testing.T) {
if _, err := d.GetValue(ctx, "hello"); err != nil {
switch err {
case routing.ErrNotFound:
//Success!
// Success!
return
case u.ErrTimeout:
t.Fatal("Should not have gotten timeout!")
Expand Down Expand Up @@ -452,7 +452,7 @@ func TestMultipleQueries(t *testing.T) {
if _, err := d.GetValue(ctx, "hello"); err != nil {
switch err {
case routing.ErrNotFound:
//Success!
// Success!
continue
case u.ErrTimeout:
t.Fatal("Should not have gotten timeout!")
Expand Down
14 changes: 7 additions & 7 deletions fullrt/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
"github.com/multiformats/go-multiaddr"
"github.com/multiformats/go-multihash"

"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/protocol"
"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/protocol"
"github.com/libp2p/go-libp2p/core/routing"
swarm "github.com/libp2p/go-libp2p/p2p/net/swarm"

"github.com/gogo/protobuf/proto"
Expand Down Expand Up @@ -661,7 +661,7 @@ func (dht *FullRT) updatePeerValues(ctx context.Context, key string, val []byte,
fixupRec := record.MakePutRecord(key, val)
for _, p := range peers {
go func(p peer.ID) {
//TODO: Is this possible?
// TODO: Is this possible?
if p == dht.h.ID() {
err := dht.putLocal(ctx, key, fixupRec)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion fullrt/dht_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strconv"
"testing"

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

func TestDivideByChunkSize(t *testing.T) {
Expand Down

0 comments on commit dae5a9a

Please sign in to comment.