Improve collator side of the collator-protocol (#1955)

* Improve collator side of the collator-protocol

This pr improves the collator-protocol implementation of the collator
side. Besides cleaning up code and rewriting it, the following changed:

- Before on `PeerViewChange` we send an advertisment to every peer, now
this only happens for validators.
- It also adds a check that we send an advertisment message only once
for a connected peer.
- If the same validator was part of the current and next group, we
requested to be connected to this validator two times. This is also
fixed now.
- Instead of having only one connection request, we now are being able
to store multiple of them. This is required as we can have multiple
active leafs at any point of time.

* Switch to common `ConnectionRequests`

* Update node/network/collator-protocol/src/collator_side.rs
This commit is contained in:
Bastian Köcher
2020-11-22 12:55:05 +01:00
committed by GitHub
parent 7abcd42fd2
commit b9a9e836ca
2 changed files with 649 additions and 623 deletions
File diff suppressed because it is too large Load Diff
@@ -18,6 +18,7 @@
//! This subsystem implements both sides of the collator protocol.
#![deny(missing_docs, unused_crate_dependencies)]
#![recursion_limit="256"]
use std::time::Duration;
use futures::{channel::oneshot, FutureExt, TryFutureExt};