Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
add tracing to assignment criteria (#3886)
Browse files Browse the repository at this point in the history
* add tracing to assignment criteria

* fmt
  • Loading branch information
rphmeier authored Sep 22, 2021
1 parent e9c4bc1 commit 90e8929
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion node/core/approval-voting/src/criteria.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,14 @@ pub(crate) fn compute_assignments(
config.assignment_keys.is_empty() ||
config.validator_groups.is_empty()
{
tracing::trace!(
target: LOG_TARGET,
n_cores = config.n_cores,
has_assignment_keys = !config.assignment_keys.is_empty(),
has_validator_groups = !config.validator_groups.is_empty(),
"Not producing assignments because config is degenerate",
);

return HashMap::new()
}

Expand All @@ -254,7 +262,10 @@ pub(crate) fn compute_assignments(
});

match key {
None => return Default::default(),
None => {
tracing::trace!(target: LOG_TARGET, "No assignment key");
return Default::default()
},
Some(k) => k,
}
};
Expand All @@ -266,6 +277,12 @@ pub(crate) fn compute_assignments(
.map(|(c_hash, core, _)| (c_hash, core))
.collect::<Vec<_>>();

tracing::trace!(
target: LOG_TARGET,
assignable_cores = leaving_cores.len(),
"Assigning to candidates from different backing groups"
);

let assignments_key: &sp_application_crypto::sr25519::Pair = assignments_key.as_ref();
let assignments_key: &schnorrkel::Keypair = assignments_key.as_ref();

Expand Down

0 comments on commit 90e8929

Please sign in to comment.