Skip to content
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

Open
ngundotra opened this issue Sep 4, 2024 · 2 comments
Labels
feature idl related to the IDL, either program or client side

Comments

@ngundotra
Copy link
Contributor

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.rs

Developers should still be able to opt-out of this default behavior and deploy the IDLs the old way.

@acheroncrypto acheroncrypto added idl related to the IDL, either program or client side feature labels Sep 5, 2024
@acheroncrypto
Copy link
Collaborator

Overall, this would be great.

If anchor IDLs were uploaded with program binaries, then we would have 100% IDL adoption, leading to increased transparency on Solana.

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.

Developers should still be able to opt-out of this default behavior and deploy the IDLs the old way.

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.

@ngundotra
Copy link
Contributor Author

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.

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🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature idl related to the IDL, either program or client side
Projects
None yet
Development

No branches or pull requests

2 participants