An Efficient Cross-Shard Smart Contract Execution Framework Leveraging Off-Chain Computation and Genetic Algorithm-Optimized Migration
Abstract
Blockchain sharding is a promising approach to improving system scalability. However, traditional designs rely on lock-based cross-shard commit protocols, which introduce significant performance bottlenecks due to repeated on-chain communication and consensus. The emergence of complex cross-shard contracts further exacerbates these issues. Although recent off-chain execution models reduce on-chain overhead by decoupling contract execution from consensus, they still incur high communication costs and struggle to maintain state consistency. To address these challenges, this paper presents a sharding framework that seamlessly integrates on-chain and off-chain processing. By leveraging Trusted Execution Environments (TEEs), the framework enables secure and efficient off-chain execution of cross-shard smart contracts. It incorporates an off-chain execution hub for verifiable contract execution and a state-aware cross-shard commit protocol to guarantee correctness. Furthermore, a genetic algorithm-based contract-migration strategy dynamically reduces cross-shard interactions. Prototype evaluations show that the proposed framework significantly outperforms mainstream sharding solutions, achieving at least 2.1× higher throughput and reducing cross-shard transaction latency by over 52.6%.