HomePhabricator

p2p: Always serialize local timestamp for version msg

Description

p2p: Always serialize local timestamp for version msg

Summary:
Rationales from the PR discussion:

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 exists... I think using GetAdjustedTime here gives a false sense of security. It will be better for node operators to instead set the correct time.

The timestamp a node sends to their inbounds will influence their adjusted time, and I think it makes sense to use the local time for that - this also counteracts non-local phenomena, where a wrong Adjusted Time is passed from A to B, affects B's adjusted time and is passed along to B's future peers and so on.

This change makes the code simpler.

This is a backport of core#23695

Depends on D13357

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13370

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Dec 7 2021, 15:32
PiRKCommitted on Mar 17 2023, 14:42
PiRKPushed on Mar 17 2023, 14:42
Reviewer
Restricted Project
Differential Revision
D13370: p2p: Always serialize local timestamp for version msg
Parents
rABC0eda354e8679: p2p: Don't use timestamps from inbound peers
Branches
Unknown
Tags
Unknown