Skip to content

Commit

Permalink
fix: OOG cases
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlyguo committed Jan 14, 2025
1 parent c8d0b17 commit 6b0ea97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public/content/developers/docs/gas/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ _Diagram adapted from [Ethereum EVM illustrated](https://takenobu-hs.github.io/d

The gas limit refers to the maximum amount of gas you are willing to consume on a transaction. More complicated transactions involving [smart contracts](/developers/docs/smart-contracts/) require more computational work, so they require a higher gas limit than a simple payment. A standard ETH transfer requires a gas limit of 21,000 units of gas.

For example, if you put a gas limit of 50,000 for a simple ETH transfer, the EVM would consume 21,000, and you would get back the remaining 29,000. However, if you specify too little gas, for example, a gas limit of 20,000 for a simple ETH transfer, the EVM will consume your 20,000 gas units attempting to fulfill the transaction, but it will not complete. The EVM then reverts any changes, but since the validator has already done 20k gas units worth of work, that gas is consumed.
For example, if you put a gas limit of 50,000 for a simple ETH transfer, the EVM would consume 21,000, and you would get back the remaining 29,000. However, if you specify too little gas, for example, a gas limit of 20,000 for a simple ETH transfer, the transaction will fail during the validation phase. It will be rejected before being included in a block, and no gas will be consumed. On the other hand, if a transaction runs out of gas during execution (e.g., a smart contract uses up all the gas halfway), the EVM will revert any changes, but all the gas provided will still be consumed for the work performed.

## Why can gas fees get so high? {#why-can-gas-fees-get-so-high}

Expand Down

0 comments on commit 6b0ea97

Please sign in to comment.