CN115987528A - Block synchronization method and block link point in block link system - Google Patents

Block synchronization method and block link point in block link system Download PDF

Info

Publication number
CN115987528A
CN115987528A CN202211733516.8A CN202211733516A CN115987528A CN 115987528 A CN115987528 A CN 115987528A CN 202211733516 A CN202211733516 A CN 202211733516A CN 115987528 A CN115987528 A CN 115987528A
Authority
CN
China
Prior art keywords
block
blocks
class
heights
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211733516.8A
Other languages
Chinese (zh)
Inventor
杨达一
陈盛龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202211733516.8A priority Critical patent/CN115987528A/en
Publication of CN115987528A publication Critical patent/CN115987528A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A block synchronization method and a block link node in a block chain system, wherein the block chain system comprises N block chain nodes, and the method executed by any one of the N block chain nodes comprises the following steps: receiving a plurality of block states from the remaining N-1 block link points, wherein each block state comprises a first block height of a first type block and a second block height of a second type block, the first type block comprises a plurality of transactions which are arranged in sequence and indicated by consensus proposals achieving consensus, the second type block is obtained based on the first type block with the same block height, and the second type block comprises a block head, a block body and a block certificate; determining a plurality of first type blocks and a plurality of second type blocks to be synchronized according to the maximum allowable malicious node number in the block chain system, the heights of all the first blocks and all the second blocks; the first type blocks and the second type blocks are synchronized from N-1 block chain nodes.

Description

Block synchronization method and block link point in block link system
Technical Field
The embodiment of the present specification belongs to the field of block chains, and in particular, relates to a block synchronization method and a block chain node in a block chain system.
Background
A block chain (Blockchain) is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. In the block chain system, data blocks are combined into a chain data structure in a sequential connection mode according to a time sequence, and a distributed account book which is not falsified and forged is guaranteed in a cryptology mode. Because the blockchain has the characteristics of decentralization, information non-tampering, autonomy and the like, the blockchain is also paid more and more attention and is applied by people.
Disclosure of Invention
The invention aims to provide a block synchronization method and a block chain node in a block chain system.
In a first aspect, a method for block synchronization in a blockchain system including N blockchain nodes is provided, where the method is performed by any one of the N blockchain nodes. The method comprises the following steps: receiving a plurality of block states from the remaining N-1 block link points, a single block state comprising a first block height of a first class of blocks newly obtained by its corresponding block link point and a second block height of a second class of blocks, the first class of blocks comprising a plurality of transactions in order indicated by consensus proposals to achieve consensus, the second class of blocks being obtained based on the first class of blocks having the same block height as it, the second class of blocks comprising a block header, a block body and a block identification; determining a plurality of first type blocks and a plurality of second type blocks to be synchronized according to the maximum number of malicious nodes allowed in the block chain system, the height of each first block and the height of each second block; synchronizing the first class blocks from the N-1 block link points and synchronizing the second class blocks from the N-1 block link points.
In a first aspect, a blockchain node in a blockchain system is provided, where the blockchain system includes N blockchain nodes, and the blockchain node includes: a state obtaining unit configured to receive a plurality of block states from the remaining N-1 block link points, a single block state including a first block height of a first class block and a second block height of a second class block, the first class block including a plurality of transactions in sequence indicated by consensus proposals achieving consensus, the second class block being obtained based on the first class block having the same block height as the second class block, the second class block including a block header, a block body, and a block certification, the first class block being a block of the first class block; a block determining unit configured to determine a number of first class blocks and a number of second class blocks to be synchronized according to the maximum number of malicious nodes allowed in the blockchain system, each of the first block heights and each of the second block heights; a synchronization processing unit configured to synchronize the first type blocks from the N-1 block chain nodes and synchronize the second type blocks from the N-1 block chain nodes.
In a third aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed in a computing device, causes the computing device to perform the method of the first aspect.
In the solution of the embodiment of the present specification, for any Block link node that needs to synchronize a Block from other Block link points in a Block link system including N Block link nodes, the Block link point may receive a plurality of Block states from the remaining N-1 Block link points, where a single Block state includes a first Block height of a Raw Block newly obtained by its corresponding Block link point and a second Block height of a Stable Block; and then according to the maximum malicious node number allowed in the Block chain system, the height of each first Block and the height of each second Block, determining a plurality of Raw blocks and a plurality of Stable blocks to be synchronized, and synchronizing the plurality of Raw blocks and the plurality of Stable blocks from the rest N-1 Block chain link points. Therefore, the Block chain link point keeps up with the normal progress of the whole Block chain system by synchronizing all Raw blocks and Stable blocks which are behind the rest Block chain nodes from the rest Block chain nodes, so that the Block chain link point can be normally used as a consensus node to participate in consensus on a consensus proposal.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and it is obvious for a person skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is an architecture diagram of a block chain system provided in an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a process for processing block data in a blockchain system using an asynchronous pipeline mechanism;
fig. 3 is a flowchart of a block synchronization method in a block chain system provided in an embodiment of the present disclosure;
fig. 4 is one of schematic diagrams of an exemplary provided synchronous Raw Block in an embodiment of the present specification;
fig. 5 is a second schematic diagram of an exemplary provided synchronous Raw Block in the embodiment of the present disclosure;
FIG. 6 is one of schematic diagrams of an exemplary synchronization Stack provided in the embodiments of the present specification;
FIG. 7 is a second schematic diagram of an exemplary synchronization Stack provided in the embodiment of the present specification;
fig. 8 is a schematic structural diagram of a blockchain link point in a blockchain system provided in an embodiment of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without making any creative effort shall fall within the protection scope of the present specification.
Fig. 1 is an architecture diagram of a block chain system exemplarily provided in an embodiment of the present disclosure. The blockchain system may include N blockchain nodes, where 8 blockchain nodes, such as nodes 1-8, are exemplarily shown in fig. 1. The lines between the nodes schematically represent P2P (Peer to Peer) connections, which may be, for example, transmission Control Protocol (TCP) connections, which are used to support the transmission of data between different nodes.
The consensus mechanism in the blockchain system is a mechanism in which blockchain nodes achieve the same consensus on blocky information (or called blocky data) in the whole network, and can ensure that the newly obtained blocks are accurately stored. The current mainstream consensus mechanisms include: proof of Work (POW), proof of stock (POS), proof of commission rights (DPOS), practical Byzantine Fault Tolerance (PBFT) algorithm, etc. In each consensus algorithm, after a predetermined number of consensus nodes agree on data to be agreed upon, it is determined that the agreed upon data is agreed upon. For example, in the PBFT algorithm, for N ≧ 3f +1 consensus nodes, f malicious nodes are allowed to exist at most, that is, when 2f +1 consensus nodes in N block chain nodes reach the same, it can be determined that consensus succeeds, and N may be less than N.
An asynchronous pipeline mechanism may be employed in the blockchain system to process block data. Referring to fig. 2, a single blockchain node may include a mutually independent consensus service and several other services. The consensus service can be responsible for performing consensus on the consensus proposal with the rest consensus nodes in the N Block chain nodes, and under the condition that N-f consensus nodes achieve consensus on the consensus proposal, obtaining a first type Block (namely Raw Block) corresponding to the consensus proposal, and adding the obtained Raw Block into the tail of a Raw Block queue; the Raw Block includes a transaction set including a plurality of transactions in sequence indicated by corresponding consensus proposals, and may further include a Block height (or referred to as a Block number) and a timestamp corresponding to the transaction set. Other services can sequentially extract a Raw Block from the head of the Raw Block queue, and correspondingly generate a second type of Block (namely, a Stable Block) with the same Block height based on the Raw Block extracted from the Raw Block queue, wherein the Stable Block is usually a non-rollback Block in a Block chain system; the Stable Block may include a Block header, a Block body, and a Block manifest. The Block body of the Stable Block comprises transaction sets located in corresponding Raw blocks and can also comprise receipt sets corresponding to the transaction sets; the Block header of the Stable Block may include a Block height, a Timestamp, a Transaction Root hash Transaction _ Root, a Receipt Root hash register _ Root, a status Root hash State _ Root, and the like; the Block certification of the Stable Block is that the signatures of the Block header and the Block body in the Stable Block are generated based on at least n-f consensus nodes, for example, the signature list may be formed by the n-f consensus nodes through signatures of hash values of the Block header and the Block body in the Stable Block, or the signature list may be a result of compressing the signature list. It should be noted that the newly obtained Raw Block and the Stable Block in the Block chain system may have different Block heights, for example, the Block height of the newly obtained Stable Block in the Block chain node may be h, and the Block height of the newly obtained Raw Block through the consensus service may be h + a greater than h.
The Block chain node may have difficulty in ensuring that it can always complete the processing procedures of all Raw blocks and Stable blocks correctly and effectively. For example, the Block link points may have slow operation and other problems caused by software program update, abnormal downtime, insufficient computing resources or storage resources, so that the obtained blocks of the Raw Block and the Stable Block are highly behind other nodes.
In the related art, the Block link points may synchronize the Block link points from the remaining N-1 Block link points to lag the Stable blocks of the remaining Block link nodes. However, as can be seen from the foregoing, the Block heights of the most recently obtained Raw Block and the Stable Block in the Block chain system may not be the same, that is, the Block height of the most recently obtained Raw Block in the Block chain system may be ahead of the Block height of the Stable Block, and if a Block chain node synchronizes its lagging Stable Block only from the rest Block chain nodes in the Block chain system, the Block chain node may not participate in the processing process corresponding to the Raw Block, which may cause the Block chain node to not normally participate in the consensus of the consensus proposal as the consensus node.
The embodiment of the specification provides a block synchronization method and a block chain node in a block chain system. For any Block chain node which needs to synchronize blocks from other Block chain link points in a Block chain system comprising N Block chain nodes, the Block chain link point can receive a plurality of Block states from the rest N-1 Block chain link points, and a single Block state comprises a first Block height of a newly obtained Raw Block and a second Block height of a Stable Block of the corresponding Block chain link point; and then according to the maximum malicious node number allowed in the Block chain system, the height of each first Block and the height of each second Block, determining a plurality of Raw blocks and a plurality of Stable blocks to be synchronized, and synchronizing the plurality of Raw blocks and the plurality of Stable blocks from the rest N-1 Block chain link points. Therefore, the Block chain link points can synchronize all Raw blocks and Stable blocks which lag behind the rest Block chain nodes from the rest Block chain nodes, so that the Block chain link points can catch up with the processing progress of the Block chain system, and the Block chain link points can normally participate in consensus on consensus suggestions as consensus nodes.
Fig. 3 is a flowchart of a block synchronization method in a block chain system according to an embodiment of the present disclosure. The blockchain system may include N blockchain nodes, the N blockchain nodes may include N consensus nodes, and the maximum number of malicious nodes allowed in the blockchain system is f. The method may be performed by any blockchain node of the N blockchain nodes, and as shown in fig. 3, the method may include some or all of the following steps S31 to S35.
In step S31, a plurality of Block states are received from the remaining N-1 Block link points, and a single Block state includes a first Block height of a Raw Block and a second Block height of a Stable Block, which are newly obtained from the corresponding Block link point.
Hereinafter, the process of node 1 synchronizing blocks from node 2 to node N and the remaining N-1 block chain nodes will be exemplarily described mainly by taking the block chain node performing each method step shown in fig. 3 as node 1 among N block chain nodes.
The blockchain node in the blockchain system, which is a common node, can broadcast the blockchain status. For example, for node 2, which is a common node among the N blockchain nodes, block state m2 may be broadcast, and Block height Raw _ Block _ number of Raw Block newly obtained by node 2 and Block height Stable _ Block _ number of stand Block newly obtained by node 2 may be included in Block state m 2. Accordingly, each node in the blockchain system may receive a plurality of block states broadcast by a common node. For example, node 1 may receive a plurality of block states broadcasted by some or all of the N common nodes from the remaining N-1 block nodes, and obtain a plurality of raw _ block _ numbers and a plurality of stable _ block _ numbers.
In step S33, according to the maximum number of malicious nodes allowed in the Block chain system, the heights of the first blocks and the heights of the second blocks, a plurality of Raw blocks and a plurality of Stable blocks to be synchronized are determined.
The node 1 may sort the obtained plurality of raw _ block _ numbers in descending order, and determine a plurality of raw _ blocks to be synchronized according to the height of the first block with the rank number k. The f Raw _ Block _ number with the largest value may be from a malicious node, so that the value of k may be greater than the maximum malicious node number f allowed in the Block chain system, and the Raw _ Block _ number with the sequence number k will be the real Block height of the currently newly obtained Raw Block in the Block chain system. Illustratively, the block height of the raw _ block newly obtained by the node 1 itself is n0, and the value of the raw _ block _ number with the arrangement number k is nr, so that r raw _ blocks corresponding to the height interval [ n1, nr ] are several raw _ blocks to be synchronized.
The node 1 may determine whether there are at least n-f raw _ block _ numbers that are the same in the obtained raw _ block _ numbers, and if so, determine a number of raw _ blocks to be synchronized based on the same raw _ block _ number. Illustratively, the Block height of the Raw _ Block newly obtained by the node 1 itself is n0, and at least n-f same values of the Raw _ Block _ number are nr, so that r Raw blocks corresponding to the height interval [ n1, nr ] are several Raw blocks to be synchronized.
Similar to the process of determining several Raw blocks to be synchronized, the node 1 may determine s Stable blocks corresponding to the height interval [ m1, ms ] as several Stable blocks to be synchronized, which is not described herein again.
And step S35, synchronizing the plurality of Raw blocks from the rest N-1 Block link points, and synchronizing the plurality of Stable blocks from the rest N-1 Block link points.
Node 1 may synchronize the plurality of Raw blocks from the remaining N-1 Block link points by 1 or more execution rounds and synchronize the plurality of Stable blocks from the remaining N-1 Block link points by 1 or more execution rounds. The number of Raw Block/Stable Block allowed to be synchronized in a single execution round can be generally limited, and excessive resource occupation in the same period is avoided.
The following describes, in conjunction with fig. 4 and 5, an execution process of any ith execution round in the process of synchronizing the plurality of Raw blocks from the remaining N-1 Block link points through 1 or more execution rounds. Referring to fig. 4, the blockchain node may perform a part or all of the following method steps S351 to S353 in the ith execution round.
At step S351, at least two third Block heights are determined from the height intervals corresponding to the plurality of Raw blocks to be synchronized.
For example, the node 1 may determine 3 Block heights, such as n1 to n3, from the height intervals [ n1, nr ] corresponding to several Raw blocks in order of decreasing in the 1 st execution round. The node 1 may determine at least two third Block heights from the height intervals [ n1, nr ] corresponding to the plurality of Raw blocks according to the execution result of the i-1 execution round in any ith execution round larger than 1. For example, in the i-1 st execution round, it is desirable to synchronize the Raw blocks corresponding to 3 Block heights, such as Block heights n4 to n6, where the Raw Block having the Block height n4 cannot be synchronized to the node 1 within a limited time, or the Raw Block having the Block height n4 fails to verify, then n4 may be included in the at least two third Block heights determined in the i-th execution round, for example, the at least two Block heights determined from the height interval [ n1, nr ] in the i-th execution round, n4 may be included, and the Block heights of one or more Raw blocks of the plurality of Raw blocks that are not successfully synchronized to the node 1 may also be included.
In step S352, for each third Block height, the corresponding Raw Block is synchronized from the first node of the remaining N-1 Block chain nodes, and a plurality of authentication data of the Raw Block is acquired from the remaining N-2 Block chain nodes except the first node.
For example, as shown in fig. 5, the Block heights determined in the 1 st execution round include N1 to N3, for the Block height N1, N-1 Raw _ Block _ numbers received by the node 1 from N-1 nodes, such as the node 2 to the node N, are not less than N1, and the node 1 may determine that it has successfully obtained Raw blocks with the Block height N1 based on the Raw _ Block _ numbers from the remaining N-1 Block chain nodes. In this case, the node 1 may select, for example, a plurality of pieces of authentication data of the Raw Block having the Block height N1 from the node 2, and the Raw Block having the Block height N1 from the remaining N-2 nodes such as the nodes 3 to N.
The validation data of the Raw Block may include a hash value of the Raw Block provided by a corresponding Block chain node, or a transaction root hash corresponding to a plurality of sequentially arranged transactions included in the Raw Block. Illustratively, the node 3 may calculate the verification data of the Raw Block with the Block height n1 obtained by the node and provide the verification data calculated by the node 1.
In step S353, for at least two Raw blocks corresponding to at least two third Block heights, the at least two Raw blocks are concurrently verified according to a plurality of verification data corresponding to the at least two Raw blocks, respectively.
In the case where the verification data includes a transaction root hash, for example, for a Raw Block having a Block height N1 from the node 2, the node 1 may calculate transaction root hashes H1 corresponding to a plurality of sequentially arranged transactions included in the Raw Block, and if the number of transaction root hashes identical to the transaction root hash H1 in a plurality of verification data corresponding to the Raw Block from the remaining N-2 nodes is smaller than N-f-1, the Raw Block verification having the Block height N1 fails.
In the case where the verification data includes a hash value of a Raw Block, for example, for a Raw Block with a Block height N1 from the node 2, the node 1 may calculate a hash value H2 of the Raw Block, and if the number of hash values identical to the hash value H2 in a plurality of verification data corresponding to the Raw Block from the remaining N-2 nodes is smaller than N-f-1, the Raw Block verification with the Block height N1 fails.
After the Raw Block passes the verification, the node 1 may install the synchronized Raw Block, i.e. persistent storage.
The following describes, with reference to fig. 6 and fig. 7, an execution process of an arbitrary ith execution round in the process of synchronizing the several Stable blocks from the remaining N-1 Block link points through 1 or more execution rounds. Referring to fig. 6, the block link point may perform some or all of the following method steps S354 to S359 in any jth execution round.
In step S354, at least two fourth Block heights are determined from the height intervals corresponding to the plurality of Stable blocks to be synchronized.
For example, in the 1 st execution round, the node 1 may determine 3 Block heights, such as m1 to m3, from among the height intervals [ m1, ms ] corresponding to several Stable blocks in descending order. The node 1 may determine at least two fourth Block heights from the height intervals [ m1, ms ] corresponding to the plurality of Stable blocks according to the execution result of the j-1 th execution round in any j-th execution round larger than 1. For example, referring to fig. 7, in the 1 st execution round, it is desirable to synchronize, from the node 2, the stack blocks corresponding to 3 Block heights, such as Block heights m1 to m3, and the stack Block with the Block height m3 is not synchronized to the node 1 within a limited time, or the stack Block with the Block height m3 fails to verify, for example, the Block header fails to verify or the Block verification fails, at least two fourth Block heights determined in the 2 nd execution round include m3, and further include the Block heights corresponding to one or more stack blocks that are not synchronized to the node 1 in the several stack blocks at present. It should be noted that, if the role of a certain blockchain node may change between a common node and a non-common node during the operation of the blockchain system, at least two fourth blockheights determined from the height interval [ m1, ms ] in the jth execution round should also be able to form sub-intervals belonging to the height interval [ m1, ms ]; for example, referring to fig. 7, if the Stable Block with the Block height m3 in the 1 st execution round fails to be synchronized to the node 1 in the valid time or fails to be verified, the at least two fourth Block heights determined in the 2 nd execution round may be, for example, sub-intervals [ m3, m5] of the height interval [ m1, ms ].
In step S355, at least two Stable blocks are synchronized from a plurality of second nodes of the remaining N-1 Block chain nodes according to at least two fourth Block heights. Referring to fig. 7, at least two Stable blocks corresponding to the at least two fourth Block heights may be synchronized from a single second node, or may be synchronized from a plurality of second nodes.
In step S356, the Block headers of the at least two Stable blocks are concurrently verified.
The Block header of the Stable Block is verified, the information such as the transaction root hash and the state root hash included in the Block header of the Stable Block can be included, and the partial information can be verified through the transaction set and/or the receipt set included in the Block of the Stable Block, so that the Block headers of at least two Stable blocks can be verified in parallel, and the verification efficiency is improved. It should be noted that, if the role of the Block chain node may change between the common node and the non-common node in the operation process of the Block chain system, the number of the thread pool queues for concurrently verifying the Block heads of the at least two Block blocks needs to be equal to or greater than the number of the at least two Block blocks, so as to avoid that the Block certification that the Block head cannot be verified by the Block with the smaller height and the Block of the Block cannot be continuously verified subsequently after the Block with the larger height fills the thread pool queues.
The Block certificate included in the Block header passing the verified Stable Block can be verified subsequently. If the role of the Block chain node may change between the common identification node and the non-common identification node in the operation process of the Block chain system, at least two Stable blocks whose Block heads pass the verification need to be sequentially verified according to the sequence of the Block heights from small to large. Verifying the Block certification included in the Stable Block whose Block header passes verification is completed, for example, by the following steps S357 and S358.
In step S357, a target Block is determined from the at least two Stable blocks according to the sizes of the at least two fourth Block heights.
The unselected fourth Block heights can be sequentially selected from at least two fourth Block heights according to the sequence from small to large of the Block heights, and the Stable Block corresponding to the selected fourth Block height is used as the target Block. If the block head of the target block is not verified, the current execution round can be directly ended and the execution process of the next execution round can be started. If the block header of the target block has been verified, the following step S358 may be continuously performed.
In step S358, public keys of a plurality of common nodes corresponding to the target block are obtained, and the block certification in the target block is verified according to the public keys of the common nodes.
For a Stable Block with a Block header and a Block certification both passing verification, the node 1 may execute a plurality of transactions included in a transaction set in the executed Stable Block, and update its own stored state data correspondingly; or the node 1 may update its own stored state data according to the receipt set included in the Stable Block, for example. Furthermore, through the stored state data, the condition that the roles of the block chain nodes change between the common nodes and the non-common nodes can be found, a plurality of common nodes corresponding to the target block are determined, the public keys of the common nodes are further acquired, and the block certification in the target block is verified by using the public keys of the common nodes. If the block in the target block fails to verify, the node 1 may directly end the current execution round and start the execution process of the next execution round.
For a plurality of Stable blocks which are synchronous from the rest N-1 nodes and pass verification, the node 1 can perform persistent storage on the plurality of Stable blocks, sequentially execute a plurality of transactions included in the plurality of Stable blocks according to the sequence of Block heights from small to large, and further correspondingly update the state data stored by the node 1. For a plurality of Raw blocks which are synchronized from the rest N-1 nodes and pass the verification, the node 1 can perform persistent storage on the plurality of Raw blocks; in addition, it is continuously assumed that the height intervals corresponding to the plurality of Stable blocks are [ m1, ms ], and the height intervals corresponding to the plurality of Raw blocks are [ n1, nr ], the node 1 further needs to sequentially process, among the plurality of Raw blocks, the Raw blocks corresponding to the height intervals [ ms +1, nr ] through other computing services, so as to obtain the Stable blocks corresponding to the height intervals [ ms +1, nr ].
Based on the same concept as the foregoing method embodiment, this specification embodiment further provides a block link point in a block chain system, where the block chain system includes N block chain nodes. As shown in fig. 8, the blockchain node includes: a state obtaining unit 81 configured to receive a plurality of block states from the remaining N-1 block link points, a single block state including a first block height of a first class block and a second block height of a second class block, the first class block including a plurality of transactions in sequence indicated by consensus proposals achieving consensus, the second class block being obtained based on the first class block having the same block height as the first class block, the second class block including a block header, a block body, and a block certification, the first class block including a block head, a block body, and a block body; a block determining unit 83 configured to determine a number of first class blocks and a number of second class blocks to be synchronized according to the maximum number of malicious nodes allowed in the blockchain system, each of the first block heights and each of the second block heights; a synchronization processing unit 85 configured to synchronize the first class blocks from the N-1 block chain nodes and synchronize the second class blocks from the N-1 block chain nodes.
In a possible implementation manner, the synchronization processing unit 85 is specifically configured to determine at least two third block heights from the height intervals corresponding to the plurality of first type blocks; and synchronizing at least two first class blocks from a first node of the N-1 blockchain nodes according to the at least two third block heights; the synchronous processing unit 85 is further configured to obtain a plurality of verification data respectively corresponding to the at least two first class blocks from the remaining N-2 block chain nodes except the first node in the N-1 block chain nodes; and according to a plurality of verification data respectively corresponding to the at least two first-class blocks, concurrently verifying the at least two first-class blocks.
In a possible implementation manner, the verification data corresponding to the first class of blocks includes a hash value of the first class of blocks and/or transaction roots corresponding to a plurality of transactions arranged in sequence in the first class of blocks.
In a possible embodiment, the process of synchronizing the first class blocks from the N-1 block link points comprises a plurality of execution rounds; the at least two third block heights determined in any ith execution turn comprise the block heights corresponding to the first type blocks which are synchronous and fail to be verified in the (i-1) th execution turn.
In a possible implementation manner, the synchronization processing unit 85 is specifically configured to determine at least two fourth block heights from the height intervals corresponding to the second type blocks; and synchronizing at least two second class blocks from a number of second nodes of the N-1 blockchain nodes according to the at least two fourth block heights; the synchronization processing unit 85 is further configured to concurrently verify the block headers of the at least two second-class blocks; and verifying the block certification included in the second type of block with the verified block header.
In a possible implementation manner, the at least two fourth block heights are the heights of the blocks included in the sub-intervals of the height intervals corresponding to the second-class blocks; obtaining the signature of a block head and a block body in the second-class blocks based on a plurality of common identification nodes corresponding to the second-class blocks; the synchronization processing unit 85 is specifically configured to determine a target block from the at least two second-class blocks according to the size of the at least two fourth block heights; under the condition that the block head of the target block passes verification, public keys of a plurality of common nodes corresponding to the target block are obtained; and verifying the block certification in the target block according to the public keys of the plurality of common identification nodes.
In one possible embodiment, the process of synchronizing the second class blocks from the N-1 block chain nodes includes a plurality of execution rounds; the at least two fourth block heights determined in any jth execution round include the block heights corresponding to blocks of the second class that are synchronized in the jth-1 execution round and whose block headers or block identifications are not verified.
In a possible implementation manner, the block determining unit 83 is specifically configured to sort the heights of the first blocks in a descending order, and determine a plurality of first type blocks to be synchronized according to the height of the first block with the rank number k; and/or sorting the heights of the second blocks in descending order, and determining a plurality of second blocks to be synchronized according to the heights of the second blocks with the arrangement sequence number k; and the value of k is greater than the maximum number of malicious nodes allowed in the block chain system.
Also provided in embodiments of the present specification is a computer-readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method performed by the blockchain node in the aforementioned method embodiments.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as ABEL (Advanced Boolean Expression Language), AHDL (alternate Hardware Description Language), traffic, CUPL (core universal Programming Language), HDCal, jhddl (Java Hardware Description Language), lava, lola, HDL, PALASM, rhyd (Hardware Description Language), and vhigh-Language (Hardware Description Language), which is currently used in most popular applications. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, 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, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be regarded as a hardware component and the means for performing the various functions included therein may also be regarded as structures within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a server system. Of course, this application does not exclude that with future developments in computer technology, the computer implementing the functionality of the above described embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted 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.
Although one or more embodiments of the present description provide method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When implemented in an actual device or end product, can be executed sequentially or in parallel according to the methods shown in the embodiments or figures (e.g., parallel processor or multi-thread processing environments, even distributed data processing environments). The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in a process, method, article, or apparatus that comprises the recited elements is not excluded. For example, if the terms first, second, etc. are used to denote names, they do not denote any particular order.
For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, when implementing one or more of the present description, the functions of each module may be implemented in one or more software and/or hardware, or the modules implementing the same functions may be implemented by a combination of a plurality of sub-modules or sub-units, etc. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage, graphene storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
One skilled in the art will appreciate that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
One or more embodiments of the specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
All the embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment. In the description of the specification, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the specification. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the various embodiments or examples and features of the various embodiments or examples described in this specification can be combined and combined by those skilled in the art without being mutually inconsistent.
The above description is merely exemplary of one or more embodiments of the present disclosure and is not intended to limit the scope of one or more embodiments of the present disclosure. Various modifications and alterations to one or more embodiments described herein will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of the present specification should be included in the scope of the claims.

Claims (17)

1. A method of block synchronization in a blockchain system comprising N blockchain nodes, the method being performed by any one of the N blockchain nodes, the method comprising:
receiving a plurality of block states from the remaining N-1 block link points, a single block state including a first block height of a first class block and a second block height of a second class block, the first class block including a plurality of transactions in sequence indicated by consensus proposals achieving consensus, the second class block being obtained based on the first class block having the same block height as the second class block, the second class block including a block header, a block body, and a block identification;
determining a plurality of first type blocks and a plurality of second type blocks to be synchronized according to the maximum number of malicious nodes allowed in the block chain system, the height of each first block and the height of each second block;
synchronizing the first class blocks from the N-1 block link points and synchronizing the second class blocks from the N-1 block link points.
2. The method of claim 1, synchronizing the number of first class blocks from the N-1 block chain nodes comprises: determining the heights of at least two third blocks from the height intervals corresponding to the first blocks; synchronizing at least two first class blocks from a first node of the N-1 block chain nodes according to the at least two third block heights;
wherein the method further comprises: obtaining a plurality of verification data corresponding to the at least two first-class blocks from the rest N-2 block chain nodes except the first node in the N-1 block chain nodes; and according to a plurality of verification data respectively corresponding to the at least two first-class blocks, concurrently verifying the at least two first-class blocks.
3. The method according to claim 2, wherein the verification data corresponding to the first type of block includes a hash value of the first type of block and/or a transaction root hash corresponding to a plurality of transactions arranged in sequence in the first type of block.
4. The method of claim 2, wherein the process of synchronizing the first class of blocks from the N-1 block chain nodes comprises a plurality of execution rounds; the at least two third block heights determined in any ith execution turn comprise the block heights corresponding to the first type blocks which are synchronous and fail to be verified in the (i-1) th execution turn.
5. The method of claim 1, synchronizing the number of blocks of the second class from the N-1 block chaining points comprises: determining at least two fourth block heights from the height intervals corresponding to the second blocks; synchronizing at least two second class blocks from a number of second nodes of the N-1 blockchain nodes according to the at least two fourth block heights;
wherein the method further comprises: concurrently verifying the block headers of the at least two second-class blocks; and verifying the block certificate included in the second type of block with the verified block header.
6. The method of claim 5, wherein the at least two fourth block heights are block heights included in a sub-interval of the height interval corresponding to the second-class blocks; obtaining, by a tile certification in the second-class tile, a signature of a tile header and a tile body in the second-class tile based on a plurality of consensus nodes corresponding to the second-class tile;
the verifying the block certification included in the second type of block whose block header passes the verification specifically includes: determining a target block from the at least two second-class blocks according to the size of the at least two fourth block heights; under the condition that the block head of the target block passes verification, public keys of a plurality of common nodes corresponding to the target block are obtained; verifying a block attestation in the target block according to public keys of the plurality of consensus nodes.
7. The method of claim 5, wherein the process of synchronizing the second class of blocks from the N-1 block chain nodes comprises a plurality of execution rounds; the at least two fourth block heights determined in any jth execution round include the block heights corresponding to blocks of the second class that are synchronized in the jth-1 execution round and whose block headers or block proofs have failed to verify.
8. The method according to any of claims 1-7, wherein the determining a number of first class blocks and a number of second class blocks to be synchronized according to a maximum number of malicious nodes allowed in the blockchain system, each of the first block heights and each of the second block heights, comprises:
sequencing the heights of the first blocks in a descending order, and determining a plurality of first type blocks to be synchronized according to the heights of the first blocks with the sequence number k; and/or sorting the heights of the second blocks in descending order, and determining a plurality of second blocks to be synchronized according to the heights of the second blocks with the arrangement sequence number k;
and the value of k is greater than the maximum number of malicious nodes allowed in the block chain system.
9. A blockchain node in a blockchain system including N of the blockchain nodes, the blockchain node comprising:
a state obtaining unit configured to receive a plurality of block states from the remaining N-1 block link points, a single block state including a first block height of a first class block, which is newly obtained by its corresponding block link point, and a second block height of a second class block, the first class block including a plurality of transactions in order indicated by consensus proposals achieving consensus, the second class block being obtained based on the first class block having the same block height as it, the second class block including a block header, a block body, and a block certificate;
a block determining unit configured to determine a number of first class blocks and a number of second class blocks to be synchronized according to the maximum number of malicious nodes allowed in the blockchain system, each of the first block heights and each of the second block heights;
a synchronization processing unit configured to synchronize the blocks of the first type from the N-1 block chain nodes and synchronize the blocks of the second type from the N-1 block chain nodes.
10. The block link point according to claim 9, wherein the synchronization processing unit is specifically configured to determine at least two third block heights from the height intervals corresponding to the first blocks; and synchronizing at least two first class blocks from a first node of the N-1 blockchain nodes according to the at least two third block heights;
the synchronous processing unit is further configured to obtain a plurality of verification data respectively corresponding to the at least two first-class blocks from the rest N-2 block chain nodes except the first node in the N-1 block chain nodes; and according to a plurality of verification data respectively corresponding to the at least two first-class blocks, concurrently verifying the at least two first-class blocks.
11. The block chain node according to claim 10, wherein the verification data corresponding to the first type of block comprises a hash value of the first type of block and/or a transaction root corresponding to a plurality of transactions arranged in sequence in the first type of block.
12. The block-link point of claim 10, the process of synchronizing the number of first class blocks from the N-1 block-link points comprising a plurality of execution rounds; the at least two third block heights determined in any ith execution turn comprise the block heights corresponding to the first type blocks which are synchronous and fail to be verified in the (i-1) th execution turn.
13. The block link point according to claim 9, wherein the synchronization processing unit is specifically configured to determine at least two fourth block heights from the height intervals corresponding to the second blocks; and synchronizing at least two second class blocks from a number of second nodes of the N-1 block chain nodes according to the at least two fourth block heights;
the synchronous processing unit is further configured to verify the block headers of the at least two second-class blocks concurrently; and verifying the block certification included in the second type of block with the verified block header.
14. The block link point according to claim 13, wherein the at least two fourth block heights are respective block heights included in a sub-interval of the height interval corresponding to the second-type blocks; obtaining the signature of a block head and a block body in the second-class blocks based on a plurality of common identification nodes corresponding to the second-class blocks;
the synchronous processing unit is specifically configured to determine a target block from the at least two second-class blocks according to the sizes of the at least two fourth block heights; under the condition that the block head of the target block passes verification, public keys of a plurality of common nodes corresponding to the target block are obtained; and verifying the block certification in the target block according to the public keys of the plurality of common identification nodes.
15. The blockchain node of claim 13, wherein the process of synchronizing the number of second class blocks from the N-1 block chain nodes includes a plurality of execution rounds; the at least two fourth block heights determined in any jth execution round include the block heights corresponding to blocks of the second class that are synchronized in the jth-1 execution round and whose block headers or block proofs have failed to verify.
16. The block link point according to any of claims 9 to 15, wherein the block determining unit is specifically configured to sort the first block heights in descending order, and determine a plurality of first type blocks to be synchronized according to the first block heights with an arrangement number k; and/or sequencing the heights of the second blocks in a descending order, and determining a plurality of second blocks to be synchronized according to the heights of the second blocks with the sequence number k;
and the value of k is greater than the maximum number of malicious nodes allowed in the block chain system.
17. A computer-readable storage medium having stored thereon a computer program which, when executed in a computing device, causes the computing device to perform the method of any of claims 1-8.
CN202211733516.8A 2022-12-30 2022-12-30 Block synchronization method and block link point in block link system Pending CN115987528A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211733516.8A CN115987528A (en) 2022-12-30 2022-12-30 Block synchronization method and block link point in block link system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211733516.8A CN115987528A (en) 2022-12-30 2022-12-30 Block synchronization method and block link point in block link system

Publications (1)

Publication Number Publication Date
CN115987528A true CN115987528A (en) 2023-04-18

Family

ID=85972043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211733516.8A Pending CN115987528A (en) 2022-12-30 2022-12-30 Block synchronization method and block link point in block link system

Country Status (1)

Country Link
CN (1) CN115987528A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118101677A (en) * 2024-04-28 2024-05-28 杭州高新区(滨江)区块链与数据安全研究院 Block chain synchronization method, device and storage medium based on state increment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118101677A (en) * 2024-04-28 2024-05-28 杭州高新区(滨江)区块链与数据安全研究院 Block chain synchronization method, device and storage medium based on state increment

Similar Documents

Publication Publication Date Title
CN109949157B (en) Business data uplink method, device and system
CN108512652B (en) Decentralized consensus method and system based on time certification and block chain system
CN113630257B (en) Consensus method, block chain system and consensus node
CN114584312B (en) Consensus method, block chain system and consensus node
CN113610531B (en) Consensus method, block chain system and consensus node
CN113761071B (en) Consensus method, block chain system and consensus node
WO2023056964A1 (en) Consensus method, blockchain system, and consensus node
CN115987528A (en) Block synchronization method and block link point in block link system
CN113743950A (en) Method for performing transactions in a blockchain, blockchain node and blockchain
CN113452747A (en) Extensible and safe consensus method, system, storage medium and intelligent terminal
CN115174572B (en) Data multicasting method in blockchain, blockchain node and storage medium
CN114996350A (en) Block state synchronization method in block chain and first node
CN113744063B (en) Method and device for executing transaction in block chain
CN111061813B (en) Method, apparatus and computing device for data synchronization in blockchain network
CN113630259A (en) Consensus method, block chain system and consensus node
CN115150409B (en) Method for executing transaction in blockchain system, node and computer readable storage medium
CN116366666A (en) Chain state updating method and block link point in block chain system
CN115174574A (en) Data broadcasting method in block chain system, node and block chain system
CN115174573B (en) Data broadcasting method in block chain system, node and block chain system
CN114924617B (en) Clock synchronization method and device in decentralization system
CN114697344A (en) Method for determining block chain consensus node, block chain and block chain link point
CN116846912A (en) View switching method, consensus node and block chain system in PBFT algorithm
Rodrigues Threat-adaptive Byzantine Consensus
WO2020181412A1 (en) Blockchain consensus processing method, apparatus, and system
CN115801780A (en) Consensus node rotation method and block link point

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination