Open armaniferrante opened 2 years ago
Adding the diagrams from the discord thread for posterity.
Go from this:
To this:
An additional question we should consider is how to atomically update the program binary with the IDL. This is important for explorers. There are two options
I'm not sure if I fully grasp #1, I'm not familiar with the details of solana executables (and I got a C in operating systems haha) but #2 sounds reasonable to me.
A unrelated question I have is how do we manage the ownership/deployment of the IDL Program? Someone (I'm assuming you) will have to generate a keypair and be responsible for keeping the private key safe + deploying the program. We could set up a CI/CD deployment pipeline and store the encrypted private key so it can auto-deploy.
Someone on discord suggested using this project for key management/deployment: https://github.com/GokiProtocol/goki
I don't have experience with it but it looks interesting.
Dealing with upgrading the IDL program is probably the main argument against such a program. We would need some governance (probably a DAO) around it. My instinct is that it's better to just leave that up to the governance mechanism of the associated program rather than introduce another one, which would mean not introducing a separate program for IDLs. Binary sizes aren't a problem that I know of and the IDL instructions don't meaningfully complicate the macro code, so I think I'm in favor of leaving the IDL mechanism as is--embedded into the the program.
I agree that is probably the main argument against this. Do you have any idea how the SPL handles this for those programs?
IDL generation is an anchor feature and the SPL programs dont use anchor so they dont have to think about it.
but given that the explorer can parse token instructions, I assume there's a js/json file somewhere for some of the programs that is being manually updated
I'm now also of the opinion that it would be better to keep it inside the programs for the reason that I think introducing any kind of dao or similiar governance structure around anchor will slow us down too much.
In the future, this could be revisited tho imo. Having a separate program has the benefit that upgrading the IDL of all anchor programs, e.g. in case there's a bug in it, can be done through upgrading a single program.
Without an IDL program, if there's a bug in the IDL generation code, each anchor program has to upgrade themselves. For some this may be easy, for others, whose upgrades are subject to governance and timelocks, it will be more difficult. In addition, upgrading to a new anchor version would also mean incorporating other new anchor code into their projects (how much of a bad thing that is, I'm not sure yet).
I know SPL programs don't use IDL, I just meant how do they handle governance/upgrades
There should be a separate program that stores the IDLs as PDAs of a program id and version number, instead of embedding the IDL instructions into the program directly.