From 5cb644d1834c622f323c405d9992b3dc89e38c1a Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Tue, 23 Nov 2021 18:06:33 -0600 Subject: [PATCH 1/2] don't initiate disputes for preparation timeout --- node/core/approval-voting/src/lib.rs | 31 ++++++++++++++++++---------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/node/core/approval-voting/src/lib.rs b/node/core/approval-voting/src/lib.rs index b7ac1e350339..e76b193d86f6 100644 --- a/node/core/approval-voting/src/lib.rs +++ b/node/core/approval-voting/src/lib.rs @@ -2310,17 +2310,26 @@ async fn launch_approval( "Detected invalid candidate as an approval checker.", ); - sender - .send_message( - DisputeCoordinatorMessage::IssueLocalStatement( - session_index, - candidate_hash, - candidate.clone(), - false, - ) - .into(), - ) - .await; + + match reason { + InvalidCandidate::ExecutionError(_) => { + // We don't raise disputes on execution errors that are likely + // spurious. + } + _ => { + sender + .send_message( + DisputeCoordinatorMessage::IssueLocalStatement( + session_index, + candidate_hash, + candidate.clone(), + false, + ) + .into(), + ) + .await; + } + } metrics_guard.take().on_approval_invalid(); return ApprovalState::failed(validator_index, candidate_hash) From b769feea3a01a121cf2399595f2809ea24d37a6e Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Tue, 23 Nov 2021 18:08:24 -0600 Subject: [PATCH 2/2] fmt --- node/core/approval-voting/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/node/core/approval-voting/src/lib.rs b/node/core/approval-voting/src/lib.rs index e76b193d86f6..50317e931111 100644 --- a/node/core/approval-voting/src/lib.rs +++ b/node/core/approval-voting/src/lib.rs @@ -2310,12 +2310,11 @@ async fn launch_approval( "Detected invalid candidate as an approval checker.", ); - match reason { InvalidCandidate::ExecutionError(_) => { // We don't raise disputes on execution errors that are likely // spurious. - } + }, _ => { sender .send_message( @@ -2328,7 +2327,7 @@ async fn launch_approval( .into(), ) .await; - } + }, } metrics_guard.take().on_approval_invalid();