mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 22:04:44 +00:00
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:
@@ -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 {
|
||||
|
||||
@@ -62,14 +62,14 @@ impl PeerSyncStatus {
|
||||
matches!(self, PeerSyncStatus::Behind { .. })
|
||||
}
|
||||
|
||||
/// Updates the peer's sync status, returning whether the status transitioned.
|
||||
///
|
||||
/// E.g. returns `true` if the state changed from `Synced` to `Advanced`, but not if
|
||||
/// the status remained `Synced` with different `SyncInfo` within.
|
||||
pub fn update(&mut self, new_state: PeerSyncStatus) -> bool {
|
||||
if *self == new_state {
|
||||
*self = new_state;
|
||||
false // state was not updated
|
||||
} else {
|
||||
*self = new_state;
|
||||
true
|
||||
}
|
||||
let changed_status = *self != new_state;
|
||||
*self = new_state;
|
||||
changed_status
|
||||
}
|
||||
|
||||
pub fn as_str(&self) -> &'static str {
|
||||
|
||||
Reference in New Issue
Block a user