Skip to content

test_worst_zero_param()

Documentation for tests/benchmark/test_worst_compute.py::test_worst_zero_param@88e9fb8f.

Generate fixtures for these test cases for Osaka with:

fill -v tests/benchmark/test_worst_compute.py::test_worst_zero_param -m benchmark

Test running a block with as many zero-parameter opcodes as possible.

Source code in tests/benchmark/test_worst_compute.py
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@pytest.mark.parametrize(
    "opcode",
    [
        Op.ADDRESS,
        Op.ORIGIN,
        Op.CALLER,
        Op.CODESIZE,
        Op.GASPRICE,
        Op.COINBASE,
        Op.TIMESTAMP,
        Op.NUMBER,
        Op.PREVRANDAO,
        Op.GASLIMIT,
        Op.CHAINID,
        Op.BASEFEE,
        Op.BLOBBASEFEE,
        Op.GAS,
        # Note that other 0-param opcodes are covered in separate tests.
    ],
)
def test_worst_zero_param(
    benchmark_test: BenchmarkTestFiller,
    pre: Alloc,
    opcode: Op,
) -> None:
    """Test running a block with as many zero-parameter opcodes as possible."""
    benchmark_test(
        pre=pre,
        post={},
        code_generator=ExtCallGenerator(attack_block=opcode),
    )

Parametrized Test Cases

This test case is only parametrized by fork.

Test ID (Abbreviated) opcode
...fork_Prague-blockchain_test-opcode_ADDRESS ADDRESS
...fork_Prague-blockchain_test-opcode_ORIGIN ORIGIN
...fork_Prague-blockchain_test-opcode_CALLER CALLER
...fork_Prague-blockchain_test-opcode_CODESIZE CODESIZE
...fork_Prague-blockchain_test-opcode_GASPRICE GASPRICE
...fork_Prague-blockchain_test-opcode_COINBASE COINBASE
...fork_Prague-blockchain_test-opcode_TIMESTAMP TIMESTAMP
...fork_Prague-blockchain_test-opcode_NUMBER NUMBER
...fork_Prague-blockchain_test-opcode_PREVRANDAO PREVRANDAO
...fork_Prague-blockchain_test-opcode_GASLIMIT GASLIMIT
...fork_Prague-blockchain_test-opcode_CHAINID CHAINID
...fork_Prague-blockchain_test-opcode_BASEFEE BASEFEE
...fork_Prague-blockchain_test-opcode_BLOBBASEFEE BLOBBASEFEE
...fork_Prague-blockchain_test-opcode_GAS GAS
...fork_Osaka-blockchain_test-opcode_ADDRESS ADDRESS
...fork_Osaka-blockchain_test-opcode_ORIGIN ORIGIN
...fork_Osaka-blockchain_test-opcode_CALLER CALLER
...fork_Osaka-blockchain_test-opcode_CODESIZE CODESIZE
...fork_Osaka-blockchain_test-opcode_GASPRICE GASPRICE
...fork_Osaka-blockchain_test-opcode_COINBASE COINBASE
...fork_Osaka-blockchain_test-opcode_TIMESTAMP TIMESTAMP
...fork_Osaka-blockchain_test-opcode_NUMBER NUMBER
...fork_Osaka-blockchain_test-opcode_PREVRANDAO PREVRANDAO
...fork_Osaka-blockchain_test-opcode_GASLIMIT GASLIMIT
...fork_Osaka-blockchain_test-opcode_CHAINID CHAINID
...fork_Osaka-blockchain_test-opcode_BASEFEE BASEFEE
...fork_Osaka-blockchain_test-opcode_BLOBBASEFEE BLOBBASEFEE
...fork_Osaka-blockchain_test-opcode_GAS GAS