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

Additional logging for dispute-coordinator #1494

Merged
merged 2 commits into from
Sep 12, 2023
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
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