Page MenuHomePhabricator

[avalanche] Remove TimePoint in favor of SteadyMilliseconds
ClosedPublic

Authored by Fabien on Sep 29 2023, 12:30.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC165e87dacdb8: [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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable