You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scout is a Ethereum 2.0 Phase 2 execution prototyping engine.
Warning: this is super experimental
Goals
Create a (black boxed) execution prototyping engine
Create some example contracts ("execution scripts")
Enable "easy" onboarding for creating scripts
By having actual real world use cases in scripts, we can benchmark the design and identify bottlenecks
What is this?
This engine intentionally avoids a lot of details and therefore it is not usable as a Eth 2.0 client.
Instead of being a client, it should support reading and outputting shard/beacon states in a YAML format.
How to use this?
Install Rust first. Add the wasm32 target to the toolchain and install chisel using cargo:
The runner expects a filename pointing to the test file or will default to test.yaml in the local directory if nothing was specified.
How to code scripts?
An example script is located in scripts/helloworld. It uses ewasm-rust-api with the experimental eth2 feature.
externcrate ewasm_api;use ewasm_api::*;#[cfg(not(test))]#[no_mangle]pubextern"C"fnmain(){let pre_state_root = eth2::load_pre_state_root();assert!(eth2::block_data_size() == 0);// No updates were made to the statelet post_state_root = pre_state_root;
eth2::save_post_state_root(post_state)}
A better example is located in scripts/bazaar which is in essence a stateless contract. It uses SSZ serialisation. A test case is included in bazaar.yaml.
It should be possible to import any Rust crate as long as it can be compiled to the wasm32 target.
Maintainer
Alex Beregszaszi
License
Apache 2.0
About
Scout is a Ethereum 2.0 Phase 2 execution prototyping engine.