Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More logs in is_potential_spam from dispute-coordinator #5252

Merged
merged 6 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions polkadot/node/core/dispute-coordinator/src/initialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,12 @@ impl Initialized {
}
}
for validator_index in new_state.votes().invalid.keys() {
gum::debug!(
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);
}
Expand All @@ -1375,6 +1381,13 @@ impl Initialized {
}
for (validator_index, (kind, _sig)) in new_state.votes().valid.raw() {
let is_backer = kind.is_backing();
gum::debug!(
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,
Expand Down
12 changes: 12 additions & 0 deletions polkadot/node/core/dispute-coordinator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
11 changes: 11 additions & 0 deletions prdoc/pr_5252.prdoc
Original file line number Diff line number Diff line change
@@ -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
Loading