fix: only exit when both channels are drained (#21877)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Arsenii Kulikov
2026-02-06 15:26:26 +04:00
committed by GitHub
parent 372802d06d
commit 913e88306b

View File

@@ -436,6 +436,14 @@ where
self.dispatch_pending_targets();
self.process_new_updates()?;
self.promote_pending_account_updates()?;
if self.finished_state_updates &&
self.account_updates.is_empty() &&
self.storage_updates.iter().all(|(_, updates)| updates.is_empty())
{
break;
}
self.dispatch_pending_targets();
} else if self.updates.is_empty() || self.pending_updates > MAX_PENDING_UPDATES {
// If we don't have any pending updates OR we've accumulated a lot already, apply
@@ -446,13 +454,6 @@ where
// Make sure to dispatch targets if we've accumulated a lot of them.
self.dispatch_pending_targets();
}
if self.finished_state_updates &&
self.account_updates.is_empty() &&
self.storage_updates.iter().all(|(_, updates)| updates.is_empty())
{
break;
}
}
debug!(target: "engine::root", "All proofs processed, ending calculation");