Blockchain Snapshot Processing Using WAL Log Correction
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In blockchain networks, snapshot processing for transaction accounts is delayed due to the need for consensus nodes to complete submitting blocks to the ledger before processing can occur, leading to inefficiencies in obtaining a complete account state.
Innovation Solution
The method involves obtaining a snapshot trigger instruction and performing snapshot processing on transaction blocks at the trigger moment, using a write-ahead logging (WAL) log of the target block with the highest block height to correct dirty data and obtain a corrected snapshot account state, even if the block is not fully submitted to the ledger.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If snapshot processing waits for the consensus node to finish submitting the block to the ledger, then the account state is complete and accurate, but the snapshot processing time is delayed
Solution Approach 1:
The patent applies preliminary action by performing snapshot processing on transaction blocks before the consensus node finishes submitting them to the ledger. The system captures account state data at an intermediate stage when blocks are ready for submission but not yet fully committed, thereby obtaining complete account state information without waiting for the entire submission process to complete. This resolves the contradiction by decoupling the snapshot timing from the final ledger submission completion.
2Productivity
If snapshot processing is performed on incomplete transaction blocks, then snapshot processing time is reduced, but dirty data is generated due to incomplete transaction data
Solution Approach 1:
The patent implements feedback by using the WAL log as a correction mechanism. After performing snapshot processing on incomplete blocks, the system retrieves the WAL log which contains the complete transaction data and account state information. The WAL log serves as feedback that allows the system to identify and correct dirty data in the snapshot, thereby maintaining account state accuracy while having processed the block at an earlier, more efficient time.
Solution Approach 2:
The system performs preliminary snapshot processing on blocks before they are fully submitted to the ledger, capturing account state data at an intermediate stage. This preliminary action enables the system to obtain snapshot data without waiting for complete block submission, improving processing efficiency. The preliminary snapshot is then corrected using WAL log information to ensure accuracy.
3Reliability
If the system waits for block submission completion before processing snapshots, then data consistency is maintained, but real-time snapshot performance is compromised
Solution Approach 1:
The patent applies preliminary action by performing snapshot processing on transaction blocks before they are fully submitted to the ledger. The system captures account state data at an intermediate stage when blocks are ready for submission but not yet fully committed, thereby obtaining complete account state information without waiting for the entire submission process to complete. This resolves the contradiction by decoupling the snapshot timing from the final ledger submission completion.
Solution Approach 2:
The WAL log serves as an intermediary mechanism that bridges the gap between preliminary snapshot processing and final data consistency. The WAL log contains the complete transaction data and account state information that allows the system to correct any inconsistencies in the preliminary snapshot, thereby maintaining data consistency while enabling faster processing speeds.
Data Source
AI summary
A blockchain-based data snapshot method, performed by a consensus node in a blockchain network, includes: obtaining a snapshot trigger instruction and a trigger moment of the snapshot trigger instruction; performing snapshot processing on one or more transaction blocks in a ledger at the trigger moment, to obtain a snapshot account state of a transaction account, the snapshot account state being account data related to transaction data in the transaction blocks; obtaining a write-ahead logging (WAL) log of a target block, the target block being a block with a highest block height in the transaction blocks, the WAL log including a log of account data corresponding to the target block; and correcting dirty data in the snapshot account state according to the WAL log, to obtain a corrected snapshot account state, the dirty data being generated based on incomplete transaction data in the target block included in the ledger.


