Skip to content

test_msize()

Documentation for tests/benchmark/compute/instruction/test_memory.py::test_msize@892e6d1e.

Generate fixtures for these test cases for Amsterdam with:

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

Benchmark MSIZE instruction.

Source code in tests/benchmark/compute/instruction/test_memory.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@pytest.mark.repricing(mem_size=1)
@pytest.mark.parametrize("mem_size", [0, 1, 1_000, 100_000, 1_000_000])
def test_msize(
    benchmark_test: BenchmarkTestFiller,
    mem_size: int,
) -> None:
    """Benchmark MSIZE instruction."""
    benchmark_test(
        target_opcode=Op.MSIZE,
        code_generator=ExtCallGenerator(
            setup=Op.POP(Op.MLOAD(Op.SELFBALANCE)),
            attack_block=Op.MSIZE,
            contract_balance=mem_size,
        ),
    )

Parametrized Test Cases

This test generates 5 parametrized test cases across 3 forks.