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

chore(tree, engine, prune, stages, storage): improve logs #4790

Merged
merged 4 commits into from
Sep 26, 2023

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Sep 26, 2023

  1. Move all tracing::instrument spans of blockchain tree to TRACE level
  2. Add chain canonicalization event and log it with INFO level in bin/reth/src/node/events.rs instead of blockchain tree
  3. Add pruner events and log them with INFO level in bin/reth/src/node/events.rs
  4. Move Execution stage and EVM time logs to DEBUG level

@shekhirin shekhirin added C-enhancement New feature or request A-observability Related to tracing, metrics, logs and other observability tools labels Sep 26, 2023
@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Merging #4790 (9618f43) into main (faf9a89) will decrease coverage by 0.14%.
Report is 12 commits behind head on main.
The diff coverage is 14.43%.

Impacted file tree graph

Files Coverage Δ
crates/consensus/beacon/src/engine/event.rs 0.00% <ø> (ø)
crates/blockchain-tree/src/blockchain_tree.rs 83.61% <80.00%> (ø)
crates/prune/src/event.rs 0.00% <0.00%> (ø)
crates/storage/provider/src/traits/executor.rs 30.76% <25.00%> (-5.60%) ⬇️
crates/net/network/src/session/active.rs 83.89% <16.66%> (-1.02%) ⬇️
bin/reth/src/node/mod.rs 26.00% <0.00%> (-0.11%) ⬇️
crates/stages/src/stages/execution.rs 92.38% <12.50%> (-0.82%) ⬇️
crates/prune/src/pruner.rs 77.97% <7.69%> (-0.80%) ⬇️
bin/reth/src/node/events.rs 11.41% <0.00%> (-1.09%) ⬇️
crates/consensus/beacon/src/engine/mod.rs 72.96% <17.64%> (-1.15%) ⬇️

... and 14 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.51% <1.03%> (+<0.01%) ⬆️
unit-tests 63.27% <13.40%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 32.11% <0.00%> (-0.12%) ⬇️
blockchain tree 83.69% <80.00%> (ø)
pipeline 88.45% <12.50%> (-0.09%) ⬇️
storage (db) 73.47% <25.00%> (-0.02%) ⬇️
trie 94.48% <ø> (ø)
txpool 49.51% <ø> (ø)
networking 76.64% <16.66%> (-0.29%) ⬇️
rpc 57.70% <ø> (ø)
consensus 62.47% <17.64%> (-0.37%) ⬇️
revm 28.33% <ø> (ø)
payload builder 8.20% <ø> (ø)
primitives 86.38% <ø> (-0.14%) ⬇️

@shekhirin shekhirin marked this pull request as ready for review September 26, 2023 12:53
Copy link
Member

@rkrasiuk rkrasiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -127,6 +128,14 @@ impl NodeState {

info!(number=block.number, hash=?block.hash, "Block added to canonical chain");
}
BeaconConsensusEngineEvent::ChainCanonicalized(outcome, elapsed) => match outcome {
CanonicalOutcome::AlreadyCanonical { header } => {
info!(number=header.number, header=?header.hash, ?elapsed, "Chain is already canonical");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be a warning?

Copy link
Collaborator Author

@shekhirin shekhirin Sep 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, what are the cases when chain is already canonical? It doesn't sound like a problem that we need to warn the user about for me

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this commonly happens on start up and could also happen if there are more CL connected

info is fine here imo

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd prefer downgrading it to trace/debug level, but no strong opinion on this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree on debug level, because it might be seem like something's wrong while in reality it was a no-op

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable to me

@@ -127,6 +128,14 @@ impl NodeState {

info!(number=block.number, hash=?block.hash, "Block added to canonical chain");
}
BeaconConsensusEngineEvent::ChainCanonicalized(outcome, elapsed) => match outcome {
CanonicalOutcome::AlreadyCanonical { header } => {
info!(number=header.number, header=?header.hash, ?elapsed, "Chain is already canonical");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this commonly happens on start up and could also happen if there are more CL connected

info is fine here imo

@shekhirin shekhirin added this pull request to the merge queue Sep 26, 2023
Merged via the queue into main with commit 5e01a21 Sep 26, 2023
24 checks passed
@shekhirin shekhirin deleted the alexey/improve-logs branch September 26, 2023 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-observability Related to tracing, metrics, logs and other observability tools C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants