Skip to content

Commit

Permalink
debug messages adjusted
Browse files Browse the repository at this point in the history
  • Loading branch information
michalkucharczyk committed Jan 9, 2025
1 parent 5d59731 commit 4df40da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,14 @@ where
let stream_map = futures::stream::unfold(ctx, |mut ctx| async move {
loop {
if let Some(dropped) = ctx.get_pending_dropped_transaction() {
debug!("dropped_watcher: sending out (pending): {dropped:?}");
trace!("dropped_watcher: sending out (pending): {dropped:?}");
return Some((dropped, ctx));
}
tokio::select! {
biased;
Some(event) = next_event(&mut ctx.stream_map) => {
if let Some(dropped) = ctx.handle_event(event.0, event.1) {
debug!("dropped_watcher: sending out: {dropped:?}");
trace!("dropped_watcher: sending out: {dropped:?}");
return Some((dropped, ctx));
}
},
Expand Down
9 changes: 5 additions & 4 deletions substrate/client/transaction-pool/src/graph/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ impl<B: ChainApi> Pool<B> {
let mut validated_counter: usize = 0;

let mut future_tags = Vec::new();
let now = Instant::now();
for (extrinsic, in_pool_tags) in all {
match in_pool_tags {
// reuse the tags for extrinsics that were found in the pool
Expand Down Expand Up @@ -341,7 +342,7 @@ impl<B: ChainApi> Pool<B> {
}
}

log::trace!(target: LOG_TARGET,"prune: validated_counter:{validated_counter}");
log::debug!(target: LOG_TARGET,"prune: validated_counter:{validated_counter}, took:{:?}", now.elapsed());

self.prune_tags(at, future_tags, in_pool_hashes).await
}
Expand Down Expand Up @@ -373,6 +374,7 @@ impl<B: ChainApi> Pool<B> {
tags: impl IntoIterator<Item = Tag>,
known_imported_hashes: impl IntoIterator<Item = ExtrinsicHash<B>> + Clone,
) {
let now = Instant::now();
log::trace!(target: LOG_TARGET, "Pruning at {:?}", at);
// Prune all transactions that provide given tags
let prune_status = self.validated_pool.prune_tags(tags);
Expand All @@ -391,9 +393,8 @@ impl<B: ChainApi> Pool<B> {
let reverified_transactions =
self.verify(at, pruned_transactions, CheckBannedBeforeVerify::Yes).await;

let pruned_hashes = reverified_transactions.keys().map(Clone::clone).collect();

log::trace!(target: LOG_TARGET, "Pruning at {:?}. Resubmitting transactions: {}", &at, reverified_transactions.len());
let pruned_hashes = reverified_transactions.keys().map(Clone::clone).collect::<Vec<_>>();
log::debug!(target: LOG_TARGET, "Pruning at {:?}. Resubmitting transactions: {}, reverification took: {:?}", &at, reverified_transactions.len(), now.elapsed());
log_xt_trace!(data: tuple, target: LOG_TARGET, &reverified_transactions, "[{:?}] Resubmitting transaction: {:?}");

// And finally - submit reverified transactions back to the pool
Expand Down

0 comments on commit 4df40da

Please sign in to comment.