All Projects → ewasm → scout

ewasm / scout

Licence: Apache-2.0 License
Scout is a Ethereum 2.0 Phase 2 execution prototyping engine.

Programming Languages

rust
11053 projects
Makefile
30231 projects

Projects that are alternatives of or similar to scout

shorelark
Simulation of life & evolution
Stars: ✭ 109 (+34.57%)
Mutual labels:  webassembly
ricardo-forth
Forth dialect implemented in C, Javascript, WebAssembly and compiled from C to asm.js and WebAssembly.
Stars: ✭ 26 (-67.9%)
Mutual labels:  webassembly
holyc
An easy to use C++ to WASM compiler (Highly-experimental)
Stars: ✭ 33 (-59.26%)
Mutual labels:  webassembly
WasmEdge-go
The GO language SDK and API for WasmEdge
Stars: ✭ 62 (-23.46%)
Mutual labels:  webassembly
libOpenDRIVE
Small, lightweight C++ library for handling OpenDRIVE files
Stars: ✭ 104 (+28.4%)
Mutual labels:  webassembly
awesome-swiftwasm
A community-driven curated list of SwiftWasm projects and content
Stars: ✭ 117 (+44.44%)
Mutual labels:  webassembly
fast-base64
Fastest base64 on the web, with Wasm + SIMD
Stars: ✭ 23 (-71.6%)
Mutual labels:  webassembly
learn-wasm
🎲 Learning WebAssembly
Stars: ✭ 57 (-29.63%)
Mutual labels:  webassembly
go-wasm-examples
Some small examples of using Go and WebAssembly
Stars: ✭ 22 (-72.84%)
Mutual labels:  webassembly
magnum-integration
Integration libraries for the Magnum C++11/C++14 graphics engine
Stars: ✭ 75 (-7.41%)
Mutual labels:  webassembly
rustwasmc
Tool for building Rust functions for Node.js. Combine the performance of Rust, safety and portability of WebAssembly, and ease of use of JavaScript.
Stars: ✭ 97 (+19.75%)
Mutual labels:  webassembly
kotlin-gradle-templates
Quick start kotlin gradle DSL
Stars: ✭ 50 (-38.27%)
Mutual labels:  webassembly
rustexp
A Rust regular expression editor and tester that runs entirely within the browser!
Stars: ✭ 59 (-27.16%)
Mutual labels:  webassembly
block-aligner
SIMD-accelerated library for computing global and X-drop affine gap penalty sequence-to-sequence or sequence-to-profile alignments using an adaptive block-based algorithm.
Stars: ✭ 58 (-28.4%)
Mutual labels:  webassembly
idris-codegen-wasm
WebAssembly Code Generation Backend for Idris Compiler
Stars: ✭ 79 (-2.47%)
Mutual labels:  webassembly
yew-router
Router extension to yew
Stars: ✭ 27 (-66.67%)
Mutual labels:  webassembly
wapc-rust
Rust-based WebAssembly Host Runtime for waPC-compliant modules
Stars: ✭ 75 (-7.41%)
Mutual labels:  webassembly
SadlyDistributed
Distributing your code(soul), in almost any language(state), among a cluster of idle browsers(voids)
Stars: ✭ 20 (-75.31%)
Mutual labels:  webassembly
Babylon.Font
Generate text mesh for BabylonJS using WASM, written in AssemblyScript.
Stars: ✭ 22 (-72.84%)
Mutual labels:  webassembly
krustlet-wasmcloud-provider
Kubernetes Rust Kubelet provider for wasmCloud
Stars: ✭ 15 (-81.48%)
Mutual labels:  webassembly

Scout

Scout is a Ethereum 2.0 Phase 2 execution prototyping engine.

Warning: this is super experimental

Goals

  1. Create a (black boxed) execution prototyping engine
  2. Create some example contracts ("execution scripts")
  3. Enable "easy" onboarding for creating scripts
  4. 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:

rustup target add wasm32-unknown-unknown
rustup component add rustfmt
rustup update
cargo install chisel

There is a Makefile to make building easy:

  • build will build all components (the runner and the example scripts)
  • test will run tests using the YAML test files
  • all will do both

The runner is called scout and is available at target/release/phase2-scout after being built.

The runner expects a YAML test file:

beacon_state:
  execution_scripts:
    - scripts/helloworld/target/wasm32-unknown-unknown/release/phase2_helloworld.wasm
shard_pre_state:
  exec_env_states:
    - "0000000000000000000000000000000000000000000000000000000000000000"
shard_blocks:
  - env: 0
    data: ""
  - env: 0
    data: ""
shard_post_state:
  exec_env_states:
    - "0000000000000000000000000000000000000000000000000000000000000000"

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.

extern crate ewasm_api;

use ewasm_api::*;

#[cfg(not(test))]
#[no_mangle]
pub extern "C" fn main() {
    let pre_state_root = eth2::load_pre_state_root();

    assert!(eth2::block_data_size() == 0);

    // No updates were made to the state
    let 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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].