Page MenuHomePhabricator

[wip] consensus upgrade to restrict timestamps to be monotonic
Changes PlannedPublic

Authored by markblundeberg on Jan 24 2020, 10:47.

Details

Reviewers
Mengerian
deadalnix
Group Reviewers
Restricted Project
Summary

zawy has noted a class of devastating attacks that are possible on
some difficulty algorithms when block timestamps are allowed to vary
nonmonotonicaly. There appear to be a few ways to stop it:

  • Use an exploit-free difficulty algorithm.
  • Reject deep reorgs.
  • Prevent nonmonotonic timestamps.

This diff includes all necessary changes to C++ it takes to permit
monotonic timestamps -- the third option above.

Incidentally, there was only one test that
was explicitly testing the median timestamp rule on regtest, but several
others that were (unnecessarily) relying on it.

TODO: add a functional test for the activation

Test Plan
ninja check-extended
ninja check-upgrade-activated-extended

Diff Detail

Repository
rABC Bitcoin ABC
Branch
tighten-timestamp
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 9127
Build 16213: Bitcoin ABC Buildbot
Build 16212: arc lint + arc unit