strip out all ICMP network code and begin gossip refactor for attestations (#256)

* strip out all ICMP code and begin gossip refactor

* validate incoming statements

* message_allowed logic

* compiles

* do reporting and neighbor packet validation

* tests compile

* propagate gossip messages

* test message_allowed

* some more tests

* address grumbles
This commit is contained in:
Robert Habermeier
2019-05-17 14:30:10 -04:00
committed by GitHub
parent 2bbfcc2f72
commit 164943b961
12 changed files with 738 additions and 491 deletions
+5 -3
View File
@@ -179,7 +179,6 @@ pub trait Network {
fn communication_for(
&self,
table: Arc<SharedTable>,
outgoing: Outgoing,
authorities: &[SessionKey],
) -> Self::BuildTableRouter;
}
@@ -319,7 +318,11 @@ impl<C, N, P> ParachainValidation<C, N, P> where
.map(|x| x.collect())
.unwrap_or_default();
let outgoing: Vec<_> = {
// TODO: https://github.com/paritytech/polkadot/issues/253
//
// We probably don't only want active validators to do this, or messages
// will disappear when validators exit the set.
let _outgoing: Vec<_> = {
// extract all extrinsic data that we have and propagate to peers.
live_instances.get(&grandparent_hash).map(|parent_validation| {
parent_candidates.iter().filter_map(|c| {
@@ -351,7 +354,6 @@ impl<C, N, P> ParachainValidation<C, N, P> where
let table = Arc::new(SharedTable::new(authorities, group_info, sign_with.clone(), parent_hash, self.extrinsic_store.clone()));
let router = self.network.communication_for(
table.clone(),
outgoing,
authorities,
);