Skip to content

Commit

Permalink
don't initialize status for spam disputes
Browse files Browse the repository at this point in the history
  • Loading branch information
ordian committed Feb 16, 2024
1 parent 6d3d3c2 commit d7ad6ab
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions polkadot/node/core/dispute-coordinator/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,12 @@ impl CandidateVoteState<CandidateVotes> {

let supermajority_threshold = polkadot_primitives::supermajority_threshold(n_validators);

// We have a dispute, if we have votes on both sides:
let is_disputed = !votes.invalid.is_empty() && !votes.valid.raw().is_empty();
// We have a dispute, if we have votes on both sides from non-disabled validators:
let all_invalid_votes_disabled =
votes.invalid.keys().all(|i| env.disabled_indices().contains(i));
let is_disputed = !all_invalid_votes_disabled &&
!votes.invalid.is_empty() &&
!votes.valid.raw().is_empty();

let (dispute_status, byzantine_threshold_against) = if is_disputed {
let mut status = DisputeStatus::active();
Expand Down

0 comments on commit d7ad6ab

Please sign in to comment.