Understanding Ethereum Gas, Blocks and the Fee Market

Gas is one of the most fundamental concepts on Ethereum but it also seems to be one of the most misunderstood. This isn’t surprising because while on the surface the concept is easy to grasp, there are many layers. The goal of this article is to cover the essential concepts when it comes to gas, blocks and the fee market.


The EVM — the Ethereum Virtual Machine (EVM) running on each Ethereum node — is an emulation of a computer system. One example of a regular, non-blockchain virtual machine is the VirtualBox software, which allows you to emulate computer systems (guests) on your physical hardware (hosts). Any operation in the EVM consumes CPU cycles, disk access, or memory on the hosting machine. We must somehow measure this work and that is called gas.

Each operation on the EVM consumes a certain amount of gas and not all transactions are created equally. Accessing memory or writing to disk have differing costs with each EVM during execution of a contract. Essentially the more complex the contract and the more operations it performs, the more expensive it is to run it. For example, a simple send of ETH is 21,000 gas but a bet on Augur can cost 1,000,000 gas. In order to cover these costs, the sender of a transaction specifies how much they are willing to pay per unit of gas, called the gas price, which is denominated in gwei (1 gwei = 0.000000001 ETH). We can now calculate a transaction cost which is ‘gas consumed x gas price’.

If a malicious operator crafted a smart contract that went into an infinite loop, each loop would consume some gas and have an infinite cost to the user. Therefore there is a gas limit on every transaction, at which point the EVM would abort the execution of this contract if hit but still charge the malicious transaction the full fee.


Full node size over time

Another factor to consider when thinking of blocks is the uncle rate. Uncle blocks are an entire article on their own but in very short, if two blocks are found simultaneously by miners, they race across the network to see which propagates first. The “winner” gets the main block with a 2 ETH reward and the loser gets an uncle block with a smaller reward. Due to optimizations in the Geth and Parity clients recently, uncle rates have fallen and are steady around 7%.

Uncle count over time

In order to keep state size and uncle rates in check, Ethereum has the concept of a block gas limit. Since every transaction has an associated total gas consumed, this limit determines how much computation can be done on the Ethereum network per block.

Block gas limit over time

A recap on the above:

Fee Market

At this point, users determine how much they are willing to pay per unit of gas (gas price). This will fluctuate depending on the current demand of the network and there are plans to overhaul the current system through EIP-1559. Due to the gas block limit, the fee market almost always determines what order transactions are mined because miners looking to profit will select the transactions with the highest fees.

Recent Trends

Correlation between block size and gas limit

Transactions per day is not the best way to measure usage of the Ethereum network. The proper metric would be total gas spent per day. Over time, as usage of smart contracts have become more popular, the gas/tx on the network has gone up. So while transaction counts are not at an all time high, gas used is.

Gas used over time

Hopefully this primer has helped in your understanding of how the Ethereum network functions.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store