Sharding is a prominent technique for scaling blockchains. By dividing the network into smaller components known as shards, a sharded blockchain can process transactions in parallel without introducing inconsistencies through the coordination of intra-shard and cross-shard consensus protocols. However, we observe a critical security issue with sharded systems: transaction ordering manipulations can occur when coordinating intra-shard and cross-shard consensus protocols, leaving the system vulnerable to attack. Specifically, we identify a novel security issue known as finalization fairness, which can be exploited through a front-running attack. This attack allows an attacker to manipulate the execution order of transactions, even if the victim's transaction has already been processed and added to the blockchain by a fair intra-shard consensus. To address the issue, we offer Haechi, a novel cross-shard protocol that is immune to front-running attacks. Haechi introduces an ordering phase between transaction processing and execution, ensuring that the execution order of transactions is the same as the processing order and achieving finalization fairness. To accommodate different consensus speeds among shards, Haechi incorporates a finalization fairness algorithm to achieve a globally fair order with minimal performance loss. By providing a global order, Haechi ensures strong consistency among shards, enabling better parallelism in handling conflicting transactions across shards. These features make Haechi a promising solution for supporting popular smart contracts in the real world. To evaluate Haechi's performance, we implemented the protocol using Tendermint and conducted extensive experiments on a geo-distributed AWS environment. Our results demonstrate that Haechi achieves finalization fairness with little performance sacrifice compared to existing cross-shard consensus protocols.
翻译:分片是扩展区块链的一种重要技术。通过将网络划分为称为分片的较小组件,分片区块链可以在协调片内和跨片共识协议的同时并行处理交易,而不引入不一致性。然而,我们观察到分片系统存在一个关键的安全问题:在协调片内和跨片共识协议时可能发生交易排序操纵,使系统易受攻击。具体来说,我们识别出一个称为最终化公平性的新型安全问题,该问题可通过抢跑攻击加以利用。这种攻击允许攻击者操纵交易的执行顺序,即使受害者的交易已被公平的片内共识处理并添加到区块链中。为解决此问题,我们提出了Haechi,一种能够抵抗抢跑攻击的新型跨片协议。Haechi在交易处理与执行之间引入了一个排序阶段,确保交易的执行顺序与处理顺序一致,从而实现最终化公平性。为适应不同分片间共识速度的差异,Haechi采用了一种最终化公平性算法,在最小化性能损失的前提下实现全局公平排序。通过提供全局顺序,Haechi确保了分片间的强一致性,从而在处理跨片冲突交易时实现更好的并行性。这些特性使Haechi成为支持现实世界中流行智能合约的有前景的解决方案。为评估Haechi的性能,我们使用Tendermint实现了该协议,并在地理分布的AWS环境中进行了大量实验。结果表明,与现有跨片共识协议相比,Haechi在实现最终化公平性的同时性能损失极小。