Skip to content
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

Move apps should have access to accounts data #62

Open
ksolana opened this issue Jun 9, 2024 · 1 comment
Open

Move apps should have access to accounts data #62

ksolana opened this issue Jun 9, 2024 · 1 comment
Labels
bug Something isn't working Stale

Comments

@ksolana
Copy link
Collaborator

ksolana commented Jun 9, 2024

The move apps only use the instruction_data for now. the program_id and the accounts array are unused by the entrypoint(generated by the compiler) as well as the entry function(in the move programs).

Currently the workaround is to pass accounts data as args (in the instruction_data) but this doesn't look clean. The upside of this approach is that there is no extra cost for apps who dont need to use the data, and can chose not to pass those as args.

There are different approaches we can take but we should make sure any approach we take is long term as it will be hard to change it in the future. We probably need to safeguard the stack to make sure a program doesn't access anything outside.

  1. [The original idea from Dmitri] VM sets up the stack of the entry function with program_id, accounts, and instruction_data parameters. The move compiler generates code that is executed before entry function proper code starts, to deserialize the actual arguments of this entry function based on its knowledge of the parameter types.

  2. Entry function can have a pointer to the data (which is stored on stack) as their first parameter. entry function can chose to parse the data or not.

@ksolana ksolana added the bug Something isn't working label Jun 9, 2024
Copy link

github-actions bot commented Aug 9, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

1 participant