Skip to content

test_sibling_frame_memory()

Documentation for tests/benchmark/compute/instruction/test_memory.py::test_sibling_frame_memory@814481c0.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/benchmark/compute/instruction/test_memory.py::test_sibling_frame_memory --gas-benchmark-values 1

Benchmark sibling call frames that each expand their own memory.

Source code in tests/benchmark/compute/instruction/test_memory.py
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
@pytest.mark.parametrize("mem_size", [0, 8 * 1024, 64 * 1024])
def test_sibling_frame_memory(
    benchmark_test: BenchmarkTestFiller,
    pre: Alloc,
    mem_size: int,
) -> None:
    """Benchmark sibling call frames that each expand their own memory."""
    frame_code = Op.STOP if mem_size == 0 else Op.MSTORE8(mem_size - 1, 0)
    frame_address = pre.deploy_contract(code=frame_code)

    benchmark_test(
        target_opcode=Op.CALL,
        code_generator=JumpLoopGenerator(
            attack_block=Op.POP(
                Op.CALL(
                    gas=Op.GAS,
                    address=frame_address,
                )
            )
        ),
    )

Parametrized Test Cases

This test generates 3 parametrized test cases across 3 forks.