arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2207.14592cs.CRcs.DCcs.DS
收藏

区块链中用于降低网络费用的模式匹配算法

Pattern matching algorithms in Blockchain for network fees reduction

Robert Susik, Robert Nowotniak

AI总结:

本文研究以太坊虚拟机上的精确模式匹配算法,提出 Solidity/YUL 高效实现,相比 StringUtils 最多降低 22 倍 gas 使用并提升 55 倍速度,从而降低区块链网络费用。

摘要:

区块链近年来受到了大量关注,并且仍在持续发展。第二代区块链(如以太坊)允许在以太坊虚拟机(EVM)中执行几乎任意程序,使其成为分布式应用的全球协议。代码部署以及在 EVM 中执行的每个操作都会消耗称为 gas 的网络费用,其价格会波动且可能相当可观。因此,代码优化和精心选择的算法在区块链编程中至关重要。本文评估了几种精确模式匹配算法在以太坊虚拟机上的 gas 使用情况。我们还提出了这些算法在 Solidity/YUL 语言中的高效实现。我们针对不同参数(如模式长度、字母表大小和文本大小)评估了所有算法的 gas 费用。我们展示了与 StringUtils(一个流行的 Solidity 字符串库)相比,gas 费用和执行时间显著降低,gas 使用量最多降低 22 倍,速度提升最多 55 倍。

英文摘要:

Blockchain received a vast amount of attention in recent years and is still growing. The second generation of blockchain, such as Ethereum, allows execution of almost any program in Ethereum Virtual Machine (EVM), making it a global protocol for distributed applications. The code deployment and each operation performed in EVM cost the network fee called gas, which price varies and can be significant. That is why code optimization and well-chosen algorithms are crucial in programming on the blockchain. This paper evaluates the gas usage of several exact pattern matching algorithms on the Ethereum Virtual Machine. We also propose an efficient implementation of the algorithms in the Solidity/YUL language. We evaluate the gas fees of all the algorithms for different parameters (such as pattern length, alphabet size, and text size). We show a significant gas fee and execution time reduction with up to 22-fold lower gas usage and 55-fold speed-up comparing to StringUtils (a popular Solidity string library).

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

↑