Skip to content

test_nested_calls()

Documentation for tests/benchmark/compute/instruction/test_system.py::test_nested_calls@02aafd78.

Generate fixtures for these test cases for Bogota with:

fill -v tests/benchmark/compute/instruction/test_system.py::test_nested_calls --gas-benchmark-values 1

Benchmark chains of nested call frames.

Source code in tests/benchmark/compute/instruction/test_system.py
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
@pytest.mark.parametrize(
    "opcode",
    [Op.CALL, Op.CALLCODE, Op.DELEGATECALL, Op.STATICCALL],
)
def test_nested_calls(
    benchmark_test: BenchmarkTestFiller,
    pre: Alloc,
    opcode: Op,
) -> None:
    """Benchmark chains of nested call frames."""
    chain_address = pre.deploy_contract(
        code=Op.POP(opcode(gas=Op.GAS, address=Op.ADDRESS))
    )

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

Parametrized Test Cases

This test generates 4 parametrized test cases across 4 forks.