Contract Startup Process#

  1. GenVM is started with “message”

  2. GenVM receives contract code for recipient address from Host

  3. GenVM inspects contract code to find construct a file tree of it

  4. If contract code is a zip it is equivalent to tree

  5. If it is a plain-text contract, then GenVM tries to parse “runner comment” from it (as of now, #, //, -- are supported),

    and constructs following tree: /file = <original file>, /runner.json = <parsed comment>

  6. It acts upon /runner.json provided actions

  7. In the end this actions must lead to StartWasm one

  8. GenVM starts wasm, with stdin of calldata-encoded ExtendedMessage

  9. For startup contract must use following fields:

    1. entry_kind one of main, sandbox and consensus_stage.

      Main means regular contract entry, sandbox stands for sandbox and consensus_stage has entry_stage_data used for non-deterministic operation

    2. entry_data blob of bytes

    3. entry_stage_data calldata information provided by “consensus implementation”.

      Right now it is null for leader and {leaders_result: <calldata>} for validator