Integer ASERT difficulty algorithm with 2-day half-life and MTP activation (aserti3-2d)
This MR adds the aserti3-2d DAA algorithm to BCH in the Nov 15, 2020 Axion upgrade. For a high-level description of the motivation and background for this proposal, please start by reading this article:
This specific MR uses a MTP-based activation, not a height-based activation as stated in the article. The block before the activation block is used as the reference block for the absolute ASERT algorithm. Timestamps before the reference block are allowed and valid (though the median-time-past of 11 rule still applies). No restrictions on the FTL (MAX_FUTURE_BLOCK_TIME) are made in this MR, as that is considered to be a separate issue, and a nice-to-have rather than a must-have.
cmake -DBUILD_ASERT_TEST_VECTORS=ON -GNinja ..
ninja all check-all asert-testgen
- compare generated test vector
build/contrib/testgen/are identical to those in QA assets repository
- run the Python validation program on the generated test vectors to verify that the Python reference implementation matches the C++:
../contrib/testgen/validate_nbits_aserti3_2d.py contrib/testgen/run*(you should get an 'All OK' message at the end)
Links to specification: