From d766b7fa48e60aa0dab53f0dc4652c69ca4ddc65 Mon Sep 17 00:00:00 2001 From: Age Manning Date: Tue, 31 Mar 2020 13:54:27 +1100 Subject: [PATCH] Sends discovery for persistent subnets (#973) --- beacon_node/network/src/attestation_service/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/beacon_node/network/src/attestation_service/mod.rs b/beacon_node/network/src/attestation_service/mod.rs index 8386006382..aa792d5dbc 100644 --- a/beacon_node/network/src/attestation_service/mod.rs +++ b/beacon_node/network/src/attestation_service/mod.rs @@ -27,9 +27,9 @@ const TARGET_PEER_DISCOVERY_SLOT_LOOK_AHEAD: u64 = 6; const LAST_SEEN_VALIDATOR_TIMEOUT: u32 = 150; // 30 mins at a 12s slot time /// The fraction of a slot that we subscribe to a subnet before the required slot. /// -/// Note: The time is calculated as `time = milliseconds_per_slot / ADVANCE_SUBSCRIPTION_TIME` +/// Note: The time is calculated as `time = milliseconds_per_slot / ADVANCE_SUBSCRIPTION_TIME`. const ADVANCE_SUBSCRIBE_TIME: u32 = 3; -/// The the default number of slots before items in hash delay sets used by this class should expire +/// The default number of slots before items in hash delay sets used by this class should expire. const DEFAULT_EXPIRATION_TIMEOUT: u32 = 3; // 36s at 12s slot time #[derive(Debug, PartialEq)] @@ -425,6 +425,10 @@ impl AttestationService { .find(|topic| topic.kind() == topic_kind) { // not already subscribed to the topic + + // send a discovery request and a subscription + self.events + .push_back(AttServiceMessage::DiscoverPeers(subnet_id)); self.events .push_back(AttServiceMessage::Subscribe(subnet_id)); }