一种基于录制重放的区块链交易执行追溯方法
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

基金项目:

国家重点研发计划(2020YFC1523203)


A Tracing Method for Blockchain Transaction Execution based on Recoding and Replay
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    区块链上运行的智能合约具有一经部署难以修改、调用执行需经过共识等特点,现有的需要修改智能合约代码或打断其执行过程的调试方法难以直接应用到智能合约上.由于智能合约的运行过程由区块链交易顺序执行过程组成,实现对区块链交易执行过程的追溯是提升智能合约可调试性的一个有效途径.对区块链交易执行过程进行追溯主要目标是找出一条已经出块的区块链交易是如何得到当前的执行结果的.区块链交易的执行依赖于区块链内部状态,且该状态取决于之前区块链交易的执行结果,因此存在着传递性依赖.区块链交易的依赖性和区块链所提供的执行环境的特点给区块链交易执行追溯带来了挑战.区块链交易执行追溯面临的挑战主要有三方面,即如何从智能合约部署的生产环境中获取足够追溯的信息、如何获取区块链交易之间的依赖关系,以及如何保证追溯结果与实际在线执行过程一致.本文提出了一种基于录制重放的区块链交易执行追溯方法,在合约容器中建立录制重放机制,无需修改合约代码即可支持交易执行中对状态读写操作的录制,并且不会打断智能合约运行;提出了基于状态读写的交易依赖分析算法,支持对存在依赖关系的前序交易进行按需回溯;此外,设计了录制读写操作记录的验证机制,确保重放的执行过程与真实执行过程之间的一致性可被验证.所提出的方法能够追溯区块链交易调用智能合约的执行过程,可用于智能合约调试,并且当智能合约异常造成损失时可用于举证.在实验中对比了将录制的读写操作记录存储于链上和存储于链下之间的性能差异,通过案例研究展示了本方法在追溯区块链交易执行方面的有效性和优点.

    Abstract:

    The smart contract running on the blockchain can hardly be modified after deployment, and its execution relies on a consensus procedure. Thus, existing debugging methods that require modification of the smart contract or interrupting the execution process cannot be applied to the smart contract. Since the running of smart contract is composed of ordered execution of transactions, the ability to trace the execution of the transaction can make the smart contract more debuggable. The goal of tracing blockchain transaction execution is to unveil how a blockchain transaction produces such result in execution. The execution of a transaction relies on the internal state of the blockchain system, and the state is determined by previous transactions that executed, which results in transitive dependency. Such dependency and the execution environment which the blockchain provides brings challenges for tracing. There are three main challenges:how to obtain enough information for tracing from the production environment in which the smart contract is deployed, how to obtain the dependency between transactions, and how to ensure the consistency between the result of tracing and the real execution process online. In this paper, a tracing method for blockchain transaction execution based on recoding and replay is proposed. By building the recording and replay mechanism in the smart contract container, the reading and writing operations of state can be recorded without modification of the smart contract, and the running of the smart contract is not interrupt. A transaction dependency analysis method based on state reading and writing operation is proposed, to support retracing previous transactions linked by dependency on demand. Moreover, the verification mechanism for reading and writing operation record is proposed, to ensure the consistence between the replaying execution and the real online execution can be verified. The tracing method can trace the execution of the blockchain transaction that calls the smart contract, which can be used in debugging of smart contracts. When loss is caused by the failure of smart contracts, the tracing result can be used as evidence. Experiments demonstrate the comparison of performance between storing recorded reading and writing operations on chain and off chain. The advantages and effectiveness of this method are revealed via case study.

    参考文献
    相似文献
    引证文献
引用本文

陈胜,方明哲,蒋步云,李春晓,左春,李玉成,梁赓.一种基于录制重放的区块链交易执行追溯方法.软件学报,,():0

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2021-08-09
  • 最后修改日期:2021-12-21
  • 录用日期:
  • 在线发布日期: 2022-09-20
  • 出版日期:
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号