From 736d0a48feccfc5c5bb0dd69504dcf0bf070d933 Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Fri, 4 Jun 2021 11:50:38 -0500 Subject: [PATCH] better logging for approval voting failures (#3180) --- polkadot/node/core/approval-voting/src/lib.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/polkadot/node/core/approval-voting/src/lib.rs b/polkadot/node/core/approval-voting/src/lib.rs index eb287a75b4..bedfeb5790 100644 --- a/polkadot/node/core/approval-voting/src/lib.rs +++ b/polkadot/node/core/approval-voting/src/lib.rs @@ -2006,17 +2006,27 @@ async fn launch_approval( candidate_index, })).await; } - Ok(Ok(ValidationResult::Invalid(_))) => { + Ok(Ok(ValidationResult::Invalid(reason))) => { tracing::warn!( target: LOG_TARGET, - "Detected invalid candidate as an approval checker {:?}", - (candidate_hash, para_id), + ?reason, + ?candidate_hash, + ?para_id, + "Detected invalid candidate as an approval checker.", ); // TODO: issue dispute, but not for timeouts. // https://github.com/paritytech/polkadot/issues/2176 } - Ok(Err(_)) => return, // internal error. + Ok(Err(e)) => { + tracing::error!( + target: LOG_TARGET, + err = ?e, + "Failed to validate candidate due to internal error", + ); + + return + } } };