Gas — Paying for Computation
Asha's call to release is executed by thousands of nodes. If contract calls were free, anyone could send one containing an endless loop, and every node would spin forever. Gas is how Ethereum and the other EVM chains prevent that: every step of computation has a price, and the sender pays it.
The rule
Every step costs gas; the fee is gas used times the price per gas.
- Gas units measure work. Each EVM operation has a fixed gas cost: adding two numbers is cheap, writing to storage is expensive. A plain ETH transfer between two ordinary accounts costs exactly 21,000 gas.
- Gas limit. The sender sets the most gas the transaction may use. If execution needs more, it stops with out of gas: every change reverts, and the whole gas limit is spent.
- Gas price. The native coin paid per unit of gas, quoted in gwei, one billionth of an ETH. On Ethereum it has two parts: a base fee set by the protocol, which rises when blocks are busier than a target and is burned, plus a priority fee, or tip, which goes to the validator.
- Unused gas is refunded. When a call finishes, or fails a
requirecheck, you pay for the gas actually used, not the whole limit.
Each block has a gas limit too, so gas also measures how much of the scarce space in a block you take up. When demand is high, the base fee climbs and cheaper transactions wait.