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

Feature Request: IdlBuffer Program #7393

Open
ngundotra opened this issue Oct 23, 2024 · 4 comments
Open

Feature Request: IdlBuffer Program #7393

ngundotra opened this issue Oct 23, 2024 · 4 comments

Comments

@ngundotra
Copy link
Contributor

There has been some issue with supporting IDLs in the program binary via a new ELF header section, versus officially supporting IDLs in PDAs.

Given that Anza is prioritizing changes to make program binaries smaller & more efficient to load, it seems like officially supporting the IDL in PDAs is better for cluster performance.

Good place to start would probably be to copy the IdlInstructions from anchor's injected macros.

I think it would be awesome if uploading IDLs to this program was natively supported in solana program deploy as well

@nickfrosty
Copy link
Contributor

I think this is a great idea, especially if it was standard via the Solana/agave tooling. Having all programs upload their idl will boost comparability for programs

@buffalojoec
Copy link
Contributor

It might be interesting to consider some version pairing constraints. Imagine you store your program's version in the ELF header instead, and then when you register the IDL with IdlBuffer, the version has to match the deployed binary's program version (must be deployed, not a buffer, this way the ELF has been verified). This would unlock versioned IDLs and the ability to identify missing/outdated IDLs.

You could also - in the future - maybe outfit the IdlBuffer program to identify known interfaces in the IDL, to store PDAs that contain program IDs of registered SPL Token programs, for example.

In either case, the tricky part is for IdlBuffer to be able to verify the IDL is actually for the provided program. Otherwise, program authorities could register false IDLs for malicious programs. I suppose you can still do that with an Anchor program, though...

@ngundotra
Copy link
Contributor Author

@buffalojoec updated the spec to incorporate the versioning feedback: https://solanafoundation.notion.site/Program-Metadata-128d36dad52d801e974fcc3a30736506

@ngundotra
Copy link
Contributor Author

ngundotra commented Oct 23, 2024

I think it's better to leave the IdlBuffer unopinionated for now (storing only authority & bytes) & allow developers to figure out versioning systems - like just getting metadata.version in Codama & Anchor would be a win.

Relevant: https://discord.com/channels/428295358100013066/1295768706806321264/1298759290525319189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants