IEEE Access (Jan 2020)

Function-Level Dynamic Monitoring and Analysis System for Smart Contract

  • Yi Ding,
  • Chenshuo Wang,
  • Qionghui Zhong,
  • Haisheng Li,
  • Jinjing Tan,
  • Jie Li

DOI
https://doi.org/10.1109/ACCESS.2020.3046005
Journal volume & issue
Vol. 8
pp. 229161 – 229172

Abstract

Read online

The close integration of blockchain and smart contract technology has become an important foundation for current trusted applications. High-quality, high-efficiency and high-security codes have become basic requirements for smart contract applications because they are not easy to be modified after being deployed on blockchain. This paper proposes a function-level dynamic monitoring and analysis method for smart contract, and implements a prototype system. The method adds a “shadow stack” and related data structures to virtual machine of testing blockchain platform by analyzing the principle of function management with original stack, then monitors the bytecode after code instrumentation, records the function calling relationships as well as the relevant metrics of time, instruction number and gas consumption. The prototype system identifies contract inefficient behaviors using visualization and intelligent analysis methods, then forms a smart contract optimization closed loop through iterative improvement. Finally, the paper verified the high feasibility and applicability of the monitoring and analyzing method as well as prototype system's performance through experiments.

Keywords