Forest Growth

Forest Growth

Authored by Ben Adar

An update from the last month of work on Forest

Forest is ChainSafe's Rust implementation of the Filecoin protocol. Rust provides a foundation for building blockchains with memory safety and performance as a priority. Filecoin is an open-source blockchain-based decentralized storage network. Check out this primer by former Forest Tech Lead Austin Abell to learn more about the project. Also, be sure to check out Amer Ameen's high-level overview of Forest at April's Filecoin Virtual Community Meetup!

Audit Update

This month, the Forest team has been working closely with the Sigma Prime team for the codebase audit, which is nearing completion. With the preliminary audit report already in the hands of the Forest team, they have created Git issues for the suggested improvements and bug fixes. These suggestions have been labelled as FORs 1–16 and are tracked with THIS EPIC!

So far, over 50 percent of the issues have been closed, including:

  • FOR-02: Inconsistent Deserialisation of Address

  • FOR-04: Inconsistent Code Paths in the Multisig Actor #1136

  • FOR-08: Disabled Gossipsub Scoring Parameters

  • FOR-10: Inconsistent CONSENSUS_MINER_MIN_MINERS Constant Value to Lotus #1142

  • FOR-11: Incorrect message_id in Gossipsub

  • FOR-14 — Unencrypted Private Keys

  • FOR-16: Unnecessary Extensive Permissions for Private Keys

The remaining open issues include:

  • FOR-01: Denial-of-Service via Panic in Block Validation

  • FOR-03 Inconsistent Deserialisation of Randomness

  • FOR-07: Panic when Unmarshalling String Data Types

  • FOR-12: No Validation Of Genesis And Initial Drand Beacons

  • FOR-13: Potential Reentrancy in the Multisig Actor

  • FOR-09: Inconsistent Beacon Entry Validation Across Forks

  • Research Spike: FOR-06: Panics in indexmap and hashbrown Libraries

Keep up with our announcements and updates as the Audit continues to unfold!

Integrating Storage & Retrieval Markets

As mentioned in the previous Forest update the team has been working on integrating the storage and retrieval markets. The motivation behind this goal is to integrate the Go version of the markets module so that the team does not need to build it from scratch. This integration will allow all Forest nodes the ability to make storage and retrieval deals!

In the last month, the team has worked on implementing full pay channel functionality #553 and worked on payment channel RPC methods #529.

More work is already well underway, be sure to keep up with our updates to learn more!

State Migration

Penguin Migration

The Forest team has been implementing a State Migration, giving Forest the ability to sync over hard forks where the state tree form changes. Currently, whenever this state change happens, the team has to intervene manually and sync from a snapshot after the change. The State Migration allows Forest to do this on the fly as it's syncing past the height of the hard fork where the form of the state tree changes.

Check out this ➡️ Solution doc that outlines the purpose & details behind this work!

This month, the team made a checklist tracking Network Migrations from v1-v13 to allow them to point to a list of migrations they are capable of syncing to. Ideally, this would include the epoch as well. So far the team has:

Once the State Migration is fully implemented and running on Forest, the node will be a whole new beast, with much more flexibility and smoother syncing.

Performance

The importance of metrics has not been lost on the Forest team, as they have been busy adding instrumentation these last few months. The goal is to have a complete view of all the on goings happening within Forest. The team wants to understand how the node is performing and where bottlenecks might be happening. As mentioned in the previous Forest update, some of the metrics that the team is collecting include:

  • tipset processing time,

  • Gossipsub messages stats,

  • counter of tipsets received through Gossipsub which fail validation,

  • gauge of rocksDB size on disk,

  • count of TipsetRangeSyncer future errors,

  • and libp2p metrics

Currently, the metrics are being collected and the Grafana/Prometheus server stacks are implemented, which the team uses to track and visualize metrics. Great progress has been made on this front, and you can even check out the sample Forest dashboard below! ⬇️⬇️⬇️⬇️⬇️

RPC & CLI Updates

As you might have read in our previous updates, the team has been working on updating the RPC and CLI commands. These commands are mainly focused on the State, Message Pool, and P2P CLI. The team will also be importing many of the most important commands from Lotus, allowing the Forest CLI to interoperate with the Lotus node. The goal is to make Forest more usable for an end-user, be those new users to the Filecoin ecosystem or users coming from other nodes. This will include tons of changes that will ultimately help scale the RPC and CLI. It will even give Forest read/write/sign/admin permissions handling capabilities for each endpoint.

This month the team has:

  • Finished work on the RPC API with permissions, allowing for a new program to be built that imports the interface and is able to make calls to the RPC node. The RPC server and client make use of this interface.

  • Finished work on the wallet CLI commands!

  • Worked on the message pool CLI commands.

  • Implemented Forest CLI FULLNODE_API_INFO support, and - rpc_port override. This implementation will give Forest the Lotus capability that lets it be run in both daemon and in client mode. This is because the client allows HTTP JSON-RPC commands to be sent to a remote server.

Moving forward the team will continue implementing the Network RPC API and ChainSync CLI commands. Very soon, Forest will be smoother and more usable than ever! \(^▽^)/

Get Involved!

If you are interested in getting involved and contributing to the project, check out our Github. If you would like to contact one of the Forest team members, please drop by on Chainsafe's Discord or email forest@chainsafe.io. We would love to know more about you, your team and your project!

For more details on Forest, please head to our documentation site.

Learn more about ChainSafe by visiting our website, through our Medium, via Twitter, or visiting the ChainSafe GitHub.