| As a representative of a new generation of information technology,blockchain has become the industrial direction of the national key layout with big data,artificial intelligence and the Internet of Things.Due to the excellent characteristics of decentralization,tampering and traceability,blockchain has become a powerful supplement to the traditional centralized system,which is expected to have a fundamental change in the traditional industry.The consortium chain is the preferred framework for the current application of blockchain,and has been applied in the fields of finance,education,and medical treatment.The study of the consortium chain and its key algorithms is of great significance to the innovative development of blockchain.As the most widely used consortium chain system,HyperLeader Fabric provides a foundation for the landing of blockchain in various application scenarios.However,there are still many security risks in HyperLeader Fabric,such as Fabric using the Raft algorithm for consensus but does not have the ability to resist Byzantine nodes,the existence of malicious nodes will seriously affect system security,and the use of Gossip algorithm for message propagation but information redundancy is large,bringing greater latency.In view of the above problems,this paper conducts in-depth research on the consensus mechanism and message propagation mechanism in Fabric,and the main work completed is as follows:(1)In view of the problem that the Raft algorithm does not have anti-Byzantine nodes,an RBRaft(Resist Byzantine-Raft)algorithm that resists Byzantine nodes is designed.Firstly,the hash chain is used to iteratively hash each log,and the log is verified through the dynamic verification mechanism so that the malicious behavior of the Leader node has a certain fault tolerance rate,which solves the problem of log forgery and verification.Secondly,the "legacy" mechanism based on threshold encryption is proposed,which makes the Candidate node have the legitimacy to pull the vote,prevents the Byzantine node from pulling the ballot at will to replace the Leader node’s attack,and solves the problem of the Byzantine node affecting the system consistency.Then the improved algorithm is tested in detail.The experimental results show that the RB-Raft algorithm proposed in this paper has been optimized in log encryption and vote verification,and has done a good job in the comprehensiveness of the Raft algorithm against Byzantine nodes.(2)In view of the problem that a large number of messages are redundant in the process of message synchronization of Gossip algorithm,which in turn affects the efficiency of message synchronization,an improved Gossip algorithm-KT Gossip algorithm is proposed.Set up two different node types,P node for message forwarding,and D node for message distribution.By introducing high-performance nodes to process the message distribution path of the cluster,each module is streamlined,so that the distribution path is in the form of a K-tree,and the message propagation efficiency is greatly improved,which greatly reduces the redundancy of the message.Finally,experiments show that the KT-Gossip algorithm proposed in this paper greatly improves the efficiency of message forwarding and greatly reduces the degree of message redundancy,and can be applied to the Fabric platform. |