Zihao Li
Current Organizations / Institutes
The organizations/institutes from the scholar's latest article
Previous Organizations / Institutes
The organizations / institutes from the scholar's other articles in the past ten years
Research Subjects
Research Interests
Zihao Li has a total of 64 co-authors. Here are the top co-authors by number of shared publications:
- Xiapu Luo
The Hong Kong Polytechnic University, Hong Kong, China
15 shared publications - Ting Chen
University of Electronic Science and Technology of China
12 shared publications - Zheyuan He
University of Electronic Science and Technology of China, Chengdu, China
5 shared publications - Hao Zhou
The Hong Kong Polytechnic University, Hong Kong, Hong Kong
4 shared publications - Xiaosong Zhang
University of Electronic Science and Technology of China
4 shared publications - Jianfeng Li
Xi'an Jiaotong University, Xi'an, China
3 shared publications
Latest Publications
- Open Access
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 491-503
FORGE: An LLM-driven Framework for Large-Scale Smart Contract Vulnerability Dataset Construction
High-quality smart contract vulnerability datasets are critical for evaluating security tools and advancing smart contract security research. Two major limitations of current manual dataset construction are (1) labor-intensive and error-prone annotation processes limit the scale, quality, and evolution of the dataset, and (2) absence of standardized classification rules results in inconsistent vulnerability categories and labeling results across different datasets. To address these limitations, we present forge, the first automated approach for constructing smart contract vulnerability datasets. forge leverages an LLM-driven pipeline to extract high-quality vulnerabilities from real-world audit reports and classify them according to the Common Weakness Enumeration (CWE), the most widely recognized classification in software security. forge employs a divide-and-conquer strategy to extract structured and self-contained vulnerability information from unstructured audit reports. Additionally, it uses a tree-of-thoughts technique to classify the vulnerability information into the hierarchical CWE classification. To evaluate forge’s effectiveness, we run forge on 6,454 real-world audit reports and generate a dataset comprising 81,390 solidity files and 27,497 vulnerability findings across 296 CWE categories. Manual assessment of the dataset demonstrates high extraction precision and classification consistency with human experts (precision of 95.6% and inter-rater agreement k-α of 0.87). We further validate the practicality of our dataset by benchmarking 13 existing security tools on our dataset. The results reveal the significant limitations in current detection capabilities. Furthermore, by analyzing the severity-frequency distribution patterns through a unified CWE perspective in our dataset, we highlight inconsistency between the current smart contract research focus and the priorities identified from real-world vulnerabilities. This analysis also reveals key differences from traditional software security concerns, providing practical implications for improving the smart contract security ecosystem.
- 12 April 2026
- Published by Association for Computing Machinery (ACM)
- p. 491-503
Open AccessFORGE: An LLM-driven Framework for Large-Scale Smart Contract Vulnerability Dataset Construction
High-quality smart contract vulnerability datasets are critical for evaluating security tools and advancing smart contract security research. Two major limitations of current manual dataset construction are (1) labor-intensive and error-prone annotation processes limit the scale, quality, and evolution of the dataset, and (2) absence of standardized classification rules results in inconsistent vulnerability categories and labeling results across different datasets. To address these limitations, we present forge, the first automated approach for constructing smart contract vulnerability datasets. forge leverages an LLM-driven pipeline to extract high-quality vulnerabilities from real-world audit reports and classify them according to the Common Weakness Enumeration (CWE), the most widely recognized classification in software security. forge employs a divide-and-conquer strategy to extract structured and self-contained vulnerability information from unstructured audit reports. Additionally, it uses a tree-of-thoughts technique to classify the vulnerability information into the hierarchical CWE classification. To evaluate forge’s effectiveness, we run forge on 6,454 real-world audit reports and generate a dataset comprising 81,390 solidity files and 27,497 vulnerability findings across 296 CWE categories. Manual assessment of the dataset demonstrates high extraction precision and classification consistency with human experts (precision of 95.6% and inter-rater agreement k-α of 0.87). We further validate the practicality of our dataset by benchmarking 13 existing security tools on our dataset. The results reveal the significant limitations in current detection capabilities. Furthermore, by analyzing the severity-frequency distribution patterns through a unified CWE perspective in our dataset, we highlight inconsistency between the current smart contract research focus and the priorities identified from real-world vulnerabilities. This analysis also reveals key differences from traditional software security concerns, providing practical implications for improving the smart contract security ecosystem.
- 21 January 2026
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Services Computing
- Vol. 19 (2) , 1406-1421
Mind the Service: What Crypto Wallets Aren’t Telling You
Web3 introduces a new paradigm of decentralized services, where users interact with distributed applications and digital assets without centralized intermediaries. Non-custodial wallets, as faithful practitioners of this philosophy, also serve as critical service interfaces, enabling users to store and transact digital assets independently without reliance on third parties. Although prior studies have examined non-custodial wallet design, most focus on generic app issues rather than the service-oriented software challenges unique to wallets, particularly overlooking their core feature-transaction. Since all user actions in the crypto world depend on transactions, the design and implementation of transaction features are critical to wallet usability and trustworthiness, yet remain largely underexplored. To bridge the gap, this paper proposes a five-phase, semi-automated approach that leverages dynamic analysis to thoroughly evaluate the design of transaction features from multiple perspectives. Our study of 77 popular wallets shows that the design of transaction features is often unsatisfactory, potentially undermining the quality and reliability of wallet services and, in some cases, leading to direct financial losses. We identify numerous common design flaws across these wallets and provide targeted recommendations for wallet developers to improve the quality of wallet. This work sheds light on a critical dimension of Web3 services.
- 21 January 2026
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Services Computing
- Vol. 19 (2) , 1406-1421
Mind the Service: What Crypto Wallets Aren’t Telling You
Web3 introduces a new paradigm of decentralized services, where users interact with distributed applications and digital assets without centralized intermediaries. Non-custodial wallets, as faithful practitioners of this philosophy, also serve as critical service interfaces, enabling users to store and transact digital assets independently without reliance on third parties. Although prior studies have examined non-custodial wallet design, most focus on generic app issues rather than the service-oriented software challenges unique to wallets, particularly overlooking their core feature-transaction. Since all user actions in the crypto world depend on transactions, the design and implementation of transaction features are critical to wallet usability and trustworthiness, yet remain largely underexplored. To bridge the gap, this paper proposes a five-phase, semi-automated approach that leverages dynamic analysis to thoroughly evaluate the design of transaction features from multiple perspectives. Our study of 77 popular wallets shows that the design of transaction features is often unsatisfactory, potentially undermining the quality and reliability of wallet services and, in some cases, leading to direct financial losses. We identify numerous common design flaws across these wallets and provide targeted recommendations for wallet developers to improve the quality of wallet. This work sheds light on a critical dimension of Web3 services.
- Open Access
- 19 November 2025
- Published by Association for Computing Machinery (ACM)
- p. 2084-2098
Denial of Sequencing Attacks in Ethereum Layer 2 Rollups
- 19 November 2025
- Published by Association for Computing Machinery (ACM)
- p. 2084-2098
Open AccessDenial of Sequencing Attacks in Ethereum Layer 2 Rollups
- 22 September 2025
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 51 (12) , 3310-3330
Finding Correctness Issues on Ethereum Verkle Tries via Preimage-Aware Differential Testing
Stateless Ethereum is proposed to address the challenges of unbounded state growth, which poses centralization risks to Ethereum by imposing considerable operational costs on network participants. This approach enables Ethereum clients to verify and maintain blockchain using only block witnesses, eliminating the need for the underlying state data. Verkle Tries, as the next-generation state trie structure for Ethereum, are set to replace Merkle Patricia Tries to facilitate the stateless Ethereum by significantly reducing the size of block witnesses. Besides, since blockchain maintenance and verification entail intensive read and update operations on state data, ensuring the correctness of state access in Verkle Tries is crucial. In this study, we conduct the first systematic study on the correctness issues in Ethereum Verkle Tries, and define two kinds of such issues. Besides, we design VERDIFF, the first tool for automatically identifying correctness issues in Ethereum Verkle Tries through preimage-aware differential testing. To facilitate the identification of interpretable and reproducible issues, we propose PAL, the first domain-specific language designed to construct semantically valid trie access statements as test inputs for Verkle Tries. During the preimage-aware differential testing, these statements are iteratively generated and mutated based on our novel feedback mechanisms for inducing diverse behaviors when accessing states across varied regions in Verkle Tries at the preimage level. Moreover, we define new correctness issue oracles based on our definitions of these issues to ensure their accurate identification. We implement VERDIFF on Ethereum clients, and conduct extensive experiments to evaluate its effectiveness in identifying correctness issues. Through our evaluation, VERDIFF can uncover eight critical correctness issues, spanning four distinct classes, in Ethereum Verkle Tries across three major Ethereum clients (Go-ethereum, Nethermind, and EthereumJS). Additionally, it achieves at least 23.3% higher code path coverage compared to two baselines. Furthermore, we empirically analyze the security risks posed by the identified correctness issues, and explore their potential security implications, highlighting the critical role of VERDIFF in securing Ethereum Verkle Tries.
- 22 September 2025
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 51 (12) , 3310-3330
Finding Correctness Issues on Ethereum Verkle Tries via Preimage-Aware Differential Testing
Stateless Ethereum is proposed to address the challenges of unbounded state growth, which poses centralization risks to Ethereum by imposing considerable operational costs on network participants. This approach enables Ethereum clients to verify and maintain blockchain using only block witnesses, eliminating the need for the underlying state data. Verkle Tries, as the next-generation state trie structure for Ethereum, are set to replace Merkle Patricia Tries to facilitate the stateless Ethereum by significantly reducing the size of block witnesses. Besides, since blockchain maintenance and verification entail intensive read and update operations on state data, ensuring the correctness of state access in Verkle Tries is crucial. In this study, we conduct the first systematic study on the correctness issues in Ethereum Verkle Tries, and define two kinds of such issues. Besides, we design VERDIFF, the first tool for automatically identifying correctness issues in Ethereum Verkle Tries through preimage-aware differential testing. To facilitate the identification of interpretable and reproducible issues, we propose PAL, the first domain-specific language designed to construct semantically valid trie access statements as test inputs for Verkle Tries. During the preimage-aware differential testing, these statements are iteratively generated and mutated based on our novel feedback mechanisms for inducing diverse behaviors when accessing states across varied regions in Verkle Tries at the preimage level. Moreover, we define new correctness issue oracles based on our definitions of these issues to ensure their accurate identification. We implement VERDIFF on Ethereum clients, and conduct extensive experiments to evaluate its effectiveness in identifying correctness issues. Through our evaluation, VERDIFF can uncover eight critical correctness issues, spanning four distinct classes, in Ethereum Verkle Tries across three major Ethereum clients (Go-ethereum, Nethermind, and EthereumJS). Additionally, it achieves at least 23.3% higher code path coverage compared to two baselines. Furthermore, we empirically analyze the security risks posed by the identified correctness issues, and explore their potential security implications, highlighting the critical role of VERDIFF in securing Ethereum Verkle Tries.
- Open Access
- 19 June 2025
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 2 (FSE) , 2665-2688
Recasting Type Hints from WebAssembly Contracts
WebAssembly has become the preferred smart contract format for various blockchain platforms due to its high portability and near-native execution speed. To effectively understand WebAssembly contracts, it is crucial to recover high-level type signatures because of the limited type information that WebAssembly provides. However, existing studies on type inference for smart contracts primarily center around Ethereum Virtual Machine bytecode, which is not applicable to WebAssembly owing to their differing targets and runtime semantics. This paper introduces WasmHint, a novel solution that leverages deep learning inference to automatically recover high-level parameter and return types from WebAssembly contracts. More specifically, WasmHint constructs a wCFG representation to clarify dependencies within WebAssembly code and simulates its execution to capture type-related operational information. By learning comprehensive code semantics, it infers parameter and return types, with a semantic corrector designed to enhance information coordination. We conduct experiments on a newly constructed dataset containing 77,208 WebAssembly contract functions. The results demonstrate that WasmHint achieves inference accuracies of 80.0% for parameter types and 95.8% for return types, with average improvements of 86.6% and 34.0% over the baseline methods, respectively.
- 19 June 2025
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 2 (FSE) , 2665-2688
Open AccessRecasting Type Hints from WebAssembly Contracts
WebAssembly has become the preferred smart contract format for various blockchain platforms due to its high portability and near-native execution speed. To effectively understand WebAssembly contracts, it is crucial to recover high-level type signatures because of the limited type information that WebAssembly provides. However, existing studies on type inference for smart contracts primarily center around Ethereum Virtual Machine bytecode, which is not applicable to WebAssembly owing to their differing targets and runtime semantics. This paper introduces WasmHint, a novel solution that leverages deep learning inference to automatically recover high-level parameter and return types from WebAssembly contracts. More specifically, WasmHint constructs a wCFG representation to clarify dependencies within WebAssembly code and simulates its execution to capture type-related operational information. By learning comprehensive code semantics, it infers parameter and return types, with a semantic corrector designed to enhance information coordination. We conduct experiments on a newly constructed dataset containing 77,208 WebAssembly contract functions. The results demonstrate that WasmHint achieves inference accuracies of 80.0% for parameter types and 95.8% for return types, with average improvements of 86.6% and 34.0% over the baseline methods, respectively.
- Open Access
- 2 December 2024
- Published by Association for Computing Machinery (ACM)
- p. 2577-2590
DoubleUp Roll: Double-spending in Arbitrum by Rolling It Back
Optimistic rollup protocols are widely adopted as the most popular blockchain scaling solutions. As a dominant implementation, Arbitrum has boasted a total locked value exceeding 18 billion USD, highlighting the significance of optimistic rollups in blockchain ecosystem. Despite their popularity, little research has been done on the security of optimistic rollup protocols, and potential vulnerabilities on them remain unknown. In this work, we unveil three novel double spending attacks on Arbitrum, each enabling an attacker to steal funds from cross-chain applications on Arbitrum. To facilitate these double spending attacks, we introduce an attack to induce manipulable delays in the transaction rollup process and propose a cost optimization solution to reduce further transaction fees associated with the attacks. Our investigations broaden the exploitation of our double spending attacks to another leading optimistic rollup protocol, Optimism, highlighting the generability of our proposed attacks. Through extensive experiments on a local test network, we demonstrated that our attacks lead to severe malicious effects, such as fund losses from double spending. From late 2022 to early 2023, we reported these vulnerabilities to the Arbitrum and Optimism teams. All the issues were acknowledged and resolved, and our research safeguarded billions of dollars at risk, earning us half a million dollars in bug bounty rewards.
- 2 December 2024
- Published by Association for Computing Machinery (ACM)
- p. 2577-2590
Open AccessDoubleUp Roll: Double-spending in Arbitrum by Rolling It Back
Optimistic rollup protocols are widely adopted as the most popular blockchain scaling solutions. As a dominant implementation, Arbitrum has boasted a total locked value exceeding 18 billion USD, highlighting the significance of optimistic rollups in blockchain ecosystem. Despite their popularity, little research has been done on the security of optimistic rollup protocols, and potential vulnerabilities on them remain unknown. In this work, we unveil three novel double spending attacks on Arbitrum, each enabling an attacker to steal funds from cross-chain applications on Arbitrum. To facilitate these double spending attacks, we introduce an attack to induce manipulable delays in the transaction rollup process and propose a cost optimization solution to reduce further transaction fees associated with the attacks. Our investigations broaden the exploitation of our double spending attacks to another leading optimistic rollup protocol, Optimism, highlighting the generability of our proposed attacks. Through extensive experiments on a local test network, we demonstrated that our attacks lead to severe malicious effects, such as fund losses from double spending. From late 2022 to early 2023, we reported these vulnerabilities to the Arbitrum and Optimism teams. All the issues were acknowledged and resolved, and our research safeguarded billions of dollars at risk, earning us half a million dollars in bug bounty rewards.
- Open Access
- 2 December 2024
- Published by Association for Computing Machinery (ACM)
- p. 1016-1030
Towards Automatic Discovery of Denial of Service Weaknesses in Blockchain Resource Models
Nial-of-Service (DoS) attacks at the execution layer represent one of the most severe threats to blockchain systems, compromising availability by depleting the resources of victims. To counteract these attacks, many blockchains have implemented unique resource models that incorporate transaction fees. Nevertheless, historical incidents of DoS attacks demonstrate that these resource model designs remain inadequate. Although there are studies that manually craft DoS attacks on specific blockchains in isolation, none of them can discover DoS weaknesses in blockchains automatically. In this paper, we provide an insight into DoS weaknesses in blockchain resource models, and present a generic and systematic approach to uncover these weaknesses. In our approach, we first identify DoS weaknesses by DoSVER, a novel tool that reasons feasible DoS weaknesses against blockchain resource models by formal verification. The identified DoS weaknesses will be further validated by DoSDET, a new framework that automates the attack synthesis in exploiting the identified DoS weaknesses. We conduct a comprehensive and systematic evaluation by extensive experiments on nine diverse and widely-used blockchains, and discovered 12 DoS weaknesses with corresponding exploitation across the nine blockchains, 10 of which were unveiled for the first time.
- 2 December 2024
- Published by Association for Computing Machinery (ACM)
- p. 1016-1030
Open AccessTowards Automatic Discovery of Denial of Service Weaknesses in Blockchain Resource Models
Nial-of-Service (DoS) attacks at the execution layer represent one of the most severe threats to blockchain systems, compromising availability by depleting the resources of victims. To counteract these attacks, many blockchains have implemented unique resource models that incorporate transaction fees. Nevertheless, historical incidents of DoS attacks demonstrate that these resource model designs remain inadequate. Although there are studies that manually craft DoS attacks on specific blockchains in isolation, none of them can discover DoS weaknesses in blockchains automatically. In this paper, we provide an insight into DoS weaknesses in blockchain resource models, and present a generic and systematic approach to uncover these weaknesses. In our approach, we first identify DoS weaknesses by DoSVER, a novel tool that reasons feasible DoS weaknesses against blockchain resource models by formal verification. The identified DoS weaknesses will be further validated by DoSDET, a new framework that automates the attack synthesis in exploiting the identified DoS weaknesses. We conduct a comprehensive and systematic evaluation by extensive experiments on nine diverse and widely-used blockchains, and discovered 12 DoS weaknesses with corresponding exploitation across the nine blockchains, 10 of which were unveiled for the first time.
- Open Access
- 2 December 2024
- Published by Association for Computing Machinery (ACM)
- p. 971-985
fAmulet: Finding Finalization Failure Bugs in Polygon zkRollup
Zero-knowledge layer 2 protocols emerge as a compelling approach to overcoming blockchain scalability issues by processing transactions through the transaction finalization process. During this process, transactions are efficiently processed off the main chain. Besides, both the transaction data and the zero-knowledge proofs of transaction executions are reserved on the main chain, ensuring the availability of transaction data as well as the correctness and verifiability of transaction executions. Hence, any bugs that cause the transaction finalization failure are crucial, as they impair the usability of these protocols and the scalability of blockchains. In this work, we conduct the first systematic study on finalization failure bugs in zero-knowledge layer 2 protocols, and define two kinds of such bugs. Besides, we design fAmulet, the first tool to detect finalization failure bugs in Polygon zkRollup, a prominent zero-knowledge layer 2 protocol, by leveraging fuzzing testing. To trigger finalization failure bugs effectively, we introduce a finalization behavior model to guide our transaction fuzzer to generate and mutate transactions for inducing diverse behaviors across each component (e.g., Sequencer) in the finalization process. Moreover, we define bug oracles according to the distinct bug definitions to accurately detect bugs. Through our evaluation, fAmulet can uncover twelve zero-day finalization failure bugs in Polygon zkRollup, and cover at least 20.8% more branches than baselines. Furthermore, through our preliminary study, fAmulet uncovers a zero-day finalization failure bug in Scroll zkRollup, highlighting the generality of fAmulet to be applied to other zero-knowledge layer 2 protocols. At the time of writing, all our uncovered bugs have been confirmed and fixed by Polygon zkRollup and Scroll zkRollup teams.
- 2 December 2024
- Published by Association for Computing Machinery (ACM)
- p. 971-985
Open AccessfAmulet: Finding Finalization Failure Bugs in Polygon zkRollup
Zero-knowledge layer 2 protocols emerge as a compelling approach to overcoming blockchain scalability issues by processing transactions through the transaction finalization process. During this process, transactions are efficiently processed off the main chain. Besides, both the transaction data and the zero-knowledge proofs of transaction executions are reserved on the main chain, ensuring the availability of transaction data as well as the correctness and verifiability of transaction executions. Hence, any bugs that cause the transaction finalization failure are crucial, as they impair the usability of these protocols and the scalability of blockchains. In this work, we conduct the first systematic study on finalization failure bugs in zero-knowledge layer 2 protocols, and define two kinds of such bugs. Besides, we design fAmulet, the first tool to detect finalization failure bugs in Polygon zkRollup, a prominent zero-knowledge layer 2 protocol, by leveraging fuzzing testing. To trigger finalization failure bugs effectively, we introduce a finalization behavior model to guide our transaction fuzzer to generate and mutate transactions for inducing diverse behaviors across each component (e.g., Sequencer) in the finalization process. Moreover, we define bug oracles according to the distinct bug definitions to accurately detect bugs. Through our evaluation, fAmulet can uncover twelve zero-day finalization failure bugs in Polygon zkRollup, and cover at least 20.8% more branches than baselines. Furthermore, through our preliminary study, fAmulet uncovers a zero-day finalization failure bug in Scroll zkRollup, highlighting the generality of fAmulet to be applied to other zero-knowledge layer 2 protocols. At the time of writing, all our uncovered bugs have been confirmed and fixed by Polygon zkRollup and Scroll zkRollup teams.
- 19 November 2024
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 51 (4) , 879-903
Unearthing Gas-Wasting Code Smells in Smart Contracts With Large Language Models
Smart contracts are automated programs stored on a blockchain, featuring unique attributes such as permissionlessness, trustlessness, immutability, and transparency. These properties underpin an array of unprecedented decentralized services. Compiled into bytecodes, Ethereum smart contracts are executed within the Ethereum Virtual Machine (EVM). Ethereum’s distinct gas mechanism assigns a price to each bytecode execution, incentivizing resource-efficient computing. However, a disconnect exists between conventional coding practices and the less intuitive gas consumption computation mechanism, resulting in inadvertent gas wastage. Gas-wasting code smells at the source code level have been studied in various related works; however, the task of manually identifying such code smells by reading through codes and reasoning about them is both time-consuming and economically inefficient. In this work, we propose to leverage Large Language Models (LLMs), which have seen a surge in popularity recently, to facilitate undertaking the labor-intensive part of the code-smell-finding pipeline. In particular, we focus on Solidity, the predominant programming language for Ethereum smart contracts. Overall, we identified 26 gas-wasting code smells, out of which 13 were not presented in previous papers. On average, applying these code smells led to a reduction of approximately 10.534% in deployment costs and 21.528% in message call costs across our test codes. We further make a report on each of the identified code smells with associated example contracts sourced from either previous literature or recently deployed contracts.
- 19 November 2024
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 51 (4) , 879-903
Unearthing Gas-Wasting Code Smells in Smart Contracts With Large Language Models
Smart contracts are automated programs stored on a blockchain, featuring unique attributes such as permissionlessness, trustlessness, immutability, and transparency. These properties underpin an array of unprecedented decentralized services. Compiled into bytecodes, Ethereum smart contracts are executed within the Ethereum Virtual Machine (EVM). Ethereum’s distinct gas mechanism assigns a price to each bytecode execution, incentivizing resource-efficient computing. However, a disconnect exists between conventional coding practices and the less intuitive gas consumption computation mechanism, resulting in inadvertent gas wastage. Gas-wasting code smells at the source code level have been studied in various related works; however, the task of manually identifying such code smells by reading through codes and reasoning about them is both time-consuming and economically inefficient. In this work, we propose to leverage Large Language Models (LLMs), which have seen a surge in popularity recently, to facilitate undertaking the labor-intensive part of the code-smell-finding pipeline. In particular, we focus on Solidity, the predominant programming language for Ethereum smart contracts. Overall, we identified 26 gas-wasting code smells, out of which 13 were not presented in previous papers. On average, applying these code smells led to a reduction of approximately 10.534% in deployment costs and 21.528% in message call costs across our test codes. We further make a report on each of the identified code smells with associated example contracts sourced from either previous literature or recently deployed contracts.
- Open Access
- 11 September 2024
- Published by Association for Computing Machinery (ACM)
- p. 1440-1452
Following the “Thread”: Toward Finding Manipulatable Bottlenecks in Blockchain Clients
Blockchain clients are the fundamental element of the blockchain network, each keeping a copy of the blockchain’s ledger. They play a crucial role in ensuring the network’s decentralization, integrity, and stability. As complex software systems, blockchain clients are not exempt from bottlenecks. Some bottlenecks create new attack surfaces, where attackers deliberately overload these weak points to congest client’s execution, thereby causing denial of service (DoS). We call them manipulatable bottlenecks. Existing research primarily focuses on a few such bottlenecks, and heavily relies on manual analysis. To the best of our knowledge, there has not been any study proposing a systematic approach to identify manipulatable bottlenecks in blockchain clients. To bridge the gap, this paper delves into the primary causes of bottlenecks in software, and develops a novel tool named ThreadNeck to monitor the symptoms that signal these issues during client runtime. ThreadNeck models the clients as a number of threads, delineating their inter-relationship to accurately characterize the client’s behavior. Building on this, we can identify the suspicious bottlenecks and determine if they could be exploited by external attackers. After applying ThreadNeck to four mainstream clients developed in different programming languages, we totally discover 13 manipulatable bottlenecks, six of which are previously unknown.
- 11 September 2024
- Published by Association for Computing Machinery (ACM)
- p. 1440-1452
Open AccessFollowing the “Thread”: Toward Finding Manipulatable Bottlenecks in Blockchain Clients
Blockchain clients are the fundamental element of the blockchain network, each keeping a copy of the blockchain’s ledger. They play a crucial role in ensuring the network’s decentralization, integrity, and stability. As complex software systems, blockchain clients are not exempt from bottlenecks. Some bottlenecks create new attack surfaces, where attackers deliberately overload these weak points to congest client’s execution, thereby causing denial of service (DoS). We call them manipulatable bottlenecks. Existing research primarily focuses on a few such bottlenecks, and heavily relies on manual analysis. To the best of our knowledge, there has not been any study proposing a systematic approach to identify manipulatable bottlenecks in blockchain clients. To bridge the gap, this paper delves into the primary causes of bottlenecks in software, and develops a novel tool named ThreadNeck to monitor the symptoms that signal these issues during client runtime. ThreadNeck models the clients as a number of threads, delineating their inter-relationship to accurately characterize the client’s behavior. Building on this, we can identify the suspicious bottlenecks and determine if they could be exploited by external attackers. After applying ThreadNeck to four mainstream clients developed in different programming languages, we totally discover 13 manipulatable bottlenecks, six of which are previously unknown.