Closed hackfisher closed 3 years ago
https://crab.subscan.io/block/0x34f61bfda344b3fad3c3e38832a91448b3c613b199eb23e5110a635d71c13c65
0x34f61bfda344b3fad3c3e38832a91448b3c613b199eb23e5110a635d71c13c65 is genesis block.
https://crab.subscan.io/block/0x34f61bfda344b3fad3c3e38832a91448b3c613b199eb23e5110a635d71c13c65
0x34f61bfda344b3fad3c3e38832a91448b3c613b199eb23e5110a635d71c13c65 is genesis block.
Actually, syncing headers is OK for pruning nodes as they also store all history headers. The reason why only genesis header has this error, is that it seems genesis header is not in the db, and it uses runtime api to get genesis throw rpc, but before that it need to check whether it have this rpc api in runtime throw query the state at block 0.
Archive mode support the state query at block 0, but no for pruning mode.
Refer
Great catch! A related pull request https://github.com/paritytech/frontier/pull/279
There were reports from some crab nodes(pruning mode), found error logs:
And @WoeOm tested that it will be back to normal if the node replace dvm/db with datas from other normal db.
The root cause is that in node pruning mode, the mapping sync worker will not able to sync blocks(might need to read some pruned state data in current rpc implementation).
Fix this by only enabling this worker on archive mode.
https://github.com/darwinia-network/darwinia-common/blob/d8896a3621cd8d6f00fc34238403720b62aad9c1/client/dvm/mapping-sync/src/worker.rs#L121
https://github.com/darwinia-network/darwinia-common/blob/d8896a3621cd8d6f00fc34238403720b62aad9c1/bin/node/cli/src/service.rs#L673
Need companion PR and fix for darwinia repo(Crab)