-
Notifications
You must be signed in to change notification settings - Fork 1.6k
*: Ensure GossipEngine is being polled #836
Conversation
With paritytech/substrate#4767 a `GossipEngine` does not spawn its own tasks, but relies on its owner to poll it. This patch removes the unneeded executor argument and spawns the gossip engine as an orphaned task onto the executor instead.
It looks like @mxinden signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
Friendly ping @rphmeier @andresilva. |
POLKADOT_ENGINE_ID, | ||
gossip_side, | ||
); | ||
|
||
// Ideally this would not be spawned as an orphaned task, but polled by | ||
// `RegisteredMessageValidator` which in turn would be polled by a `ValidationNetwork`. |
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.
note that when we remove the legacy code we will use protocol.rs
which could run this in a future.
// `RegisteredMessageValidator` which in turn would be polled by a `ValidationNetwork`. | ||
let spawn_res = executor.spawn_obj(futures::task::FutureObj::from(Box::new(gossip_engine.clone()))); | ||
|
||
// Note: we consider the chances of an error to spawn a background task almost null. |
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.
I agree, but should we panic instead? This code will only be run on node startup, maybe it makes sense to just fail right away?
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.
A graceful exit would be hard to include, but maybe a warning would be good.
Superseded by: #834 |
With paritytech/substrate#4767 a
GossipEngine
does not spawn its own tasks, but relies on its owner to poll it. This
patch removes the unneeded executor argument and spawns the gossip
engine as an orphaned task onto the executor instead.
ba3b548 is the core of the pull request and should be reviewed.
c1fb81b is temporary and makes Polkadot use a patched version of Substrate's polkadot-master which includes paritytech/substrate#4767.
🛑 Please don't merge yet, given that c1fb81b is not yet removed.