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

app: more logs for mining, wallet updates, net #16

Merged
merged 16 commits into from
Jan 29, 2025
Merged

Conversation

torkelrogstad
Copy link
Contributor

No description provided.

@torkelrogstad torkelrogstad force-pushed the 2025-01-24-mine-logs branch 3 times, most recently from 1aa232b to de87372 Compare January 25, 2025 17:42
@torkelrogstad torkelrogstad changed the title app: more logs for mining + wallet updates app: more logs for mining, wallet updates, net Jan 25, 2025
Copy link
Collaborator

@Ash-L2L Ash-L2L left a comment

Choose a reason for hiding this comment

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

Mostly LGTM, requested some style/code quality changes

app/app.rs Show resolved Hide resolved
tracing::debug!(%bmm_txid, "mine: confirming BMM...");
if let Some((main_hash, header, body)) =
miner_write.confirm_bmm().await?
{
tracing::debug!(
"mine: confirmed BMM, submitting block {}",
header.hash()
%main_hash, side_hash = %header.hash(), "mine: confirmed BMM, submitting block",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: There is no need to prefix logs with the function name. The logger should do that automatically. You can use tracing::instrument with skip_all if you want to construct a new span specific to the function.

app/app.rs Show resolved Hide resolved
app/app.rs Show resolved Hide resolved
app/app.rs Outdated Show resolved Hide resolved
lib/node/net_task.rs Show resolved Hide resolved
lib/node/net_task.rs Show resolved Hide resolved
lib/node/net_task.rs Show resolved Hide resolved
lib/node/net_task.rs Outdated Show resolved Hide resolved
lib/node/net_task.rs Show resolved Hide resolved
@torkelrogstad
Copy link
Contributor Author

Re. all the whitespace: we probably look at this differently. I think whitespace is a good way of logically chunking groups of code lines that "belong together", and avoiding whitespace quickly leads to walls of text that's tiring to read. I'd be fine with a strict standard for whitespace, if it's something we can automate through cargo fmt or similar. Otherwise we'll probably just go back and forth on individual styles, haha

@torkelrogstad
Copy link
Contributor Author

Re. the log lines including function names: that's not the case when I'm running locally. Is that perhaps something that needs to be configured?

Providing example logs here

2025-01-28T22:01:08.416978Z  INFO thunder_app:115: Running in headless mode
2025-01-28T22:01:08.417040Z TRACE thunder_app::app:49: starting wallet update
2025-01-28T22:01:08.417233Z DEBUG thunder_app::app:61: finished wallet update
2025-01-28T22:01:08.417241Z  INFO thunder_app::rpc_server:215: RPC server listening on 127.0.0.1:6009
2025-01-28T22:01:08.417394Z DEBUG thunder::node::net_task:631: starting net task
2025-01-28T22:01:08.417512Z DEBUG thunder::net:272: accept incoming: listening for connections on `0.0.0.0:4009`

@Ash-L2L Ash-L2L merged commit 98e8aa7 into master Jan 29, 2025
13 checks passed
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.

2 participants