Block chain total data synchronization method and device, equipment, medium and product

By dividing the blockchain full data synchronization process into multiple stages and utilizing multi-core processors for concurrent calculations, the problems of low synchronization efficiency and resource waste in the existing technology are solved, and more efficient data processing and storage are achieved.

CN118535640APending Publication Date: 2024-08-23CHINA CONSTRUCTION BANK +1

Patent Information

Application Number
CN202410364629.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-28
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The existing blockchain full data synchronization process is inefficient and takes a long time, especially the waste of CPU computing and storage resources caused by limited concurrent operations and repeated Merkle Patricia Tree (MPT) construction.

Method used

Divide the full data synchronization process of the blockchain into multiple stages. Each stage processes part of the data in the blockchain, and only constructs the Merkle Patricia Tree once after replaying all transactions, using multi-core processors to concurrently calculate and Optimize data storage and reduce repeated operations.

Benefits of technology

It significantly improves the execution efficiency of full data synchronization in the blockchain, reduces processing time, maximizes the use of hardware resources, and avoids the computing and storage burden caused by multiple MPT constructions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535640A
    Figure CN118535640A
Patent Text Reader

Abstract

The embodiment of the invention provides a block chain total data synchronization method and device, equipment, a medium and a product, and the method comprises the steps: dividing a block chain total data synchronization process into a plurality of stages, each stage being used for processing part of data of each block in a block chain; the block comprises a block head and a block body, and the plurality of stages comprise replaying all transactions in the block body and constructing a Merkel-pavilion tree; and constructing a Merkel-Parene tree: after all transactions in each block body are replayed, establishing a data structure of the Merkel-Parene tree according to a mapping relationship between an account address and an account state of each transaction, and calculating a root hash value. According to the embodiment of the invention, the execution efficiency of block chain total data synchronization can be improved, and the time required for block chain total data synchronization is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of blockchain technology, and in particular, relates to a method, device, equipment, medium and product for synchronizing full blockchain data. Background Art

[0002] In the related technology, the full data synchronization of the blockchain will first download the data of all blocks (including block headers, transactions in blocks, etc.), and process each block in sequence from the creation. The processing process of each block includes: after verifying the block header, transaction and other information, all transactions contained in the current block will be re-executed (replayed). After the transactions in each block are executed, the world state corresponding to the current block will be generated. The processes of downloading full blocks, verifying block headers, replaying transactions, building Merkle Patricia Tree (MPT) trees, verifying transactions, and establishing indexes are carried out simultaneously. It seems that each operation is performed concurrently, but in fact, many operations are often constrained by access resources (such as waiting for read and write network and disk I / O operations), and many operations cannot benefit from parallel computing.

[0003] In addition, in the full data synchronization mode of Ethereum, the MPT tree root will be incrementally updated and recalculated for each block, which increases the CPU computing burden. At the same time, the incremental part does not directly overwrite the original value, but creates a new value. In this way, the original value will always be retained in the local storage, which will take up a lot of storage resources. With the increase in the number of transactions, taking Ethereum as an example, it takes several weeks to fully synchronize all transactions. Summary of the invention

[0004] The embodiments of the present application provide a method, apparatus, device, medium and product for synchronizing the full amount of data of a blockchain, which can improve the execution efficiency of synchronizing the full amount of data of a blockchain and reduce the time required for synchronizing the full amount of data of a blockchain.

[0005] In a first aspect, an embodiment of the present application provides a method for synchronizing the full data of a blockchain, and the method for synchronizing the full data of a blockchain includes: dividing the process of synchronizing the full data of a blockchain into multiple stages, each stage being used to process partial data of each block in the blockchain; a block includes a block header and a block body, and the multiple stages include replaying all transactions in the block body and constructing a Merkle Patricia tree; constructing a Merkle Patricia tree includes: after replaying all transactions in each block body, establishing a data structure of a Merkle Patricia tree according to a mapping relationship between an account address and an account status of each transaction, and calculating a root hash value.

[0006] According to the implementation manner of the first aspect of the present application, a data structure of a Merkle Patricia tree is established according to the mapping relationship between the account address and the account status of each transaction, and a root hash value is calculated, including: performing a hash calculation on the mapping relationship between the account address and the account status of each transaction to obtain a hash value corresponding to each transaction; using the hash value corresponding to each transaction as a node of the Merkle Patricia tree; and calculating a root hash value according to the hash value corresponding to each transaction.

[0007] According to any of the aforementioned implementations of the first aspect of the present application, before replaying all transactions in the block body, the multiple stages also include: downloading the block headers of each block in the blockchain; indexing the block number by block hash; downloading the block body; restoring the sender address of the transaction; after constructing the Merkle Patricia tree, the multiple stages also include: generating an index.

[0008] According to any of the aforementioned implementations of the first aspect of the present application, downloading block headers of each block in the blockchain includes: downloading block headers of multiple blocks in the blockchain; using a multi-core processor to concurrently verify the block headers of multiple blocks; generating first storage data, the first storage data including a mapping of block hash to block header and a mapping of blockchain height hash to block.

[0009] According to any of the aforementioned implementations of the first aspect of the present application, indexing block numbers by block hash includes: calculating a mapping of block hash to block height; pre-sorting the mapping of block hash to block height; and batch inserting the pre-sorted mapping of block hash to block height into a database.

[0010] According to any of the aforementioned implementations of the first aspect of the present application, downloading a block body includes: downloading a block body corresponding to a block header, the block body including at least one transaction; calculating and verifying whether a root hash value in a block header corresponding to the transaction in the block body matches; generating second storage data, the second storage data including a mapping of a blockchain height to a transaction start ID within the blockchain and a mapping of a transaction ID within the blockchain to the transaction itself.

[0011] According to any of the aforementioned implementations of the first aspect of the present application, recovering the sender address of a transaction includes: based on the digital signature and multi-core processor in each transaction, concurrently recovering the public key information of the sender of each transaction, and obtaining the sender address of each transaction from the public key information of the sender of each transaction.

[0012] According to any of the aforementioned implementations of the first aspect of the present application, replaying all transactions in a block body includes: for each transaction, calculating a mapping from an account address to account data and a mapping from an account address hash value to account data; for each block, recording a mapping from a modified state object to a value of the modified state object before modification; for each transaction, calculating transaction data, and comparing a hash value of the transaction with a root hash value in a root node field.

[0013] According to any of the aforementioned implementations of the first aspect of the present application, generating an index includes: generating an account history record index according to the account address, the account history record index including a mapping of the account address to a block number sequence; generating a transaction lookup index, the transaction lookup index including a mapping of a transaction hash to a transaction location.

[0014] In the second aspect, an embodiment of the present application provides a device for synchronizing the full data of a blockchain. The device for synchronizing the full data of a blockchain includes: a division module, which is used to divide the process of synchronizing the full data of a blockchain into multiple stages, each stage is used to process part of the data of each block in the blockchain, the block includes a block header and a block body, and the multiple stages include replaying all transactions in the block body and building a Merkle Patricia tree; a replay module, which is used to replay all transactions in the block body; a construction module, which is used to establish a data structure of a Merkle Patricia tree according to the mapping relationship between the account address and the account status of each transaction after replaying all transactions in each block body, and calculate the root hash value.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the method for synchronizing the full amount of blockchain data provided in the first aspect are implemented.

[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for synchronizing the full amount of blockchain data provided in the first aspect are implemented.

[0017] In a fifth aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the steps of the method for synchronizing the full amount of blockchain data provided in the first aspect.

[0018] The method, device, equipment, medium and product for synchronizing the full amount of data of the blockchain of the embodiment of the present application, on the one hand, divides the process of synchronizing the full amount of data of the blockchain into multiple stages, each stage is used to process part of the data of each block in the blockchain, which is conducive to improving the execution efficiency, giving full play to the hardware resources available for each blockchain node, improving the processing performance of the full amount of block data, and reducing the time required for processing the full amount of data. On the other hand, after replaying all the transactions in each of the block bodies, the Merkle Patricia tree is constructed, and there is no need to repeat the construction of the Merkle Patricia tree for each block. The Merkle Patricia tree is constructed only once for all transactions of multiple blocks. The separation of this step can greatly shorten the calculation time required for the synchronization of the full amount of data of the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0020] Figure 1 A flowchart of a method for synchronizing the full amount of blockchain data provided in an embodiment of the present application;

[0021] Figure 2 An operation diagram of S101 in the method for synchronizing the full amount of blockchain data provided in an embodiment of the present application;

[0022] Figure 3 A flowchart of S103 in the method for synchronizing the full amount of blockchain data provided in an embodiment of the present application;

[0023] Figure 4 Another flowchart of the method for synchronizing the full amount of blockchain data provided in an embodiment of the present application;

[0024] Figure 5 A schematic diagram of the structure of a device for synchronizing the full amount of blockchain data provided in an embodiment of the present application;

[0025] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0026] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0027] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0028] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0029] It is obvious to those skilled in the art that various modifications and changes can be made in the present application without departing from the spirit or scope of the present application. Therefore, the present application is intended to cover modifications and changes of the present application that fall within the scope of the corresponding claims (technical solutions for protection) and their equivalents. It should be noted that the implementation methods provided in the embodiments of the present application can be combined with each other without contradiction.

[0030] The acquisition, transmission, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of this application, some existing solutions in the industry such as certain software, components, and models may be mentioned, and they should be considered as exemplary. Their purpose is only to illustrate the feasibility of the implementation of the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.

[0031] Before explaining the technical solutions provided by the embodiments of the present application, in order to facilitate the understanding of the embodiments of the present application, the technical terms involved in the present application are explained below.

[0032] Full Node: A type of node in the blockchain. Simply put, it is a node used for computing in Ethereum and virtual resource systems. It stores complete blockchain data (in order to save space, a portion of historical state data will be cropped, and this portion of data can be calculated and restored in real time when needed), participates in block verification (or consensus), and verifies all blocks and states. It provides services for the network and provides data upon request.

[0033] Full Sync: A method of synchronizing blockchain data. Full Sync downloads all blocks (including block headers, transactions, receipts, etc.) and executes each block from the genesis to generate the blockchain state incrementally. By verifying each transaction, trust is minimized and security is provided. As the number of transactions increases, it may take days to weeks to process all transactions.

[0034] Write amplification: The ratio of the size of data actually written to the hard disk drive (HDD) / solid state drive (SSD) to the size of data required to be written by the program (greater than 1). Under normal circumstances, the data written to the HDD / SSD is more than the data written by the upper-layer program. Since the key-value (KV) system used by most blockchain systems uses the LSM-Tree data structure, if the operation is discrete random write or frequent data deletion, it will cause the sorting and merging operations of the internal hierarchical data to occur during the write, which may eventually lead to the erasure, copying, sorting and other operations of a large amount of data. The service life of the SSD is related to its write volume. Excessive write amplification will greatly shorten the service life of the SSD. Because the SSD does not support overwrite, it must be erased before writing. The average number of erases for each SSD block (block is the basic unit of SSD erase operation) is limited. The sequential read and write performance of the HDD is far superior to the random read and write performance.

[0035] MPT: Merkle Patricia Trie is a data structure that is often used to implement state storage in distributed ledgers (such as the Ethereum blockchain). It is designed based on the Merkle tree and prefix tree (Patricia Trie). This data structure allows efficient storage and retrieval of key-value data, and can provide data immutability and verification, and is used to represent the entire world state after the current block transaction is executed. The Merkle tree is immutable, and any change in the data will cause the root hash value to change, so it is easy to detect whether the data has been tampered with. See the link above for details.

[0036] Block transaction replay: Blockchain transactions are similar to the input value of a state machine. The state machine receives the input value and executes the transaction internally (usually through the smart contract execution engine), and the output value is the next state machine (that is, the internal state has changed and is different from the previous state machine). Replay means re-executing the transactions in the block after downloading it to re-establish the world state.

[0037] Hash, in this article, has the same meaning. It usually refers to converting input data of any length into an output value of fixed length through a hash function. This output value is usually called a hash value or hash code. A hash function is a mathematical algorithm that maps input data into a fixed-size binary string, usually a fixed-length sequence of numbers or letters.

[0038] Key-Value (KV) storage database is a type of NoSQL database used to store and retrieve data organized in the form of key-value pairs. In a KV database, each data item consists of a unique key (Key) and an associated value (Value). These key-value pairs can be used to efficiently store and retrieve data. The most commonly used KV databases in blockchain systems are LevelDB and RocksDB. The underlying data structure is the LSM-Tree hierarchical storage structure.

[0039] LSM-Tree, the full name of Log-Structured Merge-Tree, is a data structure for high-performance storage and retrieval of data, commonly used in distributed storage systems and NoSQL databases. LSM-Tree is designed to solve the performance bottleneck of traditional disk storage systems, especially the efficient processing of write operations. LSM-Tree adopts a multi-level storage structure, including multiple different components. It usually includes a write log, a memory table (Memtable), and multiple disk levels (SSTables, Sorted String Tables). Write operations are first appended to the write log, then written to the memory table, and finally merged into SSTables of different levels periodically in the background. The data merge operation is the key feature of LSM-Tree. In the background, the merge operation between SSTables merges data with the same key and generates a new SSTable. This process helps to reduce the waste of storage space and improve read performance. The merge process is usually performed according to the order of the key, which can improve read performance.

[0040] In order to facilitate the understanding of the embodiments of the present application, the problems existing in the related art are specifically described below:

[0041] In related technologies, the full data synchronization of blockchain will first download all block data (including block headers, transactions within blocks, etc.), and process each block in order from the creation. The processing of each block includes: after verifying the block header, transaction and other information, all transactions contained in the current block will be re-executed (replayed). After the transactions in each block are executed, the world state corresponding to the current block will be generated.

[0042] For ease of understanding, this application uses Ethereum as an example to illustrate the synchronization method. Most blockchains on the market use the Ethereum account model and the Merkle Patricia tree data structure, so the applicability of this application includes but is not limited to Ethereum, and is applicable to data synchronization technology of most blockchain systems.

[0043] The update of Ethereum's world state is similar to a state machine. The current block updates the blockchain state in an incremental manner after executing transactions based on the world state of the parent block. Each world state is constructed by building a Merkle Patricia (MPT) tree. The root of the Merkle Patricia tree will be encoded in the blockchain header. Root corresponds to the only snapshot of the current state. Among them, the value of Root is a hash value, which is equivalent to hashing all the data of the current state according to the MPT encoding rules. After each blockchain replays the transaction, it needs to update the Merkle Patricia tree in an incremental manner based on the current Merkle Patricia tree according to the state generated by the transaction, recalculate the hash value of Root, compare whether the value is consistent with the Root value in the currently downloaded block header, and store the current world state in local storage. The current number of Ethereum blocks is 18161652, which is equivalent to this many cycles.

[0044] In related technologies, downloading full blocks, verifying block headers, replaying transactions, building Merkle Patricia trees, verifying transactions, and creating indexes are all done simultaneously. It seems that each operation is done concurrently, but in fact, many operations cannot benefit from parallel computing due to resource constraints (such as waiting for network read / write and disk I / O operations).

[0045] In addition, in the full data synchronization mode of Ethereum, the MPT tree root will be incrementally updated and recalculated for each block, which increases the CPU computing burden. At the same time, the incremental part does not directly overwrite the original value, but creates a new value. In this way, the original value will always be retained in the local storage, which will take up a lot of storage resources. With the increase in the number of transactions, taking Ethereum as an example, it takes several weeks to fully synchronize all transactions.

[0046] In summary, in the related technologies, the processes of downloading full blocks, verifying block headers, replaying transactions, building Merkle Patricia trees, verifying transactions, and establishing indexes are mixed together, which affects the analysis and optimization of the processing process. For example, some CPU-intensive operations are subject to input / output (I / O) constraints or resource conflicts (such as waiting for read / write network and disk I / O operations) and cannot maximize the use of existing multi-core resources to achieve efficient concurrency. In addition, in the related technologies, the world state is incrementally updated and the MPT tree root is recalculated for each block, which increases the CPU computing burden; the update of an account will link the incremental changes of all intermediate nodes from the root node to the leaf node path, and the incremental changes do not directly overwrite the original values, but create new key values. In this way, many original old state values ​​will remain in local storage, which will occupy a lot of storage resources. The general practice is to spend a separate time to trim its old state data. With the increase in the number of transactions, taking Ethereum as an example, it takes several weeks to fully synchronize all transactions.

[0047] In view of the above research findings of the inventors, the embodiments of the present application provide a method, device, equipment, medium and product for full data synchronization of blockchain, which can solve the technical problems of low execution efficiency of full data synchronization of blockchain and long time required for full data synchronization of blockchain existing in the related technology.

[0048] The technical concept of the embodiment of the present application is: on the one hand, the process of synchronizing the full amount of blockchain data is divided into multiple stages, each stage is used to process part of the data of each block in the blockchain, which is conducive to improving the execution efficiency, giving full play to the hardware resources available for each blockchain node, improving the processing performance of the full amount of block data, and reducing the time required for processing the full amount of data. On the other hand, after replaying all the transactions in each of the block bodies, the Merkle Patricia tree is constructed, and there is no need to repeat the construction of the Merkle Patricia tree for each block. All transactions of multiple blocks only need to build the Merkle Patricia tree once. The separation of this step can greatly shorten the calculation time required for the synchronization of the full amount of blockchain data.

[0049] The following first introduces the method for synchronizing the full amount of blockchain data provided by the embodiment of the present application.

[0050] Figure 1 A flowchart of a method for synchronizing the full amount of blockchain data provided in an embodiment of the present application. Figure 1 As shown, the method for synchronizing the full amount of blockchain data may include the following steps S101 to S103.

[0051] S101, dividing the process of synchronizing the full amount of blockchain data into multiple stages, wherein each stage is used to process part of the data of each block in the blockchain.

[0052] Figure 2 This is an operation diagram of S101 in the method for synchronizing the full amount of blockchain data provided in the embodiment of the present application. Figure 2 As shown, the processing of all blocks (block 1 to block N) is divided into M stages, where N and M are integers greater than 1. Each stage only processes part of the data of each block. Since each stage only processes part of the data of each block, most stages will be completed quickly. In addition, each stage can also choose to support concurrent execution according to the operation type (such as CPU intensive), thereby further improving execution efficiency.

[0053] This application optimizes the operation of a block and divides it into M stages. Each stage processes part of the data of all blocks and completes part of the work. The operations in each stage can be performed concurrently. Overall, each stage is executed sequentially, but each stage can use multi-core parallel processing and can be optimized independently, which is conducive to improving execution efficiency.

[0054] In this way, this application divides the blockchain full data synchronization process into several stages (or steps). The purpose of extraction in each stage is to improve execution efficiency, ultimately maximizing the available hardware resources of each blockchain node, improving the processing performance of the full amount of block data, and reducing the time required to process the full amount of data. For example, the time can be reduced from weeks to days.

[0055] In the embodiment of the present application, a block may include a block header and a block body. The multiple stages may include S102, replaying all transactions in the block body and S103, constructing a Merkle Patricia tree.

[0056] S103, constructing a Merkle Patricia tree may include the following steps:

[0057] After replaying all transactions in each block, the data structure of the Merkle Patricia tree is established based on the mapping relationship between the account address and account status of each transaction, and the root hash value is calculated.

[0058] The global state consists of a mapping between account addresses and account states. This mapping can be stored in a Merkle Patricia tree data structure. Among them, the account state can include the cumulative number of transactions initiated (nonce), account balance (balance), the hash value of the smart contract code (codeHash), and the root node hash value of the contract storage tree (storageRoot). The Merkle Patricia tree can be used to store the state, and the root hash value of the Merkle Patricia tree can be stored in each block header to ensure data consistency and security.

[0059] The method for synchronizing the full amount of data of the blockchain of the embodiment of the present application, on the one hand, divides the process of synchronizing the full amount of data of the blockchain into multiple stages, each stage is used to process part of the data of each block in the blockchain, which is conducive to improving the execution efficiency, giving full play to the hardware resources available for each blockchain node, improving the processing performance of the full amount of block data, and reducing the time required for processing the full amount of data. On the other hand, after replaying all the transactions in each of the block bodies, the Merkle Patricia tree is constructed, and there is no need to repeat the construction of the Merkle Patricia tree for each block. The Merkle Patricia tree is constructed only once for all transactions of multiple blocks. The separation of this step can greatly shorten the calculation time required for the synchronization of the full amount of data of the blockchain.

[0060] Figure 3 A flowchart of S103 in the method for synchronizing the full amount of blockchain data provided in the embodiment of the present application. Figure 3 As shown, according to some embodiments of the present application, optionally, S103, establishing a Merkle Patricia tree data structure according to the mapping relationship between the account address and the account status of each transaction, and calculating the root hash value may include the following steps S301 to S303.

[0061] S301. Perform hash calculation on the mapping relationship between the account address and the account status of each transaction to obtain the hash value corresponding to each transaction.

[0062] S302: Use the hash value corresponding to each transaction as a node of the Merkle Patricia tree.

[0063] S303. Calculate the root hash value according to the hash value corresponding to each transaction.

[0064] The data at the bottom of the Merkle Patricia tree is obtained by splitting the stored data into blocks, then splitting the blocks into buckets, and finally taking the hash of each bucket and repeating the same process until the total number of remaining hashes becomes only one: the root hash.

[0065] The S103 phase does not involve any network activity and is CPU intensive. Based on the current status of all accounts, the intermediate state hash and the root state hash (i.e., the root hash value) are created or updated. This phase can be implemented according to certain algorithms to speed up the construction. At the end of this phase, the root hash value becomes known and is compared and verified against the root hash value of the current latest blockchain header.

[0066] When calculating the root hash value, the information of the MPT tree will be stored in the database so that the incremental calculation of the root hash value can be more efficiently calculated later. If it is the first initial synchronization, the complete MPT tree and its root hash value will be built. If it has been built, the incremental modification part between the MPT tree block height at that time and the current block height can be calculated. Only the incremental modification and calculation of the current MPT tree will be made, which will eventually reflect the change of the root hash value of the MPT tree.

[0067] In some specific embodiments, optionally, the process of synchronizing the full amount of blockchain data can be divided into 7 stages, that is, M=7.

[0068] Figure 4 Another flowchart of the method for synchronizing the full amount of blockchain data provided in the embodiment of the present application. Figure 4 As shown, according to some embodiments of the present application, optionally, before S102, replaying all transactions in the block body, the multiple stages may also include:

[0069] S401. Download the block headers of each block in the blockchain;

[0070] S402, indexing the block number by block hash;

[0071] S403, downloading the block body;

[0072] S404: Restore the sender address of the transaction.

[0073] After S103, constructing the Merkle Patricia tree, the multiple stages may also include:

[0074] S405: Generate an index.

[0075] In this way, the process of full blockchain data synchronization is divided into seven stages: downloading the block headers of each block in the blockchain, indexing the block number by block hash, downloading the block body, restoring the sender address of the transaction, replaying all transactions in the block body, building the Merkle Patricia tree and generating the index. In this way, analyzing a single stage can better understand the performance of the stage, and conduct targeted process analysis and optimization for the stage. Secondly, the input and output of each stage are clearly defined, and a general interface can be defined. Specific functional modules can be developed according to different blockchains, and functional assembly can be completed. Thirdly, multiple stages are executed sequentially. When concurrent execution is supported in each stage (previously concurrent operations can still be executed concurrently), the efficiency will not be reduced. This separation is to better utilize multi-core concurrency. Thirdly, separating network-intensive operation stages, such as using download mechanisms such as data compression and network acceleration, can maximize the use of broadband and focus on downloading data. Thirdly, for the CPU-intensive operation stages in multiple stages, multi-core processing can be maximized. By designing dedicated concurrent algorithms, the concurrent algorithms are less affected by I / O interference and can greatly improve the concurrency efficiency.

[0076] In some embodiments, when a new block is generated during the synchronization of the full data of the blockchain, the above multiple stages can be executed in a loop, and the second loop to the nth loop can only make changes to the incremental changes, such as updating the data structure of the Merkle Patricia tree according to the increment, where n≥2 and is an integer.

[0077] In some embodiments, in each stage, the parsed key data can be stored in the KV database of the blockchain in the form of key-value pairs (Key=>Value), and the value (Value) can be efficiently queried through the key (Key), which is convenient for subsequent efficient query. The data stored in each stage can provide query services for subsequent stages, and can also provide blockchain system query services.

[0078] According to some embodiments of the present application, optionally, S401, downloading the block headers of each block in the blockchain, may include the following steps 1 to 3.

[0079] Step 1: Download the block headers of multiple blocks in the blockchain.

[0080] Taking Ethereum as an example, the block header information of all blocks can be downloaded from the Ethereum network. Since the block header occupies a small space, the full amount of block header information can be obtained.

[0081] Step 2: Use a multi-core processor to concurrently verify the block headers of multiple blocks.

[0082] After obtaining the block header information of multiple blocks in the blockchain, the validity of the block headers of multiple blocks can be verified, such as the parent block Hash verification, proof of work and other information verification. The verification work is CPU intensive, and multi-core processors can be used to design concurrent verification codes to concurrently verify the block headers of multiple blocks, which can improve the verification efficiency.

[0083] Step 3: Generate first storage data, the first storage data includes a mapping of block hash to block header and a mapping of blockchain height hash to block.

[0084] Among them, the block hash to block header mapping: hash=>RLP encoding of header (RLP is a storage format for data compression encoding).

[0085] Mapping of blockchain height (and blockchain number) hash to block: height=>hash.

[0086] According to some embodiments of the present application, optionally, S402, indexing the block number by block hash, may include the following steps four to six.

[0087] Step 4: Calculate the mapping from block hash to block height.

[0088] The mapping of block hash to block height, i.e. the reverse mapping, can be calculated and persisted to a database table.

[0089] Step 5: Pre-sort the mapping of block hash to block height.

[0090] Step 6: Map the pre-sorted block hashes to block heights and insert them into the database in batches.

[0091] S402 could have been performed at S401. The reason for extracting it separately is that block hashes look like pseudo-random numbers, so inserting them into the blockchain KV database in the order they appear will cause unnecessary delays on some disks with high access latency, such as ordinary disks HDD. To alleviate this problem, by pre-sorting the mapping of block hashes to block heights before inserting them into the database in batches, this method can significantly reduce the write amplification problem of the KV database. It will be more efficient to extract this operation independently to this stage S402.

[0092] In this way, by separating the KV data disk write operation, pre-sorting the key values, and writing them into the KV database in batches in the sorted order, the write amplification problem of the KV database can be greatly reduced, and the data writing efficiency can be accelerated.

[0093] According to some embodiments of the present application, optionally, S403, downloading the block body, may include the following steps seven to nine.

[0094] Step 7: Download the block body corresponding to the block header, which includes at least one transaction.

[0095] Download the block body corresponding to the block header. This is the most intensive network connection stage. Most of the data is downloaded in this stage. This stage is mainly network and disk I / O intensive operations. The block body can include at least one transaction information.

[0096] Step 8. Calculate and verify whether the root hash value in the block header corresponding to the transaction in the block body matches.

[0097] Step 9: Generate second storage data, which includes a mapping from the blockchain height to the transaction start ID in the blockchain and a mapping from the transaction ID in the blockchain to the transaction itself.

[0098] Mapping of blockchain height to transaction start ID within the blockchain: height=>(start_tx_id; tx_count).

[0099] The mapping of the transaction ID within the blockchain to the transaction itself: tx_id=>RLP encoding of tx.

[0100] In this way, the second storage data is generated, which can facilitate the use of blockchain height (block number) to query transaction information.

[0101] According to some embodiments of the present application, optionally, S404, restoring the sender address of the transaction, may include the following steps:

[0102] Based on the digital signature in each transaction and the multi-core processor, the public key information of the sender of each transaction is concurrently restored, and the address of the sender of each transaction is obtained from the public key information of the sender of each transaction.

[0103] S404 does not require any network connection. In some blockchain systems (such as Ethereum), in order to save space for each transaction, the sender address of each transaction is not in the transaction body. The sender's public key information can be restored through the digital signature in the transaction (such as ECDSA digital signature). Then the sender's address can be obtained from the public key and stored in the database. Verification work is CPU-intensive. This stage is second only to the block transaction replay stage. Multi-core processors can be used to design concurrent computing codes, which can greatly reduce recovery time. If the transaction structure of some blockchain systems comes with the sender address, this step can be omitted. Only persistence operations need to be completed:

[0104] Mapping of block height to address list of all senders in the block: height=>sender_0|sender_1|…|sender_{tx_count-1}.

[0105] According to some embodiments of the present application, optionally, S102, replaying all transactions in the block body, may include the following steps ten to twelve.

[0106] The process of S102 can be single-threaded, and transactions can be executed one by one without participating in any network activities. It is CPU and disk I / O intensive and the most time-consuming stage. In order to ensure that each block transaction is legal and compliant and to establish the world state, in the full synchronization mode, transactions of all blocks can be executed in sequence in the blockchain smart contract.

[0107] Step 10: For each transaction, calculate the mapping from account address to account data and the mapping from account address hash value to account data.

[0108] As transactions are replayed, three main types of data will be generated. The first is the current world state, which is a mapping of account addresses and their hashes to account data.

[0109] Step 11: For each block, record the mapping between the modified state object and the value of the modified state object before modification.

[0110] The second is the record of state changes, that is, for each block, record the mapping of modified state objects and the values ​​of these objects before modification.

[0111] Step 12: For each transaction, calculate the transaction data and compare the hash value of the transaction with the root hash value in the root node field.

[0112] For each transaction, the transaction data can be calculated and the Merkle hash of the transaction can be compared with the root hash in the root node (ReceiptHash) field.

[0113] Among them, the account address to account data mapping: account_address=>(balance; nonce; code_hash; storage_hash).

[0114] Account address hash value to account data mapping: keccak256(account_address)=>(balance; nonce; code_hash; storage_hash).

[0115] Account modification set, block height to account address, account address to data before modification: height=>account_address=>(prev_balance; prev_nonce; prev_code_hash).

[0116] Mapping of blockchain height to transaction receipts: height=>CBOR encoding of receipts.

[0117] During the execution of this phase, this application does not build and check the root hash of the world state, but delays it to the next phase (building the Merkle Patricia tree). The advantage of this is that there is no need to repeat the construction and checking of the MPT root for each block. In the next phase, only the MPT root construction and verification work is performed once for all account addresses. The separation of this step can greatly shorten the calculation time required for synchronization.

[0118] According to some embodiments of the present application, optionally, S405, generating an index, may include step thirteen and step fourteen.

[0119] Step 13: Generate an account history index according to the account address. The account history index includes a mapping from the account address to the block number sequence.

[0120] This phase can create additional indexes by account address, allowing quick access to the list of block numbers that modified a specific account. The account history index can include a mapping of account addresses to block number sequences.

[0121] Sequence of account address to block number that caused the account status to change: account_address=>bitmap of heights where account was modified.

[0122] Step 14: Generate a transaction search index, which includes a mapping from transaction hash to transaction location.

[0123] Establish a mapping from transaction hash to the transaction location (block number). Mapping from transaction hash to block height: tx_hash=>height.

[0124] The mapping from the transaction ID in the blockchain established in S403 to the transaction itself, height=>tx_id=>RLPof transaction, is equivalent to indirectly querying the transaction body data using the transaction hash.

[0125] like Figure 4 As shown, in some embodiments, after S405, generating the index, the method for synchronizing the full amount of blockchain data may also include the following steps: S406, starting calculation.

[0126] After the synchronization is completed, you can start the calculation mode and exit the above 7-stage cycle mode.

[0127] Based on the method for synchronizing the full amount of blockchain data provided in the above embodiment, the present application also provides a specific implementation method of the device for synchronizing the full amount of blockchain data. Please refer to the following embodiment.

[0128] Figure 5 A schematic diagram of a structure of a device for synchronizing the full amount of blockchain data provided in an embodiment of the present application. Figure 5 As shown, the device 50 for synchronizing the full amount of blockchain data provided in the embodiment of the present application may include the following modules:

[0129] A division module 501 is used to divide the process of synchronizing the full amount of blockchain data into multiple stages, each stage is used to process part of the data of each block in the blockchain, the block includes a block header and a block body, and the multiple stages include replaying all transactions in the block body and constructing a Merkle Patricia tree;

[0130] Replay module 502, used to replay all transactions in the block body;

[0131] The construction module 503 is used to establish the data structure of the Merkle Patricia tree and calculate the root hash value according to the mapping relationship between the account address and the account status of each transaction after replaying all transactions in each block body.

[0132] The device for synchronizing the full amount of data of the blockchain of the embodiment of the present application, on the one hand, divides the process of synchronizing the full amount of data of the blockchain into multiple stages, each stage is used to process part of the data of each block in the blockchain, which is conducive to improving the execution efficiency, giving full play to the hardware resources available for each blockchain node, improving the processing performance of the full amount of block data, and reducing the time required for processing the full amount of data. On the other hand, after replaying all the transactions in each block body, the Merkle Patricia tree is constructed, and there is no need to repeat the construction of the Merkle Patricia tree for each block. The Merkle Patricia tree is constructed only once for all transactions of multiple blocks. The separation of this step can greatly shorten the calculation time required for the synchronization of the full amount of data of the blockchain.

[0133] According to some embodiments of the present application, optionally, the construction module 503 is specifically used to perform hash calculation on the mapping relationship between the account address and the account status of each transaction to obtain a hash value corresponding to each transaction; use the hash value corresponding to each transaction as a node of the Merkle Patricia tree; and calculate the root hash value based on the hash value corresponding to each transaction.

[0134] According to some embodiments of the present application, optionally, before replaying all transactions in the block body, the multiple stages also include: downloading the block headers of each block in the blockchain; indexing the block number by block hash; downloading the block body; restoring the sender address of the transaction; after building the Merkle Patricia tree, the multiple stages also include: generating an index.

[0135] According to some embodiments of the present application, optionally, the device 50 for synchronizing the full amount of blockchain data provided in the embodiments of the present application may also include a first download module for downloading block headers of multiple blocks in the blockchain; using a multi-core processor to concurrently verify the block headers of multiple blocks; and generating first storage data, the first storage data including a mapping of block hash to block header and a mapping of blockchain height hash to block.

[0136] According to some embodiments of the present application, optionally, the device 50 for synchronizing the full amount of blockchain data provided in the embodiments of the present application may also include a hash module for calculating the mapping of block hash to block height; pre-sorting the mapping of block hash to block height; and batch inserting the mapping of pre-sorted block hash to block height into the database.

[0137] According to some embodiments of the present application, optionally, the device 50 for synchronizing the full amount of blockchain data provided in the embodiments of the present application may also include a second download module, which is used to download a block body corresponding to a block header, where the block body includes at least one transaction; calculate and verify whether the root hash value in the block header corresponding to the transaction in the block body matches; generate second storage data, and the second storage data includes a mapping of the blockchain height to the transaction start ID in the blockchain and a mapping of the transaction ID in the blockchain to the transaction itself.

[0138] According to some embodiments of the present application, optionally, the device 50 for synchronizing the full amount of blockchain data provided by the embodiments of the present application may also include a recovery module for concurrently recovering the public key information of the sender of each transaction based on the digital signature and multi-core processor in each transaction, and obtaining the address of the sender of each transaction from the public key information of the sender of each transaction.

[0139] According to some embodiments of the present application, optionally, the device 50 for synchronizing the full amount of blockchain data provided by the embodiments of the present application may also include a replay module, which is used to calculate the mapping of account address to account data and the mapping of account address hash value to account data for each transaction; for each block, record the mapping of modified state objects and the values ​​of the modified state objects before modification; for each transaction, calculate the transaction data, and compare the hash value of the transaction with the root hash value in the root node field.

[0140] According to some embodiments of the present application, optionally, the device 50 for synchronizing the full amount of blockchain data provided by the embodiments of the present application may also include a generation module for generating an account history index according to the account address, the account history index including a mapping of the account address to the block number sequence; and generating a transaction lookup index including a mapping of the transaction hash to the transaction location.

[0141] Figure 5 Each module / unit in the device shown has the function of implementing each step in the method for synchronizing the full amount of blockchain data provided by the above method embodiment, and can achieve its corresponding technical effect. For the sake of concise description, it will not be repeated here.

[0142] Based on the method for synchronizing the full amount of blockchain data provided in the above embodiment, the present application also provides a specific implementation method of the electronic device accordingly. Please refer to the following embodiment.

[0143] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0144] The electronic device may include a processor 601 and a memory 602 storing computer program instructions.

[0145] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0146] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In one example, the memory 602 may include a removable or non-removable (or fixed) medium, or the memory 602 is a non-volatile solid-state memory. The memory 602 may be inside or outside the electronic device.

[0147] In one example, the memory 602 may be a read-only memory (ROM). In one example, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of these.

[0148] The memory 602 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present application.

[0149] The processor 601 implements the method / steps in the above method embodiment by reading and executing the computer program instructions stored in the memory 602, and achieves the corresponding technical effects achieved by the method embodiment executing its method / steps, which will not be repeated here for the sake of brevity.

[0150] In one example, the electronic device may further include a communication interface 603 and a bus 610. Figure 6 As shown, the processor 601, the memory 602, and the communication interface 603 are connected via a bus 610 and communicate with each other.

[0151] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0152] Bus 610 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (Accelerated Graphics Port, AGP) or other graphics bus, enhanced industry standard architecture (Extended Industry Standard Architecture, EISA) bus, front side bus (Front Side Bus, FSB), Hyper Transport (Hyper Transport, HT) interconnection, industry standard architecture (Industry Standard Architecture, ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 610 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0153] In addition, in combination with the method for synchronizing the full amount of blockchain data in the above embodiment, the embodiment of the present application may provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the methods for synchronizing the full amount of blockchain data in the above embodiment is implemented. Examples of computer-readable storage media include non-transitory computer-readable storage media, such as electronic circuits, semiconductor memory devices, ROM, random access memory, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, and hard disks.

[0154] In addition, in combination with the method, device, and readable storage medium for synchronizing the full amount of blockchain data in the above embodiments, the embodiments of the present application may provide a computer program product for implementation. When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device executes any one of the methods for synchronizing the full amount of blockchain data in the above embodiments.

[0155] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0156] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or communication link by a data signal carried in a carrier. "Machine-readable medium" may include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0157] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0158] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.

[0159] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A method for synchronizing the full amount of blockchain data. It is characterized in that include: The process of synchronizing the full amount of blockchain data is divided into multiple stages, each stage is used to process part of the data of each block in the blockchain; The block includes a block header and a block body, and the multiple stages include replaying all transactions in the block body and constructing a Merkle Patricia tree; The construction of the Merkle Patricia tree includes: After replaying all transactions in each of the block bodies, the data structure of the Merkle Patricia tree is established according to the mapping relationship between the account address and the account status of each transaction, and the root hash value is calculated.

2. The method according to claim 1, It is characterized in that The step of establishing the data structure of the Merkle Patricia tree according to the mapping relationship between the account address and the account status of each transaction and calculating the root hash value includes: Perform hash calculation on the mapping relationship between the account address and account status of each transaction to obtain the hash value corresponding to each transaction; Using the hash value corresponding to each transaction as a node of the Merkle Patricia tree; Calculate the root hash value based on the hash values ​​corresponding to each transaction.

3. The method according to claim 1, It is characterized in that Before replaying all transactions in the block body, the multiple stages further include: Downloading the block headers of each block in the blockchain; Index the block number by block hash; Download the block body; The sender address of the recovery transaction; After constructing the Merkle Patricia tree, the multiple stages further include: Generate index.

4. The method according to claim 3, It is characterized in that The downloading of the block headers of each block in the blockchain includes: Downloading block headers of multiple blocks in the blockchain; Using a multi-core processor to concurrently verify the block headers of the multiple blocks; Generate first storage data, the first storage data including a mapping of block hash to block header and a mapping of blockchain height hash to block.

5. The method according to claim 3, It is characterized in that The block number is indexed by block hash, including: Calculate the mapping from block hash to block height; Pre-sort the mapping of block hashes to block heights; The mapping of pre-sorted block hashes to block heights is inserted into the database in batches.

6. The method according to claim 3, It is characterized in that The download block body includes: Downloading a block body corresponding to a block header, wherein the block body includes at least one transaction; Calculate and verify whether the root hash value in the block header corresponding to the transaction in the block body matches; Generate second storage data, the second storage data including a mapping of the blockchain height to the transaction start ID within the blockchain and a mapping of the transaction ID within the blockchain to the transaction itself.

7. The method according to claim 6, It is characterized in that The sender address of the recovery transaction includes: Based on the digital signature in each transaction and the multi-core processor, the public key information of the sender of each transaction is concurrently restored, and the address of the sender of each transaction is obtained from the public key information of the sender of each transaction.

8. The method according to claim 1, It is characterized in that The replaying of all transactions in the block body includes: For each transaction, calculate the mapping from account address to account data and the mapping from account address hash value to account data; For each block, record a mapping between a modified state object and a value of the modified state object before modification; For each transaction, the transaction data is calculated and the hash value of the transaction is compared with the root hash value in the root node field.

9. The method according to claim 8, It is characterized in that Generating the index includes: Generate an account history record index according to the account address, wherein the account history record index includes a mapping from the account address to the block number sequence; A transaction lookup index is generated, the transaction lookup index comprising a mapping of transaction hashes to transaction locations.

10. A device for synchronizing the full amount of blockchain data, It is characterized in that include: A partitioning module, for dividing the process of synchronizing the full amount of blockchain data into multiple stages, each stage is used to process part of the data of each block in the blockchain, the block includes a block header and a block body, and the multiple stages include replaying all transactions in the block body and constructing a Merkle Patricia tree; A replay module, used to replay all transactions in the block body; A construction module is used to establish the data structure of the Merkle Patricia tree and calculate the root hash value according to the mapping relationship between the account address and the account status of each transaction after replaying all the transactions in each of the block bodies.

11. An electronic device, It is characterized in that The electronic device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the method for synchronizing the full amount of blockchain data as described in any one of claims 1 to 9 are implemented.

12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the method for synchronizing the full amount of blockchain data as described in any one of claims 1 to 9 are implemented.

13. A computer program product, It is characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device performs the steps of the method for synchronizing the full amount of blockchain data as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • MPT tree batch updating method in block chain, electronic equipment and storage medium

    CN115617818A

  • Blockchain state data synchronization method and apparatus, and electronic device

    WO2021017436A1

Cited By

  • Block chain node difference synchronization method, electronic equipment and chip system

    CN119539802A

  • Blockchain node difference synchronization method, electronic device, and chip system

    CN119539802B