Skip to content

test_no_memory_corruption_on_upper_create_stack_levels()

Documentation for tests/cancun/eip5656_mcopy/test_mcopy_contexts.py::test_no_memory_corruption_on_upper_create_stack_levels@892e6d1e.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/cancun/eip5656_mcopy/test_mcopy_contexts.py::test_no_memory_corruption_on_upper_create_stack_levels --fork Amsterdam

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

Source code in tests/cancun/eip5656_mcopy/test_mcopy_contexts.py
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
@pytest.mark.parametrize(
    "call_opcode",
    [
        Op.CREATE,
        Op.CREATE2,
    ],
)
@pytest.mark.valid_from("Cancun")
def test_no_memory_corruption_on_upper_create_stack_levels(
    state_test: StateTestFiller,
    pre: Alloc,
    post: Mapping[str, Account],
    tx: Transaction,
) -> None:
    """
    Perform a subcall with any of the following opcodes, which uses MCOPY
    during its execution, and verify that the caller's memory is unaffected:
      - `CREATE`
      - `CREATE2`.
    """
    state_test(
        env=Environment(),
        pre=pre,
        post=post,
        tx=tx,
    )

Parametrized Test Cases

This test generates 2 parametrized test cases across 4 forks.