-
Notifications
You must be signed in to change notification settings - Fork 2.6k
client/network-gossip/bridge: Use bounded channel #5748
Conversation
Instead of returning an unbounded channel on `GossipEngine::messages_for` return a bounded channel. For now the channel length is determined by the amount of past messages cached in the `ConsensusGossip`. With a bounded channel, one can't just fire-and-forget style send into it, but has to first check whether the channel is ready. Thus this commit restructures `GossipEngine::poll` and introduces a `ForwardingState` into `GossipEngine`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Carefully reviewed this and looks good to me
One thing that might a bit worrisome is that if a "subsystem" is frozen (e.g. grandpa is stuck in an infinite loop), we will prevent all the other "subsystems" from receiving messages as well. I think that's fine. |
@tomaka each subsystem creates its own |
|
This has been running on |
bot merge |
🤖 merge done 🤖 |
Instead of returning an unbounded channel on
GossipEngine::messages_for
return a bounded channel. For now thechannel length is determined by the amount of past messages cached in
the
ConsensusGossip
.With a bounded channel, one can't just fire-and-forget style send into
it, but has to first check whether the channel is ready. Thus this
commit restructures
GossipEngine::poll
and introduces aForwardingState
intoGossipEngine
.polkadot companion: paritytech/polkadot#1046