Skip to content

chore(chain,wire): lower three per-message debug logs to trace - #20

Open
lorenzolfm wants to merge 1 commit into
masterfrom
chore/debug-to-trace
Open

lorenzolfm wants to merge 1 commit into
masterfrom
chore/debug-to-trace

Conversation

@lorenzolfm

@lorenzolfm lorenzolfm commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Description and Notes

Part of getfloresta/floresta#167 ("[tracking-issue] Audit logging and identify improvements").

This PR only changes the level of three debug! call sites to trace!. They fire once per header or once per P2P message, and they made up nearly all --debug output:

message site lines, 4 min fresh signet --debug, before
Header builds on top of our best chain crates/floresta-chain/src/pruned_utreexo/chain_state.rs 330,127
Received {cmd} from peer N / Writing {cmd} to peer N crates/floresta-wire/src/p2p_wire/peer.rs 828
Handling node request: {request:?} (prints the full GetHeaders locator) crates/floresta-wire/src/p2p_wire/peer.rs 229

After this change, --debug leaves the connection lifecycle (attempts, transport, timeouts, address exchange) readable instead of buried under header sync.

Not in this PR (possible follow-ups): adding height/hash to the header line, logging just the command name instead of {request:?}, and changing the default --debug filter directive.

How to verify the changes you have done?

Fresh signet run, 4 minutes each, same machine. Header sync completes (height 330k) in all runs.

florestad --network signet --data-dir <fresh> --log-to-file --debug
total lines moved messages
master, --debug 331,937 331,184
this PR, --debug 727 0
this PR, RUST_LOG=debug,floresta_chain=trace,floresta_wire=trace + --debug 331,862 all present at TRACE

cargo +nightly fmt --check, cargo hack clippy --feature-powerset --all-targets -- -D warnings on floresta-chain and floresta-wire, and cargo test -p floresta-chain -p floresta-wire pass.

`Header builds on top of our best chain` fires once per header, and the
per-P2P-message `Received`/`Writing` lines and `Handling node request`
(which Debug-prints the whole GetHeaders locator) fire once per message.
Together they were 99% of `--debug` output during signet header sync.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant