Some gossip improvements (#1892)

* queue messages in future

* use new gossip API in GRANDPA

* implement message_expired for grandpa

* fix indent
This commit is contained in:
Robert Habermeier
2019-02-28 14:19:42 -05:00
committed by Gav Wood
parent c21d7436cc
commit 4c8fec17fc
4 changed files with 200 additions and 81 deletions
+8 -2
View File
@@ -181,7 +181,10 @@ impl Network<Block> for MessageRouting {
self.validator.note_round(round, set_id);
let inner = self.inner.lock();
let peer = inner.peer(self.peer_id);
let messages = peer.consensus_gossip_messages_for(make_topic(round, set_id));
let messages = peer.consensus_gossip_messages_for(
GRANDPA_ENGINE_ID,
make_topic(round, set_id),
);
let messages = messages.map_err(
move |_| panic!("Messages for round {} dropped too early", round)
@@ -211,7 +214,10 @@ impl Network<Block> for MessageRouting {
self.validator.note_set(set_id);
let inner = self.inner.lock();
let peer = inner.peer(self.peer_id);
let messages = peer.consensus_gossip_messages_for(make_commit_topic(set_id));
let messages = peer.consensus_gossip_messages_for(
GRANDPA_ENGINE_ID,
make_commit_topic(set_id),
);
let messages = messages.map_err(
move |_| panic!("Commit messages for set {} dropped too early", set_id)