Commit f970cb3
committed
Merge bitcoin#34267: net: avoid unconditional
b39291f doc: fix `-logips` description to clarify that non-debug logs can also contain IP addresses (Lőrinc)
c7028d3 init: log that additional logs may contain privacy-sensitive information (Lőrinc)
31b771a net: move `privatebroadcast` logs to debug category (Lőrinc)
Pull request description:
### Motivation
The recently merged [private broadcast](bitcoin#29415) 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 [bitcoin#29415 (comment)](bitcoin#29415 (comment))
### Changes
* Move private-broadcast event logs from `LogInfo()` to `LogDebug(BCLog::PRIVBROADCAST, ...)`, so they are only emitted when `-debug=privatebroadcast` was 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 `-debug` categories 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:
```bash
./build/bin/bitcoind -printtoconsole=1 -stopatheight=1 -listen=0 -connect=0 | grep 'Debug logging is enabled' | wc -l
0
./build/bin/bitcoind -printtoconsole=1 -stopatheight=1 -listen=0 -connect=0 -debug | grep 'Debug logging is enabled' | wc -l
1
```
ACKs for top commit:
janb84:
re ACK b39291f
vasild:
ACK b39291f
andrewtoth:
ACK b39291f
frankomosh:
crACK b39291f .The approach and implementation look good. Moving private broadcast logs to debug only would effectively reduce privacy leaks for users sharing logs.
sedited:
ACK b39291f
Tree-SHA512: feca25ebe72a03948ba436e25f9a682947966c4c09627e8f20201ef3872ddbce1c636cd82f06be1afdc09cb80da305058667c0c2eaeadeb351311155325ea06fprivatebroadcast logging (+ warn for debug logs)3 files changed
+26
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3225 | 3225 | | |
3226 | 3226 | | |
3227 | 3227 | | |
3228 | | - | |
| 3228 | + | |
3229 | 3229 | | |
3230 | 3230 | | |
3231 | 3231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1653 | 1653 | | |
1654 | 1654 | | |
1655 | 1655 | | |
1656 | | - | |
1657 | | - | |
1658 | | - | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
1659 | 1659 | | |
1660 | 1660 | | |
1661 | 1661 | | |
| |||
3536 | 3536 | | |
3537 | 3537 | | |
3538 | 3538 | | |
3539 | | - | |
3540 | | - | |
3541 | | - | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
3542 | 3542 | | |
3543 | 3543 | | |
3544 | 3544 | | |
| |||
3677 | 3677 | | |
3678 | 3678 | | |
3679 | 3679 | | |
3680 | | - | |
3681 | | - | |
| 3680 | + | |
| 3681 | + | |
3682 | 3682 | | |
3683 | 3683 | | |
3684 | 3684 | | |
| |||
4203 | 4203 | | |
4204 | 4204 | | |
4205 | 4205 | | |
4206 | | - | |
4207 | | - | |
| 4206 | + | |
| 4207 | + | |
4208 | 4208 | | |
4209 | 4209 | | |
4210 | 4210 | | |
| |||
4220 | 4220 | | |
4221 | 4221 | | |
4222 | 4222 | | |
4223 | | - | |
4224 | | - | |
| 4223 | + | |
| 4224 | + | |
4225 | 4225 | | |
4226 | 4226 | | |
4227 | 4227 | | |
| |||
4465 | 4465 | | |
4466 | 4466 | | |
4467 | 4467 | | |
4468 | | - | |
4469 | | - | |
4470 | | - | |
| 4468 | + | |
| 4469 | + | |
| 4470 | + | |
4471 | 4471 | | |
4472 | 4472 | | |
4473 | 4473 | | |
| |||
4981 | 4981 | | |
4982 | 4982 | | |
4983 | 4983 | | |
4984 | | - | |
4985 | | - | |
| 4984 | + | |
| 4985 | + | |
4986 | 4986 | | |
4987 | 4987 | | |
4988 | 4988 | | |
| |||
5712 | 5712 | | |
5713 | 5713 | | |
5714 | 5714 | | |
5715 | | - | |
5716 | | - | |
| 5715 | + | |
| 5716 | + | |
5717 | 5717 | | |
5718 | 5718 | | |
5719 | 5719 | | |
| |||
0 commit comments