背景:
- v0.19.1在高度5150000后会执行新逻辑,如果有节点没升级导致与validator节点执行结果不一致出现app hash不一致问题,导致节点会挂掉
问题:
- 没有升级至v0.19.1版本的节点报如下错误:
E[2021-08-28|07:47:09.469][4640] dialing failed (attempts: 1): auth failure: secret conn failed: read tcp 172.16.90.61:44666->54.249.109.150:26656: i/o timeout module=pex addr=9e2aa6bd61c40f08782f7c2ff47d9ea197994b74@54.249.109.150:26656
panic: Failed to process committed block (5150002:42D43AEB9CE6F17C2517D65B487EFC352612D92BE8A05B154BFB67ADEEB678EB): wrong Block.Header.LastResultsHash. Expected DBC62DB6E38E211BFCF82A96CCCEE5C98C42AC0DD10D733E386C096ACF58EE22, got F0AF8B8E9B498F68631DF986F69BD41A9F97A3FD436CAD709C97A470AD28EDCA
goroutine 170 [running]:
github.com/tendermint/tendermint/blockchain/v0.(*BlockchainReactor).poolRoutine(0xc00003fba0)
/usr/local/go_workspace/pkg/mod/github.com/okex/tendermint@v0.33.9-exchain2/blockchain/v0/reactor.go:349 +0x1c67
created by github.com/tendermint/tendermint/blockchain/v0.(*BlockchainReactor).OnStart
/usr/local/go_workspace/pkg/mod/github.com/okex/tendermint@v0.33.9-exchain2/blockchain/v0/reactor.go:118 +0xad
解决方案:
1. 修复数据
// 确保commit为e8f67c3fbebbc3c278297bec10ad56b99db01452
git clone https://github.com/okex/exchain.git -b mxj/assign-height
cd exchain
make mainnet
exchaind start --rpc.unsafe --rest.laddr tcp://localhost:8545 --chain-id exchain-66 --log_level *:debug --trace --home your_exchaind_path --keyring-backend "test" --pruning=nothing --local-rpc-port 26657 --start_height 5150000 --halt-height=5150005 --p2p.seeds="e926c8154a2af4390de02303f0977802f15eafe2@3.16.103.80:26656,7fa5b1d1f1e48659fa750b6aec702418a0e75f13@35.177.8.240:26656,c8f32b793871b56a11d94336d9ce6472f893524b@18.167.16.85:26656"
参数解释:
--home your_exchaind_path // 指定自己本地节点的exchaind路径,即data目录的上层目录
--start_height 5150000 // 指定开始执行的高度
--halt_height 5150005 // 指定停止高度,即在高度5150005进程自动退出
2. 升级至v0.19.1版本
进程退出后,数据恢复完成,之后参考链接完成版本升级至v0.19.1。