CN111368344B - Method for improving fault tolerance of endorsement node based on dynamic election - Google Patents

Method for improving fault tolerance of endorsement node based on dynamic election Download PDF

Info

Publication number
CN111368344B
CN111368344B CN202010243595.9A CN202010243595A CN111368344B CN 111368344 B CN111368344 B CN 111368344B CN 202010243595 A CN202010243595 A CN 202010243595A CN 111368344 B CN111368344 B CN 111368344B
Authority
CN
China
Prior art keywords
endorsement
node
nodes
pointendorser
endorsement node
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
Application number
CN202010243595.9A
Other languages
Chinese (zh)
Other versions
CN111368344A (en
Inventor
王一川
丁一凡
张彤
尹欣悦
田钰滢
姜新宇
马冰
梁小龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian University of Technology
Original Assignee
Xian University of Technology
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 Xian University of Technology filed Critical Xian University of Technology
Priority to CN202010243595.9A priority Critical patent/CN111368344B/en
Publication of CN111368344A publication Critical patent/CN111368344A/en
Application granted granted Critical
Publication of CN111368344B publication Critical patent/CN111368344B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Bioethics (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Technology Law (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer And Data Communications (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method for improving fault tolerance of endorsement nodes based on dynamic election, which is implemented according to the following steps: step 1, when a chain code is instantiated, nodes appointed in an endorsement strategy are changed and appointed to a specific organization; and 2, configuring the nodes organized in the step 1, selecting a representative endorsement node, and recording the representative endorsement node as pointEndorser:1, pointEndorser:2, \8230 \ 8230;, pointEndorser: n, N represents a positive integer; step 3, carrying out dynamic election among representatives of the endorsement nodes to determine the endorsement nodes; and 4, the client sends the transaction proposal needing endorsement to the endorsement node determined in the step 3, the endorsement node carries out endorsement on the transaction proposal sent by the client, and a message is returned to the client after the endorsement is completed.

Description

Method for improving fault tolerance of endorsement node based on dynamic election
Technical Field
The invention discloses the technical field of financial transactions, and relates to a method for improving fault tolerance of endorsement nodes based on dynamic election.
Background
In the hyper Ledger Fabric, the mode of accounting of the account book is not recorded according to the account of the holder, but is recorded according to the transaction, so whether the transaction source is legal or not needs to be verified. Before the formal transaction is initiated, the client needs to submit a transaction proposal to an endorsement node (Endorser) for endorsement, and the client can construct a legal transaction request by using the endorsement after receiving enough endorsement support and send the legal transaction request to the orderer for ordering processing.
The endorsement node (Endorser) is a dynamic role, is a chain node for verifying transaction information and declaring whether the transaction is legal, and is mainly used for responding to an endorsement request of a specific chain code (chaincode) and performing endorsement processing on the transaction before the transaction is submitted. Namely, endorsement is the confirmation of the transaction, and simultaneously, the transaction is simulated according to the logic of the transaction and the chain code, and a transaction result is generated and signed and returned to the client.
The endorsement strategy is a condition for transaction confirmation, defines a necessary condition of legal transaction endorsement, is used for guiding endorsement nodes to carry out correct endorsement, and often relates to a collection of endorsement nodes. The most typical endorsement strategy is to designate certain nodes to endorse, form a set of endorsement nodes and complete the signature of the set of endorsement nodes.
In instantiating a chain code (chaincode), the instantiate command may specify the endorsement policy (EndorsementPolicy) of the chain code through a "-p" parameter. The endorsement policy indicates which nodes in the organization should endorse the transaction before the transaction is accepted by the ledger copy of the submitting node. A transaction includes one or more endorsement nodes for endorsement support. The endorsement policy specifies the endorsement rules for each chain code (e.g., who endorsements or how many endorsements are needed).
In CLI, the endorsement policy to a subject is expressed using a simple boolean expression language. For example, endorsement policies for transactions:
(1) AND ('org 1.Member', 'org2.Member', 'org3. Member') indicates that these 3 principals must endorse AND approve the signature simultaneously.
(2) OR ('org 1.Member', 'org2. Member') represents any one of these 2 principals endorsed and approved the signature.
(3) OR ('org 1.Member', AND ('org 2.Member', 'org3. Member')) represents that the subject 1 endorses AND approves the signature OR that both the subject 2 AND the subject 3 endorse AND approve the signature at the same time.
When the blockchain project is used daily, because the endorsement policy specifies the corresponding endorsement node, in the process of adopting the endorsement policy to endorse, if a certain endorsement node or a plurality of endorsement nodes specified in the endorsement policy fail, the transaction does not reach the expected endorsement quantity, and an error occurs in the endorsement process. What I want to do is to improve the fault tolerance of the endorsement node, change the existing mode and provide a method for dynamically selecting the endorsement node, so that the problems caused by the reasons can be effectively avoided.
Disclosure of Invention
The invention aims to provide a method for improving the fault tolerance of endorsement nodes based on dynamic election, which aims to solve the problems that the transaction does not reach the expected endorsement quantity and errors occur in the endorsement link due to the failure of one or some endorsement nodes specified in an endorsement strategy.
In order to achieve the purpose, the invention adopts the technical scheme that: a method for improving fault tolerance of an endorsement node based on dynamic election is implemented according to the following steps:
step 1, when a chain code is instantiated, nodes appointed in an endorsement strategy are changed and appointed to a specific organization;
and 2, configuring the nodes organized in the step 1, selecting a representative endorsement node, and recording the representative endorsement node as pointEndorser:1, pointEndorser:2, \8230 \ 8230;, pointEndorser: n, N represents a positive integer;
step 3, carrying out dynamic election among representatives of the endorsement nodes to determine the endorsement nodes;
and 4, the client sends the transaction proposal needing endorsement to the endorsement node determined in the step 3, the endorsement node carries out endorsement on the transaction proposal sent by the client, and a message is returned to the client after the endorsement is completed.
The technical scheme of the invention also has the following characteristics:
in step 2, configuring nodes in an organization specifically includes:
useEndorseElection: whether the node is allowed to dynamically elect a representative of the endorsement node;
orgEndorser: whether the node is designated as an endorsement node of an organization and cannot be designated as true simultaneously with the useEndorseElection;
pointEndorser: (1, 2,3 \8230; N), and when the useEndorseElection is true, the node numbering is performed.
In step 2, gossip configuration is performed on the nodes organized in step 1.
In step 3, after the endorsement node is determined, a heartbeat message needs to be sent to representatives of other endorsement nodes at regular time in the using process of the endorsement node, so as to know whether the state of the endorsement node is normal or not, and if an error occurs, a new endorsement node is elected at any time.
And in the using process of the endorsement node, sending heartbeat messages to representatives of other endorsement nodes at regular time according to the gossip protocol.
Every 1s is a cycle, each cycle using a representation of an endorsement node.
The first cycle used pointEndorser:1 is an endorsement node, and the pointEndorser is sequentially used in the subsequent period: 2, \8230 \ 8230; pointEndorser: n, last from pointEndorser:1, starting to recycle the materials in sequence.
In step 4, the endorsement node endorses the transaction proposal sent by the client specifically as follows: if the fault occurs, the endorsement node crashes, the endorsement cannot be carried out, and the pointEndorser:2, replacing in time to complete the next work, and enabling the crashed nodes to enter the organization again after waiting for repair; if no fault has occurred, after one cycle is complete, pointEndorser:1, handing over the position of the endorsement node to the pointEndorser:2, pointEndorser:2 becoming endorsement nodes and broadcasting to representatives of other endorsement nodes; taking turns down in turn according to this pattern, the representatives of each endorsement node take turns and then begin a new turn.
The beneficial effects of the invention are: according to the method for improving the fault tolerance of the endorsement node based on dynamic election, dynamic adjustment is performed aiming at the problems that the endorsement node is broken down possibly in the endorsement link of a block chain project, so that a transaction proposal cannot be carried out, and the like, so that the fault tolerance is improved; the method does not only depend on a plurality of endorsement nodes specified by the endorsement strategy to carry out endorsement verification work, but adjusts the specified object of the endorsement strategy, the specified object is adjusted to be the endorsement node dynamically selected in the organization, and the node represents the organization to carry out the endorsement verification work.
Detailed Description
The following embodiments are described in detail with reference to the accompanying drawings, so that how to implement the technical features of the present invention to solve the technical problems and achieve the technical effects can be fully understood and implemented.
The invention relates to a method for improving fault tolerance of endorsement nodes based on dynamic election, which is implemented according to the following steps:
step 1, downloading an official release version of a block chain project from an official website as a standard, correspondingly changing an endorsement link in the version, and when a chain code is instantiated, changing a node specified in an endorsement strategy to a specific organization;
and 2, performing gossip configuration on the nodes organized in the step 1, selecting representatives of endorsement nodes, and marking as pointEndorser:1, pointEndorser:2, \8230 \ 8230;, pointEndorser: n, N represents a positive integer;
step 3, carrying out dynamic election among representatives of the endorsement nodes to determine the endorsement nodes;
and 4, the client sends the transaction proposal needing endorsement to the endorsement node determined in the step 3, the endorsement node carries out endorsement on the transaction proposal sent by the client, and a message is returned to the client after the endorsement is completed.
The configuration of the nodes in the organization specifically comprises the following steps:
useEndorseElectrion: whether the node is allowed to dynamically elect a representative endorsement node;
orgEndorser: whether the node is designated as an endorsement node of an organization and cannot be designated as true simultaneously with the useEndorseElection;
pointEndorser: (1, 2,3 \8230; N), and when the useEndorseElection is true, the node numbering is performed.
In the step 3, after the endorsement node is determined, in the using process, according to the gossip protocol, a heartbeat message needs to be sent to representatives of other endorsement nodes at regular time so as to know whether the state of the endorsement node is normal, and if an error occurs, a new endorsement node is selected at any time.
Every 1s is a period, and each period uses a representation of an endorsement node; the first cycle uses the pointEndorser:1 is an endorsement node, and the pointEndorser is sequentially used in the subsequent period: 2, \8230; pointEndorser: n, last from pointEndorser:1, starting to recycle the materials in sequence.
In one organization, nodes that may elect an endorsement node are configured in advance. To avoid single point failures, the number of nodes is typically >1. The nodes are numbered pointEndorser (1, 2,3 \8230;), endorsement nodes are forcibly set in an initial state (generally from the beginning of the number 1), after the endorsement nodes become endorsement nodes, heartbeat messages need to be sent to other nodes regularly so as to know whether the states of the endorsement nodes are normal or not, and if errors occur, new endorsement nodes are selected at any time. The selected endorsement node (Endorser) performs endorsement verification work on behalf of the organization.
In step 4, the endorsement node endorses the transaction proposal sent by the client specifically as follows: if the fault occurs, the endorsement node crashes, the endorsement cannot be carried out, and the pointEndorser:2, replacing in time to complete the next work, and enabling the crashed nodes to enter the organization again after waiting for repair; if no fault has occurred, after one cycle is complete, pointEndorser:1, handing over the position of the endorsement node to the pointEndorser:2, pointEndorser:2 becoming endorsement nodes and broadcasting to representatives of other endorsement nodes; and sequentially turning downwards according to the mode, wherein the representation of each endorsement node starts a new round after the round of rotation, and the nodes can represent the organization to perform the endorsement work.
Therefore, the method for improving the fault tolerance of the endorsement node based on dynamic election of the invention dynamically adjusts the problems that the endorsement node is broken down possibly in the endorsement link of a block chain project, so that the transaction proposal cannot be carried out and the like, and improves the fault tolerance; the method does not only depend on a plurality of endorsement nodes specified by the endorsement strategy to carry out endorsement verification work, but adjusts the specified object of the endorsement strategy, the specified object is adjusted to be the endorsement node dynamically selected in the organization, and the node represents the organization to carry out the endorsement verification work.

Claims (7)

1. A method for improving fault tolerance of an endorsement node based on dynamic election is characterized by comprising the following steps:
step 1, when chain codes are instantiated, nodes appointed in an endorsement strategy are changed and appointed to a specific organization;
and 2, configuring the nodes organized in the step 1, selecting a representative endorsement node, and recording the representative endorsement node as pointEndorser:1, pointEndorser:2, \8230;, pointEndorser: n, N represents a positive integer;
step 3, carrying out dynamic election among representatives of the endorsement nodes to determine the endorsement nodes;
in the step 3, after the endorsement node is determined, a heartbeat message needs to be sent to representatives of other endorsement nodes at regular time in the using process of the endorsement node, so that whether the state of the endorsement node is normal or not can be known, and if an error occurs, a new endorsement node is selected at any time;
and 4, the client sends the transaction proposal needing endorsement to the endorsement node determined in the step 3, the endorsement node carries out endorsement on the transaction proposal sent by the client, and a message is returned to the client after the endorsement is completed.
2. The method according to claim 1, wherein in step 2, the nodes in the organization are configured specifically as follows:
useEndorseElectrion: whether the node is allowed to dynamically elect a representative endorsement node;
orgEndorser: whether the node is designated as an endorsement node of an organization and cannot be designated as true simultaneously with the useEndorseElection;
pointEndorser: (1, 2,3 \8230; N), and when the useEndorseElection is true, the node numbering is performed.
3. The method of claim 2, wherein in step 2, gossip configuration is performed on the nodes organized in step 1.
4. The method for improving endorsement node fault tolerance based on dynamic election of claim 3, wherein the endorsement node sends heartbeat messages to representatives of other endorsement nodes timed according to gossip protocol during use.
5. The method of claim 4, wherein each 1s period is one period, and each period uses a representation of an endorsement node.
6. The method of claim 5 for improving endorsement node fault tolerance based on dynamic election, wherein the first cycle uses a pointEndorser:1 is an endorsement node, and the pointEndorser is sequentially used in the subsequent period: 2, \8230 \ 8230; pointEndorser: n, last from pointEndorser:1, starting to recycle the materials in sequence.
7. The method for improving fault tolerance of endorsement nodes based on dynamic election according to claim 6, wherein in the step 4, the endorsement node endorses the transaction proposal sent by the client specifically comprises: if the fault occurs, the endorsement node crashes, the endorsement cannot be carried out, and the pointEndorser:2, replacing in time to complete the next work, and after the crashed nodes wait for repair, re-entering the organization; if no fault has occurred, after one cycle is complete, pointEndorser:1, handing over the position of the endorsement node to the pointEndorser:2, pointEndorser:2 becoming endorsement nodes and broadcasting to representatives of other endorsement nodes; taking turns down in turn according to this pattern, the representatives of each endorsement node take turns and then begin a new turn.
CN202010243595.9A 2020-03-31 2020-03-31 Method for improving fault tolerance of endorsement node based on dynamic election Active CN111368344B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010243595.9A CN111368344B (en) 2020-03-31 2020-03-31 Method for improving fault tolerance of endorsement node based on dynamic election

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010243595.9A CN111368344B (en) 2020-03-31 2020-03-31 Method for improving fault tolerance of endorsement node based on dynamic election

Publications (2)

Publication Number Publication Date
CN111368344A CN111368344A (en) 2020-07-03
CN111368344B true CN111368344B (en) 2023-03-21

Family

ID=71210813

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010243595.9A Active CN111368344B (en) 2020-03-31 2020-03-31 Method for improving fault tolerance of endorsement node based on dynamic election

Country Status (1)

Country Link
CN (1) CN111368344B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111988188A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Transaction endorsement method, device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108667614A (en) * 2018-04-19 2018-10-16 上海分布信息科技有限公司 A kind of Byzantine failure tolerance method and its realize system
CN110706106A (en) * 2019-09-26 2020-01-17 联想(北京)有限公司 Information processing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11494344B2 (en) * 2018-03-06 2022-11-08 International Business Machines Corporation Customized endorsement logic for blockchain

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108667614A (en) * 2018-04-19 2018-10-16 上海分布信息科技有限公司 A kind of Byzantine failure tolerance method and its realize system
CN110706106A (en) * 2019-09-26 2020-01-17 联想(北京)有限公司 Information processing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘东伟 ; 张学旺 ; 郭晓金 ; .基于区块链的学位证书存证系统设计与实现.2020,(02),全文. *

Also Published As

Publication number Publication date
CN111368344A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
CN111367628B (en) Distributed transaction processing method and device, message producer and consumer system
CN106502769B (en) Distributed transaction processing method, apparatus and system
US20230274358A1 (en) 24 hours global low latency computerized exchange system
CN104216912A (en) Method and device for achieving non-intrusive service form workflow
CN110855793A (en) Distributed system consensus method
US9513894B2 (en) Database software upgrade using specify-validate-execute protocol
CN105243586A (en) Bank agent insurance system and wrong-account-prevention processing method thereof
CN111368344B (en) Method for improving fault tolerance of endorsement node based on dynamic election
CN112162768B (en) Block chain upgrading method and system
CN113179168B (en) Cross-chain interaction method of block chain
US20030204804A1 (en) Providing a chain of tokenized error and state information for a call stack
CN110955469B (en) Method and device for online transaction of distributed batch call of X86 platform
CN111241589A (en) Database system, node and method
CN105184575A (en) Transaction system construction method, transaction flow control device, and third-party transaction platform
CN107800667B (en) Information processing method and access processing device
US5758029A (en) Formal trust building in the execution of partially trusted behaviors
CN111062060B (en) Voting proposal life cycle management method based on intelligent contract
CN113064759A (en) Block chain data rollback processing method and processing system thereof
CN112052021A (en) Method, device, equipment and storage medium for upgrading block chain of alliance
CN103440460A (en) Application system change validation method and system
CN112511312B (en) Assembled consensus method and system
CN115544034A (en) Data consistency method and service system
CN116233220A (en) Service processing method and device and server
CN110765148B (en) Service data processing method and device
WO2022127424A1 (en) Obtaining method and apparatus for block group header, storage medium, and electronic device

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