Interchain message-passing (#117)

* compute ingress and routing in polkadot runtime

* extract parent candidates from block when beginning consensus

* fetch incoming messages when validating

* fix consensus tests

* parachain wasm execution uses messages

* update parachain tests to check if messages are executed

* abstract out network service to make room for network tests

* skeleton for incoming data fetch

* collate ingress from consensus-gossip

* keep track of validated candidates in the shared-table

* add some shared_table tests for new behavior

* broadcast egress messages on gossip

* test compute_ingress

* move network tests to module folder

* dummy network for consensus-network tests

* make consensus network generic over executor

* test egress broadcast and ingress fetch

* fix test compilation

* address some grumbles

* address grumbles and fix parachain shuffle

* remove broadcast parameter from consensus network trait
This commit is contained in:
Robert Habermeier
2019-02-19 13:59:29 -03:00
committed by GitHub
parent da409f6c9e
commit f8af277006
26 changed files with 1733 additions and 368 deletions
+12 -6
View File
@@ -16,9 +16,8 @@
//! Polkadot-specific network implementation.
//!
//! This manages gossip of consensus messages for BFT and for parachain statements,
//! parachain block and extrinsic data fetching, communication between collators and validators,
//! and more.
//! This manages routing for parachain statements, parachain block and extrinsic data fetching,
//! communication between collators and validators, and more.
extern crate parity_codec as codec;
extern crate substrate_network;
@@ -30,16 +29,23 @@ extern crate polkadot_availability_store as av_store;
extern crate polkadot_primitives;
extern crate arrayvec;
extern crate futures;
extern crate parking_lot;
extern crate tokio;
extern crate rhododendron;
extern crate slice_group_by;
#[macro_use]
extern crate futures;
#[macro_use]
extern crate log;
#[macro_use]
extern crate parity_codec_derive;
#[cfg(test)]
extern crate substrate_client;
#[cfg(test)]
extern crate substrate_keyring;
mod collator_pool;
mod local_collations;
mod router;
@@ -256,7 +262,7 @@ impl PolkadotProtocol {
send_polkadot_message(
ctx,
who,
Message::RequestBlockData(req_id, parent, c_hash)
Message::RequestBlockData(req_id, parent, c_hash),
);
in_flight.insert((req_id, who), pending);