Why Ethereum's blockspace is limited?
Before we go any further into gas fees, let's understand block gas limits and why they exist.
Block space is limited
When a user initiates a transaction, it is not immediately processed by the Ethereum network. Instead, it is added to the node's mempool(waiting area) and awaits processing until it is picked up.
Miners(validators) cannot process all the pending transactions into the next block.
There is a limit on the transactions that can be included based on their complexity.
The block gas limit is expressed in gas units. For example, if the block gas limit is 10M, it can include transactions that cumulatively consume 10M gas units.
Why is there a block gas limit?
For a moment, consider ticket fare gates in train stations. The job of the fare gate (during checkout) is to confirm that every passenger has a valid ticket with balance before letting them out.
What if there was only one gate that can let out ~30 customers per second and trains kept coming every five seconds?
The fare gate would never catch up because there would always be an excessive number of people waiting to be checked out.
It is not a hard problem to solve. Just install additional gates.
In case of the Ethereum, each node has to validate every transactions in the latest block, that are produced every ~12 seconds.
To allow for more transactions to be added to the block, the nodes must be powerful enough to complete the validation and begin producing new blocks within that time frame. This leads to centralization since only nodes with powerful hardware can now participate in the network.
However, in order to achieve decentralization, regular users with consumer grade hardware must be able to participate in the network. The greater the number of nodes, the greater the decentralization. Hence, the block gas limit exists.
Block size impact
Let us query the blockchain to understand the block gas limit and the size of the latest blocks.
EVM records the block
gas_used by all the included transactions in the block header.
Dune Analytics extract and loads the block header information into
Dune Data Load
SELECT number as block_number, gas_used AS gas_used, -- gas used by all transactions in that block gas_limit - gas_used AS gas_remaining FROM ethereum.blocks ORDER by block_number DESC LIMIT 10; --select the latest 10 blocks
👨🏽💻 Fork the above query and give it a go.
This is a live chart. If you see any full blocks, it is likely that some transactions did not make it and will have to wait for their turn in subsequent blocks.
So, if all pending transactions are unable to enter the next block, how are they selected?
What are your thoughts?
Let's discuss it in the next section.
🏋️ Let's query the chain
Can you identify when the block gas limit was increased to 30 Million gas units?
Hint: Solve https://dune.com/queries/1275435