Closed garious closed 3 years ago
@jackcmay, looking in your general direction for this one.
I realized that right now a program can be "upgraded"/"replaced" by allowing it to self-destruct by forcing the program account's tokens to 0
, and then re-loading a new program into the account. Still thinking about whether this is something nice or not.
But in either case, this kind of "upgrade" wouldn't be atomic and program users would see transaction failures during this time (and at the moment be charged the transaction fee if I'm reading bank.rs right). If we like this kind of an "upgrade", then we should at least ensure transactions that are rejected during this window do not take the fee.
So I think the “feature” discussed in previous comment should be considered harmful and prohibited. If the loader of the program can yank and replace it at any time, they essentially have full access to all tokens that have ever been assigned to that program. This means that whenever an executable account hits zero tokens, that program_id probably should be blacklisted. Unfortunately this would mean that tokens in accounts owned by that program_id are unrecoverable. This doesn’t seem great. Alternatively an executable account lives forever?
I don't think we want executable accounts to live forever. They're probably the ones we least want to live forever, since they are very useless one a program's been upgraded. Also, they're likely going to be some of the largest accounts.
I think we can optimize for blacklisted account keys. It's not a route I'm really excited about, but feels least bad at the moment.
(302 to v0.12, I'm quite sure I won't have bandwidth to complete this issue in the next couple days)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Stale given upgradeable loader was released in v1.4.23
program_id
re-assignment of an account it controls, such as an erc20 account.