In this track: Execution traces and low-level calls
advanced · 4 MIN READ
State rollback boundaries
A child failure and a top-level failure have different enclosing scopes.
LET’S PICTURE IT
Canceling one subtask can discard its edits while the larger project still continues.
SEE IT FOR YOURSELF
Follow a revert and decode its error dataStep 1 / 4
This fictional call requests a transfer of one hundred raw units while the relevant balance is forty.
This fictional call requests a transfer of one hundred raw units while the relevant balance is forty.The contract rejects this request. State changes in the reverted call are rolled back, while work already consumed can still cost gas.A common Error(string) begins with selector 08c379a0. This example then encodes the message Not enough tokens.A decoder can recognize the supplied error shape. Identifying the true cause and source still needs the call context, code and state.
Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.
Follow the failed scope
A child revert rolls back effects within that child’s scope, including changes made by its nested calls. It does not automatically choose the parent’s later control flow.
Handle the parent response
A parent can catch the failure and continue, or propagate a failure that rolls back a larger enclosing scope. The resulting state depends on that decision.
Track state and logs together
Retained logs follow successful scopes, while logs from reverted scopes disappear. A trace can still show attempted operations that do not survive.
Keep fee accounting separate
Execution rollback does not refund all consumed gas or erase transaction processing costs. Explain state outcome and fee outcome as separate parts of the result.
Follow the execution
A writes x = 1
B writes y = 2, then reverts
A catches B and succeeds
A’s x can remain; B’s y does not.
A local conceptual trace with explicit assumptions; this is not a trace of a live transaction.
QUICK CHECK · NO PRESSURE
Can a successful parent retain earlier changes after catching a child revert?
The child rollback does not necessarily revert the whole parent.