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

Update IDL program #2365

Merged
merged 13 commits into from
Jan 26, 2023
Merged

Update IDL program #2365

merged 13 commits into from
Jan 26, 2023

Conversation

Henry-E
Copy link

@Henry-E Henry-E commented Jan 20, 2023

The IDL program uses a bunch of deprecated account types. Updating to the new account types is non-trivial because of how some of the IDL types are stored in /lang and how the new account types require knowing the program_id of the program ahead of time.

Might also take the opportunity to add some requested security features from #1215 in which only the program upgrade authority can create and change the IDL. Not too sure about this yet, would need to check with users first how much of a hassle this change would be. Usually program upgrade authorities are gated behind complex multisig arrangement, it might be quite annoying to have to go through the process of signing an IDL update every time, although maybe not if you just update the IDL whenever the program is update, let's find out.

Another security thing is passing the wrong IDL account, noted here #1215 (comment), we can look into adding some constraints there too.

@vercel
Copy link

vercel bot commented Jan 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
anchor-docs ⬜️ Ignored (Inspect) Jan 26, 2023 at 11:15AM (UTC)

@Henry-E
Copy link
Author

Henry-E commented Jan 24, 2023

Note to self: The root of much evil is the "internal" namespace. If we can get rid of that it cleans up a lot of hacky internal code. The main issues being

  • it's a breaking change for the discriminator to change
  • I still have to figure out where the TS client gets the discriminator for IdlAccount from, is it hard coded or is scraped as part of the IDL generation process?

@Henry-E
Copy link
Author

Henry-E commented Jan 26, 2023

I ended up not adding too many extra features just because IDL is already such a weird and outdated program that trying to modify it without making a breaking change is real pain and not necessarily worth the effort if it's already doing the job.

@Henry-E Henry-E merged commit 2a05075 into master Jan 26, 2023
@Henry-E Henry-E deleted the update-idl-program branch January 26, 2023 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant