THE ESSENTIALS

  • Gas limit and price per gas describe different constraints.
  • The priority fee is capped by the room left after the base fee.
  • Included transactions can consume gas even when execution fails.

An Ethereum wallet can show several numbers under “gas”: a gas limit, a maximum fee per gas, a priority-fee cap and an estimated total. Reading the largest number as the inevitable bill mixes together a resource allowance, a price ceiling and an eventual charge.

For an ordinary EIP-1559 transaction on Ethereum's base layer, the execution fee depends on gas actually charged and the effective price per gas. The following explanation concerns that fee mechanism, with primary documentation checked on 23 September 2026. It does not describe every wallet service fee or an L2's complete fee formula.

Gas measures work; the limit bounds it

Gas units account for execution resources. Gas price states how much ether is paid per unit, commonly quoted in gwei; one gwei is one billionth of an ether. The transaction gas limit sets the maximum execution allowance supplied by the sender. It is distinct from the block gas limit, which constrains the whole block. Ethereum's gas documentation explains these units and limits.

If execution needs less than the allowance, unused gas is not charged as though it had been consumed. If execution exhausts the available gas, the attempted operation can fail. Raising the allowance does not by itself raise the price offered per unit or guarantee inclusion.

The transaction also has to satisfy validity requirements, including sufficient funds. The ability to afford its maximum execution-fee exposure is separate from the smaller fee it may ultimately pay.

The maximum fee includes the tip

For the EIP-1559 transaction type, maxFeePerGas caps the total execution price per gas. maxPriorityFeePerGas caps the priority component. The protocol sets the block's base fee; the sender does not choose it.

The effective priority fee is the smaller of the priority cap and the amount left under the total cap after paying the base fee. Thus:

effective price = base fee + min(priority cap, maximum fee − base fee)

This expression assumes the maximum fee is at least the base fee and the transaction satisfies the other validity rules. If the base fee exceeds the maximum fee, it cannot be included at that block's base fee. The EIP-1559 specification states the checks and capped-tip calculation explicitly.

The base-fee portion is burned. The priority portion rewards the block producer. A larger fee cap provides headroom for a changing base fee; it is not automatically an instruction to pay that entire cap.

A hypothetical bill, calculated twice

Assume a transaction has a gas limit of 100,000, is ultimately charged 60,000 gas, sets a maximum fee of 40 gwei and a priority cap of 3 gwei. These are invented inputs, not typical costs or a recommendation.

Hypothetical caseBase feeEffective tipEffective priceExecution fee
A25 gwei3 gwei28 gwei0.00168 ETH
B39 gwei1 gwei40 gwei0.00240 ETH

Case A costs 60,000 × 28 gwei. In case B, only one gwei of room remains under the total cap, so the tip is clipped. Both are below the maximum execution-fee exposure of 100,000 × 40 gwei, or 0.004 ETH. The comparison isolates fee arithmetic and assumes identical charged gas in both cases.

A failed operation can still cost money

Inclusion and successful execution are different events. A contract can reject an operation after computation has already occurred. A top-level revert rolls back its execution's state changes but does not erase the gas already spent doing that work.

Failure does not always mean the entire gas allowance was consumed. EIP-140 defines REVERT so it can stop execution while preserving remaining gas. An out-of-gas failure has different accounting consequences. Conversely, a transaction rejected before inclusion has no onchain execution fee from that rejected submission.

This distinction matters when reading a failed swap: slippage and minimum-received conditions can protect an execution outcome without making the attempted computation free.

Compare the estimate with the receipt

Use the receipt's gas used and effective gas price to reconcile the execution fee; Ethereum's JSON-RPC documentation describes transaction receipts. Keep the transferred amount separate. Also identify any application charge before treating the wallet's combined total as a network fee.

Finally, identify the transaction and network. Ethereum supports multiple transaction types, including blob transactions with an additional data-fee mechanism. On L2s, Ethereum publication costs may also affect the total. Those qualifications prevent a correct EIP-1559 calculation from being misapplied to a different bill.

Worked illustrationCryptX

Illustration: fee cap versus execution fee paid

Hypothetical Ethereum L1 EIP-1559 execution-fee arithmetic only; excludes transferred value, blob fees, L2 publication costs and service charges.

Hypothetical gas allowance
100,000 gas

The example assumes only 60,000 gas is charged.

Hypothetical fee caps
40 gwei total; 3 gwei priority

The priority cap sits inside the total per-gas cap.

Case A: 25 gwei base fee
0.00168 ETH

Effective tip = min(3, 40 − 25) = 3; 60,000 × 28 × 10^-9 ETH.

Case B: 39 gwei base fee
0.00240 ETH

Effective tip = min(3, 40 − 39) = 1; 60,000 × 40 × 10^-9 ETH.

Maximum execution-fee exposure
0.004 ETH

100,000 × 40 × 10^-9 ETH; this is not either scenario’s actual fee.

Example basis: Primary documentation checked 23 September 2026

Retrieved / checked:

Method: All numerical inputs are hypothetical. Applied the capped priority-fee rule from EIP-1559, multiplied the effective price by assumed charged gas, and converted gwei to ETH at 10^-9 ETH per gwei.

Limits: Both scenarios assume a valid included transaction and the same charged gas. Figures are not observations, cost estimates or proposed fee settings. Maximum exposure excludes any transferred ETH.

Sources & transparency

  1. Ethereum.org: Gas and fees ↗
  2. EIP-1559: Fee market change ↗
  3. Ethereum.org: Transactions ↗
  4. EIP-140: REVERT instruction ↗
  5. Ethereum.org: JSON-RPC API ↗

Prepared with AI assistance using the sources above. No individual human reviewer is claimed. How we use AI.

This article is educational and is not a recommendation to buy, sell or hold an asset. Jurisdiction and product terms matter.

Suggest a correction