arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2106.09440cs.SE
收藏

Archer:检测去中心化应用程序中的链上链下同步漏洞

ÐArcher: Detecting On-Chain-Off-Chain Synchronization Bugs in Decentralized Applications

Wuqi Zhang, Lili Wei, Shuqing Li, Yepang Liu, Shing-Chi Cheung

摘要:

自从以太坊出现以来,基于区块链的去中心化应用程序(DApps)变得越来越受欢迎和重要。为了平衡安全性、性能和成本,DApp通常由两层组成:链上层用于执行交易并将关键数据存储在区块链上,链下层用于与用户交互。DApp需要主动将其链下层与链上层同步。否则,链下层中的不一致数据可能会误导用户并导致不良后果,例如,交易费用损失。然而,发送到区块链的交易并不能保证被执行,甚至可能在执行后由于链重组而被逆转。交易执行中的这种非确定性是区块链所独有的。DApp开发人员可能无法准确执行链上链下同步,因为他们对复杂的事务生命周期不熟悉。在这项工作中,我们研究了在基于以太坊的DApp中同步链上和链下数据的挑战。我们提出了两种可能导致链上和链下层之间不一致的错误。为了帮助检测这种链上链下同步错误,我们引入了一个状态转换模型来指导DApp的测试,并提出了两个有效的预言机来帮助自动识别错误。我们构建了第一个测试框架DArcher,以检测DApp中的链上链下同步错误。我们已经在11个流行的真实世界DApps上评估了DArcher。DArcher在缺陷检测中实现了高精度(99.3%),召回率(87.6%)和准确率(89.4%),并显着优于基线方法。它在11个DApp中发现了15个真正的bug。到目前为止,开发人员已经确认了15个bug中的6个,并修复了3个。这些有希望的结果证明了DArcher的有用性。

英文摘要:

Since the emergence of Ethereum, blockchain-based decentralized applications (DApps) have become increasingly popular and important. To balance the security, performance, and costs, a DApp typically consists of two layers: an on-chain layer to execute transactions and store crucial data on the blockchain and an off-chain layer to interact with users. A DApp needs to synchronize its off-chain layer with the on-chain layer proactively. Otherwise, the inconsistent data in the off-chain layer could mislead users and cause undesirable consequences, e.g., loss of transaction fees. However, transactions sent to the blockchain are not guaranteed to be executed and could even be reversed after execution due to chain reorganization. Such non-determinism in the transaction execution is unique to blockchain. DApp developers may fail to perform the on-chain-off-chain synchronization accurately due to their lack of familiarity with the complex transaction lifecycle. In this work, we investigate the challenges of synchronizing on-chain and off-chain data in Ethereum-based DApps. We present two types of bugs that could result in inconsistencies between the on-chain and off-chain layers. To help detect such on-chain-off-chain synchronization bugs, we introduce a state transition model to guide the testing of DApps and propose two effective oracles to facilitate the automatic identification of bugs. We build the first testing framework, DArcher, to detect on-chain-off-chain synchronization bugs in DApps. We have evaluated DArcher on 11 popular real-world DApps. DArcher achieves high precision (99.3%), recall (87.6%), and accuracy (89.4%) in bug detection and significantly outperforms the baseline methods. It has found 15 real bugs in the 11 DApps. So far, six of the 15 bugs have been confirmed by the developers, and three have been fixed. These promising results demonstrate the usefulness of DArcher.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑