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. |
acheroncrypto
left a comment
There was a problem hiding this comment.
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 |
acheroncrypto
left a comment
There was a problem hiding this comment.
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. |
acheroncrypto
left a comment
There was a problem hiding this comment.
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 😉 |
…fter `idl upgrade` (otter-sec#2760) Co-authored-by: acheron <acheroncrypto@gmail.com>
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 closewith 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.