Skip to content

test: drop Dash unit checks that do not guard a contract - #8160

Merged
PastaPastaPasta merged 1 commit into
dashpay:developfrom
PastaPastaPasta:t3/simplify-dash-unit-tests-1
Nov 16, 2026
Merged

PastaPastaPasta merged 1 commit into
dashpay:developfrom
PastaPastaPasta:t3/simplify-dash-unit-tests-1

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

#8160 is stacked on #8157. Both were removing validate_promotion_entry_valid. That consolidation now lives only in #8157 (d787bd3091a). This branch's own commit does not touch coinjoin_inouts_tests.cpp.

Issue being fixed or feature implemented

Dash-only unit tests had checks that cannot fail for the reason their names claim: getter echoes, a value compared with itself, and truncation loops that swallow every error. #8157 already removed the CoinJoin copies of that pattern. This PR keeps the LLMQ copies #8157 did not already remove.

What was done?

Parent is #8157. The commit on top of it (6553a62cdcd) changes four LLMQ test files, net −207 lines:

  • ChainLock construction, ToString, and the truncation loop that accepted either an exception or a success are gone. IsNull, serialization (including height 0 and INT_MAX), and the handler tests stay.
  • Quorum-snapshot constructor echoes are gone. test: drop Dash unit tests that repeat a covered branch #8157 already folded skip-mode, empty, and bit-width round-trips into the serialization case. ToJson checks member bits, skip mode, and skip-list values. Truncated prefixes are tested again in quorum_snapshot_truncated_wire_is_rejected: one-byte steps, and each prefix must throw std::ios_base::failure.
  • Final-commitment null-field echoes and payload field readback are gone. test: drop Dash unit tests that repeat a covered branch #8157 already removed the commitment-hash case whose "same inputs" used two different random keys. Determinism and per-field sensitivity, including null quorum hash, null vvec hash, and an invalid pubkey, stay in llmq_hash_tests.

How Has This Been Tested?

Built test_dash after the rebase and ran llmq_chainlock_tests, llmq_commitment_tests, llmq_hash_tests, and llmq_snapshot_tests. All passed.

Before the rebase, widening ShouldPromoteDenoms from "below half the goal" to "below the goal" made the CoinJoin count keeper fail on (60 smaller, 0 larger) and (50, 0). That keeper is now the one in #8157. The production check was restored.

Breaking Changes

None. Test-only.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (if you have permission to set one)

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The LLMQ tests remove several ChainLockSig and commitment test cases. A new commitment test checks debug output when an undersized bitset is rejected. Hash sensitivity assertions compare each tested input with a base hash. Snapshot tests check selected JSON values and require deserialization to reject every nonempty proper prefix of serialized data.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: kwvg

Merge Risk: Minimal · up to 6fbc7

This is a test-only cleanup that removes low-value checks and tightens the snapshot truncation test. It has no production behavior impact, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: removing Dash unit test checks that do not guard a real contract. The changeset removes ChainLock, commitment, hash, and snapshot test cases that echo getters, compare…
Description check Passed The description relates directly to the changeset. It explains the stacked relationship with #8157, lists the LLMQ test files changed with a net removal of 207 lines, describes which checks were remov…
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.
Full details: Title check

Explanation

The title names the main change: removing Dash unit test checks that do not guard a real contract. The changeset removes ChainLock, commitment, hash, and snapshot test cases that echo getters, compare values with themselves, or accept any error. The title matches the summary and objectives.

Full details: Description check

Explanation

The description relates directly to the changeset. It explains the stacked relationship with #8157, lists the LLMQ test files changed with a net removal of 207 lines, describes which checks were removed and which were kept, and reports the test run results.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 72439e2f-0a56-4d74-9ff3-b0142c8afd84
Commits

Reviewing files that changed from the base of the PR and between 0b813a4 and 6fbc706.

Files selected for processing: 1

  • src/test/llmq_chainlock_tests.cpp
Files with no reviewable changes: 1

  • src/test/llmq_chainlock_tests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@thepastaclaw

thepastaclaw commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Final review complete — no blockers (commit 6fbc706) · triage: low

@PastaPastaPasta PastaPastaPasta added this to the 24.1 milestone Nov 15, 2026
Comment thread src/test/coinjoin_inouts_tests.cpp Resolved

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

Final validation — Phase 1 + Phase 2

The review range is a test-only cleanup that removes tautological, duplicated, or non-actionable assertions while retaining contract-level coverage for serialization, validation, hashing, edge cases, and live handlers. The available CI snapshot shows successful builds, lint, formatting, cppcheck, and nowallet tests; the remaining source test jobs were still in progress and no code check had failed.

Review provenance

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.1-sol (effort low) — This is a contained test-only cleanup that removes redundant or non-contractual assertions without changing production behavior, and its correctness is straightforward to verify.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 99% left, weekly 51% left; passed over gemini-3.8-flash-high (antigravity quota lookup failed)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer, gpt-6.1-sol — dash-core-commit-history (completed, effort medium); agent phase2-reviewer

@thepastaclaw thepastaclaw added the pastaclaw:approved thepastaclaw's latest review approved this PR label Nov 15, 2026
Comment thread src/test/llmq_snapshot_tests.cpp Resolved
@PastaPastaPasta
PastaPastaPasta force-pushed the t3/simplify-dash-unit-tests-1 branch from 6553a62 to 0b813a4 Compare November 15, 2026 22:19
@thepastaclaw thepastaclaw removed the pastaclaw:approved thepastaclaw's latest review approved this PR label Nov 15, 2026

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

Re-review — Final validation — Phase 1 + Phase 2

The PR removes non-contractual LLMQ unit checks and replaces the snapshot truncation test with a meaningful one-byte-prefix rejection test. The remaining issues are limited to an orphaned include introduced by the cleanup and a history suggestion to squash the corrective snapshot-test commit; no blocking correctness issues were found. Build, lint, and platform checks passed, while the Linux test and sanitizer jobs were still in progress in the supplied CI snapshot.

🟡 1 suggestion(s)

Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.

1 finding(s) not shown inline (the lines are not part of this PR's diff)

🟡 Suggestion: Squash the replacement snapshot test into the cleanup commit
<commit:0b813a40ace>:1

The second commit restores a stricter version of the snapshot truncation test that the first commit removed, so both commits together form one logical test-cleanup change. Squashing 0b813a4 into d818fb0 would avoid leaving permanent history that shows the test being deleted and then immediately reintroduced.

source: gpt-6.1-sol (phase2-reviewer: dash-core-commit-history)

Review provenance

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.1-sol (effort low) — This is a small, contained test-only deletion with no production behavior changes, and the retained assertions are straightforward to verify.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 99% left, weekly 51% left; passed over gemini-3.8-flash-high (antigravity quota lookup failed)
  • Code unchanged since the last final review (6553a62c): 1 new nitpick(s) dropped
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer, gpt-6.1-sol — dash-core-commit-history (completed, effort medium); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `<commit:0b813a40ace>`:
- [SUGGESTION] <commit:0b813a40ace>:1: Squash the replacement snapshot test into the cleanup commit
  The second commit restores a stricter version of the snapshot truncation test that the first commit removed, so both commits together form one logical test-cleanup change. Squashing 0b813a40ace into d818fb0303a would avoid leaving permanent history that shows the test being deleted and then immediately reintroduced.

@thepastaclaw thepastaclaw added the pastaclaw:approved thepastaclaw's latest review approved this PR label Nov 15, 2026
Repeated LLMQ cases only echoed getters, compared a value with itself, or ignored truncation errors. Keep each distinct input in one keeper, and reject every proper prefix of a quorum snapshot.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PastaPastaPasta
PastaPastaPasta force-pushed the t3/simplify-dash-unit-tests-1 branch from 0b813a4 to 6fbc706 Compare November 15, 2026 22:54
@PastaPastaPasta

Copy link
Copy Markdown
Member Author

Squashed the snapshot-prefix test into the cleanup commit, and dropped the now-unused #include <util/strencodings.h> from llmq_chainlock_tests.cpp. That include only served the ToString case this PR removes. Head is 6fbc706f3ad.


🤖 Posted autonomously by Cursor on behalf of pasta.

@thepastaclaw thepastaclaw removed the pastaclaw:approved thepastaclaw's latest review approved this PR label Nov 15, 2026

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

Re-review — Final validation — Phase 1 + Phase 2

The test-only cleanup is correct: retained LLMQ tests still cover serialization, field sensitivity, edge cases, and handler behavior, while the replacement snapshot test rejects every proper wire prefix. No in-scope defects were found; completed CI checks passed, and the remaining source build/test checks were still in progress at the supplied snapshot.

🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)

Review provenance

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.1-sol (effort low) — This is a small, self-contained test-only deletion and strengthening change with no production behavior or critical-surface changes.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 99% left, weekly 51% left; passed over gemini-3.8-flash-high (antigravity quota lookup failed)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer, gpt-6.1-sol — dash-core-commit-history (completed, effort medium); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.

No unresolved findings remain from the prior review on this head.

@thepastaclaw thepastaclaw added the pastaclaw:approved thepastaclaw's latest review approved this PR label Nov 15, 2026

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Approved

@PastaPastaPasta
PastaPastaPasta merged commit e20ea76 into dashpay:develop Nov 16, 2026
50 checks passed
@thepastaclaw thepastaclaw removed the pastaclaw:approved thepastaclaw's latest review approved this PR label Nov 16, 2026
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