bigbangcore / BigBang

BigBang Core
https://www.bigbangcore.com/
MIT License
27 stars 7 forks source link

测试网络cached pow出块同时在同一个高度连续校验不过导致全网高度停滞(偶现) #592

Open ouyun opened 4 years ago

ouyun commented 4 years ago

supernode-verify-certtx-fail-log.tar.gz 3个节点组成一个测试网络:

从创世块启动后在高度为3时停滞,区块高度保持约有1个小时,强制手工退出; 附日志,可看出3个节点全部在高度4出cached pow块时卡住,出错信息均为:

2020-07-29 12:59:59.427957 : [CTxPool] <debug> {7fe760ffb700:powmaker} - ArrangeBlockTx: hashPrev is last block, target height: 4, new vtx size: 8, old vtx size: 4, view tx count: 8
2020-07-29 12:59:59.428498 : [CBlockChain] <info> {7fe760ffb700:powmaker} - VerifyBlockCertTx: not enough votes, votes: 0, dest: 20m0dfqskvwy26ckcz11kq60pssh3fvhd5ehfz8nb1pap2tqrc3ncez6w
2020-07-29 12:59:59.428541 : [bigbang] <info> {7fe760ffb700:powmaker} - <blockchain>VerifyPowBlock Verify Block Error(cert transaction quantity out of bounds) : 0000000480ad2456e9fad4e888ada64669961efee0bb77f3bec76d3978ea8634 
2020-07-29 12:59:59.428569 : [NetChannel] <error> {7fe760ffb700:powmaker} - AddCacheLocalPowBlock VerifyPowBlock fail: height: 4, block: 0000000480ad2456e9fad4e888ada64669961efee0bb77f3bec76d3978ea8634
2020-07-29 12:59:59.428580 : [CService] <error> {7fe760ffb700:powmaker} - SubmitWork: AddCacheLocalPowBlock fail

以上错误一直连续出现,导致所有节点中没有一个节点能成功生成区块,造成主网区块停滞,此issue并不必现。 跟踪错误,根源在: CBlockChain::VerifyBlockCertTx

            if (mt == mapVote.end() || mt->second < nMinAmount)
            {
                StdLog("CBlockChain", "VerifyBlockCertTx: not enough votes, votes: %ld, dest: %s",
                       (mt == mapVote.end() ? 0 : mt->second), CAddress(dest).ToString().c_str());
                return false;
            }

失败造成。

ouyun commented 4 years ago

这次复现在高度2:

stick-height-2-again.tar.gz