Subscribe to core topics after sync (#1613)

## Issue Addressed

N/A

## Proposed Changes

Prevent subscribing to core gossipsub topics until after we have achieved a full sync. This prevents us censoring gossipsub channels, getting penalised in gossipsub 1.1 scoring and saves us computation time in attempting to validate gossipsub messages which we will be unable to do with a non-sync'd chain.
This commit is contained in:
Age Manning
2020-09-23 03:26:33 +00:00
parent 80ecafaae4
commit 80e52a0263
9 changed files with 68 additions and 30 deletions

View File

@@ -78,15 +78,6 @@ impl Default for Config {
network_dir.push(".lighthouse");
network_dir.push("network");
// The default topics that we will initially subscribe to
let topics = vec![
GossipKind::BeaconBlock,
GossipKind::BeaconAggregateAndProof,
GossipKind::VoluntaryExit,
GossipKind::ProposerSlashing,
GossipKind::AttesterSlashing,
];
// The function used to generate a gossipsub message id
// We use the first 8 bytes of SHA256(data) for content addressing
let gossip_message_id =
@@ -145,7 +136,7 @@ impl Default for Config {
trusted_peers: vec![],
client_version: lighthouse_version::version_with_platform(),
disable_discovery: false,
topics,
topics: Vec::new(),
}
}
}