Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize Genesis state #344

Closed
aakoshh opened this issue Mar 20, 2023 · 1 comment · Fixed by consensus-shipyard/fendermint#51
Closed

Initialize Genesis state #344

aakoshh opened this issue Mar 20, 2023 · 1 comment · Fixed by consensus-shipyard/fendermint#51

Comments

@aakoshh
Copy link
Contributor

aakoshh commented Mar 20, 2023

Initialize the FVM state tree from the genesis in #345

Examples of this are:

Forest doesn't have an actor-specific intialisation code, because it loads a singe CAR file prepared by Lotus that has all the state exported in just the right format already.

@aakoshh
Copy link
Contributor Author

aakoshh commented Mar 21, 2023

One question is what to pass in InitChain::app_state_bytes?

Option 1

We could, as Tendermint suggests, take the serialized application state

Pros:

  • If we go for the first option, we can resume the chain from a snapshot, passing the height to Tendermint.
    Cons:
  • In this case we would need a CLI command to take the Genesis and turn it into a CAR file like Lotus. IIRC this is possible with the Rust library, but it's a bit non-intuitive, not clear in the API.
  • We also need a way to interrogate the state to produce the list of validators and their power, which we currently don't have an actor to put into.

Option 2

We can take the serialized Genesis type and fill the state in the app.

Cons:

  • If this is our only way to start, we'd have to export snapshots in this format.
    Pros:
  • We can delay creating an actor to hold the validator state, because the validators are right there in Genesis, we can return them to Tendermint; in this milestone they are not expected to change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants