consensus: handle justification sync for blocks authored locally (#8698)

* consensus: add trait to control justification sync process

* network: implement JustificationSyncLink for NetworkService

* slots: handle justification sync in slot worker

* babe: fix slot worker instantiation

* aura: fix slot worker instantiation

* pow: handle justification sync in miner

* babe: fix tests

* aura: fix tests

* node: fix compilation

* node-template: fix compilation

* consensus: rename justification sync link parameter

* aura: fix test compilation

* consensus: slots: move JustificationSyncLink out of on_slot
This commit is contained in:
André Silva
2021-06-04 22:31:06 +01:00
committed by GitHub
parent a477d4dadf
commit c44b552d8f
13 changed files with 228 additions and 70 deletions
@@ -632,6 +632,11 @@ impl<B: BlockT> ChainSync<B> {
})
}
/// Clear all pending justification requests.
pub fn clear_justification_requests(&mut self) {
self.extra_justifications.reset();
}
/// Request syncing for the given block from given set of peers.
// The implementation is similar to on_block_announce with unknown parent hash.
pub fn set_sync_fork_request(
@@ -1117,7 +1122,7 @@ impl<B: BlockT> ChainSync<B> {
number,
hash
);
self.extra_justifications.reset()
self.clear_justification_requests();
}
if aux.needs_justification {