CN113626532B - Illegal node identification method, anti-cheating method, computer device and storage medium - Google Patents
Illegal node identification method, anti-cheating method, computer device and storage medium Download PDFInfo
- Publication number
- CN113626532B CN113626532B CN202111034618.6A CN202111034618A CN113626532B CN 113626532 B CN113626532 B CN 113626532B CN 202111034618 A CN202111034618 A CN 202111034618A CN 113626532 B CN113626532 B CN 113626532B
- Authority
- CN
- China
- Prior art keywords
- merck
- state data
- mountain
- transaction
- consensus
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 84
- 238000004590 computer program Methods 0.000 claims description 8
- 238000010586 diagram Methods 0.000 description 12
- 238000004891 communication Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000010276 construction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
- G06F16/2246—Trees, e.g. B+trees
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application provides an illegal node identification method, an anti-cheating method, computer equipment and a storage medium, wherein the method comprises the following steps: when the first state data in the first consensus transaction of the first height marked as being correctly consensus on the main chain is judged to be incorrect, second state data required for executing the first transaction is searched from a state database of the current node; generating a first report transaction according to the first merck mountain information of the first parallel chain block where the second state data is located and the first transaction, and sending the first report transaction to the main chain for the main chain node to: executing the first transaction according to the second state data to obtain third state data when the second state data is in the first merck mountain information; and when the third state data is different from the first state data, identifying an illegal consensus node of the current chain. The application identifies parallel chain consensus nodes of joint cheating with less time and less computational effort.
Description
Technical Field
The application relates to the technical field of blockchains, in particular to an illegal node identification method, an anti-cheating method, computer equipment and a storage medium.
Background
In the prior art, it is assumed that a main chain and a parallel chain pc1 exist, wherein pc1 has parallel chain nodes node1 to node7, and node1 to node4 are consensus nodes; if enough nodes in the nodes 1 to 4 are combined with cheating, generating an error parallel chain block (10) comprising an error transaction tx1, and respectively generating consensus transactions tx_coherent (10) _NODE1 to tx_coherent (10) _NODE4 of the block (10) and sending the consensus transactions to a main chain; the master link point will complete the parallel chain consensus of the block (10) on the main chain side according to tx_coherent (10) _non 1-tx_coherent (10) _non 4 and the consensus transaction that will joint cheating will be identified as having the correct consensus on the main chain.
Assuming that node7 finds tx1 to be wrong, generating a report transaction and sending the report transaction to the main chain; since only the transaction of pc1 is stored at the main chain side and the state data after the execution of the transaction of pc1 is not stored, the main chain node can only traverse each main chain block to find each transaction of pc1, and then execute each transaction of pc1 to judge whether the block (10) is true or not, which requires a great deal of time and calculation effort.
Disclosure of Invention
In view of the above-described drawbacks or shortcomings in the prior art, it is desirable to provide a method of illegal node identification, a method of anti-cheating, a computer device, and a storage medium that save time and effort.
In a first aspect, the present application provides an illegal node identification method applicable to parallel link nodes, each node of a main chain and a parallel chain stores a global index table of state data corresponding to each block of the chain where the node is located, the state data of the main chain and the parallel chain are both stored in a merkel mountain manner, and the global index table uses the block height as a version number, the method includes:
when the first state data in the first consensus transaction of the first height marked as being correctly consensus on the main chain is judged to be incorrect, second state data required for executing the first transaction is searched from a state database of the current node; the first state data are state data obtained by executing the first transaction in the first consensus transaction;
generating a first report transaction according to the first merck mountain information of the first parallel chain block where the second state data is located and the first transaction, and sending the first report transaction to the main chain for the main chain node to:
verifying whether the second state data is in the first merck mountain information:
when the second state data is in the first merck mountain information, executing a first transaction according to the second state data to obtain third state data, and judging whether the third state data is identical to the first state data or not:
when the third state data is different from the first state data, identifying an illegal consensus node of the current chain; the illegal consensus node is a consensus node submitting a second consensus transaction of a first height, and the second consensus transaction is the same with the merck mountain of the first consensus transaction.
In a second aspect, the present application provides an illegal node identification method applicable to a main chain node, each node of the main chain and parallel chains respectively stores a global index table of state data of the located chain corresponding to each block, the state data of the main chain and parallel chains are stored in a merkel mountain manner, and the global index table uses the block height as a version number, the method includes:
receiving a first reporting transaction; the first reporting transaction is generated by a first parallel link point of a first parallel chain, the first reporting transaction is generated according to first merck mountain information of a first parallel chain block where second state data is located and the first transaction, the second state data is state data required by the first parallel chain node to execute the first transaction, which is found out from a state database, the second state data is found out by the first parallel chain node when the first state data in the first consensus transaction of a first height, which is marked as being correctly consensus on a main chain, is judged to be incorrect, and the first state data is the state data obtained by executing the first transaction in the first consensus transaction;
verifying whether the second state data is in the first merck mountain information:
when the second state data is in the first merck mountain information, executing a first transaction according to the second state data to obtain third state data, and judging whether the third state data is identical to the first state data or not:
when the third state data is different from the first state data, identifying illegal consensus nodes of the first parallel chain; the illegal consensus node is a consensus node submitting a second consensus transaction of a first height, and the second consensus transaction is the same with the merck mountain of the first consensus transaction.
In a third aspect, the present application provides a method for preventing cheating for a main chain node, the method comprising:
punishment of illegal consensus nodes of the first parallel chain; wherein the illegitimate consensus node of the first parallel chain is identified according to the method described in the second aspect.
In a fourth aspect, the present application also provides an apparatus, including one or more processors and a memory, where the memory contains instructions executable by the one or more processors to cause the one or more processors to perform the illegal node identification method, the anti-cheating method provided according to the embodiments of the present application.
In a fifth aspect, the present application also provides a storage medium storing a computer program that causes a computer to execute the illegal node identification method, the anti-cheating method provided according to the embodiments of the present application.
According to the illegal node identification method, the anti-cheating method, the computer equipment and the storage medium provided by the embodiments of the application, when the first state data in the first consensus transaction of the first height which is identified as being correctly consensus on the main chain is judged to be incorrect, the second state data required for executing the first transaction is searched from the state database of the current node; generating a first report transaction according to the first merck mountain information of the first parallel chain block where the second state data is located and the first transaction, and sending the first report transaction to the main chain for the main chain node to: executing the first transaction according to the second state data to obtain third state data when the second state data is in the first merck mountain information; when the third state data is different from the first state data, the illegal consensus node of the current chain is identified, and the parallel chain consensus node of the joint cheating is identified with less time and less calculation force.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the accompanying drawings in which:
fig. 1 is a schematic diagram of a merck mountain according to an embodiment of the application.
Fig. 2 is a flowchart of an illegal node identification method according to an embodiment of the present application.
Fig. 3 is a flow chart of a preferred embodiment of the method of fig. 2.
Fig. 4 is a schematic diagram of a complete merck tree constructed according to the method shown in fig. 3.
Fig. 5 is a flow chart of a preferred embodiment of the method of fig. 2.
Fig. 6 is a schematic diagram of a portion of a merck tree constructed according to the method of fig. 5.
Fig. 7 is a schematic diagram of a complete merck tree constructed according to the method shown in fig. 5.
Fig. 8 is a flowchart of another illegal node identification method according to an embodiment of the present application.
Fig. 9 is a flowchart of a method for preventing cheating according to an embodiment of the present application.
Fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be noted that, for convenience of description, only the portions related to the application are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
Fig. 1 is a schematic diagram of the merck mountain range. The advantage of the Merck Mountain (MMR) over the merck binary tree is that when new data arrives (new data, referred to as leaf nodes), the value of the intermediate node does not need to be changed and the data is always appended. In the prior art, MMR is typically used to verify the existence of a transaction, whereas in the present application MMR is used to verify the existence of status information. As shown in fig. 1, assume that the merck mountain root in the current diagram is root1; if it is to be verified whether state data of 15 are present, it is necessary to provide a merck mountain path (16, 18, 14), in particular 17 from 15 and 16, root1 'from 14, 17, 18, if root1 = root1', state data representing 15 are present.
Fig. 2 is a flowchart of an illegal node identification method according to an embodiment of the present application. As shown in fig. 2, in this embodiment, the present application provides an anti-cheating method applicable to parallel chain nodes, each node of a main chain and a parallel chain stores a global index table of state data of a local chain corresponding to each block, the state data of the main chain and the parallel chain are both stored in a merck mountain manner, and the global index table uses a block height as a version number, and the method includes:
s11: when the first state data in the first consensus transaction of the first height marked as being correctly consensus on the main chain is judged to be incorrect, second state data required for executing the first transaction is searched from a state database of the current node; the first state data are state data obtained by executing the first transaction in the first consensus transaction;
s12: generating a first report transaction according to the first merck mountain information of the first parallel chain block where the second state data is located and the first transaction, and sending the first report transaction to the main chain for the main chain node to:
verifying whether the second state data is in the first merck mountain information:
when the second state data is in the first merck mountain information, executing a first transaction according to the second state data to obtain third state data, and judging whether the third state data is identical to the first state data or not:
when the third state data is different from the first state data, identifying an illegal consensus node of the current chain; the illegal consensus node is a consensus node submitting a second consensus transaction of a first height, and the second consensus transaction is the same with the merck mountain of the first consensus transaction.
Specifically, the first merck mountain path includes a second height of the first parallel chain block, second state data, and second state data according to the first merck mountain information; verifying whether the second state data includes in the first merck mountain information "find a third consensus transaction on the backbone that is identified as having been correctly consensus by the second height; verifying whether the second state data is in the third merck mountain root according to the third merck mountain root, the second state data and the first merck mountain path in the third consensus transaction;
assuming a main chain and a parallel chain pc1, wherein pc1 is provided with parallel chain nodes node 1-node 7, node 1-node 4 are consensus nodes, and the node 1-node 4 is frozen with a plurality of deposit on the main chain; assuming that the current addr (a) state data is 1 ten thousand (the state data is generated when the block (8) is executed), there is one transfer transaction tx1 of pc1 (10 ten thousand cobins are transferred from addr (a) to addr (b)); the joint cheating of the nodes 1 to 3 is carried out, the executing state of tx1 of the nodes 1 to 3 is successful, and blocks (10) _node1 to block (10) _node3 are respectively generated; the execution state of tx1 of each of the nodes 4 to 7 is an execution failure, and each of the nodes 4 to 10 is generated; node1 generates a consensus transaction tx_coherent (10) from block (10) _node1 and sends it to backbone … … node4 generates a consensus transaction tx_coherent (10) _node4 from block (10) _node4 and sends it to the backbone; the main chain node completes the parallel chain consensus of the block (10) at the main chain side according to tx_coherent (10) _nons1 to tx_coherent (10) _nons4); the consensus transaction of the block (10) marked as correctly consensus on the main chain is tx_consensus (10) _NODE 1-tx_consensus (10) _NODE3, namely the main chain side tx1 executes successfully through the consensus;
node4 determines that the status data of executing tx1 of the block (10) identified as correctly consensus on the main chain (for example, tx_requests (10) _node 1) is incorrect, and step S11 is executed to find out the status data required for executing tx1 from the status database of node4, that is, the status data of addr (a) is 1 ten thousand (the status data is generated when executing block (8));
node4 executes step S12 to generate report transaction tx2 according to height 8, addr (a): 1 ten thousand merck mountain path, tx1 and send to the main chain; it should be understood by those skilled in the art that, the tx1 in tx2 may be replaced by hash (tx 1) according to actual requirements, so that the block data of tx1 may be found, and the same technical effect may be achieved;
the main chain node finds out the consensus transaction (assumed to be tx_coherent (8) _NODE 1) which is marked as being correctly consensus on the main chain according to the height 8, and verifies whether the addr (a) is in the merck mountain root of tx_coherent (8) _NODE1 according to the merck mountain root and addr (a) of tx_coherent (8) _NODE1 of 1 ten thousand and addr (a) of 1 ten thousand;
assuming that addr (a): 1 ten thousand is truly in the merck mountain root of tx_requests (8) _node1, the main chain node performs tx1 according to addr (a): 1 ten thousand;
since only 1 ten thousand balance of addr (a) remains, the execution of tx1 fails, the execution state is the execution failure, the execution state of tx_requests (10) _node1 is the execution success, and the merkel mountain of tx_requests (10) _node2 to tx_requests (10) _node3 is the same as the merkel mountain of tx_requests (10) _node1, the master node recognizes that the illegal node of pc1 is node1 to node3.
In more embodiments, the specific content included in the merck mountain information may be further configured according to actual needs, for example, configured that the merck mountain information includes a third merck mountain of the first parallel chain block; accordingly, the step of verifying whether the second state data is in the first merck mountain information is configured as "verifying whether the second state data is in the third merck mountain", so that the same technical effect can be achieved.
In further embodiments, the master node may also penalize identified illegitimate nodes according to actual needs, e.g., if the consensus node of each parallel chain freezes several deposits on the master chain, then partial deposits without illegitimate consensus nodes may be penalized; or configured to add illegal consensus nodes of the current chain to the blacklist, the backbone node will mask consensus transactions sent by the consensus nodes in the blacklist, etc.
It should be understood by those skilled in the art that the role of reporting the transaction can be configured according to the actual requirement, for example, only the consensus node can generate reporting transaction, or all the parallel chain nodes can generate reporting transaction, so that the same technical effect can be achieved.
The above-described embodiments identify parallel chain consensus nodes of joint cheating in less time and with less computational effort.
Assume that there is a first scenario as follows:
while nodes 1-3 run the blockchain code of v1.0, and nodes 4-7 run the blockchain code of v1.1, nodes 1-3 execute the blockchain code to obtain the correct state data (i.e., the third state data is the same as the first state data), but the calculated merck mountain is still erroneous.
The problem arising from the first scenario described above may be solved by a method as shown in the following embodiments;
preferably, when the third state data is different from the first state data, identifying the illegitimate consensus node of the current chain includes:
when the third state data is different from the first state data, identifying an illegal consensus node of the current chain;
when the third state data is the same as the first state data, calculating a second merck mountain of a second parallel chain block of the first height according to the third state data, and verifying whether the first merck mountain and the second merck mountain in the first consensus transaction are the same or not:
when the first merck mountain is different from the second merck mountain, an illegal consensus node of the current chain is identified.
In the first scenario described above, nodes 1-3 should still be identified as illegitimate nodes.
Assume that there is a second scenario as follows:
the first merck mountain information submitted by node4 is correct, but in fact, in the correct block (9), there is another transaction tx2 successfully executed, and after the tx2 is successfully executed, the state data of addr (a) is updated to addr (a): 11 ten thousand; at this point tx1 in block (10) is actually successful. There may be various reasons for this scenario, for example, the block (9) of node4 is incorrect, or the node4 is intentionally wrongly, etc.
The problem arising from the second scenario described above may be solved by a method as shown in the following embodiments;
preferably, verifying whether the second state data is in the first merck mountain range information includes:
first reporting transaction of the certificate;
receiving a first challenge transaction within a preconfigured first duration; the first challenge transaction is generated when the second state data in the first report transaction stored on the main chain is not the latest state data required for executing the first transaction, the first challenge transaction comprises second merck mountain information of a third parallel chain block where the first transaction and fourth state data are located, the fourth state data are the state data required for executing the first transaction and found by other parallel chain nodes, and the block height of the third parallel chain block is higher than that of the first parallel chain block;
verifying whether the fourth state data is in the second merck mountain information:
when the fourth state data is not in the second merck mountain information and the first duration is reached, verifying whether the second state data is in the first merck mountain information.
Assume that in a first time period, node5 generated a challenge transaction tx3, tx3 including the merck mountain information of tx1, block (9) (assuming tx1, addr (a): 11 ten thousand merck mountain paths);
if the master node verifies that addr (a): 11 tens of thousands are not in the merck mountain of block (9), it should be verified if the second state data is in the first merck mountain information when the first time period is reached, i.e., if addr (a): 1 tens of thousands are in the merck mountain root of tx_requests (8) _node 1;
it will be appreciated by those skilled in the art that the backbone node may also be configured to operate when verifying addr (a): 11 tens of thousands in the merck mountain of block (9), e.g., configured to end, according to actual needs; or, fine 4, etc.
Fig. 3 is a flow chart of a preferred embodiment of the method of fig. 2. In a preferred embodiment, as shown in fig. 3, the method further comprises:
s131: generating a fourth parallel chain block;
s132: updating the merck mountain of the current chain according to the fourth parallel chain block;
s133: generating a first merck binary tree and a first merck root of the first merck binary tree according to each root node of the updated merck mountain of the current chain;
s134: the value of the merck root field of the fourth parallel chain block is updated to the first merck root.
Taking the MMR shown in fig. 1 as an example; it is assumed that MMR after block (10) generation is composed of 0 to 17 in fig. 1;
step S131 is executed by node1 to node7, and a parallel chain block (11) is generated; assuming that only one state data is changed after each transaction of block (11) is performed, the changed state data is 18;
node1 to node7 execute step S132 to update MMR according to block (11), and the updated MMR is composed of 0 to 18 in FIG. 1;
node1 to node7 execute step S133 to generate a merck binary tree from 14, 17, 18' (copied from 18), and a merck root of the merck binary tree; it will be appreciated by those skilled in the art that the Merkel binary tree is an odd number of points at this time, so 18 replicates an 18' when computing the merkel tree;
at this time, a complete merck tree as shown in fig. 4 is constructed;
the nodes 1 to 7 execute step S134 to update the value of the merck root field of the block (11) to the merck root of the merck binary tree.
It will be appreciated by those skilled in the art that at this point, to verify the presence of 18, there may be at least one scheme, specifically, calculating root2' from 14, 17, 18', if the mercker of block (11) =root 2', then state data representing 18 is present.
In the prior art, the value of the merck root field of the block (11) is generated directly according to 14, 17 and 18; assuming a total of 4 hundred million data (approximately 32 root nodes, only 3 root nodes are shown in fig. 1), MMR is very large, requiring at least (32+32) x 32, approximately 2k of data; by constructing MMR by the method shown in the above embodiment, only (32+5) ×32 is needed, the height of MMR constructed is reduced, and data is reduced.
Fig. 5 is a flow chart of a preferred embodiment of the method of fig. 2. In a preferred embodiment, as shown in fig. 4, the method further comprises:
s141: generating a fifth parallel chain block;
s142: generating a second merck binary tree and a second merck root of the second merck binary tree according to the state data of each transaction in the fifth parallel chain block;
s143: taking the second merck root as a first leaf node of the merck mountain of the current chain;
s144: updating the merck mountain of the current chain according to the first leaf node;
s145: generating a third merck binary tree and a third merck root of the third merck binary tree according to each root node of the updated merck mountain of the current chain;
s146: the value of the merck root field of the fifth parallel chain block is updated to the third merck root.
Taking the MMR shown in fig. 1 as an example; it is assumed that MMR after block (10) generation is composed of 0 to 17 in fig. 1;
step S141 is executed by node1 to node7 to generate a parallel chain block (11); assuming that four state data states 1 to 4 (corresponding to s1 to s4 in the figure) are generated after each transaction of the block (11) is executed;
node1 to node7 execute step S142 to generate a merck binary tree and a merck root S1234 of the merck binary tree from the states 1 to 4;
node1 to node7 execute step S143, and at this time, a partial merck tree as shown in fig. 6 is constructed using S1234 as the leaf node of the MMR; s1234 is shown as 18 in fig. 6;
node1 to node7 execute step S144 to update MMR according to 18, and the updated MMR is composed of 0 to 18 in FIG. 6;
node1 to node7 execute step S145 to generate a merck binary tree ' from 14, 17, 18' (copied from 18), and a merck root ' of the merck binary tree;
at this time, a complete merck tree as shown in fig. 7 is constructed; it will be appreciated by those skilled in the art that the Merkel binary tree is an odd number of points at this time, so 18 replicates an 18' when computing the merkel tree;
node1 to node7 execute step S146 to update the value of the merck root field of block (11) to the merck root' of the merck binary tree.
It will be appreciated by those skilled in the art that there may be at least two schemes to verify the presence of s4 at this point; scheme one, verifying whether s4 is present in 18 according to the first merck path s3, s 12; according to the second scheme, whether s4 exists or not is verified according to the first merck paths s3 and s12 and the second merck paths 14 and 17, specifically, 18 is calculated according to s3 and s12, root2' is calculated according to s14, 17, 18 and 18', and if merck root=root 2' of the block (11), state data representing s4 exists.
The above embodiments also allow the MMR height to be constructed to be reduced and the data to be reduced.
The embodiment shown in fig. 5 differs from the embodiment shown in fig. 3 in that the method according to the embodiment shown in fig. 5 constructs fewer root nodes of the MMR and the MMR is smaller.
Those skilled in the art will appreciate that the second merck binary tree may be stored in a distributed manner according to actual requirements.
Fig. 8 is a flowchart of another illegal node identification method according to an embodiment of the present application. The method shown in fig. 8 may be used in conjunction with the method shown in fig. 1.
As shown in fig. 8, in this embodiment, the present application provides an illegal node identification method applicable to a main chain node, each node of the main chain and parallel chains respectively stores a global index table of state data of the corresponding block of the chain where the node is located, the state data of the main chain and the parallel chain are both stored in a merck mountain manner, and the global index table uses the block height as a version number, and the method includes:
s22: receiving a first reporting transaction; the first reporting transaction is generated by a first parallel link point of a first parallel chain, the first reporting transaction is generated according to first merck mountain information of a first parallel chain block where second state data is located and the first transaction, the second state data is state data required by the first parallel chain node to execute the first transaction, which is found out from a state database, the second state data is found out by the first parallel chain node when the first state data in the first consensus transaction of a first height, which is marked as being correctly consensus on a main chain, is judged to be incorrect, and the first state data is the state data obtained by executing the first transaction in the first consensus transaction;
s241: verifying whether the second state data is in the first merck mountain information:
s2421: when the second state data is in the first merck mountain information, executing a first transaction according to the second state data to obtain third state data, and judging whether the third state data is identical to the first state data or not:
s2422: when the third state data is different from the first state data, identifying illegal consensus nodes of the first parallel chain; the illegal consensus node is a consensus node submitting a second consensus transaction of a first height, and the second consensus transaction is the same with the merck mountain of the first consensus transaction.
The principle of illegal node identification in the above embodiment may refer to the method shown in fig. 1, and will not be described herein.
It should be noted that MMR on the backbone can also reduce the height and reduce the data; the construction is similar to the method shown in fig. 3 and 4, and will not be described again here.
Fig. 9 is a flowchart of a method for preventing cheating according to an embodiment of the present application. As shown in fig. 9, in this embodiment, the present application provides a method for preventing cheating applicable to a main chain node, where the method includes:
s32: punishment of illegal consensus nodes of the first parallel chain; the illegal common node of the first parallel chain is identified according to the illegal node identification method.
In further embodiments, the master node may also penalize identified illegitimate nodes according to actual needs, e.g., if the consensus node of each parallel chain freezes several deposits on the master chain, then partial deposits without illegitimate consensus nodes may be penalized; or configured to add the illegitimate consensus node of the first parallel chain to the blacklist, the backbone node will mask the consensus transaction sent by the consensus node in the blacklist, etc.
For the illegal consensus node identified in the preferred embodiment shown in fig. 1, the main chain node may also configure a method for punishing the identified illegal consensus node under different situations according to actual requirements, for example, punishing a partial deposit of the illegal consensus node when the third state data is different from the first state data; when the third state data is the same as the first state data but the first merck mountain is different from the second merck mountain, adding the illegal common node of the first parallel chain into a black list and recording error reporting information on the main chain.
Fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application.
As shown in fig. 10, as another aspect, the present application also provides a computer device including one or more Central Processing Units (CPUs) 701 which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data required for the operation of the computer device are also stored. The CPU701, ROM702, and RAM703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the present disclosure, the method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing any of the methods described above. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711.
As still another aspect, the present application also provides a computer-readable storage medium, which may be a computer-readable storage medium contained in the apparatus of the above-described embodiment; or may be a computer-readable storage medium, alone, that is not assembled into a computer device. The computer-readable storage medium stores one or more programs for use by one or more processors to perform the methods described herein.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules involved in the embodiments of the present application may be implemented in software or in hardware. The described units or modules may also be provided in a processor, for example, each of the units may be a software program provided in a computer or a mobile smart device, or may be separately configured hardware devices. Wherein the names of the units or modules do not in some cases constitute a limitation of the units or modules themselves.
The above description is only illustrative of the preferred embodiments of the present application and of the principles of the technology employed. It will be appreciated by persons skilled in the art that the scope of the application referred to in the present application is not limited to the specific combinations of the technical features described above, but also covers other technical features formed by any combination of the technical features described above or their equivalents without departing from the spirit of the application. Such as the above-mentioned features and the technical features disclosed in the present application (but not limited to) having similar functions are replaced with each other.
Claims (18)
1. The illegal node identification method is characterized in that the method is applicable to parallel chain nodes, each node of a main chain and a parallel chain respectively stores a global index table of state data corresponding to each block of the chain, the state data of the main chain and the parallel chain are stored in a merck mountain mode, the global index table takes the block height as a version number, and the method comprises the following steps:
when the first state data in the first consensus transaction of the first height marked as being correctly consensus on the main chain is judged to be incorrect, second state data required for executing the first transaction is searched from a state database of the current node; the first state data are state data obtained by executing the first transaction in the first consensus transaction;
generating a first report transaction according to the first merck mountain information of the first parallel chain block where the second state data is located and the first transaction, and sending the first report transaction to a main chain for a main chain node to:
verifying whether the second state data is in the first merck mountain information:
executing the first transaction according to the second state data to obtain third state data when the second state data is in the first merck mountain information, and judging whether the third state data is identical to the first state data or not:
identifying illegal consensus nodes of the current chain when the third state data is different from the first state data; the illegal consensus node is a consensus node submitting a second consensus transaction of the first height, and the second consensus transaction is the same with the merck mountain of the first consensus transaction.
2. The method of claim 1, wherein identifying an illegitimate consensus node for a current chain when the third state data is different from the first state data comprises:
identifying illegal consensus nodes of the current chain when the third state data is different from the first state data;
when the third state data is the same as the first state data, calculating a second merck mountain of the second parallel chain block of the first height according to the third state data, and verifying whether the first merck mountain and the second merck mountain in the first consensus transaction are the same or not:
and identifying illegal consensus nodes of the current chain when the first merck mountain is different from the second merck mountain.
3. The method of claim 1, wherein the first merck mountain information comprises a third merck mountain of the first parallel chain block, and wherein the verifying whether the second state data is in the first merck mountain information comprises:
verifying whether the second state data is in the third merck mountain.
4. The method of claim 1, wherein the first merck mountain information comprises a second height of the first parallel chain block, the second state data, a first merck mountain path of the second state data; the verifying whether the second state data is included in the first merck mountain information includes:
finding a third consensus transaction on the backbone that identifies the second height as having been properly consensus by the second height;
verifying whether the second state data is in a third merck mountain root according to the third merck mountain root, the second state data, and the first merck mountain path in the third consensus transaction.
5. The method of any one of claims 1-4, wherein said verifying whether the second state data is in the first merck mountain information comprises:
authenticating the first reporting transaction;
receiving a first challenge transaction within a preconfigured first duration; the first challenge transaction is generated when other parallel link points of the current chain monitor that the second state data in the first report transaction stored on the main chain is not the latest state data required for executing the first transaction, the first challenge transaction comprises second merck mountain information of a third parallel chain block where the first transaction and fourth state data are located, and the fourth state data are the state data required for executing the first transaction and found by the other parallel chain nodes, and the block height of the third parallel chain block is higher than that of the first parallel chain block;
verifying whether the fourth state data is in the second merck mountain information:
when the fourth state data is not in the second merck mountain information and the first duration is reached, verifying whether the second state data is in the first merck mountain information.
6. The method of any one of claims 1-4, further comprising:
generating a fourth parallel chain block;
updating the merck mountain of the current chain according to the fourth parallel chain block;
generating a first merck binary tree and a first merck root of the first merck binary tree according to each updated root node of the merck mountain of the current chain;
updating the value of the merck root field of the fourth parallel chain block to the first merck root.
7. The method of any one of claims 1-4, further comprising:
generating a fifth parallel chain block;
generating a second merck binary tree and a second merck root of the second merck binary tree according to the state data of each transaction in the fifth parallel chain block;
taking the second merck root as a first leaf node of the merck mountain of the current chain;
updating the merck mountain of the current chain according to the first leaf node;
generating a third merck binary tree and a third merck root of the third merck binary tree according to each updated root node of the merck mountain of the current chain;
updating the value of the merck root field of the fifth parallel chain block to the third merck root.
8. An illegal node identification method is characterized in that the method is applicable to main chain nodes, each node of a main chain and a parallel chain respectively stores a global index table of state data corresponding to each block of the chain, the state data of the main chain and the parallel chain are stored in a merck mountain mode, the global index table takes the height of the block as a version number, and the method comprises the following steps:
receiving a first reporting transaction; the first reporting transaction is generated by a first parallel link point of a first parallel chain, the first reporting transaction is generated according to first merck mountain information of a first parallel chain block where second state data is located and first transaction, the second state data is state data required by the first parallel chain node to execute the first transaction, which is found out from a state database, the second state data is found out by the first parallel chain node when the first state data in the first consensus transaction with the first height, which is identified as being correctly consensus, on a main chain is judged to be incorrect, and the first state data is the state data obtained by executing the first transaction in the first consensus transaction;
verifying whether the second state data is in the first merck mountain information:
executing the first transaction according to the second state data to obtain third state data when the second state data is in the first merck mountain information, and judging whether the third state data is identical to the first state data or not:
identifying an illegitimate consensus node of the first parallel chain when the third state data is different from the first state data; the illegal consensus node is a consensus node submitting a second consensus transaction of the first height, and the second consensus transaction is the same with the merck mountain of the first consensus transaction.
9. The method of claim 8, wherein identifying an illegitimate consensus node of the first parallel chain when the third state data is different from the first state data comprises:
identifying an illegitimate consensus node of the first parallel chain when the third state data is different from the first state data;
when the third state data is the same as the first state data, calculating a second merck mountain of the second parallel chain block of the first height according to the third state data, and verifying whether the first merck mountain and the second merck mountain in the first consensus transaction are the same or not:
and identifying illegal consensus nodes of the first parallel chain when the first merck mountain is different from the second merck mountain.
10. The method of claim 8, wherein the first merck mountain information comprises a third merck mountain of the first parallel chain block, and wherein the verifying whether the second state data is in the first merck mountain information comprises:
verifying whether the second state data is in the third merck mountain.
11. The method of claim 8, wherein the first merck mountain information comprises a second height of the first parallel chain block, the second state data, a first merck mountain path of the second state data; the verifying whether the second state data is included in the first merck mountain information includes:
finding a third consensus transaction on the backbone that identifies the second height as having been properly consensus by the second height;
verifying whether the second state data is in a third merck mountain root according to the third merck mountain root, the second state data, and the first merck mountain path in the third consensus transaction.
12. The method of any of claims 8-11, wherein the verifying whether the second state data is in the first merck mountain information comprises:
authenticating the first reporting transaction;
receiving a first challenge transaction within a preconfigured first duration; the first challenge transaction is generated when other parallel link points of the current chain monitor that the second state data in the first report transaction stored on the main chain is not the latest state data required for executing the first transaction, the first challenge transaction comprises second merck mountain information of a third parallel chain block where the first transaction and fourth state data are located, and the fourth state data are the state data required for executing the first transaction and found by the other parallel chain nodes, and the block height of the third parallel chain block is higher than that of the first parallel chain block;
verifying whether the fourth state data is in the second merck mountain information:
when the fourth state data is not in the second merck mountain information and the first duration is reached, verifying whether the second state data is in the first merck mountain information.
13. The method according to any one of claims 8-11, further comprising:
generating a first main chain block;
updating the merck mountain of the main chain according to the first main chain block;
generating a first merck binary tree and a first merck root of the first merck binary tree according to each root node of the updated merck mountain of the main chain;
updating the value of the merck root field of the first backbone block to the first merck root.
14. The method according to any one of claims 8-11, further comprising:
generating a second main chain block;
generating a second merck binary tree and a second merck root of the second merck binary tree according to the state data of each transaction in the second main chain block;
a first leaf node of the merck mountain having the second merck root as a main chain;
updating the merck mountain of the main chain according to the first leaf node;
generating a third merck binary tree and a third merck root of the third merck binary tree according to each root node of the updated merck mountain of the main chain;
updating the value of the merck root field of the second backbone block to the third merck root.
15. A method of preventing cheating, adapted for use with a backbone node, the method comprising:
punishment of illegal consensus nodes of the first parallel chain; wherein the illegitimate consensus node of the first parallel chain is identified according to the method according to any of claims 8-14.
16. The method of claim 15, wherein the consensus node of each parallel chain freezes a number of deposits on the backbone, and wherein punishing the illegitimate consensus node of the first parallel chain comprises:
the fines have partial deposit of illegally consensus nodes of the first parallel chain.
17. A computer device, the device comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-16.
18. A storage medium storing a computer program, which when executed by a processor implements the method of any one of claims 1-16.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111034618.6A CN113626532B (en) | 2021-09-03 | 2021-09-03 | Illegal node identification method, anti-cheating method, computer device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111034618.6A CN113626532B (en) | 2021-09-03 | 2021-09-03 | Illegal node identification method, anti-cheating method, computer device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113626532A CN113626532A (en) | 2021-11-09 |
CN113626532B true CN113626532B (en) | 2023-11-24 |
Family
ID=78389095
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111034618.6A Active CN113626532B (en) | 2021-09-03 | 2021-09-03 | Illegal node identification method, anti-cheating method, computer device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113626532B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110008233A (en) * | 2019-03-31 | 2019-07-12 | 杭州复杂美科技有限公司 | A kind of information inquiry and know together method, system, equipment and storage medium |
WO2020057196A1 (en) * | 2018-09-20 | 2020-03-26 | 百度在线网络技术(北京)有限公司 | Blockchain smart contract verification method and apparatus, and storage medium |
CN111415161A (en) * | 2020-04-27 | 2020-07-14 | 财付通支付科技有限公司 | Block chain-based data verification method and device and computer-readable storage medium |
KR20210046605A (en) * | 2020-04-07 | 2021-04-28 | 바이두 인터내셔널 테크놀로지 (센젠) 코., 엘티디. | Transaction processing method, apparatus, device and system for multi-chain system, and medium |
-
2021
- 2021-09-03 CN CN202111034618.6A patent/CN113626532B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020057196A1 (en) * | 2018-09-20 | 2020-03-26 | 百度在线网络技术(北京)有限公司 | Blockchain smart contract verification method and apparatus, and storage medium |
CN110008233A (en) * | 2019-03-31 | 2019-07-12 | 杭州复杂美科技有限公司 | A kind of information inquiry and know together method, system, equipment and storage medium |
KR20210046605A (en) * | 2020-04-07 | 2021-04-28 | 바이두 인터내셔널 테크놀로지 (센젠) 코., 엘티디. | Transaction processing method, apparatus, device and system for multi-chain system, and medium |
CN111415161A (en) * | 2020-04-27 | 2020-07-14 | 财付通支付科技有限公司 | Block chain-based data verification method and device and computer-readable storage medium |
Non-Patent Citations (1)
Title |
---|
许可链多中心动态共识机制;闵新平;李庆忠;孔兰菊;张世栋;郑永清;肖宗水;;计算机学报(05);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113626532A (en) | 2021-11-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109410045B (en) | Parallel chain consensus method, equipment and storage medium | |
CN114944932B (en) | Method and system for adding blocks to licensed blockchains | |
US8364634B2 (en) | System and method for processing fault tolerant transaction | |
CN109831514A (en) | Parallel chain common recognition method, data exception processing method, equipment and storage medium | |
US20150178170A1 (en) | Method and Apparatus for Recovering Data | |
CN107423163B (en) | Error surveying method and system for block chain of overall serial added blocks | |
CN114185678A (en) | Data storage method, device, equipment and storage medium | |
CN115618010A (en) | Fusion map storage and processing method and device | |
US20220083656A1 (en) | Apparatus and method for tolerating byzantine faults in blockchain platforms | |
CN113626532B (en) | Illegal node identification method, anti-cheating method, computer device and storage medium | |
CN113287096A (en) | Test result classification for failed code verification | |
CN107451011B (en) | Error correction method and system for block chain of parallel added blocks | |
CN111310242B (en) | Method and device for generating device fingerprint, storage medium and electronic device | |
CN112184227B (en) | Parallel chain supervision consensus method, device and storage medium | |
CN112734574A (en) | Transaction execution method, computer device, and storage medium | |
CN112436962A (en) | Block chain consensus network dynamic expansion method, electronic device, system and medium | |
CN112733202B (en) | Parallel chain supervision consensus method, computer device and storage medium | |
US8539035B2 (en) | Message tying processing method and apparatus | |
Lei et al. | Improved Method of Blockchain Cross‐Chain Consensus Algorithm Based on Weighted PBFT | |
CN111523896A (en) | Anti-attack method, device and storage medium | |
CN110942300A (en) | Transfer certificate submitting method, device and storage medium | |
CN107426293B (en) | Error correction method and system for block chain of single serial added block | |
CN113704271A (en) | Mercker tree generation method, illegal node identification method, equipment and storage medium | |
CN112819625A (en) | Parallel chain arbitration consensus method, computer device and storage medium | |
CN114138903B (en) | Multi-main-chain cross-chain method, computer device and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |