Gas Limit
También conocido como: Transaction Gas Limit, Block Gas Limit
The maximum amount of computational work a user is willing to pay for in a transaction, or the maximum gas allowed in a single block.
Gas limit has two meanings in blockchain: the maximum gas units a user allocates for a specific transaction, and the maximum total gas allowed across all transactions in a single block. Both serve as caps to prevent runaway costs and infinite loops.
Transaction Gas Limit:
Every transaction specifies a gas limit, which is the maximum amount of gas the sender is willing to consume. If the transaction completes before using all the gas, the unused portion is refunded. If it runs out of gas before completing, the transaction fails (reverts), but the gas used is still charged.
Common Gas Limits:
| Operation | Gas Required | Typical Limit Set |
|---|---|---|
| ETH transfer | 21,000 | 21,000 |
| ERC-20 transfer | ~65,000 | 80,000 |
| Uniswap swap | ~150,000 | 200,000 |
| NFT mint | ~100,000-300,000 | 350,000 |
| Complex DeFi tx | ~500,000+ | 700,000+ |
Block Gas Limit:
Each block has a maximum gas capacity (currently ~30M gas on Ethereum). This limits how many transactions can fit in one block. When demand exceeds capacity, transactions compete for inclusion by offering higher gas prices.
What Happens When Gas Limit Is Wrong:
| Scenario | Result |
|---|---|
| Limit too low | Transaction fails, gas fee still charged |
| Limit too high | Transaction succeeds, excess gas refunded |
| Exactly right | Transaction succeeds, no waste |
Practical Tips: - Most wallets automatically estimate gas limits based on the transaction type - Complex contract interactions may need manual gas limit increases - If a transaction consistently fails with "out of gas," increase the limit - Never manually lower the gas limit below the estimated minimum - Some wallets show a gas estimate before you confirm, which is the lower bound
Relationship to Gas Price: Gas limit and gas price are different. The limit is how much work you allow, the price is how much you pay per unit of work. Total fee = gas used x gas price. Setting a high limit does not cost more unless the transaction actually uses that gas.
Términos relacionados
Análisis cripto relacionados
Explora cómo Gas Limit se aplica a estas criptomonedas con un análisis STRICT detallado.