Open gjtrowbridge opened 4 years ago
I'm not sure if it would be too much detail, but since you're showing the API for calling into the simulation, what are your thoughts on showing the API for EEs?
I'm not sure if it would be too much detail, but since you're showing the API for calling into the simulation, what are your thoughts on showing the API for EEs?
By EE API are you referring to the host functions available to EEs?
By EE API are you referring to the host functions available to EEs?
Both sides. So functions the EE has to export, and host functions.
Looks good! Might be interesting to add host functions, etc. in a future PR.
By EE API are you referring to the host functions available to EEs?
Both sides. So functions the EE has to export, and host functions.
I think currently there's nothing set in stone for functions EE has to export (since AFAIK technically the plan is for them to be arbitrary code), though I'd imagine most EEs would adhere to some sort of standard for functionality. Will definitely plan to add host functions to this in the future.
Looks good! Might be interesting to add host functions, etc. in a future PR.
Yep, will plan to add a list of these to the roadmap sometime soon (though it doesn't seem super urgent to publish that list so may not prioritize it immediately), and of course even once that list is up we can always add more (or remove some) as necessary in the future.
Simulation Repository Roadmap (subject to change)
Overall Goals:
Goal 1: Provide a basic interface for interacting with an Eth2-like simulation, specifically for creating and testing EEs.
Proposed Initial Interface
High-level Simulation Methods
We anticipate adding many more methods in the future, but here are the functions we think are most necessary for the initial goal of testing EEs in an Eth2-like environment.
Types / Structs
All types that are defined in the Phase 0 and Phase 1 spec documents will look the same in this simulation, with a couple exceptions: 1) Where appropriate, the simulation will either "mock" or neglect to include fields that are not relevant for the current goals of the simulation.
Unspecced Stuff
The following "unspecced" types will be included in the simulation:
ExecutionEnvironment
will be stored in the simulation on the spec'sBeaconState
struct as follows: Note: "Crosslinked" shard state was recently "specced", and is stored onBeaconState.shard_states
ShardTransaction
will be passed to the simulation as part ofShardBlock
, as follows:Note: this may not follow the spec exactly, but is useful for being able to execute a pre-bundled set of transactions on an EE via the
create_shard_block
function above. If necessary, this interface (and the associated structs) may change in the future.ExecutionEnvironments
will have shard-specific state, which will be stored as 32 bytes of arbitrary data (in most EEs, this 32 bytes is expected to be used to store the root hash of the EE's state tree)This shard-specific state will be stored on the the spec's
ShardState
struct as follows:Function Arguments
Goal 2: Support existing efforts to provide one or more examples of ExecutionEnvironments
The simulation repo already has some very basic EEs that can be used with the simulation (eg. users can create the EE in the simulation, run transactions on that EE, see the state update, etc).
However, one effort currently being worked on in parallel is to create one or more full-featured EEs that includes some of the features expected in "production" Eth2 EEs, such as:
The simulation should add whatever features are necessary to be compatible with this work.
Goal 2+: Keep up-to-date with the spec and add features as-necessary to support users