This repository contains the reference implementation of the Filecoin VM (specs). It is written in Rust, and intended to be integrated via FFI into non-Rust clients (e.g. Lotus, Fuhon), or directly into Rust clients (e.g. Forest). FFI bindings for Go are provided in-repo, and developers are encouraged to contribute bindings for other languages.
rust-toolchain(this is picked up by
$ git clone https://github.com/filecoin-project/ref-fvm.git $ cd fvm $ rustup target add wasm32-unknown-unknown $ make
Here's what you'll find in each directory:
Machine: an instantiation of the machine, anchored at a specific state root and epoch, ready to intake messages to be applied.
Executor: an object to execute messages on a
CallManager: tracks and manages the call stack for a given message.
Kernel: the environment attached to an invocation container for external interactions.
criterionRust library to measure the performance and overhead of ref-fvm across various facets.
VECTOR=test-vectors/corpus/specs_actors_v6/REST_OF_TEST_VECTOR.json cargo test -- conformance --nocapture
VECTOR=test-vectors/corpus/specs_actors_v6/REST_OF_TEST_VECTOR.json cargo bench -- conformance --nocapture
VECTOR=test-vectors/corpus/specs_actors_v6/REST_OF_TEST_VECTOR.json cargo bench -- overhead --nocapture. Note that the vector choice doesn't matter much, because the Machine initialization procedure is identicall for all vectors.
CARGO_PROFILE_BENCH_DEBUG=true VECTOR=testing/conformance/test-vectors/corpus/specs_actors_v6/REST_OF_TEST_VECTOR.json cargo flamegraph --bench bench_conformance -- --nocapture. The output SVG will be in
bench_init_only: measure the overhead of running the benchmark itself, it doesn't send any messages to the FVM to process.
bench_500_simple_state_access: measures the overhead of calling the
pubkey_addressmethod on an account actor 500 times, this is the most lightweight message possible to send that actually executes actor logic (unlike a bare send).