[p2p] Fix libp2p version lead the consensus issue (#3868)

* revert libp2p version
* Revert "[p2p] Remove DiscConcurrency code (#3865)"
pull/3869/head v4.2.1
MathxH Chen 3 years ago committed by GitHub
parent b3c470e49b
commit e58fddd264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      go.mod
  2. 6
      p2p/discovery/option.go

@ -30,12 +30,12 @@ require (
github.com/hashicorp/golang-lru v0.5.4 github.com/hashicorp/golang-lru v0.5.4
github.com/ipfs/go-ds-badger v0.2.4 github.com/ipfs/go-ds-badger v0.2.4
github.com/json-iterator/go v1.1.10 github.com/json-iterator/go v1.1.10
github.com/libp2p/go-libp2p v0.14.4 github.com/libp2p/go-libp2p v0.14.0
github.com/libp2p/go-libp2p-core v0.8.6 github.com/libp2p/go-libp2p-core v0.8.6
github.com/libp2p/go-libp2p-crypto v0.1.0 github.com/libp2p/go-libp2p-crypto v0.1.0
github.com/libp2p/go-libp2p-discovery v0.5.0 github.com/libp2p/go-libp2p-discovery v0.5.0
github.com/libp2p/go-libp2p-kad-dht v0.12.2 github.com/libp2p/go-libp2p-kad-dht v0.11.1
github.com/libp2p/go-libp2p-pubsub v0.4.2 github.com/libp2p/go-libp2p-pubsub v0.4.0
github.com/multiformats/go-multiaddr v0.3.3 github.com/multiformats/go-multiaddr v0.3.3
github.com/multiformats/go-multiaddr-dns v0.3.1 github.com/multiformats/go-multiaddr-dns v0.3.1
github.com/natefinch/lumberjack v2.0.0+incompatible github.com/natefinch/lumberjack v2.0.0+incompatible

@ -34,6 +34,12 @@ func (opt DHTConfig) getLibp2pRawOptions() ([]libp2p_dht.Option, error) {
opts = append(opts, dsOption) opts = append(opts, dsOption)
} }
// if Concurrency <= 0, it uses default concurrency supplied from libp2p dht
// the concurrency num meaning you can see Section 2.3 in the KAD paper https://pdos.csail.mit.edu/~petar/papers/maymounkov-kademlia-lncs.pdf
if opt.DiscConcurrency > 0 {
opts = append(opts, libp2p_dht.Concurrency(opt.DiscConcurrency))
}
return opts, nil return opts, nil
} }

Loading…
Cancel
Save