ChainSafe / ChainSafe/forest

Investigate genesis pledge mismatch

Open
#2,937 0 comments 0 reactions 0 assignees View on GitHub
Node Type: Bug
Dominant language
Rust
Stars
697
Forks
200
Avg merge
1d 3h
Merged PRs (30d)
64

Description

**Issue summary**
While working on the https://github.com/ChainSafe/forest/pull/2910 we discovered that there's a mismatch in the genesis pledge.

https://github.com/ChainSafe/forest/blob/171ef54d15aca25c9dc22ac51a604d20fda83191/blockchain/state_manager/src/vm_circ_supply.rs#L42

In the Forest implementation, it's hard-coded to 0, while in [Lotus](https://github.com/filecoin-project/lotus/blob/06946a8fce1fbdb793c247ab6376676c0a96a2c9/chain/stmgr/supply.go#L59-L65) it follows a bit more sophisticated logic with a call to the [Power actor](https://github.com/filecoin-project/lotus/blob/06946a8fce1fbdb793c247ab6376676c0a96a2c9/chain/stmgr/supply.go#L294-L306).

This, in turn, leaves Forest with `0` for the genesis pledge and Lotus with `2 attoFIL`. It doesn't appear to be consensus-critical but may surface in the future, and it would be good to align with the Lotus implementation. Otherwise, we should consider removing it if it's not used at all.

**Other information and links**

Contributor guide

Open the contributing guide

Research direction

Start in blockchain/state_manager/src/vm_circ_supply.rs at the genesis pledge logic and compare it with the linked Lotus supply and Power actor code. Trace whether the value is used elsewhere in Forest, then determine whether aligning the calculation or removing the unused value is appropriate. Done means the mismatch is resolved or its intentional retention/removal is clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.