Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blockchain 分叉无法自动回滚 #1236

Closed
bysomeone opened this issue Apr 1, 2022 · 2 comments · Fixed by #1238 or bityuan/bityuan#157
Closed

blockchain 分叉无法自动回滚 #1236

bysomeone opened this issue Apr 1, 2022 · 2 comments · Fixed by #1238 or bityuan/bityuan#157
Labels

Comments

@bysomeone
Copy link
Collaborator

bysomeone commented Apr 1, 2022

当节点在分叉链时, 无法自动恢复, 长时间区块高度不增长 (偶发)

bysomeone added a commit to bysomeone/chain33 that referenced this issue Apr 2, 2022
@bysomeone
Copy link
Collaborator Author

bysomeone commented Apr 11, 2022

相关问题&调整方法

分叉处理下载后续区块, 依赖单一节点, 存在单点故障

  • 调整为, 通过次高节点寻找分叉点, 再获取分叉高度后, 所有当前高度大于之前次高高度的节点均认为活跃节点, 用于下载分叉后的正常区块

侧链区块执行后即保存于数据库中, 节点重启后没有加载到 blockchain index node缓存, 导致后续侧链区块无法衔接, 导致ErrParentBlockNotExist错误

  • 对于重启节点情况,侧链区块无法在启动时自动加载到 index node缓存, 调整为重新触发保存逻辑,修改blockExist判定函数,增加主链区块哈希是否一致判定,这样对于侧链区块,就能在启动后重新执行,保证侧链区块在index node缓存记录中连续可以连接。

bysomeone added a commit to bysomeone/chain33 that referenced this issue Apr 11, 2022
33cn pushed a commit that referenced this issue Apr 18, 2022
33cn pushed a commit that referenced this issue Apr 18, 2022
<a name="1.67.2"></a>
## [1.67.2](v1.67.1...v1.67.2) (2022-04-18)

### Bug Fixes

* add fork chain detection(#1236) ([192058e](192058e)), closes [#1236](#1236)
@33cn
Copy link
Owner

33cn commented Apr 18, 2022

🎉 This issue has been resolved in version 1.67.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants