Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

client/network-gossip/bridge: Use bounded channel #5748

Merged
merged 7 commits into from
May 6, 2020

Conversation

mxinden
Copy link
Contributor

@mxinden mxinden commented Apr 23, 2020

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.

polkadot companion: paritytech/polkadot#1046

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`.
@mxinden mxinden added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes labels Apr 23, 2020
@gnunicorn gnunicorn requested a review from tomaka April 23, 2020 13:04
Copy link
Contributor

@tomaka tomaka left a 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

@tomaka
Copy link
Contributor

tomaka commented Apr 28, 2020

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.

@mxinden
Copy link
Contributor Author

mxinden commented Apr 28, 2020

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.

@tomaka each subsystem creates its own GossipEngine. The event channel between the network and a GossipEngine is still unbounded. Thus Grandpa being stuck would not imply other subsystems to get stuck as well.

@tomaka tomaka removed the A0-please_review Pull request needs code review. label Apr 28, 2020
@mxinden
Copy link
Contributor Author

mxinden commented Apr 28, 2020

Lets not merge this yet. I would like to do more testing.

@mxinden
Copy link
Contributor Author

mxinden commented May 6, 2020

This has been running on kusama-sentry-ew4-0 with no related alerts firing. In case there are no objections I suggest to merge.

@tomaka
Copy link
Contributor

tomaka commented May 6, 2020

bot merge

@bkchr bkchr merged commit 6c5db7c into paritytech:master May 6, 2020
@bkchr
Copy link
Member

bkchr commented May 6, 2020

🤖 merge done 🤖

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
B0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants