Ethereum Gas Limit explained
If you’ve ever sent a transaction on the Ethereum blockchain, you’re familiar with the concept of paying gas. The gas you pay covers the cost of computing your transaction. But, there’s no way to predetermine how much computation is required. And, that’s why you need to enter a gas limit for your transactions.
Gas consists of two components: gas price and limit
When you send an Ethereum transaction, you specify your gas price, typically denominated in Gwei, and a gas limit. The gas price you set determines how much you’re willing to pay per unit of gas. Whereas, the gas limit determines how many units of gas you’re willing to pay for. You can think of your gas limit like a budget you set for the miner processing your transaction.
Gas markets determine if and when transactions will get confirmed. Set your gas price too low and your transaction may get stuck. But, set your gas limit too low and your transaction cannot be executed because it runs out of gas.
Most of the time, your wallet automatically fills in the gas limit for you. Simple transfers typically require a limit of 21,000 units. Whereas complex interactions with smart contracts can require a limit of 100,000 or even 200,000. A general rule of thumb is that the more complex the transaction, the higher the gas limit will need to be. So don’t try and save gas by lowering your limit because it won’t change the amount of resources needed to process your transaction. Your transaction will just run out of gas and you’ll have to resubmit it, costing you more in gas fees.
Why is everyone talking about raising Ethereum’s gas limit?
When the Ethereum network starts to become congested, you always here talk about Ethereum’s gas limit. This talk can be confusing if you aren’t familiar with the term. Because, as it turns out the term gas limit is used in two different ways in Ethereum. As we’ve covered, transactions have gas limits. However, blocks themselves also have an overall gas limit.
There’s limit for the total gas that can be spent on the transactions contained within a block. Limiting the gas consumed in each block helps manage the growth of the Ethereum blockchain and the cost of operating a miner or node. Miners collectively have the ability to increase or decrease Ethereum’s block gas limit within a certain range. Theoretically, raising the limit would allow the Ethereum network to process more transactions per second. So when transactions start to pile up, you’ll often hear discussion about miners signaling for higher gas limits.
We hope we were able to clear things up for you. Join us in our Discord to discuss everything going in the Ethereum ecosystem.