diff --git a/substrate/client/transaction-pool/src/graph/pool.rs b/substrate/client/transaction-pool/src/graph/pool.rs index 96cbeb9b80..8e3570d1db 100644 --- a/substrate/client/transaction-pool/src/graph/pool.rs +++ b/substrate/client/transaction-pool/src/graph/pool.rs @@ -271,14 +271,23 @@ impl Pool { // if it's not found in the pool query the runtime at parent block // to get validity info and tags that the extrinsic provides. None => { - let validity = self - .validated_pool - .api() - .validate_transaction(parent, TransactionSource::InBlock, extrinsic.clone()) - .await; + // Avoid validating block txs if the pool is empty + if !self.validated_pool.status().is_empty() { + let validity = self + .validated_pool + .api() + .validate_transaction( + parent, + TransactionSource::InBlock, + extrinsic.clone(), + ) + .await; - if let Ok(Ok(validity)) = validity { - future_tags.extend(validity.provides); + if let Ok(Ok(validity)) = validity { + future_tags.extend(validity.provides); + } + } else { + log::trace!(target: "txpool", "txpool is empty, skipping validation for block {at:?}"); } }, }