HomePhabricator

addrman: Use system time instead of adjusted network time

Description

addrman: Use system time instead of adjusted network time

Summary:
This changes addrman to use system time for address relay instead of the network adjusted time.

This is an improvement, because network time has multiple issues:

  • It is non-monotonic, even if the system time is monotonic.
  • It may be wrong, even if the system time is correct.
  • It may be wrong, if the system time is wrong. For example, when the node has limited number of connections (4), or the system time is wrong by too much (more than +-70 minutes), or the system time only got wrong after timedata collected more than half of the entries while the time was correct, ...)

This may slightly degrade addr relay for nodes where timedata successfully adjusted the time. Addr relay can already deal with minor offsets of up to 10 minutes. Offsets larger than this should still allow addr relay and not result in a DoS.

This is a backport of core#24662

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Mar 24 2022, 18:56
PiRKCommitted on Sep 30 2024, 10:35
PiRKPushed on Sep 30 2024, 10:35
Reviewer
Restricted Project
Differential Revision
D16816: addrman: Use system time instead of adjusted network time
Parents
rABC6fd3064b6d7e: [Iguana] Implement interpreter + human readable formatter
Branches
Unknown
Tags
Unknown