evm: Don't check call depth limit in Osaka - #1704
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The consensus-sensitive Osaka boundary lacks regression coverage for CALL and CREATE paths.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Disables unreachable call-depth checks from Osaka onward due to EIP-7825’s transaction gas cap.
Changes:
- Retains the 1024-depth limit before Osaka.
- Skips it for CALL and CREATE operations in Osaka and later revisions.
File summaries
| File | Description |
|---|---|
lib/evmone/instructions_calls.cpp |
Makes call-depth checks revision-dependent. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1704 +/- ##
=======================================
Coverage 98.02% 98.02%
=======================================
Files 179 179
Lines 16347 16357 +10
Branches 3765 3765
=======================================
+ Hits 16024 16034 +10
Misses 243 243
Partials 80 80
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
2179b02 to
7aa300c
Compare
7faee99 to
2c1c0c5
Compare
The call depth limit (1024) is not reachable in Osaka because of the transaction gas limit (EIP-7825) and the 63/64 call gas rule: the cheapest possible self-recursion runs out of gas at depth 494. The added state transition test pins that depth, so the premise fails visibly if a reprice ever changes it. It is the first test to recurse for real rather than enter at a synthetic msg.depth, and it overflows the 1 MB stack Windows gives the main thread. Executing nested calls is evmone's own recursion, so the library asks its consumers for the 8 MB other platforms provide.
2c1c0c5 to
7a70350
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Direct EVMC execution can now exceed the VM’s fixed execution-state capacity, and the standalone library misses the stack option.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
lib/evmone/instructions_calls.cpp:235
- The same out-of-capacity path applies to contract creation: an Osaka frame entered at depth 1024 now forwards a CREATE at depth 1025. Recursive execution then violates
VM::get_execution_state()'s 1,025-entry invariant, asserting in debug builds or reallocating and invalidating the still-active outer state in release builds. The transaction gas cap is not enforced by the EVMC VM itself, so this check must remain unless deeper externally initiated executions are made safe across the VM.
if (state.rev < EVMC_OSAKA && state.msg->depth >= 1024)
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Balanced
| } | ||
|
|
||
| if (state.msg->depth >= 1024) | ||
| if (state.rev < EVMC_OSAKA && state.msg->depth >= 1024) |
| target_link_libraries(evmone PUBLIC evmc::evmc intx::intx PRIVATE evmone::precompiles) | ||
|
|
||
| # Nested EVM calls recurse ~2.6 KB of stack per frame, too much for Windows' 1 MB default. | ||
| target_link_options(evmone INTERFACE $<$<CXX_COMPILER_ID:MSVC>:/STACK:8388608>) |
The call depth limit (1024) is not reachable in Osaka because of the transaction gas limit (EIP-7825) and the 63/64 call gas rule. The max call depth reachable is less than 500.