Skip to content

test: cover MNHF validation rejections#7319

Draft
thepastaclaw wants to merge 1 commit into
dashpay:developfrom
thepastaclaw:test-mnhf-validation-rejections
Draft

test: cover MNHF validation rejections#7319
thepastaclaw wants to merge 1 commit into
dashpay:developfrom
thepastaclaw:test-mnhf-validation-rejections

Conversation

@thepastaclaw
Copy link
Copy Markdown

MNHF validation rejection coverage

Summary

  • Add unit coverage for malformed MNHF special transactions and missing or
    invalid quorum validation paths.
  • Add functional coverage for MNHF mempool rejection and duplicate-MNHF block
    rejection.
  • Keep the checks scoped to validation behavior without changing production
    logic.

Validation

  • python3 -m py_compile test/functional/feature_mnehf.py
  • git diff --check upstream/develop..HEAD
  • Code review gate against upstream/develop: Recommendation: ship.
  • Not run: C++ unit/functional test execution locally; this worktree does not
    have a built build/src/test/test_dash binary available.

@github-actions
Copy link
Copy Markdown

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@thepastaclaw
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

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: 2f1433e6-9ebd-4f1d-a7ed-a64039d94a72

📥 Commits

Reviewing files that changed from the base of the PR and between beca567 and fd5b45b.

📒 Files selected for processing (2)
  • src/test/evo_mnhf_tests.cpp
  • test/functional/feature_mnehf.py

Walkthrough

This PR extends MNHF (Masternode Hard Fork) test coverage across both unit and functional test suites. The C++ unit tests are enhanced with a parametric payload version override in the CreateMNHFTx builder, enabling new test cases that validate version-bit boundary enforcement and invalid transaction scenarios. The Python functional tests introduce new helper methods for asserting mempool rejection and block submission failures, and add scenarios that test invalid MNEHF signatures and duplicate transaction detection. Both changes focus on validating MNHF verification logic without modifying production code.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main objective: adding test coverage for MNHF validation rejection scenarios.
Description check ✅ Passed The description is directly related to the changeset, explaining the test additions for MNHF validation rejections in both unit and functional tests.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

Copy link
Copy Markdown
Author

@thepastaclaw thepastaclaw left a comment

Choose a reason for hiding this comment

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

Code Review

I reviewed the exact checked-out head fd5b45bc67632009626c59a58f2a9853e2f74454 against upstream/develop, focusing on the new MNHF unit and functional coverage and the corresponding validation paths in src/evo/mnhftx.cpp. The added tests align with the current rejection reasons for malformed payloads, invalid signatures, missing quorums, and duplicate active-chain signals, and I did not find a concrete correctness or Dash-specific integration issue in this patch.

Reviewed commit: fd5b45b

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.

1 participant