From 6b0ea979c3476370d457a3f19529f5b7adddd147 Mon Sep 17 00:00:00 2001 From: colinlyguo Date: Wed, 15 Jan 2025 06:36:41 +0800 Subject: [PATCH] fix: OOG cases --- public/content/developers/docs/gas/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/content/developers/docs/gas/index.md b/public/content/developers/docs/gas/index.md index 6fdff280090..e6feee8496a 100644 --- a/public/content/developers/docs/gas/index.md +++ b/public/content/developers/docs/gas/index.md @@ -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}