Test RandomX bootstrap difficulty

This commit is contained in:
Capri 2026-09-16 20:20:45 +00:00
commit b46ce28c09
Signed by: VextaProject
SSH key fingerprint: SHA256:739BZv8LvIDY2tR7lXLy/IQ6MaGTQtYcG9GNvCjmpVM

View file

@ -828,16 +828,20 @@ BOOST_AUTO_TEST_CASE(MultiAlgo_DAA_activation_boundary_test)
firstMultiAlgoShaBits,
expectedShaTarget.GetCompact());
// No RandomX block exists yet. For now this deliberately documents
// the current fallback to InitialDifficulty(). This is NOT the final
// RandomX launch calibration and will be replaced by an explicit
// RandomX initial target before activation is enabled.
// No RandomX block exists yet, so the first RandomX block must use
// the explicitly configured RandomX bootstrap target.
const unsigned int firstRandomXBits =
GetNextWorkRequired(&blocks[39], nullptr, consensus, ALGO_RANDOMX);
BOOST_CHECK_EQUAL(
firstRandomXBits,
RandomXInitialDifficulty(consensus));
// Mainnet bootstrap calibration: approximately one RandomX block every
// 20 minutes at the reference 66.76 kH/s hashrate.
BOOST_CHECK_EQUAL(
RandomXInitialDifficulty(consensus),
0x1d359bc1U);
}