-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: Anchor IDL should be uploaded to program binary instead of separate PDA #3225
Comments
Overall, this would be great.
It would increase the percentage, but I don't think we'd ever see 100% IDL adoption, especially if we give people the chance to opt out of this behavior.
Is this for backwards compatibility? We have to get rid of the IDL instructions when the IDL exists in the binary, otherwise the binary size will grow significantly. |
Yes this is true. I think aiming for 50% adoption or higher over next year would be attainable, with this change alone. On backwards compatibility, I am agnostic. On removing IDL instructions from the binary, this is super exciting because then deploying IDLs with your binary is essentially "free". In other words - this shouldn't change deployment costs 😄 ! That should make adopting this easier🤞 |
Core does not recommend putting IDLs in program binary. They are trying to shave all bits of program binaries down as much as possible. Accordingly, working on a different approach. Foundation is working on getting a program to upload program metadata on-chain like IDL, |
Makes sense. Similarly, I was going to say this is going to be very inefficient for clients as well, since they'd have to fetch the whole programdata account just to read a tiny portion of it. Adding a new RPC method probably isn't desired either.
That sounds great! I always thought having an IDL program would be better than including all IDL instructions inside all programs (like Anchor does now) anyway. What's planned sounds similar, but more general. |
Here is roughly the program spec we are thinking about: https://solanafoundation.notion.site/Program-Metadata-128d36dad52d801e974fcc3a30736506 |
Okay, after further discussion with Anza VM devs here, it seems that this was a miscommunication. Core seems to be fine with having arbitrary metadata in the ELF section headers. Given how much friction is caused by uploading IDLs via @febo and I have published An additional major benefit of uploading IDLs into binaries is that we can avoid the social consensus issue of getting program developers to use an IDL program. It's not impossible, but would suck to manage. |
To date, only 25% of Anchor programs have uploaded their IDL 🤯 (1,324 programs out of 5,335 anchor programs currently on
mainnet
).If anchor IDLs were uploaded with program binaries, then we would have 100% IDL adoption, leading to increased transparency on Solana.
Instead of requiring developers to write the compressed IDL bytes to the IDL address,
anchor build
should write the zipped bytes to an ELF section called.anchor.idl
. Example: https://github.com/nifty-oss/asset/blob/main/include-idl/src/lib.rsDevelopers should still be able to opt-out of this default behavior and deploy the IDLs the old way.
The text was updated successfully, but these errors were encountered: