Skip to content

Move apps should have access to accounts data #62

@ksolana

Description

@ksolana

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions