From e78aaec3edb753d1f2fb59b4a95682e926267fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 18 Jan 2021 13:48:36 +0100 Subject: [PATCH] Add trace logging for the POV size (#294) * Add trace logging for the POV size * :( --- cumulus/collator/src/lib.rs | 8 ++++++++ cumulus/runtime/src/lib.rs | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/cumulus/collator/src/lib.rs b/cumulus/collator/src/lib.rs index 32c84f60a4..e6ee0fc8c3 100644 --- a/cumulus/collator/src/lib.rs +++ b/cumulus/collator/src/lib.rs @@ -573,6 +573,14 @@ where return None; } + trace!( + target: "cumulus-collator", + "PoV size {{ header: {}kb, extrinsics: {}kb, storage_proof: {}kb }}", + b.header().encode().len() as f64 / 1024f64, + b.extrinsics().encode().len() as f64 / 1024f64, + b.storage_proof().encode().len() as f64 / 1024f64, + ); + let collation = self.build_collation(b, block_hash, validation_data.persisted.block_number)?; let pov_hash = collation.proof_of_validity.hash(); diff --git a/cumulus/runtime/src/lib.rs b/cumulus/runtime/src/lib.rs index dd09995b73..334a3111e8 100644 --- a/cumulus/runtime/src/lib.rs +++ b/cumulus/runtime/src/lib.rs @@ -41,6 +41,7 @@ pub struct ParachainBlockData { } impl ParachainBlockData { + /// Creates a new instance of `Self`. pub fn new( header: ::Header, extrinsics: Vec<::Extrinsic>, @@ -67,4 +68,9 @@ impl ParachainBlockData { pub fn extrinsics(&self) -> &[B::Extrinsic] { &self.extrinsics } + + /// Returns the [`StorageProof`]. + pub fn storage_proof(&self) -> &StorageProof { + &self.storage_proof + } }