HomePhabricator

[avalanche] Remove TimePoint in favor of SteadyMilliseconds

Description

[avalanche] Remove TimePoint in favor of SteadyMilliseconds

Summary:
This removes the TimePoint from node.h entirely. It also fixes a test
issue introduced in D14554: previously the TimePoint type did not
specify a duration so it used the full resolution of the clock. This
caused the test to fail because of a mismatch between the now() call
using the full resolution of the clock and the TimePoint resolution to
the milliseconds. The test was testing for strict inequality, while the
expected behavior is greater or equal: this never failed before because
the clock resolution is too high for the equality to happen. This is no
longer the case after the resolution is fixed to milliseconds, and the
test can fail if it runs fast enough.

Supersedes D14558.

Test Plan:

ninja all check-all

for i in {1..1000}; do echo "Trial $i" && ./src/avalanche/test/test-avalanche -t processor_tests || break; done

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
FabienAuthored on Sep 28 2023, 19:20
FabienPushed on Sep 29 2023, 13:21
Reviewer
Restricted Project
Differential Revision
D14562: [avalanche] Remove TimePoint in favor of SteadyMilliseconds
Parents
rABCbb6a7ba5dda1: [Chronik] Optimize SpentByWriter using merge ops
Branches
Unknown
Tags
Unknown