In this track: Execution traces and low-level calls
advanced · 4 MIN READ

Call depth and stack limits

Frame nesting and stack item depth are separate constraints.

LET’S PICTURE IT

A building’s floor count differs from the number of cards stacked on one desk.

SEE IT FOR YOURSELF
A valid counter call, step by stepStep 1 / 4
A valid counter call, step by stepFunction requestincrement()No argumentsBefore executionstored count0A local teaching example with a defined starting stateIncoming callCheck function dispatchCheck coded conditionsRules passConditions passContinue executionA failed check can revert insteadCalculation0 + 1Result: 1Storage writecount = 1Persists if call succeedsCalculating a local value and storing it are separate stepsPersistent statecount1Later readGetter reports 1No new incrementState, logs and browser display have different roles

This example begins with count zero and a request to call increment(). No real contract is deployed.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

Separate the two structures

Message-call depth counts nested call frames. The operand stack counts word items within a frame; these are not two names for the same structure.

Recognize fixed bounds

The EVM has specified depth limits, including the 1024-item operand stack bound and call-depth restrictions. A program must also satisfy each instruction’s operand requirements.

Include available gas

Gas forwarding limits can make extremely deep recursion impractical before an idealized depth limit is reached. A depth number alone does not predict a runnable recursion length.

Avoid unbounded recursion

Design finite progress and explicit bounds where possible. Test the relevant call structure rather than relying on a theoretical maximum as an application capacity guarantee.

Follow the execution

Frame A: operand stack [2,3]
  calls Frame B: its own operand stack

Nesting depth and per-frame stack depth must be tracked separately.

A local conceptual trace with explicit assumptions; this is not a trace of a live transaction.

QUICK CHECK · NO PRESSURE

Are call-frame depth and operand-stack depth the same measurement?

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.