filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.83k stars 1.25k forks source link

[BUG] LOTUS_ENABLE_CHAINSTORE_FALLBACK=1 invalid #6055

Open rickiey opened 3 years ago

rickiey commented 3 years ago

When I set LOTUS_ENABLE_CHAINSTORE_FALLBACK=1 and then start lotus daemon:

$ lotus daemon --halt-after-import --import-snapshot complete_chain_with_finality_stateroots_latest.car            

$ cat /etc/systemd/system/lotus-daemon.service
[Unit]
Description=Lotus Daemon
After=network-online.target
Requires=network-online.target

[Service]
Environment=GOLOG_FILE="/var/log/lotus/daemon.log"
Environment=GOLOG_LOG_FMT="json"
Environment=LOTUS_ENABLE_CHAINSTORE_FALLBACK=1
ExecStart=/usr/local/bin/lotus daemon
Restart=always
RestartSec=2

#MemoryAccounting=true
MemoryHigh=80G
MemoryMax=100G
LimitNOFILE=8192:50240

[Install]
WantedBy=multi-user.target

$ systemctl start lotus-daemon.service

An error occurred when I query some historical data: {\"code\": 1, \"msg\"\": load state tree: failed to load state tree: failed to load hamt node: blockstore: block not found}"}

rickiey commented 3 years ago

After magik6k Fix fallback chainstore #6003

rickiey commented 3 years ago

lotus version 1.7.0-dev+mainnet+git.b54b1303f

jennijuju commented 3 years ago

After magik6k Fix fallback chainstore #6003

The error is suggesting you dont have the state. Are you reimporting a snapshot on a clear datastore? If not - you need to make sure that the epoch of the last block is no later than the epoch of the first block the snapshot contains.Or if there isn't much historic state accesses, LOTUS_ENABLE_CHAINSTORE_FALLBACK=1 should work

rickiey commented 3 years ago

I have removed datastore/chain, and reimporting https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/complete_chain_with_finality_stateroots_latest.car; It is normal in v1.5.3, An error occurred in v1.6.0: https://github.com/filecoin-project/lotus/issues/5975, magik6k fixed it: https://github.com/filecoin-project/lotus/pull/6003, Then when I re-imported an error occurred: block not found

donnol commented 3 years ago

I use v1.9.0rc1 to build lotus, and start with LOTUS_ENABLE_CHAINSTORE_FALLBACK=1 env. I got 'block not found' error too. I want to know if the lotus node will pull missing state/receipts from the network with that env. And if true, why it doesn't work?

rickiey commented 3 years ago

v1.10.1 Still fail