test_call_clears_return_data_on_insufficient_balance()¶
Documentation for tests/byzantium/eip211_return_data/test_call.py::test_call_clears_return_data_on_insufficient_balance@26332146.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/byzantium/eip211_return_data/test_call.py::test_call_clears_return_data_on_insufficient_balance --fork Amsterdam
Test that a CALL clears the return-data buffer even when the call fails the insufficient-balance pre-check and the callee is never entered.
A CALL whose value exceeds the caller's balance is a "light" failure: it pushes 0 and never executes the callee, but per EIP-211 it must still reset the return-data buffer. A client that skips the reset on this early-return path would leave stale return data from a preceding CALL observable via RETURNDATASIZE/RETURNDATACOPY.
(The other CALL pre-check -- the 1024 call-stack depth limit -- is not exercised here: since EIP-150's 63/64 gas-forwarding rule, a call chain runs out of gas long before reaching depth 1024, so that branch is effectively unreachable.)
Storage layout
slot N = RETURNDATASIZE after the funded CALL (expected 32) slot N+1 = RETURNDATASIZE after the failing CALL (expected 0) slot N+2 = the failing CALL result (expected 0, failure)
Source code in tests/byzantium/eip211_return_data/test_call.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
Parametrized Test Cases¶
This test generates 1 parametrized test case across 12 forks.