Simulator and attestation service fixes (#1747)

## Issue Addressed

#1729 #1730 

Which issue # does this PR address?

## Proposed Changes

1. Fixes a bug in the simulator where nodes can't find each other due to 0 udp ports in their enr.
2. Fixes bugs in attestation service where we are unsubscribing from a subnet prematurely.

More testing is needed for attestation service fixes.
This commit is contained in:
Pawan Dhananjay
2020-10-15 07:11:31 +00:00
parent aadbab47cc
commit 97be2ca295
5 changed files with 131 additions and 77 deletions

View File

@@ -1,6 +1,6 @@
///! The subnet predicate used for searching for a particular subnet.
use super::*;
use slog::{debug, trace};
use slog::trace;
use std::ops::Deref;
/// Returns the predicate for a given subnet.
@@ -38,7 +38,7 @@ where
);
return false;
} else {
debug!(
trace!(
log_clone,
"Peer found on desired subnet(s)";
"peer_id" => format!("{}", enr.peer_id()),

View File

@@ -250,7 +250,9 @@ impl<TSpec: EthSpec> PeerManager<TSpec> {
.collect();
// request the subnet query from discovery
self.discovery.discover_subnet_peers(filtered);
if !filtered.is_empty() {
self.discovery.discover_subnet_peers(filtered);
}
}
/// A STATUS message has been received from a peer. This resets the status timer.