From bb46f8ac30c81c9ffec15d28fe5222ca05a91711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva?= <123550+andresilva@users.noreply.github.com> Date: Mon, 18 Jan 2021 21:27:17 +0000 Subject: [PATCH] babe: log block and slot number on verification (#7920) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * babe: log block and slot number on verification * babe: debug log formatting Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> --- .../client/consensus/babe/src/verification.rs | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/substrate/client/consensus/babe/src/verification.rs b/substrate/client/consensus/babe/src/verification.rs index 47c4da0834d..5d657b8b971 100644 --- a/substrate/client/consensus/babe/src/verification.rs +++ b/substrate/client/consensus/babe/src/verification.rs @@ -95,7 +95,11 @@ pub(super) fn check_header<B: BlockT + Sized>( match &pre_digest { PreDigest::Primary(primary) => { - debug!(target: "babe", "Verifying Primary block"); + debug!(target: "babe", + "Verifying primary block #{} at slot: {}", + header.number(), + primary.slot_number, + ); check_primary_header::<B>( pre_hash, @@ -106,7 +110,12 @@ pub(super) fn check_header<B: BlockT + Sized>( )?; }, PreDigest::SecondaryPlain(secondary) if epoch.config.allowed_slots.is_secondary_plain_slots_allowed() => { - debug!(target: "babe", "Verifying Secondary plain block"); + debug!(target: "babe", + "Verifying secondary plain block #{} at slot: {}", + header.number(), + secondary.slot_number, + ); + check_secondary_plain_header::<B>( pre_hash, secondary, @@ -115,7 +124,12 @@ pub(super) fn check_header<B: BlockT + Sized>( )?; }, PreDigest::SecondaryVRF(secondary) if epoch.config.allowed_slots.is_secondary_vrf_slots_allowed() => { - debug!(target: "babe", "Verifying Secondary VRF block"); + debug!(target: "babe", + "Verifying secondary VRF block #{} at slot: {}", + header.number(), + secondary.slot_number, + ); + check_secondary_vrf_header::<B>( pre_hash, secondary, -- GitLab