Skip to content
Crypto News

Blockchain markets, protocols and regulation

Failed Ethereum Transactions: Reverts and Gas Costs

Failed Ethereum transactions still cost gas because execution uses network resources before failure; a revert refunds unused gas, while running out does not.

The Crypto News Editors

Failed Ethereum Transactions: Reverts and Gas Costs

A failed Ethereum transaction still costs gas because the network charges for computation already performed, even when the transaction’s state changes are rolled back. Gas pays for processing and block inclusion, not for a successful outcome, and charging for that work also helps prevent free spam.

A failed transaction pays for computation up to the failure

Ethereum charges for the gas a transaction uses before it stops. A contract call can run code, check conditions and change temporary execution state before it encounters a problem. If it then fails, those state changes are undone, but the computation has already taken place and the transaction can still be included in a block.

Suibridge is a cross-chain bridge that uses lock-and-mint to transfer supported assets from Ethereum to Sui. To understand Suibridge’s lock-and-mint flow and ETH custody, it helps to know that a bridge deposit is still an Ethereum transaction: its execution uses gas whether it completes or reverts.

Say you submit a Suibridge USDT deposit before the required approval has confirmed. The deposit can reach the contract, fail its approval check and revert. The deposit does not complete, but Ethereum still charges for the work done before that check stopped execution.

A revert refunds unused gas, while running out does not

The size of the charge depends on how execution ends. With a revert, the REVERT instruction defined by EIP-140 rolls back state changes and refunds unused gas. A transaction that fails early therefore costs less than one that performs more work and fails later.

Think of the gas limit as the maximum fuel available for a trip. If the journey is stopped partway, the unused fuel remains; if the tank runs dry before the journey is complete, there is nothing left to return. Likewise, a revert consumes gas up to the failure and returns the rest, while running out of gas consumes the full gas limit.

The fee is gas used multiplied by the effective gas price: the base fee plus the priority fee, measured in ETH. Under EIP-1559, the base fee is burned and the priority fee goes to the validator. Since gas used depends on where execution stopped, two failed transactions with different limits or failure points can have different fees.

This is why “failed” does not mean “free,” and a revert is not the same as running out of gas. A revert returns the portion of the limit the transaction did not use; an out-of-gas failure uses the whole limit. In both cases, the fee covers the computation Ethereum processed before execution ended.