impl approval distribution (#2160)

* initial impl approval distribution

* initial tests and fixes

* batching seems difficult: different peers have different needs

* bridge: fix test after merge

* some guide updates

* only send assignments to peers who know about the block

* fix a test, add approvals test

* simplify

* do not send assignment to peers for finalized blocks

* guide: protocol input and output

* one more test

* more comments, logs, initial metrics

* fix a typo

* one more thing: early return when reimporting a thing locally
This commit is contained in:
Andronik Ordian
2021-01-26 00:14:32 +01:00
committed by GitHub
parent fa6e4b4488
commit 3f1e1a6ff7
18 changed files with 2119 additions and 80 deletions
+4 -1
View File
@@ -150,6 +150,9 @@ mod assigment_app {
/// to approve included parachain candidates.
pub type AssignmentId = assigment_app::Public;
/// The index of the candidate in the list of candidates fully included as-of the block.
pub type CandidateIndex = u32;
/// Get a collator signature payload on a relay-parent, block-data combo.
pub fn collator_signature_payload<H: AsRef<[u8]>>(
relay_parent: &H,
@@ -504,7 +507,7 @@ pub fn check_candidate_backing<H: AsRef<[u8]> + Clone + Encode>(
}
/// The unique (during session) index of a core.
#[derive(Encode, Decode, Default, PartialOrd, Ord, Eq, PartialEq, Clone, Copy)]
#[derive(Encode, Decode, Default, PartialOrd, Ord, Eq, PartialEq, Clone, Copy, Hash)]
#[cfg_attr(feature = "std", derive(Debug))]
pub struct CoreIndex(pub u32);