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
Follow a revert and decode its error dataRequested actionTransfer 100 raw unitsExample inputsAvailable balance40 raw unitsCheck the ruleA deliberately failing local scenario, not a live transactionCondition fails100 > 40Request rejectedRollbackNo successful transferConsumed gas still mattersTop-level failure and a caught nested failure have different contextsError selector0x08c379a04 bytesMessage tailNot enough tokensDynamic string encodingCustom errors and Panic use different selectors and schemasDecoded messageNot enough tokensA diagnostic clueFurther evidenceCaller and code pathRelevant stateError bytes can be constructed by code; decoding is not authentication

This fictional call requests a transfer of one hundred raw units while the relevant balance is forty.

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?

Your progress stays in this browser.
Keep exploring the original referenceethereum.org ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.