-
Notifications
You must be signed in to change notification settings - Fork 407
Remove explicit print in lightning-net-tokio, reduce redundant block connection logging #1048
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
Remove explicit print in lightning-net-tokio, reduce redundant block connection logging #1048
Conversation
cf84655
to
0fa452e
Compare
Codecov Report
@@ Coverage Diff @@
## main #1048 +/- ##
==========================================
+ Coverage 90.96% 92.26% +1.30%
==========================================
Files 64 65 +1
Lines 32447 38813 +6366
==========================================
+ Hits 29515 35812 +6297
- Misses 2932 3001 +69
Continue to review full report at Codecov.
|
Addressed feedback and added one more commit to clean up docs. |
lightning/src/chain/chainmonitor.rs
Outdated
self.process_chain_data(header, txdata, |monitor, txdata| { | ||
monitor.transactions_confirmed( | ||
header, txdata, height, &*self.broadcaster, &*self.fee_estimator, &*self.logger) | ||
}); | ||
} | ||
|
||
fn transaction_unconfirmed(&self, txid: &Txid) { | ||
log_debug!(self.logger, "{} reorganized out of chain", txid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: s/{}/txid {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about Transaction {}
?
It isn't exactly a critical error situation when we disconnect a socket, so we shouldn't be printing to stderr, entirely bypassing user logging, when it happens. We do still print to stderr if we fail to write the first message to the socket, but this should never happen unless the user has a reasonably-configured system with at least one packet in bytes available for the socket buffer.
For users with many ChannelMonitors, we log a large volume per block simply because each ChannelMonitor lots several times per block. Instead, we move to log only once at the TRACE level per block call in ChannelMonitors, relying instead on a DEBUG level log in ChainMonitor before we call any ChannelMonitor functions. For most users, this will reduce redundant logging and also log at the DEBUG level for block events, which is appropriate. Fixes lightningdevkit#980.
77178c6
to
5d84704
Compare
Pushed a trivial change as suggested by val and squashed, diff from Jeff's ACK:
|
This is especially important for C or other language bindings clients as the `version` field may be exported as a `u8`.
5d84704
to
35d0b7a
Compare
Oops, had to tweak the last commit cause I misunderstood doclinks, diff is trivial, so will land after CI:
|
Fixes #980.