-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lang: Require IdlCreateAccounts
instruction authority to be the program authority
#3423
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
| bench | 1,041,928 | 🔴 **+250,920 (31.72%)** | | ||
| bench | 1,106,136 | 🔴 **+315,128 (39.84%)** | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's crazy that this simple change adds ~60 KB to the program binary. I guess we could optimize it by not using the existing types such as ProgramData
(which imports bincode
) and interpreting the account data ourselves, but given we're planning to get rid of these instructions, it's probably fine to keep it as is and not complicate things further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool to see that you're tracking this. 60kb does sound way too much, but I agree with you here
looks good! |
Problem
As mentioned in #444 (comment),
IdlCreateAccounts
instruction is permissionless, meaning anyone can claim the IDL authority of a program if it hasn't yet been claimed:anchor/lang/syn/src/codegen/program/idl.rs
Lines 39 to 41 in be3ab99
Summary of changes
Require
from
account ofIdlCreateAccounts
to be the program authority.Note: This only changes the initial IDL creation instruction authority, meaning any existing IDL authority won't be affected by this change. Ideally, the IDL authority and the program deploy authority should be the same, but given that could break existing programs, it makes more sense to only let the IDL account be initialized by the program deploy authority.
Resolves #444