fix(programs): reject rent_payment < 2 for CMint decompression (L-10)#2267
fix(programs): reject rent_payment < 2 for CMint decompression (L-10)#2267ananas-block merged 3 commits intomainfrom
Conversation
CMints are always compressible and need minimum 2 epochs of rent prepayment. Previously only rent_payment == 1 was rejected, allowing rent_payment == 0 which could enable DoS by creating underfunded CMints.
📝 WalkthroughWalkthroughThe pull request raises the required rent prepayment for mint compression operations from 0 to 2 epochs, updates program-side validation to enforce the >=2 requirement, and adjusts tests to warp the clock and assert compressibility only after the 2-epoch rent period elapses. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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 |
Update tests to use rent_payment=2 (new minimum) and warp slots forward past the rent period before checking compressibility.
Summary
rent_payment = 0was accepted for CMint decompression, but onlyrent_payment = 1was rejected. A CMint with 0 epochs of rent prepayment would immediately be eligible for reclamation.rent_payment < 2.Changes
decompress_mint.rs: Changed validation fromrent_payment == 1torent_payment < 2, updated error toInvalidRentPayment.Summary by CodeRabbit
Changes
Tests