OpenAtomFoundation / xupercore

The kernel of xuperchain.
Apache License 2.0
61 stars 47 forks source link

Fixed the poa and pos consensus stopped producing blocks after operations such as proposal changes #325

Closed wangchao0222 closed 2 years ago

wangchao0222 commented 2 years ago

Description

通过系统合约进行共识提案投票或者变更候选人集合后,poa和pos类共识偶现停止出块 Fixes # (issue)

Type of change

Please delete options that are not relevant.

Brief of your solution

  1. miner中添加同步最长链检查,如果CompeteMaster后链高度变化,则需要重新计算CompeteMaster
  2. tdpos中计算calHisValidators时获取上一轮term的最后一个区块
  3. tdpos和chained-bft中添加部分日志

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration