fix(accounts): mark admin as writable in state-mutation account specs#181
fix(accounts): mark admin as writable in state-mutation account specs#1816figpsolseeker wants to merge 1 commit intodcccrypto:mainfrom
Conversation
ACCOUNTS_SET_INSURANCE_ISOLATION (line 365), ACCOUNTS_SET_OI_IMBALANCE_HARD_BLOCK (line 501), and ACCOUNTS_SET_WALLET_CAP (line 586) all marked admin as writable: false. Every other admin-signed state-mutation instruction in the file (13 specs) uses writable: true. These three instructions modify the slab (writable: true on the slab account), confirming they are state-mutating operations where the runtime may need the admin account to be writable (e.g., for rent or fee deduction). Transactions built with the old specs could fail Solana runtime validation if the on-chain program attempts to modify the admin account. 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 24 minutes and 35 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 |
Summary
Three admin-signed state-mutation account specs marked admin as
writable: falsewhile all 13 other admin specs usewritable: true:ACCOUNTS_SET_INSURANCE_ISOLATION(accounts.ts:365)ACCOUNTS_SET_OI_IMBALANCE_HARD_BLOCK(accounts.ts:501)ACCOUNTS_SET_WALLET_CAP(accounts.ts:586)All three instructions modify the slab (
writable: trueon the slab account), confirming they are state-mutating operations. Transactions built with the old specs could fail runtime validation if the on-chain program needs the admin account to be writable.Changes
Set
writable: trueon the admin account in all three specs.Test plan
npm run lintcleanvitest run: same 14 pre-existing failures, zero new failures