From 5dc01b3de6dc11f0340f0332e810e535e201d5a1 Mon Sep 17 00:00:00 2001 From: Antioch Peverell Date: Tue, 19 Feb 2019 13:22:26 +0000 Subject: [PATCH] debug how long it takes to verify the kernel sums for fast sync (#2602) --- chain/src/txhashset/txhashset.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chain/src/txhashset/txhashset.rs b/chain/src/txhashset/txhashset.rs index 9be78cd27..4805b2c33 100644 --- a/chain/src/txhashset/txhashset.rs +++ b/chain/src/txhashset/txhashset.rs @@ -1204,11 +1204,19 @@ impl<'a> Extension<'a> { /// from the respective MMRs. /// For a significantly faster way of validating full kernel sums see BlockSums. pub fn validate_kernel_sums(&self) -> Result<((Commitment, Commitment)), Error> { + let now = Instant::now(); + let genesis = self.get_header_by_height(0)?; let (utxo_sum, kernel_sum) = self.verify_kernel_sums( self.header.total_overage(genesis.kernel_mmr_size > 0), self.header.total_kernel_offset(), )?; + + debug!( + "txhashset: validated total kernel sums, took {}s", + now.elapsed().as_secs(), + ); + Ok((utxo_sum, kernel_sum)) }