WO2022068410A1 - 平行链监督共识方法、设备和存储介质 - Google Patents

平行链监督共识方法、设备和存储介质 Download PDF

Info

Publication number
WO2022068410A1
WO2022068410A1 PCT/CN2021/111856 CN2021111856W WO2022068410A1 WO 2022068410 A1 WO2022068410 A1 WO 2022068410A1 CN 2021111856 W CN2021111856 W CN 2021111856W WO 2022068410 A1 WO2022068410 A1 WO 2022068410A1
Authority
WO
WIPO (PCT)
Prior art keywords
consensus
parachain
execution result
height
transaction
Prior art date
Application number
PCT/CN2021/111856
Other languages
English (en)
French (fr)
Inventor
马登极
王志文
吴思进
Original Assignee
杭州复杂美科技有限公司
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 杭州复杂美科技有限公司 filed Critical 杭州复杂美科技有限公司
Publication of WO2022068410A1 publication Critical patent/WO2022068410A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction

Definitions

  • the present application relates to the technical field of parachains, and in particular to a method, device and storage medium for supervising consensus on a parachain.
  • the present invention provides a parachain supervision consensus method suitable for main chain nodes, the parachain is configured with one or more supervision nodes, and the above method includes:
  • each supervisory transaction of the first height of the first parachain to obtain a second execution result that passes consensus; wherein, the supervisory transaction is generated by the supervisory node of the first parachain according to the first parachain block of the first height;
  • Execute several regenerated consensus transactions and/or supervision transactions of the first height and after obtaining the first execution result and/or the second execution result that has passed the consensus, return to determine whether the first execution result is the same as the second execution result ;
  • the regenerated consensus transaction of the first height is generated by the consensus node of the first parallel chain when the consensus transaction error generated last time is detected
  • the regenerated supervision transaction of the first height is generated by the supervision node of the first parallel chain Generated when the last generated supervisory transaction error is detected
  • each consensus transaction is also used for the parachain node of the first parachain to acquire and execute to obtain the first execution result that has passed the consensus
  • each supervision transaction is also used for the parachain node of the first parachain to acquire and execute to obtain the first execution result.
  • the first execution result and the second execution result are also used for the parachain node of the first parachain to judge whether the first execution result and the second execution result are the same: yes, then in the first parachain
  • the consensus height of the first parachain is updated to the first height; the regenerated consensus transaction of the first height is also used for the parachain nodes of the first parachain to obtain and execute to obtain the first execution result that has passed the consensus again.
  • the regenerated first-level supervision transaction is also used for the parachain nodes of the first parachain to acquire and execute to obtain the second execution result that re-passes the consensus, the first execution result that re-passes the consensus, and the second execution result that re-passes the consensus.
  • the execution result is also used for the parachain node of the first parachain to return to determine whether the first execution result is the same as the second execution result.
  • the present invention provides a parachain supervisory consensus method suitable for supervisory nodes, wherein the parachain is configured with one or more supervisory nodes, and the above method includes:
  • each supervisory transaction of obtains the second execution result that passes the consensus; wherein, each consensus transaction of the first height of the current parallel chain is also used for execution by each main chain node to obtain the first execution result that passes the consensus; the first execution result and the second execution result are also used for each main chain node to determine whether the first execution result is the same as the second execution result: if yes, update the consensus height of the current parachain to the first height on the main chain; if not, wait ;
  • the present invention provides a parachain supervision consensus method suitable for consensus nodes, the parachain is configured with one or more supervision nodes, and the above method includes:
  • each supervision transaction is generated by the supervision node of the current parachain according to the first parachain block of the first height; each consensus transaction is also used for supplying Each main chain node executes to obtain the first execution result that passes the consensus; each supervisory transaction is also used for each main chain node to execute to obtain the second execution result that passes the consensus, and the first execution result and the second execution result are also used for Each main chain node judges whether the first execution result is the same as the second execution result: if yes, update the consensus height of the current parachain to the first height on the main chain; if not, wait;
  • the second execution result and/or the first execution result return to determine whether the first execution result is the same as the second execution result; wherein, the regenerated consensus transaction of the first height is checked by the consensus node of the current parachain after the last execution Generated when the generated consensus transaction of the first height is wrong; the newly generated supervision transaction of the first height is generated by the supervision node of the current parachain when the last generated supervision transaction of the first height is wrong;
  • the present invention also provides an apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform various functions according to the present invention.
  • the parachain supervision consensus method provided by the embodiment.
  • the present invention also provides a storage medium storing a computer program, the computer program causing a computer to execute the parachain supervision consensus method provided according to each embodiment of the present invention.
  • the parachain supervision consensus method, device and storage medium provided by various embodiments of the present invention obtain a first execution result that passes consensus by executing each consensus transaction of the first height of the first parachain; execute the first height of the first parachain to obtain the second execution result that has passed the consensus; judge whether the first execution result is the same as the second execution result: yes, update the consensus height of the first parachain to the first height on the main chain; no, Then wait; and, execute several regenerated consensus transactions and/or supervisory transactions of the first height, and after obtaining the first execution result and/or the second execution result that has passed the consensus, return to judge the first execution result and the first execution result. 2. Whether the execution results are the same or not, to ensure the correct growth of the parachain consensus.
  • FIG. 1 is a flowchart of a parachain supervision consensus method provided by an embodiment of the present invention.
  • FIG. 2 is a flowchart of another parachain supervision consensus method provided by an embodiment of the present invention.
  • FIG. 3 is a flowchart of another parachain supervision consensus method provided by an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a device according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a parachain supervision consensus method provided by an embodiment of the present invention.
  • the present invention provides a parachain supervision consensus method suitable for main chain nodes, the parachain is configured with one or more supervision nodes, and the above method includes:
  • S11 Execute each consensus transaction of the first height of the first parachain to obtain the first execution result that passes the consensus;
  • S12 Execute each supervisory transaction of the first height of the first parachain to obtain a second execution result that passes consensus; wherein, the supervisory transaction is generated by the supervisory node of the first parachain according to the first parachain block of the first height;
  • step S132 update the consensus height of the first parachain to the first height on the main chain
  • step S1331 is executed: wait; and,
  • S1332 Execute several regenerated consensus transactions and/or supervision transactions of the first height, and after obtaining the first execution result and/or the second execution result that has passed the consensus again, return to determine the first execution result and the second execution result Whether it is the same; wherein, the regenerated consensus transaction of the first height is generated by the consensus node of the first parachain when the error of the consensus transaction generated last time is detected, and the regenerated supervision transaction of the first height is generated by the first parachain's consensus transaction. The supervisory node is generated when the error of the supervisory transaction generated last time is detected;
  • each consensus transaction is also used for the parachain node of the first parachain to acquire and execute to obtain the first execution result that has passed the consensus
  • each supervision transaction is also used for the parachain node of the first parachain to acquire and execute to obtain the first execution result.
  • the first execution result and the second execution result are also used for the parachain node of the first parachain to judge whether the first execution result and the second execution result are the same: yes, then in the first parachain
  • the consensus height of the first parachain is updated to the first height; the regenerated consensus transaction of the first height is also used for the parachain nodes of the first parachain to obtain and execute to obtain the first execution result that has passed the consensus again.
  • the regenerated first-level supervision transaction is also used for the parachain nodes of the first parachain to acquire and execute to obtain the second execution result that re-passes the consensus, the first execution result that re-passes the consensus, and the second execution result that re-passes the consensus.
  • the execution result is also used for the parachain node of the first parachain to return to determine whether the first execution result is the same as the second execution result.
  • N1-N10 there are 10 parachain nodes N1-N10 on the parachain parachain1, of which N1-N4 are consensus nodes, N5-N7 are supervisory nodes, and N8-N10 are common parachain nodes;
  • the first height is 100;
  • N10 generates block(100);
  • N1 ⁇ N4 also generate consensus transactions tx1 ⁇ tx4 of block(100) respectively, and
  • N5 ⁇ N7 also generate consensus transactions tx5 ⁇ tx7 of block(100) respectively;
  • the execution results of tx1, tx2, and tx3 are:
  • the execution results of R1 and tx4 are R2;
  • the execution results of tx5 to tx7 are all R2; when N1 to N7 check errors, only N1 and N2 check the last generated consensus transaction error, and the execution result of the newly generated consensus transaction is R2 ;
  • Each main chain node executes step S11, and executes tx1 to tx4 to obtain the first execution result that passes the consensus. Since the execution result of tx1, tx2, and tx3 is R1, and the execution result of tx4 is R2, the first execution result is R1;
  • Each main chain node executes step S12, and executes tx5 to tx7 to obtain the second execution result that has passed the consensus. Since the execution results of tx5 to tx7 are all R2, the second execution result is R2;
  • Each main chain node executes step S131 to determine whether the first execution result is the same as the second execution result:
  • each main chain node executes step S1331: wait;
  • N1 ⁇ N10 obtain tx1 ⁇ tx7 from the main chain
  • N1-N10 execute tx1-tx4 to obtain the first execution result that passes the consensus, which is R1; N1-N10 executes tx5-tx7 to obtain the second execution result that passes the consensus, which is R2;
  • N1 ⁇ N4 respectively check whether the last generated tx1 ⁇ tx4 is wrong: N1 checks the last generated tx1 error, N2 checks the last generated tx2 error, N1 regenerates tx1 according to block(100), and N2 according to block(100) ) Regenerate tx2, and the execution result of the regenerated tx1 and the regenerated tx2 is R2; N3 does not check for errors due to failure or other reasons, then does not regenerate tx3, N4 does not check for errors, and does not regenerate tx4;
  • N5 ⁇ N7 respectively check whether the last generated tx5 ⁇ tx7 is wrong: N5 does not check for errors, then does not regenerate tx5; N6 does not check for errors, then does not regenerate tx6, N7 does not check for errors, then does not regenerate tx7 ;
  • Each main chain node executes step S1332, and executes the regenerated tx1 and tx2. Since the execution result of the regenerated tx1 and the regenerated tx2 is R2, and the execution result of tx4 is R2, the first execution result that passes the consensus is R2 ;
  • Each main chain node executes step S131 to determine whether the first execution result is the same as the second execution result:
  • step S132 Since R2 is the same as R2, the main chain node executes step S132 to update the consensus height of parachain1 to 100 on the main chain;
  • N1 ⁇ N10 obtain the regenerated tx1 and tx2 from the main chain
  • N1 to N10 execute the regenerated tx1 and tx2. Since the execution result of the regenerated tx1 and the regenerated tx2 is R2, and the execution result of tx4 is R2, the first execution result that passes the consensus is R2;
  • N1 to N10 judge whether the first execution result is the same as the second execution result:
  • N1-N10 there are 10 parachain nodes N1-N10 on the parachain parachain1, of which N1-N4 are consensus nodes, N5-N7 are supervisory nodes, and N8-N10 are common parachain nodes; the first height is 100; N1 ⁇ N10 generates block(100); N1 ⁇ N4 also generates consensus transactions tx1 ⁇ tx4 of block(100) respectively, and N5 ⁇ N7 also generates consensus transactions tx5 ⁇ tx7 of block(100) respectively; the execution results of tx1, tx2, tx3 is R1, the execution result of tx4 is R2; the execution results of tx5 to tx7 are all R2; when N1 to N7 check errors, only N1 and N2 check the last generated consensus transaction error, and the execution result of the regenerated consensus transaction is R2 is taken as an example to illustrate the principle of parachain supervision consensus in this application.
  • the configurations of consensus nodes, supervisory nodes and common parachain nodes on the parachain are not limited to the above examples, and can also be configured according to actual needs, which can achieve the same technical effect.
  • the supervision transaction can be a consensus transaction generated by the supervision node, that is, the transaction structure of the supervision transaction is exactly the same as that of the consensus transaction; the transaction structure of the supervision transaction can also be based on actual needs. For configuration, only the main chain node and the parachain node can still obtain the corresponding execution result when executing the supervision transaction.
  • supervisory node can be arranged by a role trusted by the operator of parachain1. Further, when a supervisory node is deployed, a certain deposit needs to be paid.
  • the supervisory node and the consensus node participate in the consensus together, and when a disagreement occurs in the consensus, the consensus is suspended, and the consensus is continued until either party corrects the consensus result and reaches a consensus again. In this way, it is more reasonable to suspend the consensus before producing a wrong consensus result instead of using random spot checks and punishment afterwards to manage the consensus.
  • the above embodiments ensure that the parachain consensus grows correctly.
  • the parachain is further configured with an administrator node, and the above method further includes:
  • the consensus node and the supervisory node may fail to check out the consensus transaction/supervisory transaction error generated last time due to failure, and the first parachain block of the first height is always No consensus can be reached.
  • the above problem can be solved by using the method of this embodiment.
  • FIG. 2 is a flowchart of another parachain supervision consensus method provided by an embodiment of the present invention.
  • the present invention provides a parachain supervision consensus method suitable for supervising nodes.
  • the parachain is configured with one or more supervising nodes, and the above method includes:
  • S21 Generate a first supervision transaction according to the first parachain block of the first height, and send the first supervision transaction to the corresponding main chain node, so that each main chain node can execute the first height of the current parachain including the first supervision transaction.
  • step S242 update the consensus height to the first height on the current parallel chain
  • step S2431 check whether the first supervision transaction generated last time is wrong:
  • step S2432 regenerate the first supervision transaction and send it to the corresponding main chain node, so that each main chain node can execute several regenerated supervision transactions and/or consensus transactions of the first height, and after obtaining the re-approval After the second execution result and/or the first execution result of the consensus, return to determine whether the first execution result is the same as the second execution result; wherein, the regenerated consensus transaction of the first height is checked by the consensus node of the current parachain. Generated when the last generated consensus transaction is wrong; the newly generated first-level supervision transaction is generated by the supervision node of the current parachain when the last generated supervision transaction is wrong;
  • S25 Acquire and execute each regenerated consensus transaction and/or supervision transaction of the first height from the main chain, and return to judge the first execution result after obtaining the first execution result and/or the second execution result that has passed the consensus again Is it the same as the second execution result.
  • an administrator node is also configured on the parachain, and the above method further includes:
  • the third consensus transaction generated by the administrator node of the current parachain; wherein, the third consensus transaction is executed by the administrator node after the second period of time, and the consensus height of the first parachain on the main chain has not been updated to the first The height is generated according to the first parachain block, and the third consensus transaction is executed by each main chain node and each main chain node updates the consensus height of the first parachain to the first height on the main chain;
  • FIG. 3 is a flowchart of another parachain supervision consensus method provided by an embodiment of the present invention.
  • the present invention provides a parachain supervision consensus method suitable for consensus nodes, the parachain is configured with one or more supervision nodes, and the above method includes:
  • S32 Obtain and execute each supervisory transaction from the main chain to obtain the second execution result that has passed the consensus; wherein, the supervisory transaction is generated by the supervisory node of the current parachain according to the first parachain block of the first height; each consensus transaction also uses It is used for execution by each main chain node to obtain the first execution result that has passed the consensus; each supervision transaction is also used for execution by each main chain node to obtain the second execution result that passes the consensus. The first execution result and the second execution result are also used. For each main chain node to judge whether the first execution result is the same as the second execution result: if yes, update the consensus height of the current parachain to the first height on the main chain; if not, wait;
  • step S332 update the consensus height to the first height on the current parallel chain
  • step S3331 is executed: check whether the consensus transaction of the first height generated last time is wrong:
  • step S3332 regenerate the consensus transaction of the first height and send it to the corresponding main chain node, so that each main chain node can execute several regenerated supervision transactions and/or consensus transactions of the first height, and obtain After re-passing the second execution result and/or the first execution result of the consensus, return to determine whether the first execution result is the same as the second execution result; wherein, the regenerated consensus transaction of the first height is executed by the consensus node of the current parallel chain. Generated when the consensus transaction error of the first height generated last time is detected; the newly generated supervision transaction of the first height is generated by the supervision node of the current parachain when the last generated supervision transaction error of the first height is detected;
  • S34 Acquire and execute each regenerated consensus transaction and/or supervision transaction of the first height from the main chain, and return to judge the first execution result after obtaining the first execution result and/or the second execution result that has passed the consensus again Is it the same as the second execution result.
  • an administrator node is also configured on the parachain, and the above method further includes:
  • the third consensus transaction generated by the administrator node of the current parachain; wherein, the third consensus transaction is executed by the administrator node after the second period of time, and the consensus height of the first parachain on the main chain has not been updated to the first The height is generated according to the first parachain block, and the third consensus transaction is executed by each main chain node and each main chain node updates the consensus height of the first parachain to the first height on the main chain;
  • FIG. 4 is a schematic structural diagram of a device according to an embodiment of the present invention.
  • the present application also provides a device comprising one or more central processing units (CPUs) 401 , which can be stored in a read-only memory (ROM) 402 according to a program or from The storage section 408 loads programs into the random access memory (RAM) 403 to execute various appropriate actions and processes.
  • RAM random access memory
  • various programs and data necessary for the operation of the device 400 are also stored.
  • the CPU 401 , the ROM 402 , and the RAM 403 are connected to each other through a bus 404 .
  • An input/output (I/O) interface 405 is also connected to bus 404 .
  • the following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc. ; and a communication section 409 including a network interface card such as a LAN card, a modem, and the like. The communication section 409 performs communication processing via a network such as the Internet.
  • a drive 410 is also connected to the I/O interface 405 as needed.
  • a removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 410 as needed so that a computer program read therefrom is installed into the storage section 408 as needed.
  • the method described in any of the above embodiments may be implemented as a computer software program.
  • embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for performing any of the methods described above.
  • the computer program may be downloaded and installed from the network via the communication portion 409 and/or installed from the removable medium 411 .
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be a computer-readable storage medium included in the apparatus of the foregoing embodiment; A computer-readable storage medium in a device.
  • the computer-readable storage medium stores one or more programs that are used by one or more processors to perform the methods described in the present application.
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more functions for implementing the specified logical function(s) executable instructions.
  • the functions noted in the blocks 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.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by dedicated hardware-based systems that perform the specified functions or operations , or can be implemented by a combination of dedicated hardware and computer instructions.
  • the units or modules involved in the embodiments of the present application may be implemented in a software manner, and may also be implemented in a hardware manner.
  • the described units or modules may also be provided in the processor, for example, each of the units may be a software program provided in a computer or a mobile smart device, or may be a separately configured hardware device. Wherein, the names of these units or modules do not constitute limitations on the units or modules themselves under certain circumstances.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Hardware Redundancy (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

本发明提供一种平行链监督共识方法、设备和存储介质,该方法包括:执行第一平行链的第一高度的各共识交易以获得通过共识的第一执行结果;执行第一平行链的第一高度的各监督交易以获得通过共识的第二执行结果;判断第一执行结果与第二执行结果是否相同:是,则在主链上将第一平行链的共识高度更新为第一高度;否,则等待;以及,执行若干重新生成的第一高度的共识交易和/或监督交易,并在获得重新通过共识的第一执行结果和/或第二执行结果后,返回判断第一执行结果与第二执行结果是否相同。本申请保证平行链共识正确增长。

Description

平行链监督共识方法、设备和存储介质 技术领域
本申请涉及平行链技术领域,具体涉及一种平行链监督共识方法、设备和存储介质。
背景技术
在现有平行链技术中,假设平行链parachain1上有平行链共识节点N1~N7;假设N1~N5对所生成的区块block(100)联合作弊,即使N6、N7发现N1~N5联合作弊,N6、N7根据所生成的区块block(100)生成的共识交易也无法改变block(100)的平行链共识贡献。即,联合作弊的执行结果与N6、N7的执行结果不同,N6、N7也只能被动接收,不能对最终共识结果产生纠正,可能造成资产损失。
发明内容
鉴于现有技术中的上述缺陷或不足,期望提供一种保证平行链共识正确增长的平行链监督共识方法、设备和存储介质。
第一方面,本发明提供一种适用于主链节点的平行链监督共识方法,平行链配置有一个或多个监督节点,上述方法包括:
执行第一平行链的第一高度的各共识交易以获得通过共识的第一执行结果;
执行第一平行链的第一高度的各监督交易以获得通过共识的第二执行结果;其中,监督交易由第一平行链的监督节点根据第一高度的第一平行链区块生成;
判断第一执行结果与第二执行结果是否相同:
是,则在主链上将第一平行链的共识高度更新为第一高度;
否,则等待;以及,
执行若干重新生成的第一高度的共识交易和/或监督交易,并 在获得重新通过共识的第一执行结果和/或第二执行结果后,返回判断第一执行结果与第二执行结果是否相同;其中,重新生成的第一高度的共识交易由第一平行链的共识节点在检查出上一次生成的共识交易错误时生成,重新生成的第一高度的监督交易由第一平行链的监督节点在检查出上一次生成的监督交易错误时生成;
其中,各共识交易还用于供第一平行链的平行链节点获取并执行以获得通过共识的第一执行结果,各监督交易还用于供第一平行链的平行链节点获取并执行以获得通过共识的第二执行结果,第一执行结果和第二执行结果还用于供第一平行链的平行链节点判断第一执行结果与第二执行结果是否相同:是,则在第一平行链上将第一平行链的共识高度更新为第一高度;重新生成的第一高度的共识交易还用于供第一平行链的平行链节点获取并执行以获得重新通过共识的第一执行结果,重新生成的第一高度的监督交易还用于供第一平行链的平行链节点获取并执行以获得重新通过共识的第二执行结果,重新通过共识的第一执行结果和重新通过共识的第二执行结果还用于供第一平行链的平行链节点返回判断第一执行结果与第二执行结果是否相同。
第二方面,本发明提供一种适用于监督节点的平行链监督共识方法,平行链配置有一个或多个监督节点,上述方法包括:
根据第一高度的第一平行链区块生成第一监督交易,将第一监督交易发送至对应的主链节点,以供各主链节点执行当前平行链的第一高度的包括第一监督交易的各监督交易以获得通过共识的第二执行结果;其中,当前平行链的第一高度的各共识交易还用于供各主链节点执行以获得通过共识的第一执行结果;第一执行结果和第二执行结果还用于供各主链节点判断第一执行结果与第二执行结果是否相同:是,则在主链上将当前平行链的共识高度更新为第一高度;否,则等待;
从主链获取并执行各共识交易以获得通过共识的第一执行结果;
从主链获取并执行各监督交易以获得通过共识的第二执行结果;
判断第一执行结果与第二执行结果是否相同:
是,则在当前平行链上将共识高度更新为第一高度;
否,则检查上一次生成的第一监督交易是否错误:
是,则重新生成第一监督交易并发送至对应的主链节点,以供各主链节点执行若干重新生成的第一高度的监督交易和/或共识交易,并在获得重新通过共识的第二执行结果和/或第一执行结果后,返回判断第一执行结果与第二执行结果是否相同;其中,重新生成的第一高度的共识交易由当前平行链的共识节点在检查出上一次生成的共识交易错误时生成;重新生成的第一高度的监督交易由当前平行链的监督节点在检查出上一次生成的监督交易错误时生成;
从主链获取并执行各重新生成的第一高度的共识交易和/或监督交易,并在获得重新通过共识的第一执行结果和/或第二执行结果后,返回判断第一执行结果与第二执行结果是否相同。
第三方面,本发明提供一种适用于共识节点的平行链监督共识方法,平行链配置有一个或多个监督节点,上述方法包括:
从主链获取并执行各共识交易以获得通过共识的第一执行结果;
从主链获取并执行各监督交易以获得通过共识的第二执行结果;其中,监督交易由当前平行链的监督节点根据第一高度的第一平行链区块生成;各共识交易还用于供各主链节点执行以获得通过共识的第一执行结果;各监督交易还用于供各主链节点执行以获得通过共识的第二执行结果,第一执行结果和第二执行结果还用于供各主链节点判断第一执行结果与第二执行结果是否相同:是,则在主链上将当前平行链的共识高度更新为第一高度;否,则等待;
判断第一执行结果与第二执行结果是否相同:
是,则在当前平行链上将共识高度更新为第一高度;
否,则检查上一次生成的第一高度的共识交易是否错误:
是,则重新生成第一高度的共识交易并发送至对应的主链节点,以供各主链节点执行若干重新生成的第一高度的监督交易和/或共识交易,并在获得重新通过共识的第二执行结果和/或第一执行结果后,返回判断第一执行结果与第二执行结果是否相同;其中,重新生成的第一高度的共识交易由当前平行链的共识节点在检查出上一次生成的第一高度的共识交易错误时生成;重新生成的第一高度的监督交易由当前平行链的监督节点在检查出上一次生成的第一高度的监督交 易错误时生成;
从主链获取并执行各重新生成的第一高度的共识交易和/或监督交易,并在获得重新通过共识的第一执行结果和/或第二执行结果后,返回判断第一执行结果与第二执行结果是否相同。
第四方面,本发明还提供一种设备,包括一个或多个处理器和存储器,其中存储器包含可由该一个或多个处理器执行的指令以使得该一个或多个处理器执行根据本发明各实施例提供的平行链监督共识方法。
第四方面,本发明还提供一种存储有计算机程序的存储介质,该计算机程序使计算机执行根据本发明各实施例提供的平行链监督共识方法。
本发明诸多实施例提供的平行链监督共识方法、设备和存储介质通过执行第一平行链的第一高度的各共识交易以获得通过共识的第一执行结果;执行第一平行链的第一高度的各监督交易以获得通过共识的第二执行结果;判断第一执行结果与第二执行结果是否相同:是,则在主链上将第一平行链的共识高度更新为第一高度;否,则等待;以及,执行若干重新生成的第一高度的共识交易和/或监督交易,并在获得重新通过共识的第一执行结果和/或第二执行结果后,返回判断第一执行结果与第二执行结果是否相同的方法,保证平行链共识正确增长。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:
图1为本发明一实施例提供的一种平行链监督共识方法的流程图。
图2为本发明一实施例提供的另一种平行链监督共识方法的流程图。
图3为本发明一实施例提供的另一种平行链监督共识方法的流程图。
图4为本发明一实施例提供的一种设备的结构示意图。
具体实施方式
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与发明相关的部分。
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。
图1为本发明一实施例提供的一种平行链监督共识方法的流程图。如图1所示,在本实施例中,本发明提供一种适用于主链节点的平行链监督共识方法,平行链配置有一个或多个监督节点,上述方法包括:
S11:执行第一平行链的第一高度的各共识交易以获得通过共识的第一执行结果;
S12:执行第一平行链的第一高度的各监督交易以获得通过共识的第二执行结果;其中,监督交易由第一平行链的监督节点根据第一高度的第一平行链区块生成;
S131:判断第一执行结果与第二执行结果是否相同:
是,则执行步骤S132:在主链上将第一平行链的共识高度更新为第一高度;
否,则执行步骤S1331:等待;以及,
S1332:执行若干重新生成的第一高度的共识交易和/或监督交易,并在获得重新通过共识的第一执行结果和/或第二执行结果后,返回判断第一执行结果与第二执行结果是否相同;其中,重新生成的第一高度的共识交易由第一平行链的共识节点在检查出上一次生成的共识交易错误时生成,重新生成的第一高度的监督交易由第一平行链的监督节点在检查出上一次生成的监督交易错误时生成;
其中,各共识交易还用于供第一平行链的平行链节点获取并执行 以获得通过共识的第一执行结果,各监督交易还用于供第一平行链的平行链节点获取并执行以获得通过共识的第二执行结果,第一执行结果和第二执行结果还用于供第一平行链的平行链节点判断第一执行结果与第二执行结果是否相同:是,则在第一平行链上将第一平行链的共识高度更新为第一高度;重新生成的第一高度的共识交易还用于供第一平行链的平行链节点获取并执行以获得重新通过共识的第一执行结果,重新生成的第一高度的监督交易还用于供第一平行链的平行链节点获取并执行以获得重新通过共识的第二执行结果,重新通过共识的第一执行结果和重新通过共识的第二执行结果还用于供第一平行链的平行链节点返回判断第一执行结果与第二执行结果是否相同。
具体地,假设平行链parachain1上有10个平行链节点N1~N10,其中N1~N4为共识节点,N5~N7为监督节点,N8~N10为普通平行链节点;第一高度为100;N1~N10生成block(100);N1~N4还分别生成block(100)的共识交易tx1~tx4,N5~N7还分别生成block(100)的共识交易tx5~tx7;tx1、tx2、tx3的执行结果为R1,tx4的执行结果为R2;tx5~tx7的执行结果均为R2;N1~N7检查错误时,只有N1和N2检查上一次生成的共识交易错误,且重新生成的共识交易的执行结果为R2;
各主链节点执行步骤S11,执行tx1~tx4以获得通过共识的第一执行结果,由于tx1、tx2、tx3的执行结果为R1,tx4的执行结果为R2,则第一执行结果为R1;
各主链节点执行步骤S12,执行tx5~tx7以获得通过共识的第二执行结果,由于tx5~tx7的执行结果均为R2,则第二执行结果为R2;
各主链节点执行步骤S131,判断第一执行结果与第二执行结果是否相同:
由于R1与R2不同,则各主链节点执行步骤S1331:等待;
N1~N10从主链获取tx1~tx7;
N1~N10执行tx1~tx4以获得通过共识的第一执行结果,为R1;N1~N10执行tx5~tx7以获得通过共识的第二执行结果为R2;
N1~N4分别检查上一次生成的tx1~tx4是否错误:N1检查出上一 次生成的tx1错误,N2检查出上一次生成的tx2错误,N1根据block(100)重新生成tx1,N2根据block(100)重新生成tx2,且重新生成的tx1和重新生成的tx2的执行结果为R2;N3由于故障或其它原因未检查出错误,则不重新生成tx3,N4未检查出错误,也不重新生成tx4;
N5~N7分别检查上一次生成的tx5~tx7是否错误:N5未检查出错误,则不重新生成tx5;N6未检查出错误,则不重新生成tx6,N7未检查出错误,则不重新生成tx7;
各主链节点执行步骤S1332,执行重新生成的tx1、tx2,由于重新生成的tx1和重新生成的tx2的执行结果为R2,tx4的执行结果为R2,则重新通过共识的第一执行结果为R2;
各主链节点执行步骤S131,判断第一执行结果与第二执行结果是否相同:
由于R2与R2相同,则主链节点执行步骤S132,在主链上将parachain1的共识高度更新为100;
N1~N10从主链获取重新生成的tx1、tx2;
N1~N10执行重新生成的tx1、tx2,由于重新生成的tx1和重新生成的tx2的执行结果为R2,tx4的执行结果为R2,则重新通过共识的第一执行结果为R2;
N1~N10判断第一执行结果与第二执行结果是否相同:
由于R2与R2相同,则N1~N10在parachain1上将parachain1的共识高度更新为100。
上述实施例以假设平行链parachain1上有10个平行链节点N1~N10,其中N1~N4为共识节点,N5~N7为监督节点,N8~N10为普通平行链节点;第一高度为100;N1~N10生成block(100);N1~N4还分别生成block(100)的共识交易tx1~tx4,N5~N7还分别生成block(100)的共识交易tx5~tx7;tx1、tx2、tx3的执行结果为R1,tx4的执行结果为R2;tx5~tx7的执行结果均为R2;N1~N7检查错误时,只有N1和N2检查上一次生成的共识交易错误,且重新生成的共识交易的执行结果为R2为例对本申请的平行链监督共识原理作了示例性的阐述。
在更多实施例中,平行链上的共识节点、监督节点和普通平行链节点的配置不以上述举例为限,还可以根据实际需求进行配置,可实现相同的技术效果。
需要说明的是,本领域技术人员应当理解,监督交易可以为由监督节点生成的共识交易,即,监督交易的交易结构与共识交易的交易结构完全相同;监督交易的交易结构也可以根据实际需求进行配置,只需要主链节点和平行链节点在执行监督交易时仍能获取相应的执行结果。
需要说明的是,本领域技术人员应当理解,共识节点和监督节点检查出上一次生成的共识交易/监督交易错误的场景有很多,包括但不限于,共识节点和监督节点未及时升级版本信息,共识节点联合作弊等。
需要说明的是,本领域技术人员应当可以联想,监督节点可以由parachain1的运营方可信任的角色进行布置。进一步的,监督节点在部署时,需要缴纳一定的押金。
需要说明的是,本领域技术人员应当可以联想,可以根据实际需求配置若干惩罚措施,例如,若第一次判断第一执行结果与第二执行结果不同,且该不同是由共识节点联合作弊导致的,则应当将共识节点的部分资产划转至监督节点。进一步的,该部分资产也可以根据实际需求进行配置,例如配置为冻结的押金,或,配置为共识节点生成第一高度的第一平行链区块所应获得的挖矿奖励。
需要说明的是,本领域技术人员应当可以联想,监督节点和共识节点均等分享共识挖矿奖励。
在本实施例中,监督节点和共识节点一起参与共识,在共识产生分歧时候,暂停共识,直到任何一方纠正共识结果重新达成共识后,继续共识。这样在产生错误的共识结果之前暂停共识而不是采用随机抽查事后惩罚的办法来管理共识,更加合理。上述实施例保证平行链共识正确增长。
优选地,平行链还配置有管理员节点,上述方法还包括:
执行第一平行链的管理员节点生成的第三共识交易;其中,第三 共识交易由管理员节点在经过第二时长,且主链上的第一平行链的共识高度未更新为第一高度时根据第一平行链区块生成;
在主链上将第一平行链的共识高度更新为第一高度,以供第一平行链的各平行链节点:
获取并执行第三共识交易;
在第一平行链上将第一平行链的共识高度更新为第一高度。
在图1所示的实施例中,共识节点和监督节点可能会因为故障而导致未能及时检查出上一次生成的共识交易/监督交易错误,而导致第一高度的第一平行链区块一直达不成共识。可以使用本实施例的方法解决上述问题。
图2为本发明一实施例提供的另一种平行链监督共识方法的流程图。如图2所示,在本实施例中,本发明提供一种适用于监督节点的平行链监督共识方法,平行链配置有一个或多个监督节点,上述方法包括:
S21:根据第一高度的第一平行链区块生成第一监督交易,将第一监督交易发送至对应的主链节点,以供各主链节点执行当前平行链的第一高度的包括第一监督交易的各监督交易以获得通过共识的第二执行结果;其中,当前平行链的第一高度的各共识交易还用于供各主链节点执行以获得通过共识的第一执行结果;第一执行结果和第二执行结果还用于供各主链节点判断第一执行结果与第二执行结果是否相同:是,则在主链上将当前平行链的共识高度更新为第一高度;否,则等待;
S22:从主链获取并执行各共识交易以获得通过共识的第一执行结果;
S23:从主链获取并执行各监督交易以获得通过共识的第二执行结果;
S241:判断第一执行结果与第二执行结果是否相同:
是,则执行步骤S242:在当前平行链上将共识高度更新为第一高度;
否,则执行步骤S2431:检查上一次生成的第一监督交易是否错 误:
是,则执行步骤S2432:重新生成第一监督交易并发送至对应的主链节点,以供各主链节点执行若干重新生成的第一高度的监督交易和/或共识交易,并在获得重新通过共识的第二执行结果和/或第一执行结果后,返回判断第一执行结果与第二执行结果是否相同;其中,重新生成的第一高度的共识交易由当前平行链的共识节点在检查出上一次生成的共识交易错误时生成;重新生成的第一高度的监督交易由当前平行链的监督节点在检查出上一次生成的监督交易错误时生成;
S25:从主链获取并执行各重新生成的第一高度的共识交易和/或监督交易,并在获得重新通过共识的第一执行结果和/或第二执行结果后,返回判断第一执行结果与第二执行结果是否相同。
上述实施例的平行链监督共识原理可参考图1所示的方法,此处不再赘述。
优选地,平行链上还配置有管理员节点,上述方法还包括:
获取并执行当前平行链的管理员节点生成的第三共识交易;其中,第三共识交易由管理员节点在经过第二时长,且主链上的第一平行链的共识高度未更新为第一高度时根据第一平行链区块生成,第三共识交易由各主链节点执行并由各主链节点在主链上将第一平行链的共识高度更新为第一高度;
获取并执行第三共识交易;
在当前平行链上将共识高度更新为第一高度。
上述实施例的平行链监督共识原理可参考图1所示的一种优选实施方式的方法,此处不再赘述。
图3为本发明一实施例提供的另一种平行链监督共识方法的流程图。如图3所示,在本实施例中,本发明提供一种适用于共识节点的平行链监督共识方法,平行链配置有一个或多个监督节点,上述方法包括:
S31:从主链获取并执行各共识交易以获得通过共识的第一执行结果;
S32:从主链获取并执行各监督交易以获得通过共识的第二执行结 果;其中,监督交易由当前平行链的监督节点根据第一高度的第一平行链区块生成;各共识交易还用于供各主链节点执行以获得通过共识的第一执行结果;各监督交易还用于供各主链节点执行以获得通过共识的第二执行结果,第一执行结果和第二执行结果还用于供各主链节点判断第一执行结果与第二执行结果是否相同:是,则在主链上将当前平行链的共识高度更新为第一高度;否,则等待;
S331:判断第一执行结果与第二执行结果是否相同:
是,则执行步骤S332:在当前平行链上将共识高度更新为第一高度;
否,则执行步骤S3331:检查上一次生成的第一高度的共识交易是否错误:
是,则执行步骤S3332:重新生成第一高度的共识交易并发送至对应的主链节点,以供各主链节点执行若干重新生成的第一高度的监督交易和/或共识交易,并在获得重新通过共识的第二执行结果和/或第一执行结果后,返回判断第一执行结果与第二执行结果是否相同;其中,重新生成的第一高度的共识交易由当前平行链的共识节点在检查出上一次生成的第一高度的共识交易错误时生成;重新生成的第一高度的监督交易由当前平行链的监督节点在检查出上一次生成的第一高度的监督交易错误时生成;
S34:从主链获取并执行各重新生成的第一高度的共识交易和/或监督交易,并在获得重新通过共识的第一执行结果和/或第二执行结果后,返回判断第一执行结果与第二执行结果是否相同。
上述实施例的平行链监督共识原理可参考图1所示的方法,此处不再赘述。
优选地,平行链上还配置有管理员节点,上述方法还包括:
获取并执行当前平行链的管理员节点生成的第三共识交易;其中,第三共识交易由管理员节点在经过第二时长,且主链上的第一平行链的共识高度未更新为第一高度时根据第一平行链区块生成,第三共识交易由各主链节点执行并由各主链节点在主链上将第一平行链的共识高度更新为第一高度;
获取并执行第三共识交易;
在当前平行链上将共识高度更新为第一高度。
上述实施例的平行链监督共识原理可参考图1所示的一种优选实施方式的方法,此处不再赘述。
图4为本发明一实施例提供的一种设备的结构示意图。如图4所示,作为另一方面,本申请还提供了一种设备,包括一个或多个中央处理单元(CPU)401,其可以根据存储在只读存储器(ROM)402中的程序或者从存储部分408加载到随机访问存储器(RAM)403中的程序而执行各种适当的动作和处理。在RAM403中,还存储有设备400操作所需的各种程序和数据。CPU401、ROM402以及RAM403通过总线404彼此相连。输入/输出(I/O)接口405也连接至总线404。
以下部件连接至I/O接口405:包括键盘、鼠标等的输入部分406;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分407;包括硬盘等的存储部分408;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分409。通信部分409经由诸如因特网的网络执行通信处理。驱动器410也根据需要连接至I/O接口405。可拆卸介质411,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器410上,以便于从其上读出的计算机程序根据需要被安装入存储部分408。
特别地,根据本公开的实施例,上述任一实施例描述的方法可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括有形地包含在机器可读介质上的计算机程序,所述计算机程序包含用于执行上述任一方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分409从网络上被下载和安装,和/或从可拆卸介质411被安装。
作为又一方面,本申请还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施例的装置中所包含的计算机可读存储介质;也可以是单独存在,未装配入设备中的计算机可读存储介质。计算机可读存储介质存储有一个或者一个以上程序,该程序被一个或者一个以上的处理器用来执行描述于本申请提供的方法。
附图中的流程图和框图,图示了按照本发明各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这根据所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以通过执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以通过专用硬件与计算机指令的组合来实现。
描述于本申请实施例中所涉及到的单元或模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元或模块也可以设置在处理器中,例如,各所述单元可以是设置在计算机或移动智能设备中的软件程序,也可以是单独配置的硬件装置。其中,这些单元或模块的名称在某种情况下并不构成对该单元或模块本身的限定。
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离本申请构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。

Claims (8)

  1. 一种平行链监督共识方法,其特征在于,平行链配置有一个或多个监督节点,所述方法适用于主链节点,所述方法包括:
    执行第一平行链的第一高度的各共识交易以获得通过共识的第一执行结果;
    执行所述第一平行链的所述第一高度的各监督交易以获得通过共识的第二执行结果;其中,所述监督交易由所述第一平行链的监督节点根据所述第一高度的第一平行链区块生成;
    判断所述第一执行结果与所述第二执行结果是否相同:
    是,则在主链上将所述第一平行链的共识高度更新为所述第一高度;
    否,则等待;以及,
    执行若干重新生成的所述第一高度的共识交易和/或监督交易,并在获得重新通过共识的第一执行结果和/或第二执行结果后,返回所述判断所述第一执行结果与所述第二执行结果是否相同;其中,重新生成的所述第一高度的共识交易由所述第一平行链的共识节点在检查出上一次生成的共识交易错误时生成,重新生成的所述第一高度的监督交易由所述第一平行链的监督节点在检查出上一次生成的监督交易错误时生成;
    其中,各所述共识交易还用于供所述第一平行链的平行链节点获取并执行以获得通过共识的第一执行结果,各所述监督交易还用于供所述第一平行链的平行链节点获取并执行以获得通过共识的第二执行结果,所述第一执行结果和所述第二执行结果还用于供所述第一平行链的平行链节点判断所述第一执行结果与所述第二执行结果是否相同:是,则在所述第一平行链上将所述第一平行链的共识高度更新为所述第一高度;重新生成的所述第一高度的共识交易还用于供所述第一平行链的平行链节点获取并执行以获得重新通过共识的第一执行结果,重新生成的所述第一高度的监督交易还用于供所述第一平行链的平行链节点获取并执行以获得重新通过共识的第二执行结果,重新通 过共识的第一执行结果和重新通过共识的第二执行结果还用于供第一平行链的平行链节点返回判断所述第一执行结果与所述第二执行结果是否相同。
  2. 根据权利要求1所述的方法,其特征在于,平行链还配置有管理员节点,所述方法还包括:
    执行第一平行链的管理员节点生成的第三共识交易;其中,所述第三共识交易由所述管理员节点在经过第二时长,且主链上的所述第一平行链的共识高度未更新为所述第一高度时根据所述第一平行链区块生成;
    在主链上将所述第一平行链的共识高度更新为所述第一高度,以供所述第一平行链的各平行链节点:
    获取并执行所述第三共识交易;
    在所述第一平行链上将所述第一平行链的共识高度更新为所述第一高度。
  3. 一种平行链监督共识方法,其特征在于,平行链配置有一个或多个监督节点,所述方法适用于监督节点,所述方法包括:
    根据第一高度的第一平行链区块生成第一监督交易,将所述第一监督交易发送至对应的主链节点,以供各主链节点执行当前平行链的所述第一高度的包括所述第一监督交易的各监督交易以获得通过共识的第二执行结果;其中,当前平行链的第一高度的各共识交易还用于供各主链节点执行以获得通过共识的第一执行结果;所述第一执行结果和所述第二执行结果还用于供各主链节点判断所述第一执行结果与所述第二执行结果是否相同:是,则在主链上将当前平行链的共识高度更新为所述第一高度;否,则等待;
    从主链获取并执行各所述共识交易以获得通过共识的第一执行结果;
    从主链获取并执行各所述监督交易以获得通过共识的第二执行结果;
    判断所述第一执行结果与所述第二执行结果是否相同:
    是,则在当前平行链上将共识高度更新为所述第一高度;
    否,则检查上一次生成的所述第一监督交易是否错误:
    是,则重新生成所述第一监督交易并发送至对应的主链节点,以供各主链节点执行若干重新生成的所述第一高度的监督交易和/或共识交易,并在获得重新通过共识的第二执行结果和/或第一执行结果后,返回所述判断所述第一执行结果与所述第二执行结果是否相同;其中,重新生成的所述第一高度的共识交易由当前平行链的共识节点在检查出上一次生成的共识交易错误时生成;重新生成的所述第一高度的监督交易由当前平行链的监督节点在检查出上一次生成的监督交易错误时生成;
    从主链获取并执行各重新生成的所述第一高度的共识交易和/或监督交易,并在获得重新通过共识的第一执行结果和/或第二执行结果后,返回所述判断所述第一执行结果与所述第二执行结果是否相同。
  4. 根据权利要求3所述的方法,其特征在于,平行链上还配置有管理员节点,所述方法还包括:
    获取并执行当前平行链的管理员节点生成的第三共识交易;其中,所述第三共识交易由所述管理员节点在经过第二时长,且主链上的所述第一平行链的共识高度未更新为所述第一高度时根据所述第一平行链区块生成,所述第三共识交易由各主链节点执行并由各主链节点在主链上将所述第一平行链的共识高度更新为所述第一高度;
    获取并执行所述第三共识交易;
    在当前平行链上将共识高度更新为所述第一高度。
  5. 一种平行链监督共识方法,其特征在于,平行链上配置有一个或多个监督节点,所述方法适用于共识节点,所述方法包括:
    从主链获取并执行各共识交易以获得通过共识的第一执行结果;
    从主链获取并执行各监督交易以获得通过共识的第二执行结果;其中,所述监督交易由当前平行链的监督节点根据所述第一高度的第 一平行链区块生成;各所述共识交易还用于供各主链节点执行以获得通过共识的第一执行结果;各所述监督交易还用于供各主链节点执行以获得通过共识的第二执行结果,所述第一执行结果和所述第二执行结果还用于供各主链节点判断所述第一执行结果与所述第二执行结果是否相同:是,则在主链上将当前平行链的共识高度更新为所述第一高度;否,则等待;
    判断所述第一执行结果与所述第二执行结果是否相同:
    是,则在当前平行链上将共识高度更新为所述第一高度;
    否,则检查上一次生成的所述第一高度的共识交易是否错误:
    是,则重新生成所述第一高度的共识交易并发送至对应的主链节点,以供各主链节点执行若干重新生成的所述第一高度的监督交易和/或共识交易,并在获得重新通过共识的第二执行结果和/或第一执行结果后,返回所述判断所述第一执行结果与所述第二执行结果是否相同;其中,重新生成的所述第一高度的共识交易由当前平行链的共识节点在检查出上一次生成的所述第一高度的共识交易错误时生成;重新生成的所述第一高度的监督交易由当前平行链的监督节点在检查出上一次生成的所述第一高度的监督交易错误时生成;
    从主链获取并执行各重新生成的所述第一高度的共识交易和/或监督交易,并在获得重新通过共识的第一执行结果和/或第二执行结果后,返回所述判断所述第一执行结果与所述第二执行结果是否相同。
  6. 根据权利要求5所述的方法,其特征在于,平行链上还配置有管理员节点,所述方法还包括:
    获取并执行当前平行链的管理员节点生成的第三共识交易;其中,所述第三共识交易由所述管理员节点在经过第二时长,且主链上的所述第一平行链的共识高度未更新为所述第一高度时根据所述第一平行链区块生成,所述第三共识交易由各主链节点执行并由各主链节点在主链上将所述第一平行链的共识高度更新为所述第一高度;
    获取并执行所述第三共识交易;
    在当前平行链上将共识高度更新为所述第一高度。
  7. 一种设备,其特征在于,所述设备包括:
    一个或多个处理器;
    存储器,用于存储一个或多个程序,
    当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器执行如权利要求1-6中任一项所述的方法。
  8. 一种存储有计算机程序的存储介质,其特征在于,该程序被处理器执行时实现如权利要求1-6中任一项所述的方法。
PCT/CN2021/111856 2020-09-30 2021-08-10 平行链监督共识方法、设备和存储介质 WO2022068410A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011062200.1A CN112184227B (zh) 2020-09-30 2020-09-30 平行链监督共识方法、设备和存储介质
CN202011062200.1 2020-09-30

Publications (1)

Publication Number Publication Date
WO2022068410A1 true WO2022068410A1 (zh) 2022-04-07

Family

ID=73947658

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/111856 WO2022068410A1 (zh) 2020-09-30 2021-08-10 平行链监督共识方法、设备和存储介质

Country Status (2)

Country Link
CN (1) CN112184227B (zh)
WO (1) WO2022068410A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112184227B (zh) * 2020-09-30 2023-05-30 杭州复杂美科技有限公司 平行链监督共识方法、设备和存储介质
CN112733202B (zh) * 2021-01-11 2022-09-13 杭州复杂美科技有限公司 平行链监督共识方法、计算机设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107909369A (zh) * 2017-10-13 2018-04-13 布比(北京)网络技术有限公司 基于跨链交易的共识方法、装置和存储介质
US20190058581A1 (en) * 2017-08-03 2019-02-21 Gavin Wood Methods and Systems for a Heterogeneous Multi-Chain Framework
CN109410045A (zh) * 2018-08-30 2019-03-01 杭州复杂美科技有限公司 一种平行链共识方法、设备和存储介质
CN111510285A (zh) * 2020-03-09 2020-08-07 上海能链众合科技有限公司 一种智能基于随机数的区块链共识方法
CN112184227A (zh) * 2020-09-30 2021-01-05 杭州复杂美科技有限公司 平行链监督共识方法、设备和存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200013027A1 (en) * 2018-07-06 2020-01-09 Decentralized Finance Labs, Inc. Hybrid proof of work and proof of stake consensus to reduce circulating tokens in a blockchain system
CN110287263B (zh) * 2019-06-28 2021-03-16 杭州复杂美科技有限公司 平行链自共识方法、设备和存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190058581A1 (en) * 2017-08-03 2019-02-21 Gavin Wood Methods and Systems for a Heterogeneous Multi-Chain Framework
CN107909369A (zh) * 2017-10-13 2018-04-13 布比(北京)网络技术有限公司 基于跨链交易的共识方法、装置和存储介质
CN109410045A (zh) * 2018-08-30 2019-03-01 杭州复杂美科技有限公司 一种平行链共识方法、设备和存储介质
CN111510285A (zh) * 2020-03-09 2020-08-07 上海能链众合科技有限公司 一种智能基于随机数的区块链共识方法
CN112184227A (zh) * 2020-09-30 2021-01-05 杭州复杂美科技有限公司 平行链监督共识方法、设备和存储介质

Also Published As

Publication number Publication date
CN112184227A (zh) 2021-01-05
CN112184227B (zh) 2023-05-30

Similar Documents

Publication Publication Date Title
WO2022068410A1 (zh) 平行链监督共识方法、设备和存储介质
CN109831514B (zh) 平行链共识方法、数据异常处理方法、设备和存储介质
CN109951331B (zh) 用于发送信息的方法、装置和计算集群
WO2020043048A1 (zh) 一种平行链数据同步方法、设备和存储介质
US20210216444A1 (en) Micro services tests prioritization
US9652339B2 (en) Fault tolerant listener registration in the presence of node crashes in a data grid
US10846210B1 (en) Automation of platform release
US9378078B2 (en) Controlling method, information processing apparatus, storage medium, and method of detecting failure
WO2021057259A1 (zh) 平行链共识方法、设备及存储介质
US20140195483A1 (en) Copy of replication status for synchronization
WO2022148320A1 (zh) 交易执行方法、计算机设备和存储介质
CN109995585B (zh) 一种异常处理方法、设备和存储介质
WO2021189925A1 (zh) 保护用户隐私的风险检测方法和装置
Sunyé et al. Model-based testing of global properties on large-scale distributed systems
US10776392B2 (en) Apparatus and method to establish a connection between apparatuses while synchronization of connection information thereof is suspended
CN112733202B (zh) 平行链监督共识方法、计算机设备和存储介质
CN116301978A (zh) 一种系统升级方法、装置、设备及存储介质
CN113079221B (zh) 一种基于Coq的安全跨链协议生成方法
CN107229487B (zh) 代码处理方法及装置
CN112598418B (zh) 平行链监督共识方法、设备和存储介质
CN114860615A (zh) 规则自动化测试方法、装置、电子设备及存储介质
Fragal et al. Reducing the concretization effort in FSM-based testing of software product lines
CN111260476B (zh) 平行链分段自共识方法、设备和存储介质
CN109684879A (zh) 一种国产化软硬件设备的通用监控方法及系统
CN109522098A (zh) 分布式数据库中的事务处理方法、装置、系统和储存介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21874072

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21874072

Country of ref document: EP

Kind code of ref document: A1