Repository navigation
feat(wallet): list the asset locks that fund Platform from the wallet's own transactions - #8137
Conversation
…'s own transactions An identity registration or top-up locks coins into a credit output that pays a key derived from the wallet's seed. If Platform has not consumed that lock when the GUI's own records are lost, as after a seed restore, nothing pointed back at it: the GUI would fund a second lock with the same registration key, and top-up credits stayed stranded. listAssetLockFundings(keys) reads that inventory from the transactions the wallet holds, which a restore recovers by rescanning: every credit output of a wallet asset lock that pays one of the given funding keys, with its txid, credit index, key, amount and status. ACTIVE is not abandoned and has no mined conflict; INACTIVE is abandoned and unmined, which can still be mined, so it stays listed; CONFLICTED has a mined conflict. Nothing else is persisted. Deriving the keys needs an unlocked wallet. The status comes from the state the wallet records for the transaction, not from its depth. Depth counts from the last block notification the wallet processed, and a rescan installs mined transactions above it, so a lock it finds two or more blocks higher would have a negative depth and read as conflicted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 37 minutes. View limit details
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. |
|
✅ Final review complete — no blockers (commit c47973f) · triage: normal |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The PR cleanly adds wallet and interface support for locating asset-lock credit outputs by derived Platform funding keys. The implementation derives keys under the wallet lock, scans wallet-owned asset-lock transactions, preserves the requested status semantics, and includes coverage for conflicts, rescans, and locked wallets. Cppcheck and ClangFormat pass; the queued lint and failed milestone policy check do not indicate code defects.
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 contained wallet/API behavior change involving asset-lock discovery, key derivation, transaction status classification, and rescan-related state handling, but it does not directly change funds movement, consensus, cryptographic primitives, or persistence formats. - 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
Issue being fixed or feature implemented
An identity registration or top-up locks coins into a credit output that pays a funding key derived from the wallet's seed. Nothing in the wallet points back at that lock. If Platform has not consumed it when a DashPay client loses its own records, as after a seed restore, the client cannot find it: it would fund a second lock with the same registration key, and top-up credits would stay stranded.
What was done?
interfaces::Wallet::listAssetLockFundings(keys)lists every credit output of a wallet asset lock that pays one of the given funding keys: txid, credit index, key, amount and status. It is derived only from the transactions the wallet holds, which a restore recovers by rescanning, so nothing new is persisted.ACTIVE: not abandoned, and no conflict is mined.INACTIVE: abandoned and unmined. It is still listed because it can still be mined.CONFLICTED: a conflict is mined.The status comes from the state the wallet records for the transaction, not from its depth. A rescan installs mined transactions above the last block the wallet has processed, where the depth would be negative, so a lock found there would otherwise read as conflicted.
Deriving the keys needs an unlocked wallet. There is no in-tree caller yet; the DashPay GUI that uses it comes in a later PR. This was the last commit of #8068 and is split out because it shares no code or state with the rescan work there. The two PRs touch adjacent lines, so whichever merges second needs a trivial rebase.
How Has This Been Tested?
wallet_tests/create_asset_lock_transactionis extended rather than adding a scenario:ACTIVEand the abandoned conflictINACTIVE; a key that funds nothing lists nothing;CONFLICTED;ACTIVEwhile its processed height is still two blocks below the lock;WALLET_LOCKED.test_dash --run_test=wallet_tests,platformkeys_testspasses at this head (macOS arm64, depends build,--enable-debug --enable-werror, no GUI). When the commit was written, deriving the status from depth made the restored-wallet check fail withCONFLICTED; that reversion was not re-run for this split.Breaking Changes
None.
Checklist:
🤖 Generated with Claude Code