Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Executable accounts are immutable, don't need to copy account data during load #15683

Closed
jackcmay opened this issue Mar 3, 2021 · 5 comments
Closed
Milestone

Comments

@jackcmay
Copy link
Contributor

jackcmay commented Mar 3, 2021

Problem

Once an account is marked executable the data becomes immutable and there is no longer a need to copy its data out of the accounts database each time it is referenced. Instead, a shared read-only pointer could be used to refer to the account's data. The whole account could be shared via an Rc<RefCell<Account>> except for the possibility of folks transferring lamports to the account. There is no good reason for folks to do this but if any do, that new balance should be retained. Also, the benefit of this is somewhat minimized since with upgradeable program's the executable account is quite small and the bulk of the data is stored in the ProgramData account. One solution could be looking at the authority field and if None the program is no longer upgradeable and the ProgramData account could also be shared as immutable.

Proposed Solution

@jackcmay
Copy link
Contributor Author

jackcmay commented Mar 3, 2021

fyi @jeffwashington @Lichtso

@jeffwashington
Copy link
Contributor

related: #15639

@jeffwashington
Copy link
Contributor

also #15633

@mvines mvines added this to the The Future! milestone May 10, 2021
@jackcmay
Copy link
Contributor Author

@jeffwashington Both #15639 and #15633 are closed, do you see any further action required for this issue?

@jeffwashington
Copy link
Contributor

No. I think this does what you wanted.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants