mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 09:21:05 +00:00
sc-consensus-beefy: fix on-demand async state machine (#13599)
`futures_util::pending!()` macro only yields to the event loop once, resulting in many calls to the `OnDemandJustificationsEngine::next()` made by the tokio reactor even though the on-demand-engine is idle. Replace it with the correct `futures::future::pending::<()>()` function which forever yields to the event loop, which is what we want when the engine is idle. Signed-off-by: Adrian Catangiu <adrian@parity.io>
This commit is contained in:
@@ -887,11 +887,6 @@ where
|
||||
// based on the new resulting 'state'.
|
||||
futures::select_biased! {
|
||||
// Use `select_biased!` to prioritize order below.
|
||||
// Make sure to pump gossip engine.
|
||||
_ = gossip_engine => {
|
||||
error!(target: LOG_TARGET, "🥩 Gossip engine has terminated, closing worker.");
|
||||
return;
|
||||
},
|
||||
// Process finality notifications first since these drive the voter.
|
||||
notification = finality_notifications.next() => {
|
||||
if let Some(notification) = notification {
|
||||
@@ -901,6 +896,11 @@ where
|
||||
return;
|
||||
}
|
||||
},
|
||||
// Make sure to pump gossip engine.
|
||||
_ = gossip_engine => {
|
||||
error!(target: LOG_TARGET, "🥩 Gossip engine has terminated, closing worker.");
|
||||
return;
|
||||
},
|
||||
// Process incoming justifications as these can make some in-flight votes obsolete.
|
||||
justif = self.on_demand_justifications.next().fuse() => {
|
||||
if let Some(justif) = justif {
|
||||
|
||||
Reference in New Issue
Block a user