Network adaptive asynchronous Byzantine consensus system and method
By designing a network adaptive asynchronous Byzantine consensus system in a blockchain system, using transaction broadcast module and boundary consensus module, combining fast channel and asynchronous channel, dynamically adjusting the consensus solution, the existing technology has not performed well in complex network environments. The problem of high performance and high robustness is achieved.
Patent Information
- Application Number
- CN202410981979.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-12
AI Technical Summary
The existing asynchronous Byzantine consensus algorithms do not perform well in good network environments, while some synchronous Byzantine consensus algorithms are inactivated in harsh asynchronous network environments and cannot maintain high performance and high robustness in complex network environments.
A network adaptive asynchronous Byzantine consensus system was designed, through the transaction broadcast module and the boundary consensus module of parallel execution, combining fast channel and asynchronous channel, using the network state perceptron and two-step step synchronizer, dynamically adjusting the execution strategy and selecting Suitable consensus schemes for improved performance and robustness.
It realizes an asynchronous Byzantine consensus solution that maintains high performance and high robustness in complex network environments, and can automatically adjust according to changes in network environments, improving the overall performance and stability of the blockchain system.
Smart Images

Figure CN118945172A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and more specifically, to a network adaptive asynchronous Byzantine consensus system and method. Background Art
[0002] Consensus algorithm is one of the core research areas of blockchain system, especially the asynchronous Byzantine consensus algorithm, which has significant advantages in Byzantine fault tolerance and support for asynchronous network models with unlimited delays.
[0003] The consensus algorithm of blockchain is used by all nodes in the system to reach a consensus on the block data on the chain to ensure the consistency and security of the blockchain system. In the alliance chain, the consensus algorithm is usually divided into a partially synchronous Byzantine consensus algorithm and an asynchronous Byzantine consensus algorithm. The partially synchronous Byzantine consensus algorithm usually adopts a consensus scheme with a timeout mechanism, which has higher performance, but loses activity in a harsh asynchronous network environment. The asynchronous Byzantine consensus algorithm usually adopts a pure asynchronous consensus scheme that can maintain activity in a harsh asynchronous network environment. It has stronger robustness, but is limited by the harsh asynchronous network assumption. The pure asynchronous consensus scheme requires more complex inter-node communication to ensure the activity of the algorithm, and cannot show high performance in a good network environment.
[0004] In summary, existing asynchronous Byzantine consensus algorithms usually cannot maintain high performance in good network scenarios, and some synchronous Byzantine consensus algorithms will lose their activity in harsh asynchronous network environments. Therefore, it is necessary to improve the consensus scheme of the blockchain system to enhance its adaptability to complex network environments. Summary of the invention
[0005] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a network adaptive asynchronous Byzantine consensus system and method.
[0006] According to a first aspect of the present invention, a network adaptive asynchronous Byzantine consensus system is provided. The system comprises: a transaction broadcast module and a parallel executed boundary consensus module, wherein the boundary consensus module comprises a fast channel, an asynchronous channel, a network state sensor and a two-step pace synchronizer, wherein:
[0007] The transaction broadcast module forms a set of growing proposal chains through parallel transaction broadcasts. During the transaction broadcast process, all consensus nodes lead a broadcast to other nodes as leader nodes. When a predetermined number of proposal chains are generated, the current farthest boundary of each leader node is passed to the boundary consensus module.
[0008] The boundary consensus module is used to reach a boundary consensus on the farthest boundaries received from each leader node, and obtain the effective boundary to confirm the proposal range of the latest block;
[0009] The network status sensor is used to determine the switch between the fast channel and the asynchronous channel according to the network status. In the fast channel, multiple nodes take turns to serve as the leader node and make consensus on the block boundary through broadcasting. In the asynchronous channel, the effective boundary is obtained based on the known farthest block boundary using a multi-valued Byzantine consensus algorithm.
[0010] The two-step pace synchronizer is used to ensure that each node starts a new round of boundary consensus from the same position when switching between the fast channel and the asynchronous channel.
[0011] According to a second aspect of the present invention, a network adaptive asynchronous Byzantine consensus method is provided. The method comprises the following steps:
[0012] A set of growing proposal chains is formed through parallel transaction broadcasts. During the transaction broadcast process, all consensus nodes lead a broadcast as leader nodes to broadcast their proposals to other nodes, and when a predetermined number of proposal chains are generated, the current farthest boundary of each leader node is determined;
[0013] Based on the current farthest boundary of each leader node, a boundary consensus is reached to obtain the effective boundary to confirm the proposal range of the latest block. In the boundary consensus process, the switching between the fast channel and the asynchronous channel is determined according to the network status. In the fast channel, multiple nodes take turns as leader nodes and reach consensus on block boundaries through broadcasting. In the asynchronous channel, based on the known farthest block boundary, a multi-valued Byzantine consensus algorithm is used to obtain the effective boundary. When switching between the fast channel and the asynchronous channel, each node is guaranteed to start a new round of boundary consensus from the same position.
[0014] Compared with the prior art, the advantage of the present invention is that it proposes an asynchronous Byzantine consensus scheme that dynamically adjusts the execution strategy according to changes in the network environment, thereby improving the overall performance of the consensus mechanism under complex network models. By designing a network state sensor and a dual-channel execution mode, the present invention can choose to execute a consensus scheme with a timeout mechanism or a pure asynchronous consensus scheme according to changes in the network environment, and can maintain high performance and high robustness even in a complex network environment by combining transaction broadcasting and consensus parallelism.
[0015] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
[0017] Figure 1 is a general architecture diagram of a network adaptive asynchronous Byzantine consensus system according to an embodiment of the present invention;
[0018] Figure 2 is a structural diagram of a network status sensor according to an embodiment of the present invention;
[0019] Figure 3 is a structural diagram of a two-step pace synchronizer according to an embodiment of the present invention;
[0020] Figure 4 It is a flow chart of a network adaptive asynchronous Byzantine consensus method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.
[0022] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
[0023] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0024] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0025] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0026] In the blockchain system, the core idea of the Byzantine Fault Tolerant consensus mechanism is to use the information transmission and voting mechanism between nodes to reach a consensus on a proposal. For example, each node can propose a proposal and then send the proposal to other nodes. After receiving the proposal, the node will vote based on the content of the proposal and the feedback from other nodes. When a set number of nodes vote in favor of a proposal, the proposal is considered to be the result of consensus.
[0027] In order to solve the problem that the consensus scheme with timeout mechanism is deactivated in a bad asynchronous network environment and the performance of the pure asynchronous consensus scheme is low, the present invention decouples the consensus and broadcast processes by adopting a solution of parallel transaction broadcast and consensus module. In addition, a fast channel, asynchronous channel, network status sensor, two-step pace synchronizer, etc. are designed for the consensus module to sense the network status and automatically select the best consensus channel for execution.
[0028] See also Figure 1 As shown, the provided network adaptive asynchronous Byzantine consensus system generally includes a transaction broadcast module and a parallel execution boundary consensus module. The boundary consensus module includes a fast channel, a state sensor, an asynchronous channel, etc.
[0029] The purpose of the transaction broadcast module is to form a set of growing proposal chains. The growth of the proposal chain is completed by n (n is the number of blockchain consensus nodes) consecutively running transaction broadcasts. This parallel transaction broadcast can improve the utilization of network bandwidth resources while ensuring Byzantine fault tolerance, thereby improving the transaction throughput of the algorithm. Each broadcast is led by a node, which continuously broadcasts the proposals input by this node to the entire network to form an orderly proposal chain. The proposal contains nf (f is the number of Byzantine nodes) set number of people (or set number of nodes) to prove the legitimacy of the proposal. Only after the proof of the current proposal is collected, the leader will continue to broadcast the next proposal. The block of the consensus scheme corresponds to a segment of n proposal chains. The segment is divided by the block boundary. The block boundary records a set of index values of size n, corresponding to the location of the proposals of n broadcasts. All proposals between the previous block boundary and the current block boundary are the proposals contained in the current block. The generation of block boundaries is completed by the boundary consensus module. When the transaction broadcast module generates a sufficient number of proposal chain growths, the current farthest boundary of this node is input to the boundary consensus module, and the boundary consensus module outputs a legal consensus boundary.
[0030] Specifically, see the transaction broadcast module Figure 1 In the multipoint broadcast part, all consensus nodes lead a broadcast to other nodes as leaders. Each proposal contains a number of transactions B, which can be adjusted as a parameter. For example, the leader nodes are P1, P2, P3 and P4. In a transaction broadcast, the leader node broadcasts the proposal Txs of this round to all nodes each time. i And the proof of the last proposal received in the last round of broadcast. After receiving the broadcast message, each node will i Temporarily store and verify whether the proof of the previous round of proposals can pass. If it can pass, the proposal Txs of the previous round of broadcasts will be persistently stored i-1 , then this node will Txs iThe signatures are sent to the leader node. After the leader node receives the set number of legitimate signatures, it starts the next round of broadcasting, and the cycle continues.
[0031] The boundary consensus module is responsible for reaching consensus on the farthest boundary of each node's multicast to confirm the proposed range of the latest block. The multicast module of each node inputs the farthest boundary to the processing queue of the boundary consensus module, and the boundary consensus module outputs a valid boundary among all input boundaries as the boundary value of the latest block.
[0032] Specifically, see Figure 1 The boundary consensus part of the boundary consensus module includes a fast channel, an asynchronous channel, a network status sensor, a two-step pace synchronizer, etc. It can dynamically sense the network status and select the best consensus scheme based on the network status. When the network is in a partially synchronized state, the fast channel is executed, and when the network is in an asynchronous state, the asynchronous channel is executed.
[0033] The fast channel is led by n nodes in turn, and a fast consensus on block boundaries is achieved through broadcasting. It can run efficiently in partially synchronized networks. The broadcast introduces a timeout mechanism, and when a timeout interrupt occurs, the node consensus progress is input into the network status sensor to determine the network status.
[0034] Specifically, the fast channel uses a broadcast with a timeout mechanism to quickly reach a consensus. The broadcast content is the boundary of the block to be agreed upon proposed by the leader. When starting a new fast channel, the result epoch%n of the modulus of the total number of nodes in the current fast channel generation is used as the node that serves as the leader of this generation. Each node resets the timer during each round of broadcast output. If the timer times out before the broadcast output, a timeout interrupt is triggered, and each node ends the fast channel of this generation and inputs the farthest broadcast progress of this node into the network status sensor.
[0035] The asynchronous channel executes a multi-valued Byzantine consensus algorithm (MVBA). Each node inputs the farthest block boundary known so far, and MVBA outputs one of all legal boundaries as the next block boundary. The asynchronous channel can be executed efficiently in an asynchronous network to solve the problem of fast channel inactivation in an asynchronous network.
[0036] Specifically, the asynchronous channel is implemented by MVBA (Multi-Value Byzantine Consensus Algorithm). After executing the asynchronous channel once, the algorithm continues to try to execute the fast channel to increase the execution probability of the fast channel and ensure that high-performance consensus is maintained as much as possible. After all nodes broadcast their respective farthest boundaries to other nodes, each node generates a random sequence through a coin tossing algorithm, and performs asynchronous binary consensus on the farthest boundaries of the nodes according to the random order until the consensus output is 1 (1 means that all nodes have reached a consensus and believe that the farthest boundary can be output as a legal boundary). The corresponding farthest boundary is output as the consensus block boundary, and the output block boundary needs to be able to pass the assertive legal judgment of the external input.
[0037] The network status sensor is triggered when the fast channel times out. It is used to determine the current network status and decide whether to continue executing the fast channel or switch to the asynchronous channel. The boundary consensus module gives priority to the fast channel with higher performance. When the fast channel is interrupted and the attempt to recover is invalid, the network is considered to have entered an asynchronous state and switched to the asynchronous channel. The state perception module stipulates that when an abnormal exit occurs from the fast channel midway and the farthest verifiable position of the boundary consensus of all nodes is not zero, the view is switched and the fast channel is continued to be tried. When the fast channel exits abnormally and the farthest verifiable position is zero, the asynchronous channel is entered. The farthest verifiable position is the maximum or second largest value in the consensus progress set input to the network status sensor when the fast channel of each node is interrupted by timeout.
[0038] Specifically, see Figure 2 As shown, after the network status sensor receives the farthest broadcast progress of the fast channel, it broadcasts the farthest broadcast progress to all nodes. After each node receives the farthest broadcast progress from nf nodes, it selects the maximum value and inputs it into the Two Value Byzantine Agreement (TVBA). The TVBA consensus outputs the maximum or second largest value in the consensus progress set as the farthest position cs that can be confirmed. If cs is not equal to zero, the fast channel will continue to execute. If cs is equal to zero, the asynchronous channel will be switched to execute. It should be noted that Figure 1 and Figure 2 In the , 1100, 2222, 4445 represent the block boundary values of the consensus output (i.e., the corresponding positions in each broadcast sequence); slot represents the sequence number of the corresponding different consensuses in a round of fast channel, starting from 1 and increasing (a fast channel led by a leader can reach consensus on multiple block boundaries, and the number of boundaries of the fast channel consensus is specified by the external parameter maxSlot, for example, the default is 10). There will only be one boundary consensus in a round of asynchronous channel, so the slot of the asynchronous channel will only be 1; s i Indicates the value corresponding to the slot in the fast channel, starting from 1 and increasing, such as s i =3, then s i+1=4; (s) represents the value of the current farthest position broadcast by different nodes to all nodes. The current farthest position of different nodes may be different, which can be s i ,s i+1 ,s i+2 , or other, expressed as max(furthestSlot); max({s}) represents the maximum value of the set of (s) values received by each node from other nodes; valid({edge}) represents the legal boundary of the consensus output, P[i] represents the leader node i, max(furthestSlot) represents the maximum value of the farthest position, and confirmedSlot represents the farthest position that can be confirmed.
[0039] Figure 3 This is a schematic diagram of a two-step pace synchronizer, which is used to ensure that each node starts a new round of boundary consensus from the same position when the channel is switched, while avoiding the block rollback problem caused by boundary rollback. The two-step pace synchronizer suspends the block boundary output by the last consensus and does not put it on the chain. When the consensus outputs the next block boundary, the previous suspended boundary is first confirmed on the chain, and then the new consensus boundary is updated to the suspended boundary. The progress of each node when switching channels is synchronized to the farthest position that can be confirmed output by the network status sensor. The farthest position that can be confirmed may be the last consensus boundary or the second-to-last consensus boundary. When synchronized to the last consensus boundary, the suspended boundary can be directly output as the next block boundary. When synchronized to the second-to-last consensus boundary, the suspended boundary is discarded as an invalid boundary. The buffering effect of the suspended boundary solves the problem of block rollback.
[0040] Specifically, after the two-step pace synchronizer receives the farthest confirmable position output by the network status sensor, if the farthest confirmable position is equal to the suspended boundary position of this node, a new fast channel or asynchronous channel is started directly; if the farthest confirmable position is less than the suspended boundary position of this node, the suspended boundary is withdrawn and a new fast channel or asynchronous channel is started; if the farthest confirmable position is greater than the suspended boundary position of this node by 1, the lagging boundary consensus progress is first caught up, and then a new fast channel or asynchronous channel is started.
[0041] Accordingly, the present invention also provides a network adaptive asynchronous Byzantine consensus method for realizing the functions of each module in the above system. Figure 4As shown, the method includes: step S310, forming a group of growing proposal chains through parallel transaction broadcasts, during the transaction broadcast process, all consensus nodes respectively lead a broadcast as a leader node to broadcast the proposal of the node to other nodes, and when a predetermined number of proposal chain growths are generated, the current farthest boundary of each leader node is determined; step S320, reaching a boundary consensus based on the current farthest boundaries of each leader node, obtaining a valid boundary to confirm the proposal range of the latest block, and in the boundary consensus process, determining the switching between the fast channel and the asynchronous channel according to the network status, in the fast channel, multiple nodes take turns as leader nodes, and consensus on block boundaries is performed in the form of broadcasting, and in the asynchronous channel, according to the known farthest block boundary, a multi-valued Byzantine consensus algorithm is used to obtain the effective boundary, and when switching between the fast channel and the asynchronous channel, it is ensured that each node starts a new round of boundary consensus from the same position.
[0042] The network adaptive asynchronous Byzantine consensus scheme provided by the present invention can be used in a variety of scenarios, such as for alliance chain networks, allowing authorized nodes to join the network for efficient consensus and providing digital resource copyright protection functions. In this application scenario, it includes: data collection for digital resource creation, authentication, authorization, transaction and other links, and the collected data includes identification information, author information, copyright information, transaction information, change records, smart contracts, evidence chain information, etc. The consensus node forwards the collected copyright data to all consensus nodes, and reaches a consensus on the legitimacy of the data on the chain. The consensus copyright data will be stored in the form of block data in the blockchain jointly maintained by each consensus node, thereby ensuring that the copyright data can be normally chained in a harsh network environment, and the digital copyright information on the chain is traceable and cannot be tampered with. At the same time, smart contracts are used for authorized transactions without the participation of intermediaries, and rewards can be automatically distributed according to the contract, simplifying the process of copyright transactions. When the consensus mechanism designed by the present invention is used in the digital resource copyright protection alliance chain network, the time consumption of each link of digital copyright protection is reduced due to the improvement of consensus efficiency and network state adaptability, while improving the stability and availability of the digital resource copyright protection system.
[0043] In summary, compared with the prior art, the present invention has the following advantages:
[0044] 1) The present invention provides an asynchronous Byzantine consensus scheme that can adapt to complex network environments while maintaining high performance and high robustness. It designs a network status sensor, a two-step pace synchronizer, and a dual-channel execution mode. It has the ability to automatically sense the network status and can select the best consensus scheme according to the network status. It can be used in complex network scenarios.
[0045] 2) The network status sensor designed by the present invention is triggered after the fast channel timeout interruption. When the fast channel exits abnormally midway and the farthest verifiable position of the boundary consensus of all nodes is not zero, the view is switched (i.e., the leader of the fast channel is switched) and the fast channel is continued to be tried. When the fast channel exits abnormally and the farthest verifiable position is zero, the asynchronous channel is entered. This design of automatically sensing the network status increases the probability of executing the fast channel for efficient consensus. The farthest verifiable position refers to the farthest position of the fast channel interruption that can be jointly confirmed by each node through protocol communication.
[0046] 3) The present invention designs a dual-channel mode switch, and uses a two-step pace synchronizer to ensure the consistency of the system after the channel switch, while avoiding block rollback. In the fast channel consensus stage, the two-step pace synchronizer suspends the last consensus-based but unconfirmed block boundary as a buffer boundary. Each node reaches a consensus on the interruption position of the fast channel through the binary Byzantine consensus protocol. The consensus position may point to the buffer boundary of the current node or the last confirmed boundary. If the consensus position is the last confirmed boundary, the buffer boundary can be directly discarded. Since the buffer boundary has not been formally confirmed on the chain, it will not cause block rollback, thereby ensuring smooth channel switching.
[0047] 4) It has been experimentally verified that the complex network adaptive asynchronous Byzantine consensus scheme with dual channels of the present invention has lower confirmation delay while achieving the same peak throughput.
[0048] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0049] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0050] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0051] The computer program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, Python, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.
[0052] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.
[0053] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0054] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0055] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a part of a module, a program segment or an instruction, and a part of the module, a program segment or an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.
[0056] Embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.
Claims
1. A network adaptive asynchronous Byzantine consensus system, comprising: A transaction broadcast module and a parallel executed boundary consensus module, wherein the boundary consensus module comprises a fast channel, an asynchronous channel, a network state sensor and a two-step pace synchronizer, wherein: The transaction broadcast module forms a set of growing proposal chains through parallel transaction broadcasts. During the transaction broadcast process, all consensus nodes lead a broadcast to other nodes as leader nodes. When a predetermined number of proposal chains are generated, the current farthest boundary of each leader node is passed to the boundary consensus module. The boundary consensus module is used to reach a boundary consensus on the farthest boundaries received from each leader node, and obtain the effective boundary to confirm the proposal range of the latest block; The network status sensor is used to determine the switch between the fast channel and the asynchronous channel according to the network status. In the fast channel, multiple nodes take turns to serve as the leader node and make consensus on the block boundary through broadcasting. In the asynchronous channel, the effective boundary is obtained based on the known farthest block boundary using a multi-valued Byzantine consensus algorithm. The two-step pace synchronizer is used to ensure that each node starts a new round of boundary consensus from the same position when switching between the fast channel and the asynchronous channel.
2. The system according to claim 1, characterized in that Determining the switch between the fast channel and the asynchronous channel includes: the boundary consensus module uses the fast channel to perform boundary consensus, and when a timeout interrupt occurs, inputs the node consensus progress to the network status sensor, and then the network status sensor decides whether to switch to the asynchronous channel.
3. The system according to claim 2, characterized in that The network status sensor determines whether to switch to the asynchronous channel according to the following steps: When the fast channel is interrupted and recovery is ineffective, the network is considered to have entered an asynchronous state and switched to the asynchronous channel; When the fast channel is abnormally exited midway and the farthest verifiable position of the boundary consensus of all nodes is not zero, the view is switched and the fast channel is tried. When the fast channel is abnormally exited and the farthest verifiable position is zero, the asynchronous channel is entered, where the farthest verifiable position is the maximum or second largest value in the consensus progress set input to the network status sensor when the fast channel of each node is interrupted by timeout.
4. The system according to claim 1, characterized in that The state perception module is configured to switch views and continue trying the fast channel when an abnormal exit occurs from the fast channel and the farthest verifiable position of the boundary consensus of all nodes is not zero, and to enter the asynchronous channel when an abnormal exit occurs from the fast channel and the farthest verifiable position is zero, wherein the farthest verifiable position is the maximum or second largest value in the consensus progress set input to the network state sensor when the fast channel of each node is interrupted by timeout.
5. The system according to claim 1, characterized in that The transaction broadcast module also executes in the transaction broadcast: for a node, after receiving the broadcast message, the proposal of this round is temporarily stored, and the proof of the proposal of the previous round is verified. If it is passed, the proposal of the previous round of broadcast is persistently stored, and the signature of this round of proposal of this node is sent to the leader node. After the leader node receives the set number of signatures, it starts the next round of broadcast.
6. The system according to claim 3, characterized in that In the fast track, the leader node and the timeout interrupt mechanism are determined according to the following steps: The node that serves as the leader of this generation is the result of taking the remainder of the total number of nodes in the current fast channel generation; Each node resets a preset timer during each round of broadcast output. If the timer times out before the broadcast output, a timeout interrupt is triggered, and each node ends the current generation fast channel and inputs the farthest broadcast progress of the node into the network status sensor.
7. The system according to claim 1, characterized in that The two-step pace synchronizer performs the following steps: The block boundary of the last consensus output is suspended and not put on the chain. When the consensus outputs the next block boundary, the previous suspended boundary is first confirmed on the chain, and then the new consensus boundary is updated to the suspended boundary; The progress of each node switching channels is synchronized to the farthest confirmed position output by the network status sensor, which is the last consensus boundary or the second-to-last consensus boundary. When synchronized to the last consensus boundary, the suspended boundary is output as the next block boundary. When synchronized to the second-to-last consensus boundary, the suspended boundary is discarded as an invalid boundary.
8. A network adaptive asynchronous Byzantine consensus method based on the system according to any one of claims 1 to 7, comprising the following steps: A set of growing proposal chains is formed through parallel transaction broadcasts. During the transaction broadcast process, all consensus nodes lead a broadcast as leader nodes to broadcast their proposals to other nodes, and when a predetermined number of proposal chains are generated, the current farthest boundary of each leader node is determined; A boundary consensus is reached based on the current farthest boundary of each leader node, and an effective boundary is obtained to confirm the proposal range of the latest block. In the boundary consensus process, the switching between the fast channel and the asynchronous channel is determined according to the network status. In the fast channel, multiple nodes take turns as leader nodes and reach consensus on block boundaries through broadcasting. In the asynchronous channel, based on the known farthest block boundary, a multi-valued Byzantine consensus algorithm is used to obtain the effective boundary. When switching between the fast channel and the asynchronous channel, it is ensured that each node starts a new round of boundary consensus from the same position.
9. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
10. A computer device comprising a memory and a processor, wherein a computer program capable of running on the processor is stored in the memory, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
