Separate gas used, limit and price
By the end, explain the diagram in your own words, solve the case and justify the correction.
Prerequisites : Ethereum accounts and transactions
Level 2 · Intermediate →Reading path · 9 / 35 · Intermediate
Execution cost equals gas used multiplied by the effective gas price. A gas limit is not the final amount used.
The essentials
Gas measures computational resources; the effective gas price determines their cost. Execution fees equal gas used multiplied by the effective price. A conventional simple native transfer between externally owned accounts generally uses 21,000 gas; more involved calls consume more.
How it works
Under EIP-1559, the effective price combines a burned base fee and a priority fee within the sender’s cap. A cap below the base fee can prevent inclusion. The gas limit is a consumption ceiling, not necessarily the amount ultimately charged. An out-of-gas failure can still be costly.
What to watch
Fee burning does not guarantee that ETH supply always decreases: issuance also matters. Layer 2 fees may combine local execution and data-publication costs. Our calculator covers execution at an assumed effective price only. It is useful for units and scenarios, but does not query network congestion or quote a transaction.
Understand the details
Gas measures execution work; the gas limit caps how much work a transaction permits. The price determines what each unit costs. Under Ethereum’s fee mechanism, the base fee and priority fee contribute to the effective execution price, subject to the transaction’s caps. An unused gas allowance is not the same as gas consumed.
Boundaries and common mistakes
A failed transaction can still consume gas because validators executed work before the failure. Setting a high gas limit does not by itself speed inclusion. On rollups, user fees may include a separate component related to publishing data on L1, so an L1-only formula may not explain the complete bill.
The mechanism at a glance
- Gas limit: 80,000
- Gas used: 50,000
- Effective price: 12 gwei
- Execution fee: 0.0006 ETH
Apply the lesson to a case
Assume 50,000 gas used at an effective price of 12 gwei. The limit was 80,000. Calculate the execution fee in ETH and identify which quantity would change if the same operation required more computation. Ignore additional rollup fees in this example.
Use 50,000: the fee is 600,000 gwei, or 0.0006 ETH. The 80,000 limit is an allowance, not the measured consumption. Compare this with an out-of-gas case, where the permitted gas can be exhausted and the intended state changes fail.
Check your understanding
0.00042 ETH: 21,000 × 20 × 10⁻⁹. At an assumed €2,500 per ETH, that is €1.05.
Terms in this lesson
- Gas
- A measure of execution resources; gas units and the price per unit are separate quantities.
Prepare a correction note
Describe the passage and the proposed correction. This creates a local note for you to share; it sends nothing. Do not include personal or confidential information.