Failed on the chain. It was mined and failed: a hash and a receipt with status reverted.
3 min read· Updated
Short answer
Out of gas means the transaction used its whole gas limit before the code finished. The network undoes all of its changes, but the gas is still paid. It shows up as a mined transaction with status reverted and gas used equal to the gas limit. Raise the limit, or find out why the code uses so much.
What you will see
Messages printed for it:
out of gas
status: reverted, with gas used equal to the gas limit
Unlike the refusals at the node, this one happens inside a block. The transaction passed every check, was mined and then ran out of gas while the code was running. It has a hash and a receipt, and the receipt says reverted.
There is no revert reason, because the code never reached a revert: it simply ran out of gas, so there is nothing to decode.
Why does it happen?
A gas limit set by hand and too low. A copied number, or one a model chose in a tool argument.
A stale estimate. The estimate was right for the state at that moment. The state changed before the transaction was mined.
Code that does more work than expected. A loop over data that has grown.
How do I fix it?
Estimate instead of guessing, and add headroom on top of the estimate. See the snippet on the intrinsic gas page.
Do not override the limit with a smaller number than the estimate.
If the estimate is large, find out why. A loop that grows with data is a bug to fix, not a limit to raise.
In a worker or an agent, record the limit with the transaction, so a receipt with gas used equal to the limit is easy to spot.
What does it look like in a trace?
The send span is fine: the transaction was accepted and has a hash. The confirm span ends with an error, because the receipt says reverted:
confirm 31337error
blockchain.tx.status
reverted
blockchain.tx.gas.used
50,000
blockchain.tx.fee
88,296,564,050,000
error.type
reverted
From the run above. There is no blockchain.tx.revert.reason on this span, which is how it differs from a revert with a reason.
No revert reason on a reverted confirm span, and gas used equal to the limit you sent, point to out of gas. A reverted span that does have a reason is execution reverted. How the status is set is in span status.
How this page was checked. Reproduced on a local Anvil chain (31337) with viem 2.57.2 and @hashspan/viem 1.1.0 on 2026-10-07: a gas limit of 50,000 against a contract that loops until the gas is gone. The receipt had status reverted and gasUsed 50000. The sentence that the gas is still paid is from ethereum.org's gas page.
FAQ
Do I pay for a transaction that ran out of gas?
Yes. If a transaction runs out of gas during execution, the EVM reverts any changes, but all the gas provided is still consumed for the work performed (ethereum.org, Gas). In our run the fee was 88,296,564,050,000 wei for 50,000 gas.
How do I tell out of gas from a revert?
Compare gas used with the limit you sent. When they are equal and there is no revert reason, the code ran out of gas. A revert with a reason, such as a failed require, uses part of the limit, and hashspan can decode its reason. In our run a revert used 21,054 gas of a 100,000 limit.
Why did the estimate not prevent it?
An estimate is made against the state at that moment. If the state changes before the transaction is mined, or you override the limit with a smaller number, the work can need more gas than you allowed.