consensus: add traces to block verifier

This commit is contained in:
Henry de Valence 2020-11-20 15:17:36 -08:00 committed by teor
parent 196dc6369c
commit aa45bf2b58
1 changed files with 4 additions and 2 deletions

View File

@ -120,10 +120,9 @@ where
// TODO(jlusby): Error = Report, handle errors from state_service. // TODO(jlusby): Error = Report, handle errors from state_service.
async move { async move {
tracing::trace!("beginning block verification");
let hash = block.hash(); let hash = block.hash();
// Check that this block is actually a new block. // Check that this block is actually a new block.
tracing::trace!("checking that block is not already in state");
match state_service match state_service
.ready_and() .ready_and()
.await .await
@ -139,6 +138,7 @@ where
_ => unreachable!("wrong response to Request::Depth"), _ => unreachable!("wrong response to Request::Depth"),
} }
tracing::trace!("performing block checks");
let height = block let height = block
.coinbase_height() .coinbase_height()
.ok_or(BlockError::MissingHeight(hash))?; .ok_or(BlockError::MissingHeight(hash))?;
@ -174,9 +174,11 @@ where
.call(req); .call(req);
async_checks.push(rsp); async_checks.push(rsp);
} }
tracing::trace!(len = async_checks.len(), "built async tx checks");
use futures::StreamExt; use futures::StreamExt;
while let Some(result) = async_checks.next().await { while let Some(result) = async_checks.next().await {
tracing::trace!(?result, remaining = async_checks.len());
result.map_err(VerifyBlockError::Transaction)?; result.map_err(VerifyBlockError::Transaction)?;
} }