Rolling back state does not erase computation already performed.
LET’S PICTURE IT
An office can process an application and reject it after checking its details. The work occurred even though the requested change was not approved.
SEE IT FOR YOURSELF
Calculate and split a manual execution feeStep 1 / 4
This example supplies twenty-one thousand gas used. It is a simple teaching input, not a live estimate of a contract call.
This example supplies twenty-one thousand gas used. It is a simple teaching input, not a live estimate of a contract call.With base ten Gwei, priority cap two and total cap twenty, the effective rate is twelve Gwei per gas.Twenty-one thousand times twelve Gwei gives two hundred fifty-two thousand Gwei, or 0.000252 ETH.The base-fee component is 0.00021 ETH and is burned. The priority component is 0.000042 ETH for the block fee recipient.
Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.
Revert changes the state outcome
A reverted call rolls back its state changes under execution rules. That gives atomicity to the affected operation; it does not travel backward and remove the computational steps that were needed to reach the failure.
Gas records that work
The transaction can still incur execution fees for consumed resources. An explicit REVERT can return unused gas to its caller context, which differs from claiming all spent gas is refunded.
A receipt reports the final context
For a top-level failed transaction, the receipt status indicates failure and gas fields describe accounting. A failed inner call caught by an outer contract may occur within a top-level successful transaction.
Error bytes are an aid, not a full trace
A readable error can point to a failed condition, but it does not explain every gas-consuming step. Use supplied revert data in the decoder while recognizing the missing code and state context.