Improve diagnostics for the ValidationOutputs checker / inclusion (#1926)

* Improve diagnostics for acceptance criteria failures during inclusion

* Initialize the runtime logger just before logging during inclusion

* Formatting suggestions

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Missed one suggestion

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Sergei Shulepov
2020-11-11 11:34:52 +01:00
committed by GitHub
parent fb6b94eaf0
commit dd4d8e24e0
8 changed files with 402 additions and 206 deletions
@@ -223,21 +223,7 @@ pub fn check_validation_outputs<T: initializer::Trait>(
para_id: ParaId,
outputs: primitives::v1::ValidationOutputs,
) -> bool {
match <inclusion::Module<T>>::check_validation_outputs(para_id, outputs) {
Ok(()) => true,
Err(e) => {
frame_support::debug::RuntimeLogger::init();
let err: &'static str = e.into();
log::debug!(
target: "candidate_validation",
"Validation outputs checking for parachain `{}` failed: {}",
u32::from(para_id),
err,
);
false
}
}
<inclusion::Module<T>>::check_validation_outputs(para_id, outputs)
}
/// Implementation for the `session_index_for_child` function of the runtime API.