Discovery patch (#2382)

* Upgrade libp2p and unstable gossip

* Network protocol upgrades

* Correct dependencies, reduce incoming bucket limit

* Clean up dirty DHT entries before repopulating

* Update cargo lock

* Update lockfile

* Update ENR dep

* Update deps to specific versions

* Update test dependencies

* Update docker rust, and remote signer tests

* More remote signer test fixes

* Temp commit

* Update discovery

* Remove cached enrs after dialing

* Increase the session capacity, for improved efficiency
This commit is contained in:
Age Manning
2021-06-15 14:40:43 +10:00
parent 4aa06c9555
commit 6fb48b45fa
4 changed files with 16 additions and 7 deletions

View File

@@ -580,10 +580,7 @@ impl<TSpec: EthSpec> PeerManager<TSpec> {
// ENR's may have multiple Multiaddrs. The multi-addr associated with the UDP
// port is removed, which is assumed to be associated with the discv5 protocol (and
// therefore irrelevant for other libp2p components).
let mut out_list = enr.multiaddr();
out_list.retain(|addr| !addr.iter().any(|v| matches!(v, MProtocol::Udp(_))));
out_list
enr.multiaddr_tcp()
} else {
// PeerId is not known
Vec::new()
@@ -674,6 +671,8 @@ impl<TSpec: EthSpec> PeerManager<TSpec> {
.collect();
for peer_id in &peers_to_dial {
debug!(self.log, "Dialing cached ENR peer"; "peer_id" => %peer_id);
// Remove the ENR from the cache to prevent continual re-dialing on disconnects
self.discovery.remove_cached_enr(&peer_id);
self.dial_peer(peer_id);
}
}