-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Produce an RFC that discusses how programs are loaded on-chain #940
Comments
To load and call a program we could follow a similar approach as the wallet does when performing budget transactions:
Flow could look like this:
At this point, the program is fully loaded. The user would then create a new instance (account) that contains the program state. Program state would typically start with an initial state (empty tic tac toe game, etc...), but that's not required, a user could use whatever state they wanted (prior game state for example)
At this point, the program is fully loaded, and a fully populated instance has been created. The users then send transactions with inputs.
When the program_call transaction is handled, Solana will load the program into an instance of the VM and then send it the instance account and the input data from the transaction. The program would run, modify instance state, and return, at which time Solana would update the instance account with the resulting new state. Any combination of multiple programs and multiple instances could be supported. For example, an existing program might be loaded and have multiple running instances. A new version of the program could be loaded, and multiple instances could be started concurrently. Some outstanding questions:
|
Effectively done |
Rough stetch:
The text was updated successfully, but these errors were encountered: