Skip to content

test: speed up evo activation fixtures#7460

Merged
PastaPastaPasta merged 5 commits into
dashpay:developfrom
thepastaclaw:perf-early-v24-test-activation
Jul 14, 2026
Merged

test: speed up evo activation fixtures#7460
PastaPastaPasta merged 5 commits into
dashpay:developfrom
thepastaclaw:perf-early-v24-test-activation

Conversation

@thepastaclaw

@thepastaclaw thepastaclaw commented Jul 14, 2026

Copy link
Copy Markdown

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?

  • Activate v24 at height 510 with a one-block threshold/window while preserving its existing 0:9999999999 time bounds.
  • Keep the v24 fixture near its requested 500–700 activation range and pass a configuration-specific expected tip hash instead of changing shared checkpoints.
  • Share the v19 activation fixture between evo and BLS tests.
  • Make TestChainV24PendingSetup extend the pre-v19 v24-signaling fixture, mining only the blocks needed to reach its distinct pending state.
  • Lower the ordinary DIP3/v19 fixtures to height 109, the lowest safe height with enough mature coinbase outputs for every consumer. Height 108 was tested and is one mature coinbase short.
  • Delay MN_RR until the block after v24 so the payment-multiplicity test keeps the original mine_until_duplicate helper 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=nothing
  • build/src/test/test_dash -t bls_tests/v19_boundary_validation_failure_restores_bls_scheme --log_level=nothing
  • test/lint/lint-whitespace.py
  • git diff --check upstream/develop..HEAD

The 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:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

@thepastaclaw

Copy link
Copy Markdown
Author

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 actions/cache@v5 could not save it from this fork PR (cache write denied: token has no writable scopes); the downstream source job then failed its exact restore with fail-on-cache-miss: true.

This PR changes only four C++ unit-test fixture files. The SDK restore workflow and depends/hosts/darwin.mk are identical to develop, and all completed source-build variants other than macOS passed. I filed #7461 with the logs, root-cause analysis, reproduction, and durable workflow-fix options. No branch change or CI retrigger is appropriate for this failure.

Comment thread src/test/util/setup_common.cpp Outdated
assert(
hash != checkpoints.mapCheckpoints.end() &&
m_node.chainman->ActiveChain().Tip()->GetBlockHash() == hash->second);
const uint256 actual_hash = m_node.chainman->ActiveChain().Tip()->GetBlockHash();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't do new workarounds here; add a new checkpoint the the CCheckpointData checkpoints above

@thepastaclaw thepastaclaw Jul 14, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in b57f55f. I removed the expected_tip_hash constructor workaround and moved each configuration-specific hash into the existing CCheckpointData checkpoints table.

Comment thread src/test/bls_tests.cpp
TestChainSetup(494, CBaseChainParams::REGTEST,
{"-testactivationheight=v19@500", "-testactivationheight=v20@500", "-testactivationheight=mn_rr@500"})
{
const CScript coinbase_pk = GetScriptForRawPubKey(coinbaseKey.GetPubKey());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should you clean up any included header after removing this TestChainV19Setup?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>.

Comment thread src/test/util/setup_common.cpp Outdated
"-testactivationheight=mn_rr@109"},
/*coins_db_in_memory=*/true,
/*block_tree_db_in_memory=*/true,
uint256S("0x13adad9565d0ca558f5675c50e3828f4354d26b64de044ebc88686056f30faab")}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this checkpoint to the list of checkpoints ; inside CCheckpointData checkpoints

@thepastaclaw thepastaclaw Jul 14, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@knst knst added this to the 24 milestone Jul 14, 2026

@knst knst left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM b57f55f

@knst
knst marked this pull request as ready for review July 14, 2026 18:04
@knst
knst requested review from PastaPastaPasta and UdjinM6 July 14, 2026 18:04
@thepastaclaw

thepastaclaw commented Jul 14, 2026

Copy link
Copy Markdown
Author

🔍 Review in progress — actively reviewing now (commit b57f55f)

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ff146434-e31c-4667-b5b4-49128402f4b0

📥 Commits

Reviewing files that changed from the base of the PR and between 2406ebc and b57f55f.

📒 Files selected for processing (4)
  • src/test/bls_tests.cpp
  • src/test/evo_deterministicmns_tests.cpp
  • src/test/util/setup_common.cpp
  • src/test/util/setup_common.h
💤 Files with no reviewable changes (1)
  • src/test/bls_tests.cpp

Walkthrough

The 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: pastapastapasta, knst, udjinm6

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: speeding up evo activation fixtures.
Description check ✅ Passed The description matches the changeset and explains the fixture-optimization goals and test impact.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@PastaPastaPasta
PastaPastaPasta merged commit ca2912d into dashpay:develop Jul 14, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants