Skill 5.1.1

Explain gas, gas limits and the purpose of fees

Key Concepts

Every EVM operation has a gas cost that reflects the resources it consumes: simple arithmetic costs 3 gas, while writing a new storage value costs 20,000. Gas measures work independently of the price of ether, and the sender pays for it in ether at a price per unit of gas.

The sender sets a gas limit, the maximum the transaction may consume. If execution exceeds it, the transaction stops with an out-of-gas error, all its state changes are reverted, and the gas consumed is still paid, because validators did the work. Gas not used below the limit is not charged. This makes infinite loops harmless to the network: they simply run out of gas.

Blocks also have a gas limit, which caps how much computation fits in one block, and since the Fusaka upgrade (December 2025) a single transaction may use at most 16,777,216 (224) gas. Fees therefore ration scarce block space and protect the network from spam.