Motivation
The recently merged private broadcast is a privacy feature, and users may share debug.log with support.
Unconditional LogInfo() messages that mention private broadcast and/or include (w)txids can leak sensitive context (e.g. which transactions a user originated).
Since it’s meant to be a private broadcast, we should minimize leaks.
It’s a best effort, it’s not invalidated by other logs possibly leaking identifiable information, those can be addressed separately.
We’re not promising that the logs won’t ever contain data that could be used against the user, but we should still try to minimize that data, especially for a feature that’s advertised as privacy-focused.
Follow up to #29415 (comment)
Changes
- Move private-broadcast event logs from
LogInfo()toLogDebug(BCLog::PRIVBROADCAST, ...), so they are only emitted when-debug=privatebroadcastwas explicitly provided. - Remove hardcoded
"[privatebroadcast]"log-string prefixes (category logging already adds the prefix). - Keep warning at the default log level for startup failures.
- Add an init log (not a warning since that would require excessive test framework updates) when any
-debugcategories are enabled that additional logs may contain privacy-sensitive information and should not be shared publicly. - Update a related startup arg (
-logips) to clarify that clarify that non-debug logs can also contain IP addresses.
Reproducer
The new warning can be checked with:
0./build/bin/bitcoind -printtoconsole=1 -stopatheight=1 -listen=0 -connect=0 | grep 'Debug logging is enabled' | wc -l
1 0
2./build/bin/bitcoind -printtoconsole=1 -stopatheight=1 -listen=0 -connect=0 -debug | grep 'Debug logging is enabled' | wc -l
3 1