LFAMLedger: Account Migration Across Blockchain Shards Using a Lock-Free Mechanism
Abstract
With the development of sharded blockchains, account migration mechanisms migrate accounts selected by account partition algorithms from the source shard to the target shard, aiming to reduce cross-shard transactions and balance the load. Moreover, the cost of account migration plays a critical role in determining the effectiveness of partitioning algorithms, as performance gains from resharding depend on cost-efficiency. Therefore, an efficient and low-overhead migration mechanism is critical to improving the performance of sharded blockchains. Existing migration approaches require cross-shard locks or intra-shard locks, which causes service interruption. However, we observe that account states remain unchanged during migration, indicating that such lock-based mechanisms are overly restrictive. To this end, we propose a novel Lock-Free Account Migration ledger, denoted as LFAMLedger, which consists of a prewrite phase and a migration phase. LFAMLedger ensures data consistency and lock-free migration through timestamp-based multi-version snapshots and a deferred validation mechanism. Furthermore, we propose optimistic snapshot isolation to decouple the source and target shards, and a flexible strategy to enable concurrent migration of accounts and their associated transactions to multiple target shards. We conduct extensive scalability experiments based on real Ethereum transaction histories. Compared with cross-shard lock-based and intra-shard lock-based migration approaches, our lock-free LFAMLedger achieves 1.9× and 1.8× higher throughput, and reduces latency by 2.35× and 1.75×, respectively, demonstrating significant improvements in efficiency.