grandpa: always store justification for the latest finalized block (#8392)

* grandpa: always store justification for best finalized block

* grandpa-warp-sync: add latest justification when finished proving

* grandpa-warp-sync: change logic for sending best justification when finished

* grandpa: test storing best justification

* grandpa: reorder variants in WarpSyncFinished
This commit is contained in:
André Silva
2021-04-01 10:42:56 +01:00
committed by GitHub
parent 159e7d50bb
commit 34458e9b9c
7 changed files with 130 additions and 56 deletions
@@ -195,6 +195,11 @@ impl<Block: BlockT> GrandpaJustification<Block> {
Ok(())
}
/// The target block number and hash that this justifications proves finality for.
pub fn target(&self) -> (NumberFor<Block>, Block::Hash) {
(self.commit.target_number, self.commit.target_hash)
}
}
/// A utility trait implementing `finality_grandpa::Chain` using a given set of headers.