Parallel Smart Contract Execution via Dependency Chain Tables
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In traditional blockchain systems, the execution of smart contracts is serial, which limits the use of multi-core processors and results in suboptimal performance, especially when dealing with multiple transactions in a block.
Innovation Solution
A method for parallel execution of smart contracts is introduced, which involves loading smart contracts, analyzing cross-contract calling annotations, determining calling dependency relationships, and executing transaction calling chains in parallel across multiple virtual machine instances.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If all transactions in a block are executed serially, then consistency of state modifications is maintained, but execution performance is limited
Solution Approach 1:
The patent segments transactions into different execution chains based on their dependency relationships. By analyzing cross-contract calling annotations and building chain tables, transactions are divided into independent parallel chains that can be executed simultaneously on different virtual machine instances, while maintaining consistency within each chain.
Solution Approach 2:
The patent dynamically determines the execution order and parallelization strategy based on the actual dependency relationships discovered through reflection and chain table construction. The system adapts the execution plan by identifying which transactions can be executed in parallel versus which must be executed sequentially based on their cross-contract calling relationships.
2Productivity
If transactions are executed in parallel, then execution efficiency is improved, but cross-contract calling dependencies may cause inconsistent state modifications
Solution Approach 1:
The patent introduces chain tables as an intermediary data structure to manage and track cross-contract calling dependencies. The chain table records the execution order and dependency relationships, acting as a mediator that ensures state consistency is maintained even when transactions are executed in parallel across multiple virtual machine instances.
Solution Approach 2:
The system uses reflection to obtain cross-contract calling annotations and builds feedback loops that analyze dependency relationships before execution. This feedback mechanism allows the system to identify and resolve potential consistency issues by determining the appropriate execution order and grouping transactions into coherent chains before parallel execution begins.
3Productivity
If multi-core processors are utilized for parallel execution, then performance is enhanced, but complexity of transaction dependency management increases
Solution Approach 1:
The patent extracts and isolates the dependency management logic into a separate chain table construction phase. By using reflection to obtain annotations and building chain tables beforehand, the complex dependency analysis is separated from the execution phase, allowing the actual parallel execution to focus solely on running transactions while the chain tables handle all dependency coordination.
Data Source
AI summary
A method, an apparatus and a device for parallel execution of a smart contract, and a medium are provided. The method for parallel execution of the smart contract includes the following steps: determining, according to a chain table for a cross-contract calling of each transaction in target execution transactions and the contract type of a smart contract in the target execution transactions, a calling dependency relationship between the transactions, and obtaining, according to the calling dependency relationship, transaction calling chains that cannot affect each other during an execution process.


