Validator side of the collation protocol. (#295)

* skeleton of collators object

* awaiting and handling collations. rename `collators` to CollationPool

* add some tests

* add tests

* implement Collators trait for ConsensusNetwork

* plug collators into main polkadot-network

* ignore collator role message

* add a couple more tests

* garbage collection for collations

* ensure disconnected backup collator is removed from pool

* address other grumbles
This commit is contained in:
Robert Habermeier
2018-07-12 09:47:10 +01:00
committed by Gav Wood
parent 907eeef9dd
commit 88c40c8fb4
7 changed files with 514 additions and 34 deletions
+3 -2
View File
@@ -157,7 +157,8 @@ pub fn collate<'a, R, P>(
ingress.0.iter().flat_map(|&(id, ref msgs)| msgs.iter().cloned().map(move |msg| (id, msg)))
);
let signature = key.sign(&block_data.0[..]).into();
let block_data_hash = block_data.hash();
let signature = key.sign(&block_data_hash.0[..]).into();
let pubkey_bytes: [u8; 32] = key.public().into();
let receipt = parachain::CandidateReceipt {
@@ -168,7 +169,7 @@ pub fn collate<'a, R, P>(
balance_uploads: Vec::new(),
egress_queue_roots: Vec::new(),
fees: 0,
block_data_hash: block_data.hash(),
block_data_hash,
};
parachain::Collation {