PoV Distribution optimization (#1990)

* Initial commit

* Remove unnecessary struct

* Some review nits

* Update node/network/pov-distribution/src/lib.rs

* Update parachain/test-parachains/adder/collator/tests/integration.rs

* Review nits

* notify_all_we_are_awaiting

* Both ways of peers connections should work the same

* Add mod-level docs to error.rs

* Avoid multiple connection requests at same parent

* Dont bail on errors

* FusedStream for ConnectionRequests

* Fix build after merge

* Improve error handling

* Remove whitespace formatting
This commit is contained in:
Fedor Sakharov
2020-11-25 12:20:54 +03:00
committed by GitHub
parent 51f6cb1979
commit 994d621f2c
6 changed files with 900 additions and 80 deletions
@@ -115,6 +115,12 @@ pub struct ConnectionRequests {
requests: StreamUnordered<ConnectionRequest>,
}
impl stream::FusedStream for ConnectionRequests {
fn is_terminated(&self) -> bool {
false
}
}
impl ConnectionRequests {
/// Insert a new connection request.
///
@@ -133,6 +139,11 @@ impl ConnectionRequests {
Pin::new(&mut self.requests).remove(token);
}
}
/// Is a connection at this relay parent already present in the request
pub fn contains_request(&self, relay_parent: &Hash) -> bool {
self.id_map.contains_key(relay_parent)
}
}
impl stream::Stream for ConnectionRequests {