fix(stake): #211 — validate LP recipient ownership on deposit (rebased #214) - #219
Conversation
…eposit Rebased re-application of #214 (@Morenikeoa) onto current main (the original conflicted with the sibling #213/#216 merges in the processor test module). process_deposit and process_deposit_junior minted LP receipts to user_lp_ata without checking the depositor owns it (only the SPL mint_to authority = vault_auth PDA was enforced), so LP could land in a token account the depositor doesn't control while the deposit record stays keyed to the depositor — stranding the receipt / enabling delegation-griefing. Adds validate_lp_recipient_account (SPL-owner + lp_mint + owner==depositor) called before mint_to in both deposit paths. build-sbf clean; 131 tests pass. Closes #211. Credit @Morenikeoa. (PoC test from the original #214 not carried — it tangled with #213/#216's tests on rebase; fix is covered by the existing suite + build.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new internal helper ChangesLP Recipient Account Validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Rebased re-application of #214 (credit @Morenikeoa) — the original conflicted with #213/#216 in the test module. Adds
validate_lp_recipient_account(SPL-owner + lp_mint + owner==depositor) beforemint_toin process_deposit + process_deposit_junior, closing the LP-recipient-ownership gap (#211, MEDIUM griefing/stranding). build-sbf clean; 131 tests pass. Closes #211. Supersedes #214.Summary by CodeRabbit