-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Improve debug.log output. #1311
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
Conversation
|
This makes non-trivial unrelated changes, for example it adds DoS() to node connecting with the old protocol version. |
|
Also, NAK on the general introduction of peer address to many messages. I'd be okay with logging the peer address of attack behavior or truly unusual exceptions, but logging by default the address of every peer we pull transactions from is not good and would create considerable incentives to compromise the security of nodes to use their logs for tracing transactions. |
|
logtimestamps was disabled by default for similar reasons that we don't always log peer address... major privacy implications. |
|
@gmaxwell Doesn't it make more sense to use the misbehaving function on a peer that you will always disconnect whenever it connects? Why not use it? Re peer addresses: these are changes anyone could do anyway, it is useful debug info, especially when trying to work out why blocks aren't downloading as fast as they could be, or for troubleshooting code to determine network lag in general or per peer. The debug.log is chopped regularly, so there is usually no more than a day or two of logs. Would it help perhaps, if instead of showing IP addresses, it just used a unique number instead? The IP address itself isn't important, but correlating which of several peers is. Re timestamps, @jgarzik - how is this a privacy implication? With timestamps off, the flushing of the wallet.dat is always timestamped, so a timestamp per line surely makes little difference, does it? |
|
The problem isn't that people can do it— it's the expectation that having this creates that going and collecting drives from bitcoin nodes will net you valuable information. Excessive logging endangers our users in several ways— beyond the lost privacy there is the risk of node operators being subject to frivolous fishing expedition investigations just to gather their logs, being hacked to use nodes to trace back nodes, etc. I don't believe I've ever wanted addresses in the logs of someone elses node I was troubleshooting, except on rpc authentication failures. (I have wanted addresses on my own nodes too, but I can— as you point out— enable that locally). The default logging behavior shouldn't reflect the logging we as developers user to build the software— it should reflect the logging we need to help users with mysterious behavior out in the field... and thats all. If not for that need we wouldn't have logging at all. |
|
On the misbehaving change— I wasn't complaining that it was a bad change I was complaining that you're mixing changes that require different kinds of review in your pull. The debug log entries are mostly cosmetic, assuming they aren't outright buggy and ignoring privacy issues the amount of harm changing them is at worst fairly minimal. Whereas a DoS change even if it works perfectly, could knock the whole network out— it requires a different kind of consideration. As far as it goes, I think it actually is a bad change: It means that when the old node gets upgraded he may be blacklisted by the whole network and not be able to get on for another 24 hours. Because it costs basically no more to hang up due to the blacklist vs hang up at the addr message I don't see that it saves us anything. |
|
Understood. Ok, so DoS to be removed. Timestamps off by default. How about changing it to an option to enable peer logging, that's off by default? Would that be ok then? |
|
@fanquake I just did a git log -p to check, but there's no mention of proxytoo in the entire log history, so I'm not quite sure what you're looking at. oh.. but on github it does show... I'll try pushing again. Ok, I've removed the ProxyToo mention now, thanks for spotting that. An inadvertent merge, not that this'll be enough to get it ACKed. I'll add a flag for the peer logging, as I agree with @gmaxwell that it reduces anonymousness unnecessarily in most situations. |
|
Ok, this now displays peers only if -logpeers is true, and that option isn't advertised unless the code is examined. Peers are shown for blocks, and for Dos(100) transactions only unless the option is selected. Timestamps are disabled by default. DoS for obsolete version also removed. Also, HandleSIGTERM now shows the signal number received. Thanks for the feedback @gmaxwell, hopefully this is a more agreeable edit now. |
|
This pull now contains no functional changes, only display changes. |
|
meh, this thing is still freakin' huge, touching all sorts of code. will post a few comments inline... |
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.
NAK, I like these unconditional
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.
Can use the same command line flag for these too...
Also, rename AlreadyAskedFor to AlreadyWaitingFor (makes more sense, as can cease waiting, but cannot stop having done a past thing.) Only display peer if fLogPeers is set, for privacy purposes. Conflicts: src/main.cpp
4059ed8 [GUI] Add address-label to sendconfirm-popup (random-zebra) Pull request description: Replaces bitcoin#1311 ACKs for top commit: furszy: Nice work, tested ACK 4059ed8 Fuzzbawls: ACK 4059ed8 Tree-SHA512: d2acfcc4cd5449e535081e5fcd8316f4fb0ab34d73b68bc88d9301afb7a384fc986e6b4cc0a5f02258dda0c1848f547e86f776232a3bc83dc38357e9cdc53836
This change improves debug.log output in the following ways:-
It reduces some duplicate output, and no longer needed output (which was originally added for testing).
It reduces the verbosity of output during initial block download, so rather than showing every block requested, it summarises. Once caught up, the previously level of verbosity is restored.
Information about the nodes connected are shown, and additional information about errors (particularly rejected transactions) are shown, with the offending peer alongside.
Recent changes which add many lines, such as address handling have been kept in as this code is still relatively new - I was tempted to comment out various lines such as the "tried...", etc.
Timestamps is now enabled by default. -nologtimestamps or logtimestamps=0 will disable this.
Also, renamed AlreadyAskedFor to AlreadyWaitingFor (makes more sense, as can cease waiting, but cannot stop having done a past thing.)