filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.85k stars 1.27k forks source link

Prototype: specs-actors in a VM #7001

Open Stebalien opened 3 years ago

Stebalien commented 3 years ago

Currently, the lotus filecoin actors are native code written in go. As a step along the path towards a general-purpose smart-contract VM in Filecoin, we're going to try (experimentally) swapping out specs-actors with WASM compiled actors (likely based on https://github.com/ChainSafe/forest/tree/main/vm/actor).

This will allow us to experiment with inter-actor calling conventions, syscall conventions, IPLD data handling, code deployment, etc. without making any changes to the network/spec itself.

Roadmap:

  1. Compiled WASM (for now) specs-actors that can sync the chain.
  2. Define an inter-actor message sending convention compatible with both EVM smart contracts and Filecoin Actors.
  3. Define a syscall API (treat system-calls as inter-actor calls, if possible).
  4. Define an API for working with IPLD objects (that ensures that all linked data is reachable, properly encoded, performant, etc.).
  5. Define a "code registry" for deploying new contracts. This will likely be an extension to the init actor (b ut privileged for now as we won't allow deploying contracts until we've settled on a design).

Out of scope for this epic: user-deployable smart-contracts on mainnet. We'll be learning about VMs in a secure, risk-free way.

jennijuju commented 3 years ago

do you want to start an epic? What’s the name gonna be?