ewasm / scout

Scout is a Ethereum 2.0 Phase 2 execution prototyping engine.
Apache License 2.0
90 stars 16 forks source link

Yaml format to support shard ids and environment addresses. #44

Open poemm opened 4 years ago

poemm commented 4 years ago

The following is a proposed sample yaml file which supports both shards ids and environment addresses. (I should write a schema, which yaml schema definition language is preferred?)

prestates: # list of envs (envid, shardid, wasm filename, pre_state)
 - envid: 0x1000000000000000000000000000000000000000000000000000000000000000
   shardid: 1
   code: helloshards.wasm
   stateroot: 0x0000000000000000000000000000000000000000000000000000000000000000
 - envid: 0x2000000000000000000000000000000000000000000000000000000000000000
   shardid: 2
   code: helloshards.wasm
   stateroot: 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
timeslots: # list of time slots each with a list of shard_blocks (envid, calldata)
 - slot:
   - envid: 0x1000000000000000000000000000000000000000000000000000000000000000
     inputdata: 0x0200000000000000000000000000000000000000000000000000000000000000
   - envid: 0x2000000000000000000000000000000000000000000000000000000000000000
     inputdata: 0x0100000000000000000000000000000000000000000000000000000000000000
 - slot:
   - envid: 0x1000000000000000000000000000000000000000000000000000000000000000
     inputdata: 0x0000000000000000000000000000000000000000000000000000000000000000
poststates: # list of envs (envid, shardid, post_state)
 - envid: 0x1000000000000000000000000000000000000000000000000000000000000000
   shardid: 0
   stateroot: 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
 - envid: 0x2000000000000000000000000000000000000000000000000000000000000000
   shardid: 1
   stateroot: 0x0000000000000000000000000000000000000000000000000000000000000000

Before I extend C, C++, and Python Scout yaml parsers, I am soliciting feedback.

This is a dependency to test shard-aware host functions proposed here https://github.com/ewasm/scout/issues/38 .

s1na commented 4 years ago

I'd say let's change envaddr either to address or contract or a combination, get rid of EE terminology. Also rename timeslots to blocks?

axic commented 4 years ago

The version I use locally is the following:


beacon_state:
  execution_scripts:
    - scripts/helloworld/target/wasm32-unknown-unknown/release/phase2_helloworld.wasm
shards:
  - id: 0
    pre_states:
      - "0000000000000000000000000000000000000000000000000000000000000000"
    transitions:
      - env: 0
        data: ""
    post_states:
      - "0000000000000000000000000000000000000000000000000000000000000000"
    depost_receipts: