test_extcodecopy_warm()
Documentation for tests/benchmark/compute/instruction/test_account_query.py::test_extcodecopy_warm@ffe48572.
Generate fixtures for these test cases for Bogota with:
fill -v tests/benchmark/compute/instruction/test_account_query.py::test_extcodecopy_warm --gas-benchmark-values 1
Benchmark EXTCODECOPY instruction.
Source code in tests/benchmark/compute/instruction/test_account_query.py
| @pytest.mark.repricing(copy_size=512)
@pytest.mark.parametrize(
"copy_size",
[0, 32, 256, 512, 1024, pytest.param(None, id="copy_size_max")],
)
def test_extcodecopy_warm(
benchmark_test: BenchmarkTestFiller,
pre: Alloc,
fork: Fork,
copy_size: int | None,
) -> None:
"""Benchmark EXTCODECOPY instruction."""
if copy_size is None:
copy_size = fork.max_code_size()
copied_contract_address = pre.deploy_contract(
code=Op.JUMPDEST * copy_size,
)
benchmark_test(
target_opcode=Op.EXTCODECOPY,
code_generator=JumpLoopGenerator(
setup=Op.PUSH10(copy_size) + Op.PUSH20(copied_contract_address),
attack_block=Op.EXTCODECOPY(Op.DUP4, 0, 0, Op.DUP2),
),
)
|
Parametrized Test Cases
This test generates 6 parametrized test cases across 4 forks.