-
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
cli: idl close to directly an idl address #2760
cli: idl close to directly an idl address #2760
Conversation
@ochaloup is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why upgrade
command doesn't close the buffer account by default, perhaps to version the IDLs? If you don't have any objections, I think we should close the buffer account similar to how program upgrades work and historical data should be left to RPC providers.
d938e35
to
eb71503
Compare
To me the suggestion makes perfect sense. I would expect it should work this way to follow how the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you thing adding the idl_close call at id_upgrade makes this working as you proposed?
Yes, it works great but the upgrade output is a bit confusing:
Idl buffer created: CK5yrU9hjfgPRjEN5PKTLK7UD6niW1C7RvBXstrwjJfm
Idl account closed: CK5yrU9hjfgPRjEN5PKTLK7UD6niW1C7RvBXstrwjJfm
Maybe we should log the upgrade was successful and the IDL account key?
Also, could you note both of these changes in the CHANGELOG? I think closing the buffer account is a breaking change since it's possible some people are using the buffer account.
eb71503
to
8e3cc5d
Compare
8e3cc5d
to
c5b0efb
Compare
@acheroncrypto Sure. So it's a new update here in PR. Let's see. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow the previous change that removed short
was overridden but I restored it. Thanks!
Ah, that was probably my wrong, sorry. Thanks for looking into this, for fixing and merging 😉 |
On upgrading the IDL account
It creates the IDL buffer and then it writes the buffer to the program IDL account.
The IDL buffer is still opened. It's not possible to use
anchor idl close
with specific IDL address (e.g., address of the buffer) to close it and get back the rent for the account.Adding the optional argument of providing the IDL address directly makes possible to close the buffer account as well.