V0.11.0 network update (#976)

* Adjust RPC methods to match v0.11.1

* Adds fork handling for gossipsub topics

* Update gossipsub topics to v0.11.0
This commit is contained in:
Age Manning
2020-04-01 17:20:32 +11:00
parent 5eb4c7d682
commit 88cecd6fb8
19 changed files with 247 additions and 226 deletions

View File

@@ -1,4 +1,4 @@
use crate::types::{GossipEncoding, GossipKind, GossipTopic};
use crate::types::GossipKind;
use crate::Enr;
use libp2p::discv5::{Discv5Config, Discv5ConfigBuilder};
use libp2p::gossipsub::{GossipsubConfig, GossipsubConfigBuilder, GossipsubMessage, MessageId};
@@ -61,7 +61,7 @@ pub struct Config {
pub client_version: String,
/// List of extra topics to initially subscribe to as strings.
pub topics: Vec<GossipTopic>,
pub topics: Vec<GossipKind>,
/// Introduces randomization in network propagation of messages. This should only be set for
/// testing purposes and will likely be removed in future versions.
@@ -78,11 +78,11 @@ impl Default for Config {
// The default topics that we will initially subscribe to
let topics = vec![
GossipTopic::new(GossipKind::BeaconBlock, GossipEncoding::SSZ),
GossipTopic::new(GossipKind::BeaconAggregateAndProof, GossipEncoding::SSZ),
GossipTopic::new(GossipKind::VoluntaryExit, GossipEncoding::SSZ),
GossipTopic::new(GossipKind::ProposerSlashing, GossipEncoding::SSZ),
GossipTopic::new(GossipKind::AttesterSlashing, GossipEncoding::SSZ),
GossipKind::BeaconBlock,
GossipKind::BeaconAggregateAndProof,
GossipKind::VoluntaryExit,
GossipKind::ProposerSlashing,
GossipKind::AttesterSlashing,
];
// The function used to generate a gossipsub message id