Glow of the Canopy #1 🌱: Nourishing the Filecoin Virtual Machine with help from Forest 🌲
Authored by Timothy Hao Chi Ho
An update from the Forest team on our latest progress
Forest is ChainSafe's Rust implementation of the Filecoin protocol, an open-source blockchain-based decentralized storage network. Rust provides a foundation for building blockchains with memory safety and performance as a priority. As such, a Rust client for Filecoin will bring diversity and resilience to a network currently largely run on Lotus - Filecoin's reference implementation in Go. Check out this primer to learn more about Forest. Also, be sure to check out Lee Raj's high-level overview of Forest at Filecoin Orbit, 2021! Finally, dig into the code here and jump into our Discord to get in touch.
Our time since the Alpha launch
In our last update, we left off with the announcement of Forest's alpha launch. Since then, we've focused our efforts on expanding the team to meet the talent and resource requirements for building the Rust implementation of Filecoin. Concurrently, the Forest team has made two additional releases on alpha, including v0.2.0 and v0.2.1. This includes support for:
-
Full mainnet compatibility
-
Filecoin network v14 🍫 "Chocolate" 🍫 , which included UX and core protocol improvements
-
General improvements for performance and stability
-
Audit bug fixes
Since the alpha initial launch, the team has also worked through an audit from ConsenSys (thanks to Alex Wade) on Forest's Rust actors. Actors are quintessential components of the Filecoin protocol, and changes to the state of the blockchain can only be triggered through an invocation of several built-in, protocol-defined actors. This makes the Rust language implementation of actors a key stepping stone to the project's success, and an audit of its codebase mission-critical.
Introducing the Filecoin Virtual Machine
A novel consideration for why the audit is so important for the Forest team and the Filecoin ecosystem writ large is because of a major development in parallel: the Filecoin Virtual Machine (FVM).
In June 2021, Juan Benet submitted a proposal to expand smart contract capabilities on the network. This implies the development of a robust virtual machine for the protocol. By allowing for user-defined programmability and smart contracts via the FVM, more complex logic and applications can be built on top of the pre-existing Layer 0, which is predominantly for storage and retrieval.
Protocol Labs and the Filecoin Foundation settled on an FVM built with a WASM (WebAssembly) core, which means user-defined smart contracts can be written in any programming language that compiles to a WASM target. In this way, many different virtual machines (VMs) - including the Ethereum Virtual Machine (EVM) - can be accommodated. The benefits for designing a polyglot VM is expansive, including leveraging a host of mature tooling from Ethereum in the context of Filecoin such as Truffle, Remix, Hardhat, and more.
See Raul Kripalani's kickoff blog post for full details.
ChainSafe's role in the FVM
ChainSafe is proud to have contributed to the reference implementation of the FVM (ref-fvm) in substantial ways. Since the ref-fvm is written in Rust, contributors had extensive development experience from the Forest team to draw from. Additionally, the logic of the built-in actors was forked from the Forest implementation (actors v6) and adapted to work on the FVM. In fact, this now makes the Forest Rust actors the canonical implementation. We have also since added the FVM backend in parallel with our native backend, meaning you can either run a node using the FVM or the pure Rust code.
Filecoin's recent announcement of the ref-fvm is a momentous milestone, with the ref-fvm repo officially open-sourced, a new website deployed, and an incentivized Early Builders Program introduced. Ref-fvm is currently in pre-alpha v0, but the foundation has been laid with support for built-in actors completed (ChainSafe's Forest 🌲 team will be maintaining the built-in actors repo with the Filecoin Foundation ). We're looking forward to seeing v1, where user-deployed actors and smart contracts will be enabled!
Next steps
The Forest team is currently working on compatibility with Filecoin's latest network upgrades, including Network Version 15 and 16. We are also implementing actors v7, as well as working towards joining the other alternative Filecoin clients (like Venus and Fuhon) to exclusively run FVM after the NV16 upgrade.
Acknowledgements
Thank you to Lee Raj and lil eth for their contributions to the writing of this article.
About ChainSafe
ChainSafe is a leading blockchain research and development firm specializing in infrastructure solutions for the decentralized web. Alongside client implementations for Ethereum, Polkadot, Filecoin, and Mina, we're building a portfolio of web3 products - Files, Storage, the Gaming SDK, and ChainBridge. As part of our mission to build innovative products for users and better tooling for developers, ChainSafe embodies an open source and community-oriented ethos. To learn more, click here.
Want to help build the foundations of web3? Join us!
Have a question, comment, or suggestion? Drop into our Discord and join the conversation! We're also always looking for talented people. Check out our open positions and get in touch ➡️ ➡️ careers@chainsafe.io