rust 1.53.0 updates (#2411)

## Issue Addressed

`make lint` failing on rust 1.53.0.

## Proposed Changes

1.53.0 updates

## Additional Info

I haven't figure out why yet, we were now hitting the recursion limit in a few crates. So I had to add `#![recursion_limit = "256"]` in a few places


Co-authored-by: realbigsean <seananderson33@gmail.com>
Co-authored-by: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
realbigsean
2021-06-18 05:58:01 +00:00
parent 3dc1eb5eb6
commit b84ff9f793
32 changed files with 106 additions and 134 deletions

View File

@@ -556,20 +556,18 @@ impl<TSpec: EthSpec> PeerManager<TSpec> {
if known_meta_data.seq_number < meta_data.seq_number {
debug!(self.log, "Updating peer's metadata";
"peer_id" => %peer_id, "known_seq_no" => known_meta_data.seq_number, "new_seq_no" => meta_data.seq_number);
peer_info.meta_data = Some(meta_data);
} else {
debug!(self.log, "Received old metadata";
"peer_id" => %peer_id, "known_seq_no" => known_meta_data.seq_number, "new_seq_no" => meta_data.seq_number);
// Updating metadata even in this case to prevent storing
// incorrect `metadata.attnets` for a peer
peer_info.meta_data = Some(meta_data);
}
} else {
// we have no meta-data for this peer, update
debug!(self.log, "Obtained peer's metadata";
"peer_id" => %peer_id, "new_seq_no" => meta_data.seq_number);
peer_info.meta_data = Some(meta_data);
}
peer_info.meta_data = Some(meta_data);
} else {
crit!(self.log, "Received METADATA from an unknown peer";
"peer_id" => %peer_id);
@@ -583,11 +581,7 @@ impl<TSpec: EthSpec> PeerManager<TSpec> {
// 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()
.find(|v| matches!(v, MProtocol::Udp(_)))
.is_none()
});
out_list.retain(|addr| !addr.iter().any(|v| matches!(v, MProtocol::Udp(_))));
out_list
} else {