Inferring Needless Write Memory Accesses on Ethereum Bytecode (Extended Version)

01/11/2023
by   Elvira Albert, et al.
0

Efficiency is a fundamental property of any type of program, but it is even more so in the context of the programs executing on the blockchain (known as smart contracts). This is because optimizing smart contracts has direct consequences on reducing the costs of deploying and executing the contracts, as there are fees to pay related to their bytes-size and to their resource consumption (called gas). Optimizing memory usage is considered a challenging problem that, among other things, requires a precise inference of the memory locations being accessed. This is also the case for the Ethereum Virtual Machine (EVM) bytecode generated by the most-widely used compiler, , whose rather unconventional and low-level memory usage challenges automated reasoning. This paper presents a static analysis, developed at the level of the EVM bytecode generated by , that infers write memory accesses that are needless and thus can be safely removed. The application of our implementation on more than 19,000 real smart contracts has detected about 6,200 needless write accesses in less than 4 hours. Interestingly, many of these writes were involved in memory usage patterns generated by that can be greatly optimized by removing entire blocks of bytecodes. To the best of our knowledge, existing optimization tools cannot infer such needless write accesses, and hence cannot detect these inefficiencies that affect both the deployment and the execution costs of Ethereum smart contracts.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/25/2019

Deductive Proof of Ethereum Smart Contracts Using Why3

A bug or error is a common problem that any software or computer program...
research
01/14/2021

The Good, the Bad and the Ugly: Pitfalls and Best Practices in Automated Sound Static Analysis of Ethereum Smart Contracts

Ethereum smart contracts are distributed programs running on top of the ...
research
08/12/2020

GasMet: Profiling Gas Leaks in the Deployment of Solidity Smart Contracts

Nowadays, blockchain technologies are increasingly adopted for different...
research
05/23/2019

Non-Negative PARATUCK2 Tensor Decomposition Combined to LSTM Network For Smart Contracts Profiling

Smart contracts are programs stored and executed on a blockchain. The Et...
research
10/23/2019

Empirical Review of Automated Analysis Tools on 47,587 Ethereum Smart Contracts

Over the last few years, there has been substantial research on automate...
research
05/12/2020

Blockchain Superoptimizer

In the blockchain-based, distributed computing platform Ethereum, progra...
research
09/16/2019

Broken Metre: Attacking Resource Metering in EVM

Metering is an approach developed to assign cost to smart contract execu...

Please sign up or login with your details

Forgot password? Click here to reset