Skip to content

Commit

Permalink
Fix: allowance of participation in dispute (#2240)
Browse files Browse the repository at this point in the history
* fix: allowance of participation in dispute

Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>

* fix: review issue

Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>

---------

Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
  • Loading branch information
xDimon authored Oct 14, 2024
1 parent cfbf404 commit 070f692
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions core/dispute_coordinator/impl/dispute_coordinator_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1463,12 +1463,10 @@ namespace kagome::dispute {
// - `is_included` lands in prioritized queue
// - `is_confirmed` | `is_backed` lands in the best effort queue
// We don't participate in disputes escalated by disabled validators only.
// We don't participate in disputes on finalized candidates.
// see: {polkadot}/node/core/dispute-coordinator/src/initialized.rs:907
// see:
// https://github.com/paritytech/polkadot-sdk/blob/b16237ad6f019667a59b0e3e726f6ac20e2d0a1c/polkadot/node/core/dispute-coordinator/src/initialized.rs#L1184

if (own_vote_missing //
and is_disputed and not is_postponed //
and allow_participation) {
if (own_vote_missing and is_disputed and allow_participation) {
auto priority = static_cast<ParticipationPriority>(is_included);

auto &receipt = new_state.votes.candidate_receipt;
Expand All @@ -1479,11 +1477,26 @@ namespace kagome::dispute {

auto res = participation_->queue_participation(priority, request);
if (res.has_error()) {
SL_ERROR(log_, "Error of participation: {}", res.error());
SL_ERROR(log_,
"Error of participation for candidate "
"(session={}, candidate={}): {}",
session,
candidate_hash,
res.error());
} else {
SL_TRACE(log_,
"Trying to participate for candidate "
"(session={}, candidate={})",
session,
candidate_hash);
}

} else {
SL_DEBUG(log_, "Will not queue participation for candidate");
SL_DEBUG(log_,
"Will not queue participation for candidate "
"(session={}, candidate={})",
session,
candidate_hash);
}

// Also send any already existing approval vote on new disputes:
Expand Down

0 comments on commit 070f692

Please sign in to comment.