Improve logging for transaction pool (#6152)

* improve logging

* Update client/transaction-pool/graph/src/validated_pool.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* address review and make uniform

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
Nikolay Volf
2020-05-27 18:11:36 +03:00
committed by GitHub
parent 4b3f134b4a
commit 537993a13d
3 changed files with 30 additions and 17 deletions
@@ -178,7 +178,7 @@ impl<Api: ChainApi> RevalidationWorker<Api> {
for ext_hash in transactions {
// we don't add something that already scheduled for revalidation
if self.members.contains_key(&ext_hash) {
log::debug!(
log::trace!(
target: "txpool",
"[{:?}] Skipped adding for revalidation: Already there.",
ext_hash,
@@ -245,6 +245,16 @@ impl<Api: ChainApi> RevalidationWorker<Api> {
Some(worker_payload) => {
this.best_block = worker_payload.at;
this.push(worker_payload);
if this.members.len() > 0 {
log::debug!(
target: "txpool",
"Updated revalidation queue at {}. Transactions: {:?}",
this.best_block,
this.members,
);
}
continue;
},
// R.I.P. worker!
@@ -326,7 +336,7 @@ where
/// revalidation is actually done.
pub async fn revalidate_later(&self, at: NumberFor<Api>, transactions: Vec<ExHash<Api>>) {
if transactions.len() > 0 {
log::debug!(target: "txpool", "Added {} transactions to revalidation queue", transactions.len());
log::debug!(target: "txpool", "Sent {} transactions to revalidation queue", transactions.len());
}
if let Some(ref to_worker) = self.background {