Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
address review nits
Browse files Browse the repository at this point in the history
  • Loading branch information
ordian committed Jan 16, 2023
1 parent 9d3fb1c commit b8de8d6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions runtime/parachains/src/disputes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,13 @@ struct DisputeStateImporter<BlockNumber> {
new_participants: bitvec::vec::BitVec<u8, BitOrderLsb0>,
pre_flags: DisputeStateFlags,
pre_state: DisputeState<BlockNumber>,
// The list of backing votes before importing the batch of votes. This field should be
// initialized as empty on the first import of the dispute votes and should remain non-empty
// afterwards.
//
// If a dispute has concluded and the candidate was found invalid, we may want to slash as many
// backers as possible. This list allows us to slash these backers once their votes have been
// imported post dispute conclusion.
pre_backers: BTreeSet<ValidatorIndex>,
}

Expand Down Expand Up @@ -784,7 +791,7 @@ impl<BlockNumber: Clone> DisputeStateImporter<BlockNumber> {

let pre_post_contains = |flags| (pre_flags.contains(flags), post_flags.contains(flags));

// 2. Check for FOR supermajority.
// 1. Check for FOR supermajority.
let slash_against = match pre_post_contains(DisputeStateFlags::FOR_SUPERMAJORITY) {
(false, true) => {
if self.state.concluded_at.is_none() {
Expand Down Expand Up @@ -814,7 +821,7 @@ impl<BlockNumber: Clone> DisputeStateImporter<BlockNumber> {
(false, false) => Vec::new(),
};

// 3. Check for AGAINST supermajority.
// 2. Check for AGAINST supermajority.
let slash_for = match pre_post_contains(DisputeStateFlags::AGAINST_SUPERMAJORITY) {
(false, true) => {
if self.state.concluded_at.is_none() {
Expand Down

0 comments on commit b8de8d6

Please sign in to comment.