Inform sync explicitly about new best block (#7604)

* Inform sync explicitly about new best block

Instead of "fishing" the new best block out of the processed blocks, we
now tell sync directly that there is a new best block. It also makes
sure that we update the corresponding sync handshake to the new best
block. This is required for parachains as they first import blocks and
declare the new best block after being made aware of it by the relay chain.

* Adds test

* Make sure async stuff had time to run
This commit is contained in:
Bastian Köcher authored and GitHub committed 2020-11-26 16:33:17 +00:00
1 parent 769f1981cb
commit d698d01378
7 files changed
+84 -55

No files matched your search

@@ -136,7 +136,7 @@ pub trait Link<B: BlockT>: Send {
/// Block import successful result.
#[derive(Debug, PartialEq)]
pub enum BlockImportResult<N: ::std::fmt::Debug + PartialEq> {
pub enum BlockImportResult<N: std::fmt::Debug + PartialEq> {
/// Imported known block.
ImportedKnown(N),
/// Imported unknown block.