Addition of SealGenesis command that runs the previous genesis creation logic:
Load builtin/custom actor and deploy ipc contracts using memory store. Implementation not changed, just shifted location.
Write memory store to Car file.
InitChain just reads the car file bytes into the StateStore
This PR is just an implementation of the flow, it's a quick way to show if the flow actually works. Pending items to make it ready for review:
[x] Integration testing. The current state of the PR might have missing steps (unlikely, but possible), will actually perform integration testing to ensure it actually works.
[x] Unit tests.
[x] Some further code clean up and simplification.
[x] Fix broken CI due to this change.
To actually try it out, perform the following:
# generate the fendermint genesis first, then seal the genesis state
cargo run -p fendermint_app --release -- genesis --genesis-file test-network/genesis.json \
ipc \
seal-state \
--builtin-actors-path <FULL PATH TO YOUR BUILT_IN BUNDLE> \
--custom-actors-path <FULL PATH TO YOUR CUSTOM BUNDLE> \
--artifacts-path <FULL PATH TO YOUR CONTRACT OUT FOLDER> \
--output-path <FULL PATH TO YOUR SEALED STATE OUTPUT PATH>
# convert to cometbft genesis
cargo run -p fendermint_app --release -- \
genesis --genesis-file test-network/genesis.json \
into-tendermint --out ~/.cometbft/config/genesis.json --sealed <FULL PATH TO YOUR SEALED STATE OUTPUT PATH>
[x] Add a version number to the sealed state schema.
[x] Compress the state tree CAR with Snappy + encode in base64 instead of hex.
[ ] Add a debugging tool to inspect the state tree. Iterate over the state tree printing actor IDs, code CIDs, actor names (resolved from the Code CID), balances.
This PR follows this discussion to address #1002.
The flow is simpler now with:
SealGenesis
command that runs the previous genesis creation logic:InitChain
just reads the car file bytes into theStateStore
This PR is just an implementation of the flow, it's a quick way to show if the flow actually works. Pending items to make it ready for review:
To actually try it out, perform the following: