From b23799c3669633898eaf2306c6bd8724843f99eb Mon Sep 17 00:00:00 2001 From: Tsvetomir Dimitrov Date: Tue, 6 Aug 2024 10:22:29 +0300 Subject: [PATCH 1/4] More logs in `is_potential_spam` from `dispute-coordinator` --- polkadot/node/core/dispute-coordinator/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/polkadot/node/core/dispute-coordinator/src/lib.rs b/polkadot/node/core/dispute-coordinator/src/lib.rs index daa384b36ffb..34d9ddf3a97c 100644 --- a/polkadot/node/core/dispute-coordinator/src/lib.rs +++ b/polkadot/node/core/dispute-coordinator/src/lib.rs @@ -478,6 +478,18 @@ pub fn is_potential_spam( let all_invalid_votes_disabled = vote_state.invalid_votes_all_disabled(is_disabled); let ignore_disabled = !is_confirmed && all_invalid_votes_disabled; + gum::trace!( + target: LOG_TARGET, + ?candidate_hash, + ?is_disputed, + ?is_included, + ?is_backed, + ?is_confirmed, + ?all_invalid_votes_disabled, + ?ignore_disabled, + "Checking for potential spam" + ); + (is_disputed && !is_included && !is_backed && !is_confirmed) || ignore_disabled } From 8f5864bd1ba14b27a052f5db8356e592d687e9ad Mon Sep 17 00:00:00 2001 From: Tsvetomir Dimitrov Date: Tue, 6 Aug 2024 12:09:43 +0300 Subject: [PATCH 2/4] Log when validators are offchain disabled --- .../core/dispute-coordinator/src/initialized.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/polkadot/node/core/dispute-coordinator/src/initialized.rs b/polkadot/node/core/dispute-coordinator/src/initialized.rs index 5f86da87f21c..fa046935c590 100644 --- a/polkadot/node/core/dispute-coordinator/src/initialized.rs +++ b/polkadot/node/core/dispute-coordinator/src/initialized.rs @@ -1351,6 +1351,12 @@ impl Initialized { } } for validator_index in new_state.votes().invalid.keys() { + gum::trace!( + target: LOG_TARGET, + ?candidate_hash, + ?validator_index, + "Disabled offchain for voting invalid against a valid candidate", + ); self.offchain_disabled_validators .insert_against_valid(session, *validator_index); } @@ -1375,6 +1381,13 @@ impl Initialized { } for (validator_index, (kind, _sig)) in new_state.votes().valid.raw() { let is_backer = kind.is_backing(); + gum::trace!( + target: LOG_TARGET, + ?candidate_hash, + ?validator_index, + ?is_backer, + "Disabled offchain for voting valid for an invalid candidate", + ); self.offchain_disabled_validators.insert_for_invalid( session, *validator_index, From fab88a32a510b6b531bb6767f28f4a433c5f7d40 Mon Sep 17 00:00:00 2001 From: Tsvetomir Dimitrov Date: Tue, 6 Aug 2024 12:37:09 +0300 Subject: [PATCH 3/4] Bump offchain disabling logs to `DEBUG` --- polkadot/node/core/dispute-coordinator/src/initialized.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polkadot/node/core/dispute-coordinator/src/initialized.rs b/polkadot/node/core/dispute-coordinator/src/initialized.rs index fa046935c590..5096fe5e6891 100644 --- a/polkadot/node/core/dispute-coordinator/src/initialized.rs +++ b/polkadot/node/core/dispute-coordinator/src/initialized.rs @@ -1351,7 +1351,7 @@ impl Initialized { } } for validator_index in new_state.votes().invalid.keys() { - gum::trace!( + gum::debug!( target: LOG_TARGET, ?candidate_hash, ?validator_index, @@ -1381,7 +1381,7 @@ impl Initialized { } for (validator_index, (kind, _sig)) in new_state.votes().valid.raw() { let is_backer = kind.is_backing(); - gum::trace!( + gum::debug!( target: LOG_TARGET, ?candidate_hash, ?validator_index, From 531c2c53a1e2439d2ac625fbba5b69ae4d6d7d7d Mon Sep 17 00:00:00 2001 From: Tsvetomir Dimitrov Date: Fri, 16 Aug 2024 09:29:41 +0300 Subject: [PATCH 4/4] Add PRdoc --- prdoc/pr_5252.prdoc | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 prdoc/pr_5252.prdoc diff --git a/prdoc/pr_5252.prdoc b/prdoc/pr_5252.prdoc new file mode 100644 index 000000000000..fd4454ac3b9d --- /dev/null +++ b/prdoc/pr_5252.prdoc @@ -0,0 +1,11 @@ +title: Additional logging in `dispute-coordinator` subsystem + +doc: + - audience: Node Dev + description: | + Additional logging in `dispute-coordinator` subsystem tracing the list of offchain disabled + validators and the reason why an import statement is considered spam. + +crates: + - name: polkadot-node-core-dispute-coordinator + bump: patch \ No newline at end of file