Skip to content

Commit

Permalink
Remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanjay176 committed Dec 16, 2020
1 parent 4d95a7a commit c876b82
Showing 1 changed file with 5 additions and 27 deletions.
32 changes: 5 additions & 27 deletions beacon_node/eth2_libp2p/src/peer_manager/peerdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,22 +246,11 @@ impl<TSpec: EthSpec> PeerDB<TSpec> {
let log = &self.log;
self.peers
.iter()
.filter(move |(peer_id, info)| {
let metadata_subscription = info.on_subnet_metadata(subnet_id);
let gs_subscription = info.on_subnet_gossipsub(subnet_id);
// Note: should ideally never hit this condition
if metadata_subscription != gs_subscription {
debug!(
log,
"Metadata subscription and gossipsub subscription are different";
"peer_id" => %peer_id,
"subnet_id" => ?subnet_id,
);
}
.filter(move |(_, info)| {
// We check both the metadata and gossipsub data as we only want to count long-lived subscribed peers
info.is_connected()
&& metadata_subscription
&& gs_subscription
&& info.on_subnet_metadata(subnet_id)
&& info.on_subnet_gossipsub(subnet_id)
&& info.is_good_gossipsub_peer()
})
.map(|(peer_id, _)| peer_id)
Expand Down Expand Up @@ -372,19 +361,8 @@ impl<TSpec: EthSpec> PeerDB<TSpec> {
pub fn extend_peers_on_subnet(&mut self, subnet_id: SubnetId, min_ttl: Instant) {
let log = &self.log;
self.peers.iter_mut()
.filter(move |(peer_id, info)| {
let metadata_subscription = info.on_subnet_metadata(subnet_id);
let gs_subscription = info.on_subnet_gossipsub(subnet_id);
// Note: should ideally never hit this condition
if metadata_subscription != gs_subscription {
debug!(
log,
"Metadata subscription and gossipsub subscription are different";
"peer_id" => %peer_id,
"subnet_id" => ?subnet_id,
);
}
info.is_connected() && metadata_subscription && gs_subscription
.filter(move |(_, info)| {
info.is_connected() && info.on_subnet_metadata(subnet_id) && info.on_subnet_gossipsub(subnet_id)
})
.for_each(|(peer_id,info)| {
if info.min_ttl.is_none() || Some(min_ttl) > info.min_ttl {
Expand Down

0 comments on commit c876b82

Please sign in to comment.