Skip to content

test_no_memory_corruption_on_upper_call_stack_levels()

Documentation for tests/cancun/eip5656_mcopy/test_mcopy_contexts.py::test_no_memory_corruption_on_upper_call_stack_levels@bc691d13.

Generate fixtures for these test cases for Prague with:

fill -v tests/cancun/eip5656_mcopy/test_mcopy_contexts.py::test_no_memory_corruption_on_upper_call_stack_levels --fork Prague

Perform a subcall with any of the following opcodes, which uses MCOPY during its execution, and verify that the caller's memory is unaffected.

Source code in tests/cancun/eip5656_mcopy/test_mcopy_contexts.py
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
@pytest.mark.with_all_call_opcodes
@pytest.mark.valid_from("Cancun")
def test_no_memory_corruption_on_upper_call_stack_levels(
    state_test: StateTestFiller,
    pre: Alloc,
    post: Mapping[str, Account],
    tx: Transaction,
):
    """
    Perform a subcall with any of the following opcodes, which uses MCOPY during its execution,
    and verify that the caller's memory is unaffected.
    """
    state_test(
        env=Environment(),
        pre=pre,
        post=post,
        tx=tx,
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Test ID (Abbreviated) call_opcode evm_code_type
...fork_Cancun-call_opcode_STATICCALL-evm_code_type_LEGACY-state_test STATICCALL LEGACY
...fork_Cancun-call_opcode_STATICCALL-evm_code_type_LEGACY-blockchain_test_from_state_test STATICCALL LEGACY
...fork_Cancun-call_opcode_DELEGATECALL-evm_code_type_LEGACY-state_test DELEGATECALL LEGACY
...fork_Cancun-call_opcode_DELEGATECALL-evm_code_type_LEGACY-blockchain_test_from_state_test DELEGATECALL LEGACY
...fork_Cancun-call_opcode_CALL-evm_code_type_LEGACY-state_test CALL LEGACY
...fork_Cancun-call_opcode_CALL-evm_code_type_LEGACY-blockchain_test_from_state_test CALL LEGACY
...fork_Cancun-call_opcode_CALLCODE-evm_code_type_LEGACY-state_test CALLCODE LEGACY
...fork_Cancun-call_opcode_CALLCODE-evm_code_type_LEGACY-blockchain_test_from_state_test CALLCODE LEGACY
...fork_Prague-call_opcode_STATICCALL-evm_code_type_LEGACY-state_test STATICCALL LEGACY
...fork_Prague-call_opcode_STATICCALL-evm_code_type_LEGACY-blockchain_test_from_state_test STATICCALL LEGACY
...fork_Prague-call_opcode_DELEGATECALL-evm_code_type_LEGACY-state_test DELEGATECALL LEGACY
...fork_Prague-call_opcode_DELEGATECALL-evm_code_type_LEGACY-blockchain_test_from_state_test DELEGATECALL LEGACY
...fork_Prague-call_opcode_CALL-evm_code_type_LEGACY-state_test CALL LEGACY
...fork_Prague-call_opcode_CALL-evm_code_type_LEGACY-blockchain_test_from_state_test CALL LEGACY
...fork_Prague-call_opcode_CALLCODE-evm_code_type_LEGACY-state_test CALLCODE LEGACY
...fork_Prague-call_opcode_CALLCODE-evm_code_type_LEGACY-blockchain_test_from_state_test CALLCODE LEGACY
...fork_Osaka-call_opcode_EXTCALL-evm_code_type_EOF_V1-state_test EXTCALL EOF_V1
...fork_Osaka-call_opcode_EXTCALL-evm_code_type_EOF_V1-blockchain_test_from_state_test EXTCALL EOF_V1
...fork_Osaka-call_opcode_EXTSTATICCALL-evm_code_type_EOF_V1-state_test EXTSTATICCALL EOF_V1
...fork_Osaka-call_opcode_EXTSTATICCALL-evm_code_type_EOF_V1-blockchain_test_from_state_test EXTSTATICCALL EOF_V1
...fork_Osaka-call_opcode_EXTDELEGATECALL-evm_code_type_EOF_V1-state_test EXTDELEGATECALL EOF_V1
...fork_Osaka-call_opcode_EXTDELEGATECALL-evm_code_type_EOF_V1-blockchain_test_from_state_test EXTDELEGATECALL EOF_V1
...fork_Osaka-call_opcode_STATICCALL-evm_code_type_LEGACY-state_test STATICCALL LEGACY
...fork_Osaka-call_opcode_STATICCALL-evm_code_type_LEGACY-blockchain_test_from_state_test STATICCALL LEGACY
...fork_Osaka-call_opcode_DELEGATECALL-evm_code_type_LEGACY-state_test DELEGATECALL LEGACY
...fork_Osaka-call_opcode_DELEGATECALL-evm_code_type_LEGACY-blockchain_test_from_state_test DELEGATECALL LEGACY
...fork_Osaka-call_opcode_CALL-evm_code_type_LEGACY-state_test CALL LEGACY
...fork_Osaka-call_opcode_CALL-evm_code_type_LEGACY-blockchain_test_from_state_test CALL LEGACY
...fork_Osaka-call_opcode_CALLCODE-evm_code_type_LEGACY-state_test CALLCODE LEGACY
...fork_Osaka-call_opcode_CALLCODE-evm_code_type_LEGACY-blockchain_test_from_state_test CALLCODE LEGACY