mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 16:17:59 +00:00
Initial GRANDPA integration (#866)
* implement grandpa client * consensus gossip with arbitrary topics * defer GRANDPA messages until referenced blocks imported * set up communication for voter in a transparent way * instantiate GRANDPA voter * keep last round state on disk * switch back to crates.io finality-grandpa * update cargo.lock * use new `collect_garbage` API * update sync test framework and make public * test that observers can observe * fix warning * use more idiomatic predicate for collecting garbage in gossip * kill spaces * fix date
This commit is contained in:
committed by
Gav Wood
parent
1cc0e3b6ea
commit
68b4be14ff
@@ -68,7 +68,8 @@ impl Protocol {
|
||||
fn new_consensus(&mut self, parent_hash: Hash) {
|
||||
let old_consensus = self.live_consensus.take();
|
||||
self.live_consensus = Some(parent_hash);
|
||||
self.consensus_gossip.collect_garbage(old_consensus.as_ref());
|
||||
self.consensus_gossip
|
||||
.collect_garbage(|topic| old_consensus.as_ref().map_or(true, |h| topic != h));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +106,7 @@ impl Specialization<Block> for Protocol {
|
||||
}
|
||||
|
||||
fn maintain_peers(&mut self, _ctx: &mut Context<Block>) {
|
||||
self.consensus_gossip.collect_garbage(None);
|
||||
self.consensus_gossip.collect_garbage(|_| true);
|
||||
}
|
||||
|
||||
fn on_block_imported(&mut self, _ctx: &mut Context<Block>, _hash: Hash, _header: &Header) {
|
||||
|
||||
Reference in New Issue
Block a user