Don't wait for dispute coordinator (#5157)

* Don't wait for dispute coordinator

in backing and approval-voting - we are single threaded there, so this
is blocking everything.

* Add missing import.

* Don't warn on dropped receiver.
This commit is contained in:
Robert Klotzner
2022-03-18 16:15:50 +01:00
committed by GitHub
parent 495b6cc937
commit 3688e46d1b
5 changed files with 14 additions and 26 deletions
+4 -11
View File
@@ -35,7 +35,7 @@ use polkadot_node_subsystem::{
ApprovalVotingMessage, AssignmentCheckError, AssignmentCheckResult,
AvailabilityRecoveryMessage, BlockDescription, CandidateValidationMessage, ChainApiMessage,
ChainSelectionMessage, DisputeCoordinatorMessage, HighestApprovedAncestorBlock,
ImportStatementsResult, RuntimeApiMessage, RuntimeApiRequest,
RuntimeApiMessage, RuntimeApiRequest,
},
overseer::{self, SubsystemSender as _},
FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemContext, SubsystemError,
@@ -950,7 +950,9 @@ async fn handle_actions(
dispute_statement,
validator_index,
} => {
let (pending_confirmation, confirmation_rx) = oneshot::channel();
// TODO: Log confirmation results in an efficient way:
// https://github.com/paritytech/polkadot/issues/5156
let (pending_confirmation, _confirmation_rx) = oneshot::channel();
ctx.send_message(DisputeCoordinatorMessage::ImportStatements {
candidate_hash,
candidate_receipt,
@@ -959,15 +961,6 @@ async fn handle_actions(
pending_confirmation,
})
.await;
match confirmation_rx.await {
Err(oneshot::Canceled) => {
gum::debug!(target: LOG_TARGET, "Dispute coordinator confirmation lost",)
},
Ok(ImportStatementsResult::ValidImport) => {},
Ok(ImportStatementsResult::InvalidImport) =>
gum::warn!(target: LOG_TARGET, "Failed to import statements of validity",),
}
},
Action::NoteApprovedInChainSelection(block_hash) => {
ctx.send_message(ChainSelectionMessage::Approved(block_hash)).await;
@@ -25,6 +25,7 @@ use polkadot_node_primitives::{
use polkadot_node_subsystem::{
messages::{
AllMessages, ApprovalVotingMessage, AssignmentCheckResult, AvailabilityRecoveryMessage,
ImportStatementsResult,
},
ActivatedLeaf, ActiveLeavesUpdate, LeafStatus,
};