Closed creativcoder closed 1 year ago
Yeah, this is because we aren't cleaning up the HEAD
file. We should really be validating it.
Just reproduced it now as well:
thread 'main' panicked at 'Failed to load heaviest tipset: NotFound("Key for header")', /Users/guillaume/Code/forest/blockchain/chain/src/store/chain_store.rs:234:14
Note that I didn't do anything special (e.g. cleaning db or anything else). Just hit ctrl+c to stop forest then relaunched it.
Describe the bug
Forest panics when run post
db clean
at callingheaviest_tipset
during startup. The file backed chain metadata info was introduced in https://github.com/ChainSafe/forest/pull/2635context:
To Reproduce Steps to reproduce the behavior:
forest-cli --chain calibnet db clean
forest --chain calibnet --encrypt-keystore false
Log output
Log Output
```➜ forest2 git:(main) forest --chain calibnet --encrypt-keystore false 2023-03-21T12:06:05.680299Z INFO forest: Using default calibnet config 2023-03-21T12:06:05.681304Z INFO forest::daemon: Starting Forest daemon, version 0.6.0+git.3e68aa3f 2023-03-21T12:06:05.681409Z INFO forest_libp2p::service: Could not decode networking keystore! 2023-03-21T12:06:05.681867Z INFO forest_utils::io: Permissions set to 0600 on File { fd: 9, path: "/root/.local/share/forest/libp2p/keypair", read: false, write: true } 2023-03-21T12:06:05.682079Z INFO forest::daemon: PeerId: 12D3KooWG5KKNqbhVQ6u3M75rXiJMwKdR8UbTdnvNWqemb5Ds4CR 2023-03-21T12:06:05.682111Z WARN forest::daemon: Warning: Keystore encryption disabled! 2023-03-21T12:06:05.682291Z INFO forest::daemon: Admin token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJBbGxvdyI6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXSwiZXhwIjoxNjg0NTg0MzY1fQ.OTKQSVTZbNsxJ2T10u6Q_fujfmZfiktHTzcTSGIAD-Y 2023-03-21T12:06:05.683556Z INFO forest::daemon: Prometheus server started at 0.0.0.0:6116 2023-03-21T12:06:05.689456Z INFO forest_genesis: Initialized genesis: BlockHeader: Cid(bafy2bzacecyaggy24wol5ruvs6qm73gjibs2l2iyhcqmvi7r7a4ph7zx3yqd4) 2023-03-21T12:06:05.690566Z INFO forest::daemon: Using network :: calibnet thread 'main' panicked at 'Failed to load heaviest tipset: NotFound("Key for header")', /root/forest2/blockchain/chain/src/store/chain_store.rs:240:14 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace [1] 3452847 IOT instruction (core dumped) target/release/forest --chain calibnet --encrypt-keystore false ```Expected behaviour
Screenshots
Environment (please complete the following information):
rustc --version
)Other information and links