From 128421b5dd11ad85c9d1b0fc9da8c77aa9e48454 Mon Sep 17 00:00:00 2001 From: Andronik Date: Fri, 11 Feb 2022 18:31:50 +0100 Subject: [PATCH] collator-protocol: fix wrong warning (#4909) * collator-protocol: fix wrong warning * collator-protocol: add debug log --- .../collator-protocol/src/collator_side/mod.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/polkadot/node/network/collator-protocol/src/collator_side/mod.rs b/polkadot/node/network/collator-protocol/src/collator_side/mod.rs index 58d6898bc2..b1f954b4cc 100644 --- a/polkadot/node/network/collator-protocol/src/collator_side/mod.rs +++ b/polkadot/node/network/collator-protocol/src/collator_side/mod.rs @@ -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!( @@ -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, }; @@ -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!(