From 1e694b438c644c07e984048003767b272f268afb Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Tue, 7 Nov 2023 00:15:12 +0100 Subject: [PATCH] Add aura block+collation log Signed-off-by: Oliver Tale-Yazdi --- Cargo.lock | 1 + cumulus/client/consensus/aura/Cargo.toml | 1 + cumulus/client/consensus/aura/src/collator.rs | 11 +++++++++++ 3 files changed, 13 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 764d4ed01aa5..e45a72bc9a73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3588,6 +3588,7 @@ dependencies = [ name = "cumulus-client-consensus-aura" version = "0.1.0" dependencies = [ + "array-bytes 6.1.0", "async-trait", "cumulus-client-collator", "cumulus-client-consensus-common", diff --git a/cumulus/client/consensus/aura/Cargo.toml b/cumulus/client/consensus/aura/Cargo.toml index f440270c9822..8b7faf110946 100644 --- a/cumulus/client/consensus/aura/Cargo.toml +++ b/cumulus/client/consensus/aura/Cargo.toml @@ -12,6 +12,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "deriv futures = "0.3.28" tracing = "0.1.37" schnellru = "0.2.1" +array-bytes = "6.1.0" # Substrate sc-client-api = { path = "../../../../substrate/client/api" } diff --git a/cumulus/client/consensus/aura/src/collator.rs b/cumulus/client/consensus/aura/src/collator.rs index b00c3952e2bc..ada79dbdb05f 100644 --- a/cumulus/client/consensus/aura/src/collator.rs +++ b/cumulus/client/consensus/aura/src/collator.rs @@ -226,6 +226,17 @@ where block_data.storage_proof().encode().len() as f64 / 1024f64, ); + // Hacky print for debugging: + { + let block_data = block_data.using_encoded(|d| array_bytes::bytes2hex("0x", d)); + let collation_data = collation.using_encoded(|d| array_bytes::bytes2hex("0x", d)); + + tracing::trace!( + target: "aura-collation-dump", + "SCALE encoded parachain block: {:?}, SCALE encoded collation: {:?}", block_data, collation_data, + ); + } + if let MaybeCompressedPoV::Compressed(ref pov) = collation.proof_of_validity { tracing::info!( target: crate::LOG_TARGET,