Merkle State Tree Segmentation for Blockchain Sync
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current blockchain data synchronization methods are inefficient due to the large amount of data involved in synchronizing Merkle state trees, which can lead to slow synchronization rates and redundancy in history state data, especially when node devices need to recover or join the network.
Innovation Solution
Organizing account state data into a current Merkle state tree and a history Merkle state tree, allowing for real-time synchronization of only the current Merkle state tree from other node devices, reducing data transfer and utilizing data structures like B+tree for current and LSM tree for history trees to optimize performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If the complete Merkle state tree including history state data is synchronized, then the data completeness is improved, but the synchronization time and data transfer volume increase significantly
Solution Approach 1:
The Merkle state tree is segmented into two distinct parts: the current Merkle state tree containing only latest account states, and the history Merkle state tree containing historical account states. This segmentation allows nodes to synchronize only the essential current state data in real-time, while history data can be obtained separately when needed, thus resolving the contradiction between data completeness and synchronization time.
Solution Approach 2:
The history state data is extracted from the main synchronization process. Nodes first synchronize the compact current Merkle state tree quickly, and then can optionally obtain history Merkle state tree data through separate background synchronization or on-demand retrieval, eliminating the time penalty of synchronizing all historical data simultaneously.
2Quantity of substance
If the complete Merkle state tree including history state data is synchronized, then the data completeness is improved, but the network bandwidth consumption and data transfer volume increase
Solution Approach 1:
By dividing the Merkle state tree into current and history components, the patent enables selective data transmission. The current Merkle state tree with minimal data size is transmitted during real-time synchronization, while history data transmission is deferred or performed in background, significantly reducing instantaneous network bandwidth consumption.
3Productivity
If only the current Merkle state tree is synchronized in real-time, then the synchronization rate is improved, but the history state data availability may be affected
Solution Approach 1:
The system performs preliminary synchronization of the current Merkle state tree first, ensuring nodes have the essential latest state data quickly. History Merkle state tree data is then synchronized in the background or made available through other nodes when needed, ensuring both real-time performance and historical data availability.
Data Source
AI summary
A method of synchronizing blockchain state data, where account state data in the blockchain is organized into a Merkle state tree and stored in a database; the Merkle state tree includes a current Merkle state tree formed by a latest account state of each blockchain account; and a history Merkle state tree formed by a history account state of each blockchain account; and the method includes: receiving a data synchronization instruction for the Merkle state tree; in response to the data synchronization instruction, obtaining in real time the current Merkle state tree of the latest block stored in the database of other node device in the blockchain; and storing the obtained current Merkle state tree of the latest block to the local database to complete real-time data synchronization for the Merkle state tree.


