fix: return StakeError::InvalidPda for vault_auth mismatch in AdminWithdrawInsurance - #110
Conversation
…thdrawInsurance process_admin_withdraw_insurance returned the generic ProgramError::InvalidArgument when vault_auth PDA derivation failed. Every other PDA validation in the codebase (including the identical vault_auth check in process_flush_to_insurance at line 938) returns StakeError::InvalidPda (code 10). This was the sole outlier, breaking off-chain error parsing consistency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 18 minutes and 7 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ 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 |
|
Sentinel security review — MERGE Fix is correct. Current master at processor.rs:1224 returns Minimal diff — 1 line changed. No conflicts with any other open PR. PR #99 adds Severity confirmed: MEDIUM (CVSS ~3.1 — error type inconsistency, sole outlier breaking off-chain error parsing consistency for PDA validation failures). Security APPROVED PR #110 — findings: none | error code consistency for vault_auth PDA mismatch in AdminWithdrawInsurance |
Summary
process_admin_withdraw_insurancereturnedProgramError::InvalidArgumentwhen vault_auth PDA derivation failedStakeError::InvalidPda(code 10), including the identicalvault_authcheck inprocess_flush_to_insurance(line 938)Severity
MEDIUM — error type inconsistency for identical check across two handlers
Test plan
cargo build— compiles cleanlycargo clippy— zero warnings🤖 Generated with Claude Code