fix: skip unspendable outputs in BuildSimpleUtxoMap - #7266
Conversation
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
|
✅ Final review complete — no blockers (commit b6ce527) |
WalkthroughTwo test files were modified to improve test stability and correctness. The Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
Clean test fix addressing two independent flakiness issues. (1) BuildSimpleUtxoMap now skips OP_RETURN unspendable outputs that were polluting the UTXO map in both block_reward_reallocation_tests and evo_deterministicmns_tests — these outputs would cause later spend attempts to fail with 'missing inputs'. (2) FuncVerifyDB adds IndexWaitSynced(*g_txindex) after ProcessNewBlock to ensure the txindex has indexed the collateral transaction before CreateProUpRevTx looks it up via GetTransaction. Both fixes are correct and minimal. No issues found.
Reviewed commit: 74056e9
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
Test-only flake fix at SHA 74056e9 — both fixes are correct and narrowly scoped. The IsUnspendable() filter prevents BuildSimpleUtxoMap from selecting OP_RETURN credit-pool outputs in V20+MN_RR coinbases, and the IndexWaitSynced call ensures g_txindex has indexed the block before CreateProUpRevTx's GetTransaction lookup. Both Claude and Codex independently verified no issues.
Reviewed commit: 74056e9
Fresh dispatcher run for this queue item. A same-SHA review already existed, so this records the fresh verification without duplicating inline threads.
Code Review
Reviewed commit: 74056e9
|
This pull request has conflicts, please rebase. |
Dash coinbase transactions can include OP_RETURN outputs (e.g. credit pool payments when V20+MN_RR are active). BuildSimpleUtxoMap was adding these to the UTXO map, allowing SelectUTXOs to pick them as transaction inputs which would then fail signature verification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
74056e9 to
b6ce527
Compare
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Codex + Sonnet
The current rebased patch correctly excludes unspendable outputs from both BuildSimpleUtxoMap test helpers, matching CCoinsViewCache::AddCoin behavior and preventing OP_RETURN outputs from being selected as transaction inputs. The prior clean result remains valid: the earlier txindex synchronization workaround is obsolete because the current base signs directly from returned Coin data without GetTransaction or g_txindex. No correctness, security, consensus, or test-coverage issues were found.
Review provenance
- Codex reviewers:
gpt-5.6-sol— general (completed),gpt-5.6-sol— dash-core-commit-history (completed) - Verifier:
gpt-5.6-sol— final-verifier (fallback) - Sonnet reviewers:
claude-sonnet-5— general (completed),claude-sonnet-5— dash-core-commit-history (failed),claude-sonnet-5— dash-core-commit-history (completed)
|
This pull request has conflicts, please rebase. |
Issue being fixed or feature implemented
Skip
OP_RETURNand other unspendable outputs inBuildSimpleUtxoMapin bothevo_deterministicmns_testsandblock_reward_reallocation_tests. Dash coinbases can includeOP_RETURNoutputs (credit pool payments whenV20+MN_RRare active) which should never be selected as transaction inputs.What was done?
How Has This Been Tested?
Breaking Changes
Checklist: