Infrastructure

Gas Limit

The maximum amount of gas a user allows a transaction to consume before it stops and fails.

The gas limit is a ceiling on how much computational work a transaction can use. A simple ETH transfer needs 21,000 gas; a complex DeFi interaction needs far more. Set it too low and the transaction runs out partway and reverts.

Here is the part newcomers miss: if a transaction fails because the limit was too low, you still pay for the gas it burned. The work was done; the result was thrown away.

There is also a block gas limit, set by the network, that caps total computation per block and is adjusted through consensus.

Related terms