Repository navigation
test: drop Dash unit tests that repeat a covered branch - #8157
Conversation
CoinJoin, LLMQ, InstantSend, BLS, and DIP-0020 suites each asserted the same reject or round-trip in more than one case. Keep one owner per branch, including null and NULL_INDEX input-lock ids, and delete the replays. Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. WalkthroughThe pull request consolidates and expands selected tests, and removes other test cases across BLS, CoinJoin, DIP0020 opcodes, Evolution, and LLMQ. The changes affect tests only. They do not alter public declarations. Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Merge Risk:
|
|
🔍 Review in progress (commit de4dd4d) · live progress |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The three coverage concerns are refuted by existing keeper tests: DSTX expiry is exercised through CDSTXManager, queue timeout callers invoke the no-argument overload, and the exhaustive rebalance test detects a zero-threshold regression. One minor stale-numbering issue remains in the BLS test comments; no code checks have failed because of this change, although several build/test jobs are still in progress.
💬 1 nitpick(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)
💬 Nitpick: Stale test numbering remains after equality-test consolidation
src/test/bls_tests.cpp:900-920
The equality cases formerly numbered Tests 1–3 were folded into test_equality_same_value, but the following comments still label serialization and hash checks as Test 4 and Test 5. The current file no longer presents Tests 1–3 as separate numbered tests, so these comments are misleading. Remove the numbers or renumber the comments to match the current layout.
source: muse-spark-1.3-contributor (phase1-reviewer: general)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (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); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 5: 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:
normalbygpt-6.1-sol(effort low) — This is a sizable but contained removal and consolidation of unit-test coverage with no production-code or critical-surface behavior changes, so a second review can verify that distinct cases were not accidentally removed. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Second Phase-2 pass: on this first full review every Phase-2 reviewer also ran a second, independent time, and the verifier weighed both sets
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort high); agentphase2-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 `src/test/bls_tests.cpp`:
- [NITPICK] src/test/bls_tests.cpp:900-920: Stale test numbering remains after equality-test consolidation
The equality cases formerly numbered Tests 1–3 were folded into `test_equality_same_value`, but the following comments still label serialization and hash checks as Test 4 and Test 5. The current file no longer presents Tests 1–3 as separate numbered tests, so these comments are misleading. Remove the numbers or renumber the comments to match the current layout.
|
The Test 4 and Test 5 comments sit on the serialization and hash cases, which this PR did not change. Renumbering them would push a new head and rerun CI for comment text, so I am leaving them. 🤖 Posted autonomously by Cursor on behalf of pasta. |
| CheckError(flags, {a, {0x00, 0x80}}, CScript() << OP_DIV, | ||
| ScriptError::SCRIPT_ERR_UNKNOWN_ERROR); | ||
|
|
||
| CheckError(flags, {b, {0x00}}, CScript() << OP_DIV, |
There was a problem hiding this comment.
could you clarify how exactly this regression test is duplicated?
There was a problem hiding this comment.
These rows aren't literal copies; the dividend differs. They duplicate the branch, though. OP_DIV checks only the divisor (bn2 == 0, src/script/interpreter.cpp:926), and under MINIMALDATA the non-minimal zeros {0x00}, {0x80}, {0x00,0x00}, {0x00,0x80} fail while the divisor is parsed. Every a and b here is a valid minimal number, so the dividend never changes which path runs. The kept {a, …} rows cover each zero encoding under each flag set. The kept {b, {}} row still divides b, including the one negative dividend, by zero.
To check, I changed the zero check to bn2 == 0 && bn1 >= 0. The trimmed test still fails with SIGFPE, caught by {b, {}}. These rows also came in with the original DIP-0020 port (#3893), not as a fix for a specific bug.
Happy to put them back if you'd rather keep the full {b, zero} grid.
🤖 Posted autonomously by Claude on behalf of pasta.
The remaining credit-sum case only raises the OP_RETURN amount, so it covers credits below the burned value. Credits above it are the case that would mint Platform credits, and without this check a change of the `!=` comparison to `<` passes every unit test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6fbc706 test: drop Dash unit checks that do not guard a contract (pasta) Pull request description: #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. #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. #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: - [x] 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)_ Top commit has no ACKs. Tree-SHA512: 0f0096182d7586ebe2e9fce4141d6b88dc339f78708556878d8b5078154e76db199da1ff2b5291262f2882ccefaedd8c7e31f3633208f82e64cea5ecd53cf2a8
Dash-specific unit tests had grown a second copy of checks that already fail when the production branch breaks. The extra cases made the suites longer without locking a different reject reason, input class, or round-trip.
Each removed assertion still has one owner in the same suite. CoinJoin promotion and demotion sizes, post-v24 structure, and rebalance thresholds stay in the keeper cases. InstantSend input-lock ids still match
SerializeHash("inlock", outpoint), including a null prevout hash andNULL_INDEX. Quorum snapshot modes, the 400-by-100 vectors, and the short bit patterns stay in one serialization test. ChainLock construction, commitment-hash sensitivity, lazy BLS equality, the asset-lock credit-sum check, the domain length limit, and the DIP-0020 div/mod vectors stay.The rest of the Dash unit tests were left in place. They are the only proof of those protocol branches, so cutting them to hit a line target would drop coverage. This change removes about 940 lines, roughly 3% of the 33,441-line Dash unit-test surface.
Issue being fixed or feature implemented
Duplicate unit-test cases were replaying a branch another case in the same suite already locks. That costs compile and review time and hides the test that actually owns the contract.
What was done?
Removed replay cases and folded the remaining rows into the existing keeper in:
src/test/coinjoin_inouts_tests.cppandsrc/test/coinjoin_queue_tests.cppsrc/test/llmq_chainlock_tests.cpp,src/test/llmq_commitment_tests.cpp,src/test/llmq_snapshot_tests.cpp, andsrc/test/llmq_utils_tests.cppsrc/test/evo_islock_tests.cpp,src/test/evo_assetlocks_tests.cpp, andsrc/test/evo_netinfo_tests.cppsrc/test/bls_tests.cppandsrc/test/dip0020opcodes_tests.cppNo production code changed.
How Has This Been Tested?
Rebuilt
src/test/test_dashand ran the touched suites:coinjoin_inouts_tests,coinjoin_queue_tests,llmq_snapshot_tests,llmq_commitment_tests,llmq_utils_tests,llmq_chainlock_tests,llmq_hash_tests,evo_islock_tests,evo_assetlocks_tests,evo_netinfo_tests,bls_tests, anddip0020opcodes_tests. All passed.Before the edit, the Dash-specific Boost suites (evo, llmq, governance, CoinJoin, BLS, DIP, spork, wallet platform keys, and the other Dash-only unit suites) passed on this tree.
A throwaway change that made
GenInputLockRequestIdreturn a null id for a null prevout hash orNULL_INDEXfailed the restored checks and left the ordinary-outpoint check green. That change was reverted before commit.Breaking Changes
None.
Checklist: