CN111698244B - Method and device for rapidly participating in consensus of newly added nodes and electronic equipment - Google Patents

Method and device for rapidly participating in consensus of newly added nodes and electronic equipment Download PDF

Info

Publication number
CN111698244B
CN111698244B CN202010520429.9A CN202010520429A CN111698244B CN 111698244 B CN111698244 B CN 111698244B CN 202010520429 A CN202010520429 A CN 202010520429A CN 111698244 B CN111698244 B CN 111698244B
Authority
CN
China
Prior art keywords
information
node
block
state
state root
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
CN202010520429.9A
Other languages
Chinese (zh)
Other versions
CN111698244A (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.)
Hangzhou Rivtower Technology Co Ltd
Original Assignee
Hangzhou Rivtower Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Rivtower Technology Co Ltd filed Critical Hangzhou Rivtower Technology Co Ltd
Priority to CN202010520429.9A priority Critical patent/CN111698244B/en
Publication of CN111698244A publication Critical patent/CN111698244A/en
Application granted granted Critical
Publication of CN111698244B publication Critical patent/CN111698244B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Hardware Redundancy (AREA)

Abstract

The embodiment of the specification relates to a method, a device and electronic equipment for rapidly participating in consensus of a newly added node, which are applied to a block chain system adopting a BFT consensus algorithm. The newly-added consensus node directly synchronizes the state root information of the current block height, so that the state of the highest block height is quickly reached, and the security of the latest block information is ensured by using the block information obtained from the plurality of consensus nodes as a check, so that the new node can quickly participate in the consensus block. And the blocks between the height from the creation block to the newly added consensus node are synchronized in the follow-up process, so that the current consensus process is not influenced.

Description

Method and device for rapidly participating in consensus of newly added nodes and electronic equipment
Technical Field
The embodiment of the specification relates to the technical field of networks, in particular to a method and a device for a newly added node to quickly participate in consensus and an electronic device.
Background
The PBFT-like BFT consensus algorithm (Byzantine Fault Tolerance algorithm) used in the block chain can generally tolerate not more than 1/3 malicious or wrong nodes than the total number of consensus nodes, and still can work normally. The consensus process is that the total number of votes of the consensus nodes is counted, and the block can be obtained when the common consensus votes reach more than 2/3 of the total number of the consensus nodes. In the current block chain system, after a consensus node is newly added at a certain block height, it is generally required to synchronize blocks from a creation block to a current height of the chain from other nodes, and then each block is executed one by one until the current height obtains a latest state, and then the block can participate in consensus voting.
Therefore, after the new consensus node is accessed, depending on the height of the current block, it may not be able to really participate in the consensus of the block chain for a long time, reducing the consensus security of the chain, and the new node wastes time on the synchronization and execution of the history blocks.
Disclosure of Invention
The embodiment of the specification provides a method, a device and electronic equipment for rapidly participating in consensus of a newly added node, which are used for solving the problem that the newly added node in the prior art cannot immediately participate in consensus.
In order to solve the above technical problem, the embodiments of the present specification adopt the following technical solutions:
in a first aspect, a method for a newly added node to participate in consensus quickly is provided, and is applied to a block chain system adopting a BFT consensus algorithm, where the method includes:
adding a block chain when the newly-added common identification node is at the first block height;
the newly-added common node synchronizes state root information of the first block height to the existing common node to obtain first state root information, wherein the first state root information is state root information with consistent content owned by common nodes which exceed more than one third of the total number of the common nodes;
the newly added node verifies the correctness of all leaf nodes taking the first state root information as a root;
after the correctness of the leaf node is verified, the newly added node sequentially synchronizes the block information from the height of the first block to the height of the current block, and executes to obtain the state information of the current block;
and the newly added node participates in consensus at the next height of the current block height.
In a second aspect, an apparatus for a newly added node to participate in consensus quickly is provided, and is applied to a block chain system adopting a BFT consensus algorithm, where the apparatus includes:
a node adding module: adding a block chain when the newly added common node is at the first block height;
a first state root information acquisition module: the newly-added common node synchronizes the state root information of the first block height to the existing common node to obtain first state root information, wherein the first state root information is the state root information with consistent content owned by the common node which exceeds more than one third of the total number of the common nodes;
a leaf node verification module: the newly added node is used for verifying the correctness of all leaf nodes taking the first state root information as a root;
a first synchronization module: after the correctness of the leaf node is verified, the newly added node sequentially synchronizes the block information from the height of the first block to the height of the current block, and executes to obtain the state information of the current block;
and after the newly added node obtains the state information of the current block, participating in consensus at the next height of the current block height.
In a third aspect, an electronic device is provided, including: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to perform a method of rapidly participating in a consensus provided according to embodiments of the present invention.
In a fourth aspect, the present invention also provides a computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform a method for rapidly participating in consensus by a newly added node provided according to embodiments of the present invention.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects: the newly-added consensus node directly synchronizes the state root information of the current block height, so that the state of the highest block height is quickly reached, and the security of the latest block information is ensured by using the block information obtained from the plurality of consensus nodes as a check, so that the new node can quickly participate in the consensus block. And the blocks between the height from the creation block to the newly added consensus node are synchronized in the follow-up process, so that the current consensus process is not influenced.
Drawings
In order to more clearly illustrate the embodiments of the present specification or technical solutions in the prior art, the drawings required to be used in the description of the embodiments or prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present specification, and it is also possible for a person skilled in the art to obtain other drawings based on the drawings without inventive labor.
Fig. 1 is a schematic step diagram of a method for rapidly participating in consensus by a newly added node according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a device for rapidly participating in consensus by an added node according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of this specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the embodiments in the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
It should be noted that the State root information (State root) is a State obtained by executing a transaction for each block from a block node point, and is a State root finally generated by hashing an account State two by two through a merkel tree or a variation thereof. The state modification of each account number generates a new state root.
Example one
Referring to fig. 1, a schematic step diagram of a method for rapidly participating in consensus by an added node provided in an embodiment of the present specification is applied to a blockchain system that employs a BFT consensus algorithm, where the method includes:
step 101: adding a block chain when the newly-added common identification node is at the first block height;
step 102: the newly-added common identification node synchronizes the state root information of the first block height to the existing common identification node to obtain first state root information;
the first state root information is state root information with consistent content owned by the common node which exceeds more than one third of the total number of the common nodes;
step 103: the newly added node verifies the correctness of all leaf nodes taking the first state root information as a root;
step 104: after the correctness of the leaf node is verified, the newly added node sequentially synchronizes the block information from the height of the first block to the height of the current block, and executes to obtain the state information of the current block;
step 105: and the newly added node participates in consensus at the next height of the current block height.
Wherein, step 102 may further comprise the steps of:
the first state root information is state root information with consistent content owned by N consensus nodes; n is obtained by dividing the total number of the consensus nodes by 3 and rounding down and adding 1;
the newly-added common identification node randomly synchronizes the state root information of the height of the first block to N existing common identification nodes;
if the obtained N pieces of state root information are consistent, the state root information is first state root information; and if the obtained N pieces of state root information are inconsistent, the newly-added common node continues to synchronize the state root information of the first block height to other common nodes until the state root information with the consistent content owned by the N common nodes is obtained.
Optionally, step 103 may further include the steps of:
the newly added node requests the state information of all leaf nodes taking the first state root information as the root from the consensus node with the first state root information;
the newly added nodes calculate the state information of all the leaf nodes to obtain second state root information;
comparing the first state root information with the second state root information, and if the results are consistent, the correctness verification of the leaf node is passed;
and if the result is inconsistent, the newly added node requests other consensus nodes with the first state root information for continuously verifying the state information of all leaf nodes taking the first state root information as the root.
The method in this embodiment may further include: and after the newly added nodes participate in consensus, sequentially synchronizing the block information from the creation block to the first block height, and sequentially executing.
The following description will take the existing 4 consensus nodes A, B, C and D, and the new consensus node E at the first block height H1 as an example:
because of the BFT fault tolerance relationship, node E needs to request its state root information at height H1 from more than a total number 1/3 of consensus nodes. For example, node E synchronizes its state root information at H1 chunk height to nodes a and B: state Root-A and State Root-B;
the node E needs to compare whether the State Root-A is consistent with the State Root-B or not, and if so, the State Root information is first State Root information State Root-1; if State Root-A and State Root-B are inconsistent, the node E continues to synchronize the State Root information of the H1 block height to the node C or D until the State Root information with consistent content owned by 2 nodes is obtained as State Root-1.
Assuming that the first State Root information obtained by the final node E is owned by the nodes B and C, the node E requests the node B for the State information of all leaf nodes with the first State Root information State Root-1 as the Root, i.e., the State snapshot with the State Root-1 as the Root.
The node E calculates the State information of all leaf nodes taking the State Root-1 as a Root in a way of a Mercker tree or an MPT tree or other Mercker tree varieties to obtain second State Root information State Root-2;
comparing whether the State Root-1 and the State Root-2 are the same or not, and if the State Root-1 and the State Root-2 are the same, the correctness verification of the leaf node is passed;
and if not, the node E requests the State information of all leaf nodes taking the State Root-1 as the Root to the node C for continuous verification.
When the correctness verification of the leaf node passes, if the height of the time zone block chain is increased from H1 to H2, the node E sequentially synchronizes the block information between the height H1 and the current block height H2 according to a conventional synchronization method, and executes the state information to the height H2.
With the latest state and latest block information, node E can participate in the consensus block finding and voting, because node E can already determine whether the proposal of another node is correct. Node E therefore participates in consensus at the height of (H2+ 1).
Since the newly added node E lacks the blocks and state information from the created blocks to the height H1 at this time and cannot respond to the request for the history query temporarily, after participating in the consensus, the newly added node E continues to synchronize the missing blocks as needed and executes them in sequence until the height H1.
In the embodiment of the present specification, the newly added consensus node directly synchronizes the state root information of the current block height, so as to quickly reach the state of the highest block height, and the block information obtained from the multiple consensus nodes is used as a check, thereby ensuring the security of the latest block information, and enabling the new node to quickly participate in the consensus block. And the blocks between the height from the creation block to the newly added consensus node are synchronized in the follow-up process, so that the current consensus process is not influenced.
Example two
Referring to fig. 2, a schematic structural diagram of an apparatus for rapidly participating in consensus by a newly added node provided in the embodiment of the present specification is applied to a blockchain system adopting a BFT consensus algorithm, and the apparatus mainly includes:
the node adding module 201: adding a block chain when the newly added common node is at the first block height;
the first state root information obtaining module 202: the newly-added common node synchronizes state root information of the first block height to the existing common node to obtain first state root information, wherein the first state root information is state root information with consistent content owned by common nodes which exceed more than one third of the total number of the common nodes;
leaf node verification module 203: the newly added node is used for verifying the correctness of all leaf nodes taking the first state root information as a root;
the first synchronization module 204: after the correctness of the leaf node is verified, the newly added node sequentially synchronizes the block information from the height of the first block to the height of the current block, and executes to obtain the state information of the current block;
and after the newly added node obtains the state information of the current block, participating in consensus at the next height of the current block height.
Optionally, the first state root information obtaining module 202 may further include:
the first state root information is state root information with consistent content owned by N consensus nodes; n is obtained by dividing the total number of the consensus nodes by 3 and rounding down and adding 1;
the newly-added common identification node randomly synchronizes the state root information of the height of the first block to N existing common identification nodes;
if the obtained N pieces of state root information are consistent, the state root information is first state root information; and if the obtained N pieces of state root information are inconsistent, the newly-added common node continues to synchronize the state root information of the first block height to other common nodes until the state root information with the consistent content owned by the N common nodes is obtained.
Optionally, the leaf node verifying module 203 further includes:
the newly added node requests the state information of all leaf nodes taking the first state root information as the root from the consensus node with the first state root information;
the newly added nodes calculate the state information of all the leaf nodes to obtain second state root information;
comparing the first state root information with the second state root information, and if the results are consistent, the correctness verification of the leaf node is passed;
and if the results are not consistent, the newly added node requests other common identification nodes with first state root information for continuously verifying the state information of all leaf nodes taking the first state root information as the root.
In addition, the apparatus in the embodiment of the present invention may further include: and the second synchronization module is used for sequentially synchronizing the block information from the creation block to the height of the first block after the newly added node participates in the consensus and sequentially executing the block information.
According to the technical scheme, the newly-added consensus node directly synchronizes the state root information of the current block height, so that the state of the highest block height is quickly reached, and the security of the latest block information is ensured by using the block information obtained from the plurality of consensus nodes as a check, so that the new node can quickly participate in the consensus block. And the blocks between the height from the creation block to the newly added consensus node are synchronized in the follow-up process, so that the current consensus process is not influenced.
It should be understood that the apparatus described in this embodiment two may execute all technical solutions related to each method embodiment in the embodiment one in the form of a functional module, and implement corresponding technical effects, which are not described herein again.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Referring to fig. 3, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 3, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads a corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the block chain consensus device on a logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
adding a block chain when the newly-added common identification node is at the first block height;
the newly-added common node synchronizes state root information of the first block height to the existing common node to obtain first state root information, wherein the first state root information is state root information with consistent content owned by common nodes which exceed more than one third of the total number of the common nodes;
the newly added node verifies the correctness of all leaf nodes taking the first state root information as a root;
after the correctness of the leaf node is verified, the newly added node sequentially synchronizes the block information from the height of the first block to the height of the current block, and executes to obtain the state information of the current block;
and the newly added node participates in consensus at the next height of the current block height.
The method performed by the apparatus according to the embodiments shown in fig. 1 and fig. 2 of the present specification may be implemented in a processor or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The methods, steps, and logic blocks disclosed in one or more embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with one or more embodiments of the present disclosure may be embodied directly in hardware, in a software module executed by a hardware decoding processor, or in a combination of the hardware and software modules executed by a hardware decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may also execute the method in fig. 1 and fig. 2, and implement the functions of the corresponding apparatus in the other embodiments shown in fig. 1 and fig. 2, which are not described herein again in this specification.
Of course, besides the software implementation, the electronic device of the embodiment of the present disclosure does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
Through the technical scheme of this embodiment, the newly-added consensus node directly synchronizes the state root information of the current block height, so as to quickly reach the state of the highest block height, and the security of the latest block information is ensured by taking the block information obtained from the plurality of consensus nodes as a check, so that the new node can quickly participate in the consensus block. And the blocks between the height from the creation block to the newly added consensus node are synchronized in the follow-up process, so that the current consensus process is not influenced.
Example four
Embodiments of the present specification also propose a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, are capable of causing the portable electronic device to perform the method of the embodiments shown in fig. 1 and 2, and in particular to perform the method of:
adding a block chain when the newly added common identification node is at the first block height;
the newly-added common node synchronizes state root information of the first block height to the existing common node to obtain first state root information, wherein the first state root information is state root information with consistent content owned by common nodes which exceed more than one third of the total number of the common nodes;
the newly added node verifies the correctness of all leaf nodes taking the first state root information as a root;
after the correctness of the leaf node is verified, the newly added node sequentially synchronizes the block information from the height of the first block to the height of the current block, and executes to obtain the state information of the current block;
and the newly added node participates in consensus at the next height of the current block height.
Through the technical scheme of this embodiment, the newly-added consensus node directly synchronizes the state root information of the current block height, so as to quickly reach the state of the highest block height, and the security of the latest block information is ensured by taking the block information obtained from the plurality of consensus nodes as a check, so that the new node can quickly participate in the consensus block. And the blocks between the height from the creation block to the newly added consensus node are synchronized in the follow-up process, so that the current consensus process is not influenced.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present specification shall be included in the protection scope of the present specification.
The system, apparatus, module or unit illustrated in one or more of the above embodiments may be implemented by a computer chip or an entity, or by an article of manufacture with a certain functionality. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.

Claims (10)

1. A method for rapidly participating in consensus by a newly added node is applied to a block chain system adopting a BFT consensus algorithm, and comprises the following steps:
adding a block chain when the newly-added common identification node is at the first block height;
the newly-added common node synchronizes state root information of the first block height to the existing common node to obtain first state root information, wherein the first state root information is state root information with consistent content owned by common nodes which exceed more than one third of the total number of the common nodes;
the newly added node verifies the correctness of all leaf nodes taking the first state root information as a root;
after the correctness of the leaf node is verified, the newly added node sequentially synchronizes the block information from the height of the first block to the height of the current block, and executes to obtain the state information of the current block;
and the newly added node participates in consensus at the next height of the current block height, and synchronizes the block information from the created block to the first block height after the newly added node starts to participate in the consensus.
2. The method of claim 1, wherein the new consensus node synchronizes state root information of the first block height to an existing consensus node to obtain first state root information; further comprising:
the first state root information is state root information with consistent content owned by N consensus nodes; n is obtained by dividing the total number of the consensus nodes by 3 and rounding down and adding 1;
the newly-added common identification node randomly synchronizes the state root information of the height of the first block to N existing common identification nodes;
if the obtained N pieces of state root information are consistent, the state root information is first state root information; and if the obtained N pieces of state root information are inconsistent, the newly-added common node continues to synchronize the state root information of the first block height to other common nodes until the state root information with the consistent content owned by the N common nodes is obtained.
3. The method of claim 1, the newly added node verifying correctness of all leaf nodes rooted at the first state root information; further comprising:
the newly added node requests the state information of all leaf nodes taking the first state root information as the root from the consensus node with the first state root information;
the newly added nodes calculate the state information of all the leaf nodes to obtain second state root information;
comparing the first state root information with the second state root information, and if the results are consistent, the correctness verification of the leaf node is passed;
and if the result is inconsistent, the newly added node requests other consensus nodes with the first state root information for continuously verifying the state information of all leaf nodes taking the first state root information as the root.
4. The method of any of claims 1-3, the synchronizing block information from a created block to the first block height, comprising: and sequentially synchronizing the block information from the creation block to the first block height, and sequentially executing.
5. An apparatus for rapidly participating in consensus by a newly added node, which is applied to a block chain system adopting a BFT consensus algorithm, and the apparatus comprises:
a node adding module: adding a block chain when the newly added common node is at the first block height;
a first state root information acquisition module: the newly-added common node synchronizes state root information of the first block height to the existing common node to obtain first state root information, wherein the first state root information is state root information with consistent content owned by common nodes which exceed more than one third of the total number of the common nodes;
a leaf node verification module: the newly added node is used for verifying the correctness of all leaf nodes taking the first state root information as a root;
a first synchronization module: after the correctness of the leaf node is verified, the newly added node sequentially synchronizes the block information from the height of the first block to the height of the current block, and executes to obtain the state information of the current block;
after the newly added node obtains the state information of the current block, participating in consensus at the next height of the current block height;
a second synchronization module: synchronizing block information from a created block to the first block height after beginning to participate in the consensus.
6. The apparatus of claim 5, the first state root information acquisition module further comprising:
the first state root information is state root information with consistent content owned by N consensus nodes; n is obtained by dividing the total number of the consensus nodes by 3 and rounding down and adding 1;
the newly-added common identification node randomly synchronizes the state root information of the height of the first block to N existing common identification nodes;
if the obtained N pieces of state root information are consistent, the state root information is first state root information; and if the obtained N pieces of state root information are inconsistent, the newly-added common node continues to synchronize the state root information of the first block height to other common nodes until the state root information with the consistent content owned by the N common nodes is obtained.
7. The apparatus of claim 5, the leaf node validation module further comprising:
the newly added node requests the state information of all leaf nodes taking the first state root information as the root from the consensus node with the first state root information;
the newly added nodes calculate the state information of all the leaf nodes to obtain second state root information;
comparing the first state root information with the second state root information, and if the results are consistent, the correctness verification of the leaf node is passed;
and if the results are not consistent, the newly added node requests other common identification nodes with first state root information for continuously verifying the state information of all leaf nodes taking the first state root information as the root.
8. The apparatus of any of claims 5-7, the second synchronization module further configured to synchronize block information from a created block to the first block height sequentially and perform sequentially.
9. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of any of claims 1 to 4.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores one or more programs that, when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform the method of any of claims 1 to 4.
CN202010520429.9A 2020-06-08 2020-06-08 Method and device for rapidly participating in consensus of newly added nodes and electronic equipment Active CN111698244B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010520429.9A CN111698244B (en) 2020-06-08 2020-06-08 Method and device for rapidly participating in consensus of newly added nodes and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010520429.9A CN111698244B (en) 2020-06-08 2020-06-08 Method and device for rapidly participating in consensus of newly added nodes and electronic equipment

Publications (2)

Publication Number Publication Date
CN111698244A CN111698244A (en) 2020-09-22
CN111698244B true CN111698244B (en) 2022-05-10

Family

ID=72480000

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010520429.9A Active CN111698244B (en) 2020-06-08 2020-06-08 Method and device for rapidly participating in consensus of newly added nodes and electronic equipment

Country Status (1)

Country Link
CN (1) CN111698244B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111935315B (en) * 2020-09-25 2021-01-12 支付宝(杭州)信息技术有限公司 Block synchronization method and device
CN112800129B (en) * 2020-12-31 2024-04-23 杭州趣链科技有限公司 Block state updating method, device, system and electronic equipment
CN114547655A (en) * 2022-02-25 2022-05-27 蚂蚁区块链科技(上海)有限公司 Block chain node networking and device, and electronic equipment
CN116846916B (en) * 2023-09-01 2023-12-08 武汉趣链数字科技有限公司 Data synchronization method, device, electronic equipment and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878071A (en) * 2017-01-25 2017-06-20 上海钜真金融信息服务有限公司 A kind of block chain common recognition mechanism based on Raft algorithms
CN107040594A (en) * 2017-04-12 2017-08-11 山大地纬软件股份有限公司 The method and device of license block chain node access based on PBFT
CN108243253A (en) * 2018-01-11 2018-07-03 杭州复杂美科技有限公司 A kind of block chain node synchronous mode
CN108600353A (en) * 2018-04-12 2018-09-28 北京天德科技有限公司 A kind of parallel block synchronization method of block chain node
CN109951534A (en) * 2019-02-28 2019-06-28 北京柏链基石科技有限公司 A kind of common recognition methods, devices and systems
KR102041720B1 (en) * 2018-07-20 2019-11-06 숭실대학교산학협력단 Implementing system of flexible blockchain framework and p2p network constructing method thereof, recording medium for performing the method
CN110569305A (en) * 2019-08-27 2019-12-13 网易(杭州)网络有限公司 Block synchronization method, device, medium and computing equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878071A (en) * 2017-01-25 2017-06-20 上海钜真金融信息服务有限公司 A kind of block chain common recognition mechanism based on Raft algorithms
CN107040594A (en) * 2017-04-12 2017-08-11 山大地纬软件股份有限公司 The method and device of license block chain node access based on PBFT
CN108243253A (en) * 2018-01-11 2018-07-03 杭州复杂美科技有限公司 A kind of block chain node synchronous mode
CN108600353A (en) * 2018-04-12 2018-09-28 北京天德科技有限公司 A kind of parallel block synchronization method of block chain node
KR102041720B1 (en) * 2018-07-20 2019-11-06 숭실대학교산학협력단 Implementing system of flexible blockchain framework and p2p network constructing method thereof, recording medium for performing the method
CN109951534A (en) * 2019-02-28 2019-06-28 北京柏链基石科技有限公司 A kind of common recognition methods, devices and systems
CN110569305A (en) * 2019-08-27 2019-12-13 网易(杭州)网络有限公司 Block synchronization method, device, medium and computing equipment

Also Published As

Publication number Publication date
CN111698244A (en) 2020-09-22

Similar Documents

Publication Publication Date Title
CN111698244B (en) Method and device for rapidly participating in consensus of newly added nodes and electronic equipment
CN108648078B (en) Transaction preprocessing method and device and electronic equipment
US10999060B2 (en) Data processing method and apparatus
CN109447810B (en) Parallel block chain consensus method, system, electronic device and computer-readable storage medium
CN110659988B (en) Parallel processing method and device for block chain consensus and execution and electronic equipment
CN108846749B (en) Partitioned transaction execution system and method based on block chain technology
CN110648136B (en) Consensus and transaction synchronous parallel processing method and device and electronic equipment
CN108765159B (en) Block chain-based uplink and state processing method and device and interconnection system
CN112235278B (en) Method and device for monitoring address information of trader and electronic equipment
CN110708163B (en) Block chain consensus method, device and system and electronic equipment
CN109582398B (en) State processing method and device and electronic equipment
CN110648125B (en) Packaging transaction method and device, electronic equipment and storage medium
CN112988470B (en) Consensus method, consensus node and system in alliance chain
CN109345081B (en) Data acquisition method and device and electronic equipment
CN111522648B (en) Transaction processing method and device for block chain and electronic equipment
CN113486109A (en) Data synchronization method and device of heterogeneous database and electronic equipment
CN110675148B (en) Synchronization method and system for verification node set and electronic equipment
CN108710658B (en) Data record storage method and device
CN109815083B (en) Application crash monitoring method and device, electronic equipment and medium
CN113407156B (en) Method and system for generating random number based on decentralized verifiable delay function
CN111884808A (en) Method and device for preventing cross-chain replay of transaction and electronic equipment
CN110599139B (en) Block output method and device in block chain consensus algorithm
CN112351085A (en) Network resource safety sharing method
CN109615465B (en) Service order processing method and device and electronic equipment
CN111030826A (en) Certificate revocation method and device for block chain network and electronic equipment

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