中国民航大学学报 ›› 2025, Vol. 43 ›› Issue (3): 68-74.

• 智能信息与信号处理 • 上一篇    下一篇

基于 Wasm 代码块的层次化 gas 扣除方法

  

  1. 中国民航大学计算机科学与技术学院, 天津 300300
  • 收稿日期:2023-04-21 修回日期:2023-06-20 出版日期:2025-07-12 发布日期:2025-07-12
  • 作者简介:冯霞(1970— ),女,山西吕梁人,教授,博士,研究方向为智能信息处理和人工智能民航应用
  • 基金资助:
    天津市教委科研计划项目(2021KJ037);中央高校基本科研业务费专项(3122021052);民航航空公司人工智能重点实验室自主课题基金
    (CZAILAB-COO-KJAI20001)

Hierarchical gas deduction method based on Wasm code block

  1. College of Computer Science and Technology, CAUC, Tianjin 300300, China 
  • Received:2023-04-21 Revised:2023-06-20 Online:2025-07-12 Published:2025-07-12

摘要:

针对基于 WebAssembly(简称 Wasm)的区块链智能合约虚拟机在 gas 扣除过程中产生过长时延的问题,分
析该过程中的性能瓶颈,提出一种基于代码块的层次化 gas 扣除方法。 通过在 Wasm 虚拟机中设计指令记
录器与代码块分析器,实现基于代码块的 gas 扣除。 根据 Wasm 模块结构,设计层次化代码块识别规则。 实
验结果表明,与传统逐条指令的 gas 扣除方法相比,本文方法将 gas 扣除次数减少了 79.6%,且在交易串行
执行模式和交易并行执行模式下,可分别将执行平均时延降低 17.0% 和 18.8%。

关键词:

Abstract:

Aiming at the problem of long latency in the process of gas deduction of blockchain smart contract virtual machine
based on WebAssembly (Wasm), the performance bottleneck in the process is analyzed, and a hierarchical gas deduction method based on code blocks is proposed. By designing instruction recorder and code block analyzer in
Wasm virtual machine, gas deduction based on code block is implemented. According to the structure of Wasm
module, hierarchical code block recognition rules are designed. The experimental results show that, compared with
the traditional instruction-by-instruction gas deduction method, the proposed method reduces the number of gas
deduction by 79.6%, and the execution average latency can be reduced by 17.0% and 18.8% in serial and parallel
transaction execution modes, respectively

Key words:

中图分类号: