Skip to content

Commit

Permalink
Additional logging for dispute-coordinator (#1494)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdimitrov authored Sep 12, 2023
1 parent 77c867b commit d081702
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
7 changes: 7 additions & 0 deletions polkadot/node/core/dispute-coordinator/src/initialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@ impl Initialized {
self.participation.process_active_leaves_update(ctx, &update).await?;

if let Some(new_leaf) = update.activated {
gum::trace!(
target: LOG_TARGET,
leaf_hash = ?new_leaf.hash,
block_number = new_leaf.number,
"Processing ActivatedLeaf"
);

let session_idx =
self.runtime_info.get_session_index_for_child(ctx.sender(), new_leaf.hash).await;

Expand Down
19 changes: 19 additions & 0 deletions polkadot/node/core/dispute-coordinator/src/participation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,13 @@ impl Participation {
req: ParticipationRequest,
recent_head: Hash,
) -> FatalResult<()> {
gum::trace!(
target: LOG_TARGET,
candidate_hash = ?req.candidate_hash(),
session = req.session(),
"Forking participation"
);

let participation_timer = self.metrics.time_participation();
if self.running_participations.insert(*req.candidate_hash()) {
let sender = ctx.sender().clone();
Expand Down Expand Up @@ -314,12 +321,24 @@ async fn participate(
},
Ok(Ok(data)) => data,
Ok(Err(RecoveryError::Invalid)) => {
gum::debug!(
target: LOG_TARGET,
candidate_hash = ?req.candidate_hash(),
session = req.session(),
"Invalid availability data during participation"
);
// the available data was recovered but it is invalid, therefore we'll
// vote negatively for the candidate dispute
send_result(&mut result_sender, req, ParticipationOutcome::Invalid).await;
return
},
Ok(Err(RecoveryError::Unavailable)) | Ok(Err(RecoveryError::ChannelClosed)) => {
gum::debug!(
target: LOG_TARGET,
candidate_hash = ?req.candidate_hash(),
session = req.session(),
"Can't fetch availability data in participation"
);
send_result(&mut result_sender, req, ParticipationOutcome::Unavailable).await;
return
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ impl Queues {
match self.priority.entry(comparator) {
Entry::Occupied(_) => req.discard_timer(),
Entry::Vacant(vac) => {
gum::trace!(
target: LOG_TARGET,
candidate_hash = ?req.candidate_hash(),
"Added to priority participation queue"
);
vac.insert(req);
},
}
Expand All @@ -295,6 +300,11 @@ impl Queues {
match self.best_effort.entry(comparator) {
Entry::Occupied(_) => req.discard_timer(),
Entry::Vacant(vac) => {
gum::trace!(
target: LOG_TARGET,
candidate_hash = ?req.candidate_hash(),
"Added to best effort participation queue"
);
vac.insert(req);
},
}
Expand Down

0 comments on commit d081702

Please sign in to comment.