consensus: add debug span to TransactionVerifier

This commit is contained in:
Henry de Valence 2020-11-19 17:18:50 -08:00 committed by Deirdre Connolly
parent 2e4f4d8e87
commit d1ee7f263a
1 changed files with 4 additions and 1 deletions

View File

@ -9,8 +9,8 @@ use futures::{
stream::{FuturesUnordered, StreamExt}, stream::{FuturesUnordered, StreamExt},
FutureExt, FutureExt,
}; };
use tower::{Service, ServiceExt}; use tower::{Service, ServiceExt};
use tracing::Instrument;
use zebra_chain::{ use zebra_chain::{
parameters::NetworkUpgrade, parameters::NetworkUpgrade,
@ -88,7 +88,9 @@ where
let mut redjubjub_verifier = crate::primitives::redjubjub::VERIFIER.clone(); let mut redjubjub_verifier = crate::primitives::redjubjub::VERIFIER.clone();
let mut script_verifier = self.script_verifier.clone(); let mut script_verifier = self.script_verifier.clone();
let span = tracing::debug_span!("tx", hash = ?tx.hash());
async move { async move {
tracing::trace!(?tx);
match &*tx { match &*tx {
Transaction::V1 { .. } | Transaction::V2 { .. } | Transaction::V3 { .. } => { Transaction::V1 { .. } | Transaction::V2 { .. } | Transaction::V3 { .. } => {
Err(TransactionError::WrongVersion) Err(TransactionError::WrongVersion)
@ -210,6 +212,7 @@ where
} }
} }
} }
.instrument(span)
.boxed() .boxed()
} }
} }