广西师范大学学报(自然科学版) ›› 2025, Vol. 43 ›› Issue (4): 108-119.doi: 10.16088/j.issn.1001-6600.2024101101

• 智能信息处理 • 上一篇    下一篇

基于Raft改进的拜占庭容错共识机制

李莉*, 姜淼   

  1. 东北林业大学 计算机与控制工程学院, 黑龙江 哈尔滨 150040
  • 收稿日期:2024-10-11 修回日期:2025-01-16 出版日期:2025-07-05 发布日期:2025-07-14
  • 通讯作者: 李莉(1977—),女,河南孟州人,东北林业大学教授,博士。E-mail: lli@nefu.edu.cn
  • 基金资助:
    黑龙江省重点研发计划(2022ZX01A30);黑龙江省高等教育教学改革研究重点项目(SJGZB2024069)

Byzantine Fault-Tolerant Consensus Mechanism Based on Raft Improvement

LI Li*, JIANG Miao   

  1. College of Computer and Control Engineering, Northeast Forestry University, Harbin Heilongjiang 150040, China
  • Received:2024-10-11 Revised:2025-01-16 Online:2025-07-05 Published:2025-07-14

摘要: 随着区块链技术在金融、医疗等行业的深入应用,其面临的挑战日益凸显。其中,最为关键的便是共识机制的优化与发展。目前,联盟链主要采用的PBFT和Raft共识机制均存在一定局限性。PBFT共识机制通信量会随区块链网络中节点数量的增加而呈指数级别上升,导致效率降低;而Raft共识机制虽然在效率上有所优化,但其抗拜占庭攻击能力弱。针对上述问题,本文提出一种基于Raft的抗拜占庭攻击的共识机制MRBFT。首先,在Raft选举过程中引入信誉值机制,选举信誉值较高的节点来提升当选节点可靠性;在选举Leader的同时,选举出总节点数量中一定比例的Monitor节点。其次,在共识过程中,由Monitor节点对其余节点的行为进行监督,提升算法抗拜占庭攻击的能力,同时对节点的信誉值进行更新,保证每轮选举都能选出最值得信赖的节点,提升算法的安全性。实验结果表明,在与PBFT抗拜占庭攻击能力相同的情况下,随着节点数量的增加,MRBFT通信量更低,通信开销为PBFT的44%,吞吐量为PBFT的1.5倍。对比同类算法,在安全性近似的场景下,吞吐量和共识时延上都具有较为明显的优化效果。

关键词: 区块链, 共识机制, 拜占庭攻击, 监督策略, 信誉值机制

Abstract: With the in-depth application of blockchain technology in industries such as finance and healthcare, the challenges it faces are becoming increasingly prominent. Among them, the optimization and development of consensus mechanisms are the most crucial. Currently, the two consensus protocols are mainly adopted by consortium chains, PBFT and Raft, and both have certain limitations. The communication volume of the PBFT consensus mechanism increases exponentially with the increase in the number of nodes in the blockchain network, leading to a decrease in efficiency. Although the Raft consensus mechanism has been optimized in terms of efficiency, its ability to resist Byzantine attacks is weak. To address these issues, a consensus mechanism MRBFT based on Raft that resists Byzantine attacks is proposed. Firstly, a reputation value mechanism is introduced in the Raft election process. By electing nodes with higher reputation values, the reliability of the elected nodes is enhanced. At the same time, a certain proportion of Monitor nodes are elected along with the Leader. Secondly, during the consensus process, the Monitor nodes supervise the behavior of the other nodes to enhance the algorithm’s ability to resist Byzantine attacks. At the same time, the reputation values of the nodes are updated to ensure that the most trustworthy nodes are elected in each round, improving the security of the algorithm. Experimental results show that, under the same conditions of resisting Byzantine attacks as PBFT, as the number of nodes increases, MRBFT has lower communication volume, with communication overhead being 44% of PBFT and throughput being 1.5 times that of PBFT. Compared with similar algorithms, in scenarios with similar security, it has more obvious optimization effects in terms of throughput and consensus delay.

Key words: blockchain, consensus mechanism, Byzantine attacks, supervisory strategy, reputation value mechanism

中图分类号:  TP311.13

[1] 代闯闯, 栾海晶, 杨雪莹, 等. 区块链技术研究综述[J]. 计算机科学, 2021,48(增刊2): 500-508. DOI: 10.11896/jsjkx.201200163.
[2] RAJASEKARAN A S, AZEES M, AL-TURJMAN F. A comprehensive survey on blockchain technology[J]. Sustainable Energy Technologies and Assessments, 2022, 52(Part A): 102039. DOI: 10.1016/j.seta.2022.102039.
[3] AZBEG K, OUCHETTO O, JAI ANDALOUSSI S, et al. An overview of blockchain consensus algorithms: comparison, challenges and future directions[C]// Advances on Smart and Soft Computing. Singapore: Springer, 2021: 357-369. DOI: 10.1007/978-981-15-6048-4_31.
[4] NAKAMOTO S. Bitcoin: a peer-to-peer electronic cash system[EB/OL]. (2008-10-31)[2024-10-11]. https://nakamotoinstitute.org/library/bitcoin/.
[5] SALEH F. Blockchain without waste: proof-of-stake[J]. The Review of Financial Studies, 2021, 34(3): 1156-1190. DOI: 10.1093/rfs/hhaa075.
[6] WANG B, LI H L, PAN L. Optimized DPoS consensus strategy: credit-weighted comprehensive election[J]. Ain Shams Engineering Journal, 2023, 14(2): 101874. DOI: 10.1016/j.asej.2022.101874.
[7] JIANG W X, WU X X, SONG M Y, et al. Improved PBFT algorithm based on comprehensive evaluation model[J]. Applied Sciences, 2023, 13(2): 1117. DOI: 10.3390/app13021117.
[8] HUANG X, LIANG Z H, ZHANG Q K, et al. Research on edge cloud data storage method of power operation site in Internet of things environment based on Paxos algorithm[J]. Journal of Testing and Evaluation, 2024, 52(3): 1738-1751. DOI: 10.1520/JTE20220713.
[9] YANG S J, TAN P L, FU H W. Improved raft consensus algorithm based on NSGA-II and K-Means++[C]// 2024 10th International Symposium on System Security, Safety, and Reliability (ISSSR). Los Alamitos, CA: IEEE Computer Society, 2024: 383-390. DOI: 10.1109/ISSSR61934.2024.00055.
[10] DREYER J, FISHER M, TÖNJES R. Performance analysis of hyperledger fabric 2.0 blockchain platform[C]// Proceedings of the Workshop on Cloud Continuum Services for Smart IoT Systems. New York, NY: Association for Computing Machinery, 2020: 32-38. DOI: 10.1145/3417310.3431398.
[11] 陈子豪, 李强. 基于K-medoids的改进PBFT共识机制[J]. 计算机科学, 2019,46(12): 101-107. DOI: 10.11896/jsjkx.181002014.
[12] 高娜, 周创明, 杨春晓, 等. 基于网络自聚类的PBFT算法改进[J]. 计算机应用研究, 2021, 38(11): 3236-3242. DOI: 10.19734/j.issn.1001-3695.2021.03.0098.
[13] 胡继圆, 于瓅. 基于信誉机制分组的改进PBFT算法[J]. 湖北民族大学学报(自然科学版), 2023,41(1): 85-89, 95. DOI: 10.13501/j.cnki.42-1908/n.2023.03.013.
[14] CHEN J H, ZHANG X, SHANGGUAN P F. Improved PBFT algorithm based on reputation and voting mechanism[J]. Journal of Physics: Conference Series, 2020, 1486(3): 032023. DOI: 10.1088/1742-6596/1486/3/032023.
[15] TANG S, WANG Z Q, JIANG J, et al. Improved PBFT algorithm for high-frequency trading scenarios of alliance blockchain[J]. Scientific Reports, 2022, 12(1): 4426. DOI: 10.1038/s41598-022-08587-1.
[16] GOLAN GUETA G, ABRAHAM I, GROSSMAN S, et al. SBFT: a scalable and decentralized trust infrastructure[C]// 2019 49th Annual IEEE/IFIP International Conference on Dependable Systems and Networks (DSN). Los Alamitos, CA: IEEE Computer Society, 2019: 568-580. DOI: 10.1109/DSN.2019.00063.
[17] 陈苏明, 王冰, 陈玉全, 等. 基于节点分组信誉模型的改进PBFT共识算法[J]. 计算机应用研究, 2023,40(10): 2916-2921. DOI: 10.19734/j.issn.1001-3695.2023.03.0091.
[18] 翟社平, 廉佳颖, 杨锐, 等. 基于Raft分组的实用拜占庭容错共识算法[J]. 计算机应用研究, 2023,40(11): 3218-3224, 3234. DOI: 10.19734/j.issn.1001-3695.2023.03.0100.
[19] 黄冬艳, 李浪, 陈斌, 等. RBFT:基于Raft集群的拜占庭容错共识机制[J]. 通信学报, 2021,42(3): 209-219. DOI: 10.11959/j.issn.1000-436x.2021043.
[20] 李淑芝, 邹懿杰, 邓小鸿, 等. RB-Raft:一种抗拜占庭节点的Raft共识算法[J]. 计算机应用研究, 2022, 39(9): 2591-2596. DOI: 10.19734/j.issn.1001-3695.2022.03.0090.
[21] 杨州, 周创明. 融合可验证随机函数的改进Raft共识算法[J]. 空军工程大学学报, 2023, 24(6): 104-111. DOI: 10.3969/j.issn.2097-1915.2023.06.014.
[22] 李莉, 李昊泽, 李涛. 基于Raft的多主节点拜占庭容错共识机制[J]. 广西师范大学学报(自然科学版), 2024,42(3): 121-130. DOI: 10.16088/j.issn.1001-6600.2023100805.
[23] 袁昊天, 李飞. 基于改进Raft共识算法和PBFT共识算法的双层共识算法[J]. 计算机应用研究, 2024,41(5): 1314-1320. DOI: 10.19734/j.issn.1001-3695.2023.08.0390.
[24] WANG L E, BAI Y, JIANG Q, et al. Beh-raft-chain: a behavior-based fast blockchain protocol for complex networks[J]. IEEE Transactions on Network Science and Engineering, 2021, 8(2): 1154-1166. DOI: 10.1109/TNSE.2020.2984490.
[1] 李莉, 李昊泽, 李涛. 基于Raft的多主节点拜占庭容错共识机制[J]. 广西师范大学学报(自然科学版), 2024, 42(3): 121-130.
[2] 王帆, 王灿, 甘友春, 贺旭辉, 张雪菲, 张羽, 喻亚洲. 基于链上链下协同的多元分布式储能交易机制[J]. 广西师范大学学报(自然科学版), 2024, 42(1): 39-53.
[3] 于枫, 孟令辉, 彭家辉, 李先贤, 瞿斌. 一种基于区块链的物联网数据安全交易方案[J]. 广西师范大学学报(自然科学版), 2023, 41(4): 84-95.
[4] 王涵, 王绪安, 周能, 柳玉东. 基于区块链的可审计数据分享方案[J]. 广西师范大学学报(自然科学版), 2020, 38(2): 1-7.
[5] 陈汹, 朱钰, 封科, 于同伟. 基于区块链的电力系统安全稳定控制终端身份认证[J]. 广西师范大学学报(自然科学版), 2020, 38(2): 8-18.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
[1] 何安康, 陈艳平, 扈应, 黄瑞章, 秦永彬. 融合边界交互信息的命名实体识别方法[J]. 广西师范大学学报(自然科学版), 2025, 43(3): 1 -11 .
[2] 卢展跃, 陈艳平, 杨卫哲, 黄瑞章, 秦永彬. 基于掩码注意力与多特征卷积网络的关系抽取方法[J]. 广西师范大学学报(自然科学版), 2025, 43(3): 12 -22 .
[3] 齐丹丹, 王长征, 郭少茹, 闫智超, 胡志伟, 苏雪峰, 马博翔, 李时钊, 李茹. 基于主题多视图表示的零样本实体检索方法[J]. 广西师范大学学报(自然科学版), 2025, 43(3): 23 -34 .
[4] 黄川洋, 程灿儿, 李松威, 陈鸿东, 张秋楠, 张钊, 邵来鹏, 唐剑, 王咏梅, 郭奎奎, 陆航林, 胡君辉. 带涂覆层的长周期光纤光栅温度传感特性研究[J]. 广西师范大学学报(自然科学版), 2025, 43(3): 35 -42 .
[5] 田晟, 熊辰崟, 龙安洋. 基于改进PointNet++的城市道路点云分类方法[J]. 广西师范大学学报(自然科学版), 2025, 43(4): 1 -14 .
[6] 黎宗孝, 张健, 罗鑫悦, 赵嶷飞, 卢飞. 基于K-means和Adam-LSTM的机场进场航迹预测研究[J]. 广西师范大学学报(自然科学版), 2025, 43(4): 15 -23 .
[7] 宋铭楷, 朱成杰. 基于H-WOA-GWO和区段修正策略的配电网故障定位研究[J]. 广西师范大学学报(自然科学版), 2025, 43(4): 24 -37 .
[8] 陈禹, 陈磊, 张怡, 张志瑞. 基于QMD-LDBO-BiGRU的风速预测模型[J]. 广西师范大学学报(自然科学版), 2025, 43(4): 38 -57 .
[9] 韩烁, 江林峰, 杨建斌. 基于注意力机制PINNs方法求解圣维南方程[J]. 广西师范大学学报(自然科学版), 2025, 43(4): 58 -68 .
[10] 李志欣, 匡文兰. 结合互注意力空间自适应和特征对集成判别的细粒度图像分类[J]. 广西师范大学学报(自然科学版), 2025, 43(4): 69 -82 .
版权所有 © 广西师范大学学报(自然科学版)编辑部
地址:广西桂林市三里店育才路15号 邮编:541004
电话:0773-5857325 E-mail: gxsdzkb@mailbox.gxnu.edu.cn
本系统由北京玛格泰克科技发展有限公司设计开发