fix: resolve flaky verify_db_legacy test and skip unspendable outputs in test UTXO map#7266
fix: resolve flaky verify_db_legacy test and skip unspendable outputs in test UTXO map#7266UdjinM6 wants to merge 2 commits intodashpay:developfrom
Conversation
FuncVerifyDB mines tx_collateral in a block via ProcessNewBlock, then later CreateProUpRevTx looks it up via GetTransaction/g_txindex. Unlike coinbase txns (indexed during initial chain setup), tx_collateral is only indexed asynchronously by the txindex background thread. Without an explicit IndexWaitSynced, the lookup can race and intermittently fail with "critical check txFrom has failed". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
|
✅ Review complete (commit 74056e9) |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
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)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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
Issue being fixed or feature implemented
txindexafter miningtx_collateralinFuncVerifyDBbefore it's looked up viaGetTransaction/g_txindexinCreateProUpRevTx. Unlike coinbase txns (indexed during initial chain setup), this non-coinbase tx is only indexed asynchronously, causing intermittentcritical check txFrom has failedfailures. Example: https://github.com/dashpay/dash/actions/runs/23958304920/job/69882226393?pr=7265.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: