Skip to content

Commit

Permalink
collator-protocol: fix wrong warning (paritytech#4909)
Browse files Browse the repository at this point in the history
* collator-protocol: fix wrong warning

* collator-protocol: add debug log
  • Loading branch information
ordian committed Feb 11, 2022
1 parent 45f21da commit c02c24d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions node/network/collator-protocol/src/collator_side/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,7 @@ where
// but can also include the previous group at
// rotation boundaries and considering forks
let mut group_validators = HashSet::new();
let mut maybe_core = None;

for relay_parent in state.view.iter().cloned() {
tracing::debug!(
Expand All @@ -970,7 +971,10 @@ where
// Determine our assigned core.
// If it is not scheduled then ignore the relay parent.
let (our_core, num_cores) = match determine_core(ctx, id, relay_parent).await? {
Some(core) => core,
Some(core) => {
maybe_core = Some(core);
core
},
None => continue,
};

Expand All @@ -987,7 +991,11 @@ where
let validators: Vec<_> = group_validators.into_iter().collect();
let no_one_is_assigned = validators.is_empty();
if no_one_is_assigned {
tracing::warn!(target: LOG_TARGET, "No validators assigned to our core.",);
if let Some(core) = maybe_core {
tracing::warn!(target: LOG_TARGET, ?core, "No validators assigned to our core.");
} else {
tracing::debug!(target: LOG_TARGET, "Core is occupied for all active leaves.");
}
return Ok(())
}
tracing::debug!(
Expand Down

0 comments on commit c02c24d

Please sign in to comment.