Skip to content

Commit

Permalink
Merge pull request #1091 from input-output-hk/bump-poldercast-for-ran…
Browse files Browse the repository at this point in the history
…dom-access-on-unreachable-nodes

add default custom modules to handle unreachable nodes
  • Loading branch information
NicolasDP authored Nov 8, 2019
2 parents bc7c2c8 + ba950ea commit b07ebf2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jormungandr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ linked-hash-map = "0.5"
native-tls = "0.2.2"
network-core = { path = "../chain-deps/network-core" }
network-grpc = { path = "../chain-deps/network-grpc" }
poldercast = "0.9.5"
poldercast = "0.9.7"
rand = "0.6"
serde = "1.0"
serde_derive = "1.0"
Expand Down
1 change: 1 addition & 0 deletions jormungandr/src/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ impl GlobalState {
) -> Self {
let mut topology = P2pTopology::new(config.profile.clone(), logger.clone());
topology.set_poldercast_modules();
topology.set_custom_modules();
topology.set_policy(config.policy.clone());

// inject the trusted peers as initial gossips, this will make the node
Expand Down
6 changes: 6 additions & 0 deletions jormungandr/src/network/p2p/topology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use crate::network::p2p::{Gossips, Id, Node, Policy, PolicyConfig};
use poldercast::{
custom_layers,
poldercast::{Cyclon, Rings, Vicinity},
Layer, NodeProfile, PolicyReport, StrikeReason, Topology,
};
Expand Down Expand Up @@ -51,6 +52,11 @@ impl P2pTopology {
topology.add_layer(Cyclon::default());
}

pub fn set_custom_modules(&mut self) {
let mut topology = self.lock.write().unwrap();
topology.add_layer(custom_layers::RandomDirectConnections::default());
}

/// Returns a list of neighbors selected in this turn
/// to contact for event dissemination.
pub fn view(&self) -> Vec<Node> {
Expand Down

0 comments on commit b07ebf2

Please sign in to comment.