Commit 14ba286
committed
Merge bitcoin#23695: p2p: Always serialize local timestamp for version msg
fa1dc9b p2p: Always serialize local timestamp for version msg (MarcoFalke)
Pull request description:
Currently we serialize the local time when connecting to outbound connections and the "adjusted network" time when someone connects to us.
I presume the reason is to avoid a fingerprint in case the local time is misconfigured. However, the fingerprint still exits when:
* The local time goes out-of-sync after timedata is filled up, in which case the adjusted time is *not* adjusted. See comment in `src/timedata.cpp`. (In practise I expect no adjustment to happen after timedata is filled up by one entry more than half its size).
* The local time is off by more than 70 minutes. See `DEFAULT_MAX_TIME_ADJUSTMENT`. While there is a warning in this case, the warning might be missed by the node operator.
* The adjusted time is poisoned by an attacker. This is only a theoretical concern after commit e457513.
Using the adjusted time does help in a the case where the local time is off by a constant less than 70 minutes and the node quickly connects to 5 outbound peers to retrieve the adjusted time.
Still, I think using `GetAdjustedTime` here gives a false sense of security. It will be better for node operators to instead set the correct time.
ACKs for top commit:
naumenkogs:
ACK fa1dc9b
laanwj:
Code review ACK fa1dc9b
w0xlt:
crACK fa1dc9b
Tree-SHA512: 70a0f4ab3500e6ddcde291620e35273018cefd1d9e94b91ad333e360139ed18862718bb1a9854af2bf79990bf74b05d95492f77d0747c7b9bdd276c020116dcb1 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
| 389 | + | |
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| |||
1090 | 1090 | | |
1091 | 1091 | | |
1092 | 1092 | | |
1093 | | - | |
| 1093 | + | |
1094 | 1094 | | |
1095 | 1095 | | |
1096 | 1096 | | |
1097 | 1097 | | |
1098 | 1098 | | |
| 1099 | + | |
1099 | 1100 | | |
1100 | 1101 | | |
1101 | 1102 | | |
| |||
1167 | 1168 | | |
1168 | 1169 | | |
1169 | 1170 | | |
1170 | | - | |
| 1171 | + | |
1171 | 1172 | | |
1172 | 1173 | | |
1173 | 1174 | | |
| |||
2599 | 2600 | | |
2600 | 2601 | | |
2601 | 2602 | | |
2602 | | - | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
2603 | 2606 | | |
2604 | 2607 | | |
2605 | 2608 | | |
| |||
0 commit comments