Page MenuHomePhabricator

p2p: Always serialize local timestamp for version msg
ClosedPublic

Authored by PiRK on Mar 17 2023, 09:23.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCf654010cb28c: 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