Reconcile an Ethereum execution fee with the sender’s fee cap
A wallet may authorize a much higher per-gas price than a block actually charges. The base fee and priority cap explain the difference on a type-2 transaction.
Work through a fee cap
Suppose the block base fee is 30 gwei. The sender allowed up to 32 gwei per gas in total and up to 5 gwei as a tip. Only 2 gwei per gas remain for the tip.
min(32, 30 + 5) = 32 gwei/gas
32 × 21000 = 672000 gwei
For 21,000 gas used, the execution charge is 672,000 gwei, or 0.000672 ETH. For reconciliation, take gasUsed and effectiveGasPrice from the receipt and multiply as integers in wei.
Know which charges belong here
The transferred ETH value is a separate debit. Blob transactions also have a separate blob gas charge. When the base fee exceeds a type-2 transaction’s total cap, that block cannot include the transaction at a discounted base fee. eips.ethereum.org EIP-1559