upgrade libp2p (#2933)

## Issue Addressed

Upgrades libp2p to v.0.42.0 pre release (https://github.com/libp2p/rust-libp2p/pull/2440)
This commit is contained in:
Divma
2022-02-07 23:25:03 +00:00
parent 615695776e
commit 48b7c8685b
5 changed files with 102 additions and 202 deletions

View File

@@ -38,15 +38,12 @@ directory = { path = "../../common/directory" }
regex = "1.3.9"
strum = { version = "0.21.0", features = ["derive"] }
superstruct = "0.4.0"
open-metrics-client = "0.13.0"
open-metrics-client = "0.14.0"
[dependencies.libp2p]
# version = "0.41.0"
version = "0.42.1"
default-features = false
git = "https://github.com/libp2p/rust-libp2p"
# Latest libp2p master
rev = "17861d9cac121f7e448585a7f052d5eab4618826"
features = ["websocket", "identify", "mplex", "yamux", "noise", "gossipsub", "dns-tokio", "tcp-tokio", "plaintext"]
features = ["websocket", "identify", "mplex", "yamux", "noise", "gossipsub", "dns-tokio", "tcp-tokio", "plaintext", "secp256k1"]
[dev-dependencies]
slog-term = "2.6.0"

View File

@@ -963,10 +963,11 @@ impl<TSpec: EthSpec> NetworkBehaviour for Discovery<TSpec> {
match error {
DialError::Banned
| DialError::LocalPeerId
| DialError::InvalidPeerId
| DialError::InvalidPeerId(_)
| DialError::ConnectionIo(_)
| DialError::NoAddresses
| DialError::Transport(_) => {
| DialError::Transport(_)
| DialError::WrongPeerId { .. } => {
// set peer as disconnected in discovery DHT
debug!(self.log, "Marking peer disconnected in DHT"; "peer_id" => %peer_id);
self.disconnect_peer(&peer_id);

View File

@@ -161,7 +161,7 @@ impl<TSpec: EthSpec> NetworkBehaviour for PeerManager<TSpec> {
self.events
.push(PeerManagerEvent::PeerConnectedIncoming(*peer_id));
}
ConnectedPoint::Dialer { address } => {
ConnectedPoint::Dialer { address, .. } => {
self.inject_connect_outgoing(peer_id, address.clone(), None);
self.events
.push(PeerManagerEvent::PeerConnectedOutgoing(*peer_id));