Consensus method and consensus node in blockchain system, and blockchain system

By using the block certificate mechanism in the blockchain system, the problem of inefficiency in the block finalization process in the blockchain system is solved, and the smooth advancement and efficiency improvement of the consensus process are achieved.

WO2024221919A1PCT designated stage expired Publication Date: 2024-10-31ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/135250
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-27
Filing Date
2023-11-29
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

In the blockchain system, the existing consensus protocol requires an additional round of communication independent of the consensus process to complete the finalization of the block, resulting in reduced efficiency and uneven consensus advancement, and requires waiting for the finalization of the previous block to be completed. Consensus to start a new block.

Method used

By introducing the block certificate mechanism into the blockchain system, the consensus node broadcasts the block certificate within the block number range to indicate that the transaction has been successfully executed. After collecting enough identical certificates, it continues to initiate the consensus of the new block to avoid additional communication rounds. times to ensure the smooth advancement of the consensus process.

Benefits of technology

It reduces the types of messages between consensus nodes, reduces the possibility of errors, avoids efficiency decline caused by communication instability, and allows the seamless start of consensus on new blocks to ensure the smooth advancement of consensus.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023135250_31102024_PF_FP_ABST
    Figure CN2023135250_31102024_PF_FP_ABST
Patent Text Reader

Abstract

One or more embodiments of the present application provides a consensus method and a consensus node in a blockchain system, and a blockchain system. The method is applied to any target consensus node participating in consensus in the blockchain system, and comprises: collecting a block certificate corresponding to an h-th block in a blockchain and comprised in a consensus message sent by broadcasting in a process in which each consensus node performs consensus on a block corresponding to any block number in a block number interval [h+1,h+L], the block certificate being used for indicating that a transaction comprised in the h-th block has been successfully executed, and L representing a preset offset value corresponding to the block number interval; and in response to collecting N block certificates sent by different consensus nodes and corresponding to the h-th block, after the consensus on an (h+L)-th block in the blockchain is completed, continuing to initiate consensus on an (h+L+1)-th block in the blockchain, N being a preset threshold.
Need to check novelty before this filing date? Find Prior Art

Description

Consensus method and consensus node in blockchain system, blockchain system Technical Field

[0001] One or more embodiments of the present application relate to the field of blockchain technology, and in particular, to a consensus method and consensus node in a blockchain system, and a blockchain system. Background Art

[0002] Blockchain is a novel application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus protocols, and encryption algorithms. In a blockchain system, data blocks are linked sequentially in chronological order to form a chain-like data structure, cryptographically guaranteeing an unalterable and unforgeable distributed ledger. Due to its decentralized, tamper-proof, and autonomous nature, blockchain applications are becoming increasingly widespread.

[0003] Summary of the Invention

[0004] One or more embodiments of the present application provide a consensus method and consensus node in a blockchain system, and a blockchain system, including: a consensus method in a blockchain system, applied to any target consensus node participating in consensus in the blockchain system, including: collecting block vouchers corresponding to block h in the blockchain contained in consensus messages broadcast and sent by each consensus node during the process of consensus on a block corresponding to any block number in the block number interval [h+1, h+L]; wherein the block voucher is used to indicate that a transaction contained in block h has been successfully executed; L represents a preset offset value corresponding to the block number interval; in response to collecting N identical block vouchers corresponding to block h sent by different consensus nodes, after consensus on block h+L in the blockchain is completed, continuing to initiate consensus on block h+L+1 in the blockchain; wherein N is a preset threshold.

[0005] A consensus node in a blockchain system, comprising: a message collection unit, configured to collect block vouchers corresponding to block h in the blockchain, contained in consensus messages broadcast and sent by various consensus nodes during a consensus process on a block corresponding to any block number in the block number interval [h+1, h+L]; wherein the block voucher is used to indicate that a transaction contained in block h has been successfully executed; and L represents a preset offset value corresponding to the block number interval; and a consensus initiation unit, configured to, in response to collecting N identical block vouchers corresponding to block h sent by different consensus nodes, continue to initiate consensus on block h+L+1 in the blockchain after consensus on block h+L in the blockchain is completed; wherein N is a preset threshold.

[0006] A blockchain system includes consensus nodes, wherein any target consensus node: collects block vouchers corresponding to block h in the blockchain contained in consensus messages broadcasted by various consensus nodes during the process of reaching consensus on blocks corresponding to any block number in the block number interval [h+1, h+L]; wherein the block voucher is used to indicate that a transaction contained in block h has been successfully executed; and L represents a preset offset value corresponding to the block number interval; in response to collecting N identical block vouchers corresponding to block h sent by different consensus nodes, after consensus on block h+L in the blockchain is completed, continues to initiate consensus on block h+L+1 in the blockchain; wherein N is a preset threshold.

[0007] In the above embodiment, the target consensus node in the blockchain system can collect the block vouchers for indicating that the transaction contained in block h has been successfully executed, which are included in the consensus message broadcasted by each consensus node during the consensus process for the block corresponding to any block number in the block number interval [h+1,h+L]. In this way, in response to collecting enough identical block vouchers corresponding to block h sent by different consensus nodes, after the consensus on block h+L is completed, it can continue to initiate consensus on block h+L+1.

[0008] With this approach, since the presence of the block voucher does not affect the normal execution of the consensus message, while consensus is being reached for any block number within the block number range [h+1, h+L] based on the consensus message itself, block h can also be finalized based on the block voucher included in the consensus message, indicating that the transactions contained in block h have been successfully executed. Therefore, for each block, finalization no longer requires an additional round of communication independent of the consensus process; instead, finalization can be achieved through communication within the consensus process. First, this reduces the number of messages transmitted between consensus nodes in the blockchain system, simplifying the system and reducing the potential for errors. Second, it avoids communication instability that can reduce system efficiency. Third, once consensus on block h+L is reached, there is no need to wait for the finalization of block h to complete; instead, consensus on block h+L+1 can begin seamlessly, ensuring smooth consensus progress. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0010] FIG1 is a schematic diagram of a blockchain system shown in an exemplary embodiment of the present application.

[0011] FIG2 is a schematic diagram of a conventional phase in a PBFT protocol in the related art.

[0012] FIG3 is a flowchart of a consensus method in a blockchain system shown in an exemplary embodiment of the present application.

[0013] FIG4 is a schematic diagram of a normal phase in a PBFT protocol shown in an exemplary embodiment of the present application.

[0014] FIG5 is a schematic structural diagram of a device shown in an exemplary embodiment of the present application.

[0015] FIG6 is a schematic diagram of the architecture of a consensus node in a blockchain system shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0016] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0017] Blockchains are generally categorized into three types: public, private, and consortium. Furthermore, combinations of these types are possible, such as combining private and consortium blockchains, or combining consortium and public blockchains.

[0018] Of the three types of blockchains mentioned above, public chains are the most decentralized. Participants in a public chain (also known as nodes in the blockchain) can access data records on the chain, participate in transactions, and compete for the right to record new blocks. Furthermore, each node can freely join and leave the network and perform related operations.

[0019] In contrast, private blockchains control write permissions to the network by a specific organization or institution, while data read permissions are regulated by that organization. In other words, private blockchains can be considered weakly centralized systems, with strict node restrictions and a small number of nodes. This type of blockchain is more suitable for internal use within a specific organization.

[0020] Consortium blockchains lie somewhere between public and private blockchains, enabling partial decentralization. Each node in a consortium blockchain typically has a corresponding entity or organization; nodes are authorized to join the network and form a coalition of stakeholders to jointly maintain the blockchain's operations.

[0021] Please refer to Figure 1, which is a schematic diagram of a blockchain system shown in an exemplary embodiment of the present application.

[0022] As shown in Figure 1, a blockchain system can maintain one or more blockchains (e.g., public blockchains, private blockchains, consortium blockchains, etc.) and can include multiple blockchain nodes for hosting these one or more blockchains. For example, blockchain nodes 1, 2, 3, 4, and i, as shown in Figure 1, can collectively host one or more blockchains. Cross-chain data access is also possible between the blockchains within each blockchain system, and between blockchain systems.

[0023] A blockchain node is a logical communication entity; multiple blockchain nodes of different types can run on the same physical server or on different physical servers. In one embodiment, a blockchain node can be a physical device or a virtual device implemented in a server or server cluster. For example, a blockchain node can be a physical host in a server cluster, or a virtual machine created by virtualizing the hardware resources of a server or server cluster using virtualization technology. Each blockchain node can be coupled together through various communication methods (e.g., TCP / IP) to form a network that can host one or more blockchains.

[0024] Based on the basic characteristics of blockchain, a blockchain is typically composed of several blocks. Each of these blocks is timestamped to indicate the moment of its creation. All blocks strictly follow the timestamps recorded in the blocks, forming a temporally ordered data chain.

[0025] For data generated outside the blockchain, this data can be constructed into a standard transaction format supported by the blockchain and then published to the blockchain. The nodes participating in the consensus in the blockchain system will reach a consensus on the transaction and execute the transaction after the consensus is reached, so that the transaction and the execution results can be persistently stored in the blockchain.

[0026] In a blockchain system, different participants can establish a distributed blockchain network through deployed nodes. A decentralized (or multi-centralized) distributed ledger, constructed using a chained block structure, is stored on each node (or a majority of nodes, such as consensus nodes) within the distributed blockchain network. This type of blockchain system must address the consistency and correctness of ledger data across multiple nodes within the decentralized (or multi-centralized) network. Each node in the blockchain system runs a blockchain program. Under certain fault-tolerance requirements, a consensus protocol ensures that all loyal nodes have the same transactions, ensuring consistent execution results for the same transactions. Transactions and execution results are then packaged and generated into blocks.

[0027] Current mainstream consensus protocols include Proof of Work (POW), Proof of Stake (POS), Delegated Proof of Stake (DPOS), Practical Byzantine Fault Tolerance (PBFT), and HoneyBadgerBFT. These consensus protocols can generally be categorized as asynchronous and non-asynchronous. For example, PBFT is a semi-synchronous protocol, while HoneyBadgerBFT is an asynchronous protocol.

[0028] Take the PBFT algorithm, for example. Proposed by Miguel Castro and Barbara Liskov in 1999, it addresses the inefficiency of the original Byzantine fault-tolerance algorithm, reducing its complexity from exponential to polynomial, making it feasible for practical system applications. The paper was presented at the 1999 International Conference on Operating Systems Design and Implementation (OSDI99). In the PBFT algorithm, all replicas operate in a succession of configurations called views. In a view, one replica serves as the primary node, while the others serve as backups. A view is a consecutively numbered integer. The primary node is calculated using the formula p = v mod |R|, where v is the view number, p is the replica number, and |R| is the number of replicas. The algorithm assumes that when at most f replicas (i.e., nodes) fail, if there are at least 3f+1 replicas in total, safety and activity can be guaranteed in an asynchronous system. The set of a certain number of replicas required to ensure data consistency and fault tolerance for all replicas is generally a set consisting of the majority of nodes in the distributed system, forming a majority (Quorum). For example, when the total number of nodes n is 3f+1 (n=3f+2 or n=3f generally does not improve fault tolerance), the Quorum is 2f+1. In this way, for a distributed system consisting of four nodes, any three nodes can form a Quorum.

[0029] The PBFT protocol consists of two processes: the Normal Case Phase and the View Change Phase. Figure 2 is a flowchart of the Normal Case Phase. The Normal Case Phase primarily includes three phases: PRE-PREPARE, PREPARE, and COMMIT. Node 3, for example, can represent a downed node (indicated by an "X" in Figure 2). When the primary node fails, a view change process must be initiated to adjust the system state and replace the primary node with a new one. If the primary node goes offline or acts maliciously and does not broadcast client requests, the client can set a timeout mechanism. If the timeout expires, the client can broadcast a request message to all replica nodes. If a replica node detects that the primary node is acting maliciously or is offline, it can also initiate a View Change Phase to replace the primary node (often referred to as "changing the master"). Alternatively, the three-phase consensus process of PRE-PREPARE, PREPARE, and COMMIT may fail due to an incorrect proposal from the master node. Alternatively, the quorum (e.g., 2f+1 out of 3f+1 nodes, also known as the quorum) may not be reached during the PREPARE and COMMIT phases, preventing consensus. In these cases, the View Change phase may be initiated to replace the master node.

[0030] The PBFT algorithm is a semi-synchronous protocol, assuming the network is initially asynchronous but capable of synchronization from a certain point in time. The simplest way to ensure consensus on the same proposal among different nodes in the network is to establish a master node, which unifies the opinions of all nodes. Setting a timer prevents master node errors. In the PBFT protocol, if the Normal Case Phase fails to complete within a limited time, the Backups initiate the View Change Phase to replace the master node. The PBFT protocol fixes the master node in one location, allowing all requests to be sent to the master node first, which then broadcasts them to other consensus nodes.

[0031] In single-master protocols like PBFT, only the master node can initiate consensus proposals during a consensus process; other nodes are unable to do so. Alternatively, if other nodes have proposals, they must forward them to the master node, which then initiates them on their behalf. The former approach unfairly impacts the power of consensus nodes to construct blocks. While backup nodes can also propose, the latter approach increases the strain on the master node's outbound bandwidth. Neither approach is particularly suitable for scenarios where most consensus nodes need to initiate consensus proposals.

[0032] Specifically, all consensus nodes in a blockchain system can reach consensus on the transactions contained in a new block to be connected to the chained block structure based on a consensus protocol, ensuring that all consensus nodes agree on the content and order of the transactions contained in the block. After reaching consensus, each consensus node can execute the transactions contained in the block in order and finalize the block after confirming that the transaction execution results of each consensus node are consistent. Finalization refers to the completion of the execution of the transactions contained in the block and the acceptance of the transaction execution results by all consensus nodes (or a certain number of consensus nodes, such as two-thirds of the consensus nodes).

[0033] After executing transactions included in a consensus-completed block, any consensus node in the blockchain system can broadcast a message confirming that consensus has been reached for the block and that the transactions contained within it have been executed. This message can then be used to verify the consistency of the transaction execution results across all consensus nodes for that block. This allows the finalization of the block to be completed once the consistency of the transaction execution results across all consensus nodes is confirmed. In other words, for each consensus-completed block, an additional round of communication, independent of the communication during the consensus process, is required to confirm the consistency of the transaction execution results across all consensus nodes for that block in order to finalize the block.

[0034] These messages have different names in different consensus protocols. In the PBFT algorithm, for example, they are often referred to as checkpoint messages. Checkpoints are a garbage collection mechanism within the PBFT algorithm. Checkpoint messages are used to confirm blocks for which consensus has been reached and all transactions have been executed. Checkpoint messages carry the block ID and the execution results of the transactions contained in the block (also known as proof of block execution, such as transaction receipts or world state). When a consensus node receives a quorum of checkpoint messages carrying the same block ID, it uses these checkpoint messages to confirm that all consensus nodes have executed the same transactions for the block corresponding to that block ID, thereby finalizing the block. The node also clears any locally stored consensus data related to previously agreed-upon blocks (including cached consensus messages exchanged during the consensus process).

[0035] In a blockchain, the block height refers to the number of blocks connected in the chained block structure. However, for any block in a blockchain, its block height can be used as an identifier. Blocks are generally considered to have two identifiers: a hash value of the block header and a block height. The block header hash value is obtained by performing a secondary hash calculation on the block header using algorithms such as the SHA256 algorithm. The block header hash value uniquely identifies a block, and any node in the blockchain system can independently obtain the block header hash value by hashing the block header. The block height refers to the position of a block in the blockchain; it is not a unique identifier for a block. Although a block always has a clear and fixed block height, it does not always identify a single block. Two or more blocks may have the same block height, competing for the same position in the blockchain.

[0036] Blocks in a blockchain are typically linked chronologically in a chained block structure, effectively creating a temporally ordered chain. In this case, block heights are typically set to ascending values. For example, if the block height of the previous finalized block is h, the next block to be agreed upon will have a block height of h+1, and so on.

[0037] Typically, consensus protocols in blockchain systems can be implemented using a sliding window approach. For example, a consensus window of length L can be set. Assuming the block height of the block currently being finalized is h, consensus can be reached for blocks with heights within the range [h+1, h+L]. However, if finalization of the block at height h has not yet been completed when consensus is reached for the block at height h+L, the consensus window will be blocked, and further blocks will not be produced, thus affecting the efficiency of the entire blockchain system.

[0038] In summary, in related technologies, finalizing each block requires an additional round of communication, independent of the consensus process. Furthermore, because consensus on new blocks cannot begin until the finalization of the block itself, this round of communication can potentially block consensus. Continuing with the example above, consensus on blocks at height h and above cannot begin until the finalization of the block at height h is complete. This means that consensus cannot proceed until the finalization of the previous block is complete.

[0039] The present application provides an embodiment of a consensus method, consensus node, and blockchain system in a blockchain system. In this embodiment, a target consensus node in the blockchain system can collect block vouchers, which are included in consensus messages broadcast by various consensus nodes during the consensus process for blocks corresponding to any block number in the block number interval [h+1,h+L] and indicate that a transaction included in block h has been successfully executed. In response to collecting enough identical block vouchers corresponding to block h sent by different consensus nodes, after consensus on block h+L is completed, a consensus on block h+L+1 can be initiated.

[0040] In a specific implementation, after executing the transactions contained in block h of the blockchain, any consensus node in the aforementioned blockchain system can, during the consensus process for block k of the blockchain, broadcast a consensus message corresponding to block k, but carrying a block voucher corresponding to block h. This block voucher can be used to indicate that the transactions contained in block h were successfully executed. Block k can be any block number within the block number range [h+1, h+L]. L can represent a preset offset value corresponding to the block number range.

[0041] In the above case, the target consensus node can collect the block credentials corresponding to the hth block in the blockchain contained in the above consensus message broadcasted by each consensus node in the above blockchain system during the consensus process on the kth block in the blockchain.

[0042] When the target consensus node completes consensus on block h+L in the blockchain, it has already collected the block voucher corresponding to block h in the blockchain. Therefore, in response to collecting N identical block vouchers corresponding to block h in the blockchain sent by different consensus nodes, the target consensus node can, after completing consensus on block h+L in the blockchain, proceed to initiate consensus on block h+L+1 in the blockchain. N can be a preset threshold, specifically depending on how many consensus nodes must approve the transaction execution results of the block for the block to be considered finalized.

[0043] With this approach, since the presence of the block voucher does not affect the normal execution of the consensus message, while consensus is being reached for any block number within the block number range [h+1, h+L] based on the consensus message itself, block h can also be finalized based on the block voucher included in the consensus message, indicating that the transactions contained in block h have been successfully executed. Therefore, for each block, finalization no longer requires an additional round of communication independent of the consensus process; instead, finalization can be achieved through communication within the consensus process. First, this reduces the number of messages transmitted between consensus nodes in the blockchain system, simplifying the system and reducing the potential for errors. Second, it avoids communication instability that can reduce system efficiency. Third, once consensus on block h+L is reached, there is no need to wait for the finalization of block h to complete; instead, consensus on block h+L+1 can begin seamlessly, ensuring smooth consensus progress.

[0044] Please refer to Figure 3, which is a flowchart of a consensus method in a blockchain system shown in an exemplary embodiment of the present application.

[0045] In this embodiment, the consensus method in the above-mentioned blockchain system can be applied to any consensus node (which may be referred to as a target consensus node) participating in the consensus in the blockchain system.

[0046] It should be noted that all consensus nodes in the above blockchain system can reach a consensus on the block based on the consensus message corresponding to the new block to be connected to the chain block structure.

[0047] The present application provides an embodiment of a consensus method in a blockchain system, as shown in FIG3 , specifically comprising: step 302: collecting block vouchers corresponding to block h in the blockchain contained in a consensus message broadcasted by each consensus node during a consensus process for a block corresponding to any block number in the block number interval [h+1, h+L]; wherein the block voucher is used to indicate that the transaction contained in the block h has been successfully executed; and L represents a preset offset value corresponding to the block number interval.

[0048] In this embodiment, a block number can be assigned to each block in the blockchain to identify the block. In other words, one block number can identify one block. In actual applications, the block number can be the block height or a unique number corresponding to the hash value of the block header. This application does not impose any specific restrictions on this.

[0049] After executing the transactions contained in block h of the blockchain, any consensus node in the aforementioned blockchain system may, during the consensus process for block k of the blockchain, broadcast a consensus message corresponding to block k, but carrying a block voucher corresponding to block h. The block voucher may indicate that the transactions contained in block h were successfully executed. For example, the block voucher may be the execution result of the transactions contained in block h. Block k may correspond to any block number within the block number interval [h+1, h+L]. L may represent a preset offset value corresponding to the block number interval, for example, L may be the length of the consensus window set in a sliding window manner.

[0050] It should be noted that when the consensus on block h+L is completed, the vast majority of consensus nodes have usually completed the execution of transactions contained in block h. Therefore, in the process of consensus on block k in the blockchain, it is feasible to broadcast a consensus message corresponding to block k but carrying the block certificate corresponding to block h.

[0051] In actual applications, for any consensus node in the above-mentioned blockchain system, the transaction execution service on the consensus node (which can be a thread responsible for executing transactions contained in the block on which consensus has been completed) can generate the above-mentioned consensus message after executing the transactions contained in block h in the blockchain, and push the consensus message to the consensus service on the consensus node (which can be a thread responsible for consensus on blocks), so that the consensus service on the consensus node can broadcast and send the consensus message during the consensus process on block k in the blockchain.

[0052] In the above case, the above-mentioned target consensus node can collect the block certificate corresponding to the hth block in the blockchain contained in the above-mentioned consensus message broadcasted by each consensus node in the above-mentioned blockchain system during the process of reaching consensus on the kth block in the blockchain.

[0053] Since the consensus message above corresponds to block k, where k is in the interval [h+1, h+L], and the consensus message contains the block certificate corresponding to block h, it is guaranteed that by the time consensus on blocks h+L is completed, the block certificate corresponding to block h has already been collected, thus completing the finalization of block h. This means that when consensus on blocks h+L is completed, there is no need to wait for the finalization of block h, and consensus on blocks h+L+1 can begin seamlessly.

[0054] In one embodiment, after executing the transaction contained in block h in the blockchain, any consensus node in the blockchain system may, during the consensus process for block h+L in the blockchain, broadcast a consensus message corresponding to block h+L, but carrying the block certificate corresponding to block h. At this point, the target consensus node may collect the block certificate corresponding to block h in the blockchain, contained in the consensus message broadcast by each consensus node in the blockchain system during the consensus process for block h+L in the blockchain.

[0055] That is, for each block, the block certificate corresponding to the block can be collected during the consensus process for the Lth block after the block, so the block certificate can be avoided from being collected too early, thereby ensuring the smooth progress of the consensus.

[0056] In one embodiment shown, when collecting the block voucher corresponding to the hth block in the blockchain contained in the consensus message broadcasted by each consensus node in the above-mentioned blockchain system during the consensus on the h+Lth block in the block number interval [h+1,h+L], the target consensus node can specifically receive the consensus message broadcasted by each consensus node in the blockchain system during the consensus on the h+Lth block in the block number interval [h+1,h+L], and verify the block voucher corresponding to the hth block in the blockchain contained in the received consensus message; if the verification of the block voucher is passed, the block voucher contained in the consensus message can be saved, thereby completing the collection of the block voucher.

[0057] By verifying the block credentials contained in the consensus message, the correctness and reliability of the collected block credentials can be guaranteed, and the collection of abnormal block credentials can be avoided, thereby ensuring the normal and reliable advancement of consensus.

[0058] In one embodiment, the block voucher may include a digest value of block h in the blockchain. The digest value may be a hash value obtained by performing a hash calculation on block h. Furthermore, the block voucher may be signed (e.g., digitally signed) by the consensus node that sent the block voucher.

[0059] Since the target consensus node, as one of the consensus nodes participating in the consensus, can also broadcast a consensus message carrying a block voucher corresponding to block h in the blockchain, the target consensus node can locally store the digest value of block h. In this case, when verifying the block voucher corresponding to block h contained in the received consensus message, the target consensus node can specifically perform signature verification on the block voucher and verify whether the locally stored digest value of block h is the same as the digest value in the block voucher. If the signature verification of the block voucher passes, and the locally stored digest value of block h is the same as the digest value in the block voucher, then the verification of the block voucher can be confirmed to have passed. If the signature verification of the block voucher fails, or the locally stored digest value of block h is different from the digest value in the block voucher, then the verification of the block voucher can be confirmed to have failed.

[0060] By including the digest value of the corresponding block in the block voucher and signing the block voucher, the block voucher can be verified by performing signature verification on the block voucher and verifying the digest value in the block voucher to achieve verification of the block voucher. By performing signature verification on the block voucher, it can be ensured that the collected block vouchers are sent by trusted consensus nodes; by verifying the digest value in the block voucher, it can be ensured that the blocks corresponding to the collected block vouchers are consistent. Therefore, block vouchers that fail verification can be regarded as sent by malicious nodes and ignored, avoiding the collection of abnormal block vouchers, thereby ensuring the normal and reliable advancement of consensus.

[0061] Step 304: In response to collecting N identical block certificates corresponding to the hth block sent by different consensus nodes, after the consensus on the h+Lth block in the blockchain is completed, continue to initiate a consensus on the h+L+1th block in the blockchain; wherein N is a preset threshold.

[0062] In this embodiment, the target consensus node has already collected the block voucher corresponding to block h in the blockchain upon completing consensus on block h+L in the blockchain. Therefore, in response to collecting N identical block vouchers corresponding to block h in the blockchain sent by different consensus nodes, the target consensus node can, after completing consensus on block h+L in the blockchain, proceed to initiate consensus on block h+L+1 in the blockchain. N can be a preset threshold, specifically depending on how many consensus nodes must approve the transaction execution results of the block before finalization of the block is considered complete. For example, assuming the finalization rule set for the blockchain system is that the transactions contained in the block are executed and approved by two-thirds of the consensus nodes, then N can be two-thirds of the total number of consensus nodes in the blockchain system.

[0063] As previously mentioned, finalization refers to the completion of the execution of transactions contained in a block, with the transaction execution results recognized by all consensus nodes (or a certain number of consensus nodes, such as two-thirds of the consensus nodes). In other words, it is necessary to confirm that the transaction execution results of the transactions contained in the block are consistent across all consensus nodes. Therefore, when collecting block vouchers corresponding to block h in the aforementioned blockchain, the target consensus node can not only confirm whether it has collected N block vouchers corresponding to block h in the blockchain sent by different consensus nodes in the aforementioned blockchain system, but also confirm whether these N block vouchers are identical. If it is confirmed that N identical block vouchers corresponding to block h in the blockchain sent by different consensus nodes in the blockchain system have been collected, block h in the blockchain can be considered finalized.

[0064] In one embodiment shown, the block certificate may include the digest value of block h in the blockchain, and the block certificate may be signed (e.g., digitally signed) by the consensus node that sent the block certificate.

[0065] In the above situation, on the one hand, the above-mentioned target consensus node can confirm whether these block certificates are the same by verifying whether the summary values ​​in the collected block certificates corresponding to the h-th block in the above-mentioned blockchain are the same; on the other hand, the target consensus node can confirm whether these block certificates are sent by different consensus nodes in the above-mentioned blockchain system through the signatures of the collected block certificates corresponding to the h-th block in the blockchain. For example, the signatures of the collected block certificates can be verified by using the keys corresponding to the various consensus nodes in the blockchain system, so as to confirm which consensus node sent the block certificate that passed the signature verification.

[0066] In one embodiment, the consensus protocol supported by the blockchain system may include multiple consensus phases. Accordingly, the block certificate may be carried in the consensus messages exchanged between the consensus nodes in the blockchain system during any consensus phase of the consensus protocol. For example, assuming the blockchain system supports the PBFT protocol, as previously described, the PBFT protocol primarily includes the pre-prepare, prepare, and commit phases. Therefore, the block certificate may be carried in any of the pre-prepare, prepare, or commit messages exchanged during these three phases.

[0067] Specifically, for any consensus node in the blockchain system, the consensus phase in which it includes the block certificate in the consensus message exchanged can depend on when the consensus node has completed executing all transactions contained in the corresponding block. For example, in the PBFT protocol, if the consensus node executes all transactions contained in the block after sending the prepare message exchanged in the prepare phase, the consensus node can include the block certificate in the commit message exchanged in the commit phase.

[0068] It's important to note that the presence of block vouchers doesn't affect the normal execution of consensus messages; rather, they simply serve as a carrier for block vouchers. Taking the pre-prepare message in the PBFT protocol as an example, upon receiving a pre-prepare message carrying a block voucher, the consensus node in the blockchain system can verify the block voucher to complete its collection and count the number of block vouchers collected. Furthermore, it can continue to send prepare messages. These two operations are independent of each other and do not affect each other.

[0069] In one embodiment shown, L may be a configurable offset value. In this case, the user may configure the value of L based on actual needs, that is, the user may configure the length of the consensus window based on actual needs.

[0070] In one embodiment, the number of consensus nodes required to approve a block's transaction execution results in the finalization rules set by the blockchain system may depend on the fault tolerance threshold supported by the consensus protocol used by the blockchain system. Therefore, the value of N may range from [f+1, nf]. Here, f represents the number of fault-tolerant nodes supported by the consensus protocol used by the blockchain system, and n represents the total number of consensus nodes in the blockchain system.

[0071] In one embodiment, the consensus protocol used by the blockchain system may be a Byzantine Fault Tolerant (BFT) protocol. The total number of consensus nodes in the blockchain system can be represented by 3f+1. In this case, the value of N may range from [f+1, 2f+1]. Here, f represents the number of Byzantine nodes tolerated by the consensus protocol used by the blockchain system.

[0072] In one embodiment shown, the consensus protocol used by the blockchain system can be the PBFT protocol. As previously mentioned, the PBFT protocol primarily includes three phases: pre-prepare, prepare, and commit. Therefore, the block certificate can be carried in any of the pre-prepare, prepare, or commit messages exchanged during these three phases. Furthermore, as shown in FIG2 , the pre-prepare messages exchanged during the pre-prepare phase of the PBFT protocol are sent by the master node of the blockchain system, the prepare messages exchanged during the prepare phase are sent by the backup nodes of the blockchain system, and the commit messages exchanged during the commit phase are sent by both the master and backup nodes of the blockchain system. Therefore, the master node can carry the block certificate in either the pre-prepare or commit message, while the backup node can carry the block certificate in either the prepare or commit message.

[0073] As mentioned above, the consensus stage in which the master node and the backup node in the above blockchain system carry the above block certificate in the consensus message exchanged may depend on when the master node and the backup node have completed executing all transactions included in the corresponding block.

[0074] In actual applications, if the consensus protocol used by the blockchain system is the PBFT protocol, the target consensus node can be the master node in the PBFT protocol. Since any consensus node in the blockchain system can be called a master node in the PBFT protocol, the target consensus node can be any consensus node in the blockchain system.

[0075] Please refer to FIG4 in conjunction with FIG2 . FIG4 is a schematic diagram of a normal phase in a PBFT protocol shown in an exemplary embodiment of the present application.

[0076] As shown in Figure 4, the consensus protocol used by the blockchain system can be the PBFT protocol. The blockchain system can include replicas 0, 1, 2, and 3. Replica 0 serves as the primary node, while replicas 1, 2, and 3 serve as backup nodes. Replica 3 can represent a downed node (indicated by an "X" in Figure 4).

[0077] Assume that the normal phase is the normal phase in which all consensus nodes in the blockchain system reach consensus on block k in the blockchain, k is in the interval [h+1, h+L], and that replica 0 has already executed the transactions contained in block h in the blockchain before the normal phase begins. Replica 0 can include the block certificate corresponding to block h in the pre-prepare message exchanged during the pre-prepare phase (indicated by the dotted line with an arrow in Figure 4). If replica 2 has already executed the transactions contained in block h before sending the prepare message exchanged during the prepare phase, it can include the block certificate corresponding to block h in the prepare message exchanged during the prepare phase. Replica 1 has not yet completed executing the transactions contained in block h after sending the prepare message exchanged during the prepare phase and before sending the commit message exchanged during the commit phase. Therefore, it can include the block certificate corresponding to block h in the commit message exchanged during the commit phase. In this way, it can be guaranteed that when any consensus node in the blockchain system completes the consensus on block h+L, it has already collected the block certificate corresponding to block h, thereby completing the finalization of block h.

[0078] In the above embodiment, the target consensus node in the blockchain system can collect the block vouchers for indicating that the transaction contained in block h has been successfully executed, which are included in the consensus message broadcasted by each consensus node during the consensus process for the block corresponding to any block number in the block number interval [h+1,h+L]. In this way, in response to collecting enough block vouchers corresponding to block h sent by different consensus nodes, after the consensus on block h+L is completed, it can continue to initiate consensus on block h+L+1.

[0079] With this approach, since the presence of the block voucher does not affect the normal execution of the consensus message, while consensus is being reached for any block number within the block number range [h+1, h+L] based on the consensus message itself, block h can also be finalized based on the block voucher included in the consensus message, indicating that the transactions contained in block h have been successfully executed. Therefore, for each block, finalization no longer requires an additional round of communication independent of the consensus process; instead, finalization can be achieved through communication within the consensus process. First, this reduces the number of messages transmitted between consensus nodes in the blockchain system, simplifying the system and reducing the potential for errors. Second, it avoids communication instability that can reduce system efficiency. Third, once consensus on block h+L is reached, there is no need to wait for the finalization of block h to complete; instead, consensus on block h+L+1 can begin seamlessly, ensuring smooth consensus progress.

[0080] Please refer to Figure 5, which is a structural diagram of a device shown in an exemplary embodiment of the present application. At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510, and of course may also include other required hardware. One or more embodiments of the present application can be implemented based on software, such as the processor 502 reading the corresponding computer program from the non-volatile memory 510 into the memory 508 and then running it. Of course, in addition to software implementation, one or more embodiments of the present application do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic module, but can also be hardware or logic devices.

[0081] Please refer to Figure 6, which is a schematic diagram of the architecture of a consensus node in a blockchain system shown in an exemplary embodiment of the present application.

[0082] In this embodiment, the consensus node in the above-mentioned blockchain system can be a device as shown in Figure 5 to implement the technical solution of this application.

[0083] The present application also provides an embodiment of a consensus node in a blockchain system, which may be shown in FIG6 , including: a message collecting unit 602, which collects block certificates corresponding to block h in the blockchain contained in the consensus message broadcasted by each consensus node during the consensus process for a block corresponding to any block number in the block number interval [h+1, h+L]; wherein the block certificate is used to indicate that the transaction contained in block h has been successfully executed; and L represents a preset offset value corresponding to the block number interval; a consensus initiating unit 604, which, in response to collecting N block certificates corresponding to block h sent by different consensus nodes, continues to initiate consensus for block h+L+1 in the blockchain after consensus for block h+L in the blockchain is completed; wherein N is a preset threshold.

[0084] Optionally, the message collecting unit 602 collects block credentials corresponding to the hth block in the blockchain contained in the consensus message broadcasted by each consensus node during the consensus process on the h+Lth block in the block number interval [h+1,h+L].

[0085] Optionally, the message collection unit 602: receives the consensus message broadcasted by each consensus node during the consensus process on the h+Lth block in the block number interval [h+1,h+L]; verifies the block certificate contained in the consensus message; if the verification of the block certificate is passed, saves the block certificate contained in the consensus message.

[0086] Optionally, the block voucher includes a digest value of the hth block; and a signature for the digest value; the message collecting unit 602: verifies the signature in the block voucher; and verifies whether the locally stored digest value of the hth block is the same as the digest value in the block voucher; if the signature in the block voucher is verified to be successful, and the locally stored digest value of the hth block is the same as the digest value in the block voucher, then it is confirmed that the verification of the block voucher is successful; if the signature in the block voucher is verified to be unsuccessful, or the locally stored digest value of the hth block is different from the digest value in the block voucher, then it is confirmed that the verification of the block voucher is unsuccessful.

[0087] Optionally, the consensus protocol supported by the blockchain system includes multiple consensus stages; the block certificate is included in the consensus message exchanged between each consensus node in any consensus stage of the consensus protocol.

[0088] Optionally, L is a configurable offset value.

[0089] Optionally, the value range of N is [f+1, nf]; wherein f represents the number of fault-tolerant nodes supported by the consensus protocol adopted by the blockchain system; and n represents the total number of consensus nodes in the blockchain system.

[0090] Optionally, the consensus protocol adopted by the blockchain system is a Byzantine fault-tolerant protocol; the total number of consensus nodes in the blockchain system is represented by 3f+1; the value range of N is [f+1, 2f+1]; wherein f represents the number of Byzantine nodes tolerated by the consensus protocol adopted by the blockchain system.

[0091] Optionally, the consensus protocol adopted by the blockchain system is the PBFT protocol; the block certificate is included in any one of the pre-prepare message, prepare message and commit message exchanged in the three stages of the PBFT protocol.

[0092] The present application also provides an embodiment of a blockchain system, including consensus nodes, wherein any target consensus node: collects block vouchers corresponding to block h in the blockchain contained in consensus messages broadcast by various consensus nodes during the process of reaching consensus on blocks corresponding to any block number in the block number interval [h+1, h+L]; wherein the block voucher is used to indicate that the transaction contained in block h has been successfully executed; the L represents a preset offset value corresponding to the block number interval; in response to collecting N block vouchers corresponding to block h sent by different consensus nodes, after the consensus on block h+L in the blockchain is completed, continues to initiate consensus on block h+L+1 in the blockchain; wherein N is a preset threshold.

[0093] Optionally, the target consensus node collects block credentials corresponding to block h in the blockchain, which are contained in the consensus message broadcasted by each consensus node during the consensus process on block h+L in the block number interval [h+1,h+L].

[0094] Optionally, the target consensus node: receives the consensus message broadcasted by each consensus node during the consensus process on the h+Lth block in the block number interval [h+1,h+L]; verifies the block certificate contained in the consensus message; if the verification of the block certificate is passed, saves the block certificate contained in the consensus message.

[0095] Optionally, the block voucher includes a summary value of the hth block; and a signature for the summary value; the target consensus node: verifies the signature in the block voucher; and verifies whether the locally stored summary value of the hth block is the same as the summary value in the block voucher; if the signature in the block voucher is verified to be successful, and the locally stored summary value of the hth block is the same as the summary value in the block voucher, then confirms that the verification of the block voucher is successful; if the signature in the block voucher is verified to be unsuccessful, or the locally stored summary value of the hth block is different from the summary value in the block voucher, then confirms that the verification of the block voucher is unsuccessful.

[0096] Optionally, the consensus protocol supported by the blockchain system includes multiple consensus stages; the block certificate is included in the consensus message exchanged between each consensus node in any consensus stage of the consensus protocol.

[0097] Optionally, L is a configurable offset value.

[0098] Optionally, the value range of N is [f+1, nf]; wherein f represents the number of fault-tolerant nodes supported by the consensus protocol adopted by the blockchain system; and n represents the total number of consensus nodes in the blockchain system.

[0099] Optionally, the consensus protocol adopted by the blockchain system is a Byzantine fault-tolerant protocol; the total number of consensus nodes in the blockchain system is represented by 3f+1; the value range of N is [f+1, 2f+1]; wherein f represents the number of Byzantine nodes tolerated by the consensus protocol adopted by the blockchain system.

[0100] Optionally, the consensus protocol adopted by the blockchain system is the PBFT protocol; the block certificate is included in any one of the pre-prepare message, prepare message and commit message exchanged in the three stages of the PBFT protocol.

[0101] In the 1990s, technological improvements could be clearly distinguished as either hardware improvements (for example, improvements to circuit structures such as diodes, transistors, and switches) or software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using hardware modules. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to hire a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly done using "logic compiler" software. This is similar to the software compiler used when developing programs. Before compilation, the original code must also be written in a specific programming language, called a hardware description language (HDL). There is not just one HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also understand that by simply programming the method flow in one of these hardware description languages ​​and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.

[0102] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code format, the controller can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules that implement the method and structures within the hardware component.

[0103] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, this application does not exclude that with the future development of computer technology, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, an in-vehicle human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0104] Although one or more embodiments of the present application provide method operation steps as described in the embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent a unique execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any particular order.

[0105] For the convenience of description, the above devices are described as being divided into various modules according to their functions. Of course, when implementing one or more of the present applications, the functions of each module can be implemented in the same or multiple software and / or hardware, or the module that implements the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0106] The present application is described with reference to the flowchart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, and the combination of the process and / or box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.

[0107] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0108] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0109] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0110] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0111] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0112] It will be understood by those skilled in the art that one or more embodiments of the present application may be provided as a method, system, or computer program product. Therefore, one or more embodiments of the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, one or more embodiments of the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0113] One or more embodiments of the present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0114] The various embodiments in this application are described in a progressive manner. Similar or identical parts between the various embodiments can be referenced to each other. Each embodiment focuses on the differences from other embodiments. In particular, since the system embodiments are generally similar to the method embodiments, the description is relatively simple. For relevant parts, reference can be made to the partial description of the method embodiments. In the description of this application, reference to the terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this application. In this application, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this application, as well as the features of different embodiments or examples, without conflict.

[0115] The foregoing is intended to be one or more embodiments of the present application and is not intended to limit the present application. It will be apparent to those skilled in the art that various modifications and variations may be made to one or more embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of the claims.

Claims

1. A consensus method in a blockchain system, applied to any target consensus node participating in the consensus in the blockchain system, include: Collect the block voucher corresponding to the hth block in the blockchain contained in the consensus message broadcasted by each consensus node during the consensus process for the block corresponding to any block number in the block number interval [h+1,h+L]; wherein the block voucher is used to indicate that the transaction contained in the hth block has been successfully executed; and L represents a preset offset value corresponding to the block number interval; In response to collecting N identical block certificates corresponding to the hth block sent by different consensus nodes, after the consensus on the h+Lth block in the blockchain is completed, continue to initiate the consensus on the h+L+1th block in the blockchain; wherein N is a preset threshold.

2. The method according to claim 1, in, Collect the block voucher corresponding to the h-th block in the blockchain contained in the consensus message broadcasted by each consensus node during the consensus process for the block corresponding to any block number in the block number interval [h+1,h+L], including: Collect the block certificate corresponding to the hth block in the blockchain contained in the consensus message broadcasted by each consensus node during the consensus process on the h+Lth block in the block number interval [h+1,h+L].

3. The method according to claim 2, in, Collecting the block voucher corresponding to the hth block in the blockchain contained in the consensus message broadcasted by each consensus node during the consensus process for the h+Lth block in the block number interval [h+1,h+L], including: Receive the consensus message broadcasted by each consensus node during the consensus process on the h+Lth block in the block number interval [h+1,h+L]; The block voucher included in the consensus message is verified; if the verification of the block voucher passes, the block voucher included in the consensus message is saved.

4. The method according to claim 3, in, The block certificate includes the summary value of the hth block; the block certificate is signed by the consensus node that sends the block certificate; Verifying the block certificate contained in the consensus message includes: Performing signature verification on the block voucher; and verifying whether the locally stored digest value of the hth block is the same as the digest value in the block voucher; If the signature verification of the block voucher is successful, and the locally saved digest value of the hth block is the same as the digest value in the block voucher, then the verification of the block voucher is confirmed to be successful; If the signature verification of the block voucher fails, or the locally stored summary value of the hth block is different from the summary value in the block voucher, it is confirmed that the verification of the block voucher fails.

5. The method according to any one of claims 1 to 4, in, The consensus protocol supported by the blockchain system includes multiple consensus stages; the block certificate is included in the consensus message exchanged by each consensus node in any consensus stage of the consensus protocol.

6. The method according to claim 1, in, The L is a configurable offset value.

7. The method according to claim 1, in, The value range of N is [f+1,nf]; wherein f represents the number of fault-tolerant nodes supported by the consensus protocol adopted by the blockchain system; and n represents the total number of consensus nodes in the blockchain system.

8. The method according to claim 7, in, The consensus protocol adopted by the blockchain system is the Byzantine fault-tolerant protocol; the total number of consensus nodes in the blockchain system is represented by 3f+1; the value range of N is [f+1, 2f+1]; wherein f represents the number of Byzantine nodes tolerated by the consensus protocol adopted by the blockchain system.

9. The method according to claim 8, in, The consensus protocol adopted by the blockchain system is the PBFT protocol; the block certificate is included in any one of the pre-prepare messages, prepare messages and commit messages exchanged in the three stages of the PBFT protocol.

10. A consensus node in a blockchain system, include: The message collection unit collects the block number pairs of each consensus node in the block number interval [h+1,h+L] During the consensus process of the corresponding block, the block voucher corresponding to the h-th block in the blockchain contained in the consensus message sent by the broadcast; wherein the block voucher is used to indicate that the transaction contained in the h-th block has been successfully executed; and L represents a preset offset value corresponding to the block number interval; The consensus initiating unit, in response to collecting N identical block certificates corresponding to the hth block sent by different consensus nodes, continues to initiate a consensus on the h+L+1th block in the blockchain after the consensus on the h+Lth block in the blockchain is completed; wherein N is a preset threshold.

11. A blockchain system, comprising consensus nodes, wherein any target consensus node: Collect the block voucher corresponding to the h-th block in the blockchain contained in the consensus message broadcasted by each consensus node during the consensus process for the block corresponding to any block number in the block number interval [h+1,h+L]; in, The block voucher is used to indicate that the transaction contained in the hth block has been successfully executed; the L represents a preset offset value corresponding to the block number interval; In response to collecting N identical block certificates corresponding to the hth block sent by different consensus nodes, after the consensus on the h+Lth block in the blockchain is completed, continue to initiate the consensus on the h+L+1th block in the blockchain; wherein N is a preset threshold.

Citation Information

Patent Citations

  • Consensus method and consensus node in block chain system, and block chain system

    CN116527694A

  • Distributed network with consensus mechanism

    US20220383304A1

  • Consensus method and apparatus, and blockchain system

    WO2023040364A1

  • Consensus method, blockchain system, and consensus node

    WO2023056958A1