test: speed up evo activation fixtures#7460
Conversation
|
The mac source-build failure is unrelated to this PR and the branch is proper as-is. The job failed before configuration or compilation because the exact macOS SDK cache entry was absent. Its prerequisite cache-check job downloaded and extracted the SDK, but This PR changes only four C++ unit-test fixture files. The SDK restore workflow and |
| assert( | ||
| hash != checkpoints.mapCheckpoints.end() && | ||
| m_node.chainman->ActiveChain().Tip()->GetBlockHash() == hash->second); | ||
| const uint256 actual_hash = m_node.chainman->ActiveChain().Tip()->GetBlockHash(); |
There was a problem hiding this comment.
don't do new workarounds here; add a new checkpoint the the CCheckpointData checkpoints above
There was a problem hiding this comment.
Addressed in b57f55f. I removed the expected_tip_hash constructor workaround and moved each configuration-specific hash into the existing CCheckpointData checkpoints table.
| TestChainSetup(494, CBaseChainParams::REGTEST, | ||
| {"-testactivationheight=v19@500", "-testactivationheight=v20@500", "-testactivationheight=mn_rr@500"}) | ||
| { | ||
| const CScript coinbase_pk = GetScriptForRawPubKey(coinbaseKey.GetPubKey()); |
There was a problem hiding this comment.
should you clean up any included header after removing this TestChainV19Setup?
There was a problem hiding this comment.
Yes, good catch. Removed the now-unused <chainparams.h> include in b57f55f. The remaining boundary test still directly needs <deploymentstatus.h> and <script/standard.h>.
| "-testactivationheight=mn_rr@109"}, | ||
| /*coins_db_in_memory=*/true, | ||
| /*block_tree_db_in_memory=*/true, | ||
| uint256S("0x13adad9565d0ca558f5675c50e3828f4354d26b64de044ebc88686056f30faab")} |
There was a problem hiding this comment.
add this checkpoint to the list of checkpoints ; inside CCheckpointData checkpoints
There was a problem hiding this comment.
Done in b57f55f. Height 103 is now registered in CCheckpointData checkpoints; the other hashes that used the same removed override are registered there as well.
|
🔍 Review in progress — actively reviewing now (commit b57f55f) |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
WalkthroughThe changes centralize v19 activation boundary fixtures in shared test utilities. DIP3 and v24 deterministic masternode tests now use revised activation parameters, inheritance, and explicit deployment-state assertions. The BLS test removes its local v19 fixture and an unused include. Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Issue being fixed or feature implemented
The
evo*unit-test selection had slowed from roughly 4 seconds to roughly 15 seconds. The largest regression came from v24's 500-block versionbits window, which forced several tests to mine about 1,000 additional blocks before reaching the state they actually exercise. Other evo and BLS activation fixtures also repeated hundreds of unnecessary setup blocks.What was done?
0:9999999999time bounds.TestChainV24PendingSetupextend the pre-v19 v24-signaling fixture, mining only the blocks needed to reach its distinct pending state.mine_until_duplicatehelper and reaches duplicate outputs immediately on both sides of the boundary.No production behavior or test cases are removed.
How Has This Been Tested?
build/src/test/test_dash -t 'evo*' --log_level=nothingbuild/src/test/test_dash -t bls_tests/v19_boundary_validation_failure_restores_bls_scheme --log_level=nothingtest/lint/lint-whitespace.pygit diff --check upstream/develop..HEADThe full
evo*selection passes all 47 cases. Controlled before/after runs produced median wall times of 12.41 seconds and 7.39 seconds respectively. The restored boundary helper passes its focused test in 1.59 seconds.Independent exact-range Codex reviews found no significant issues.
Breaking Changes
None.
Checklist: