Skip to content

Test Worst Compute

Documentation for tests/zkevm/test_worst_compute.py@cc5fc26a.

Generate fixtures for these test cases for Prague with:

fill -v tests/zkevm/test_worst_compute.py --fork Prague
Tests zkEVMs worst-case compute scenarios.

Tests zkEVMs worst-case compute scenarios.

Tests running worst-case compute opcodes and precompile scenarios for zkEVMs.

Test Functions Overview

Name Type Cases (Prague) Description
test_worst_zero_param state_test 14 Test running a block with as many zero-parameter opcodes as possible.
test_worst_calldatasize state_test 3 Test running a block with as many CALLDATASIZE as possible.
test_worst_callvalue state_test 4 Test running a block with as many CALLVALUE opcodes as possible.
test_worst_returndatasize_nonzero state_test 6 Test running a block which execute as many RETURNDATASIZE opcodes which return a non-zero
test_worst_returndatasize_zero state_test 1 Test running a block with as many RETURNDATASIZE opcodes as possible with a zero buffer.
test_worst_msize state_test 5 Test running a block with as many MSIZE opcodes as possible.
test_worst_keccak state_test 1 Test running a block with as many KECCAK256 permutations as possible.
test_worst_precompile_only_data_input state_test 3 Test running a block with as many precompile calls which have a single data input.
test_worst_modexp state_test 34 Test running a block with as many calls to the MODEXP (5) precompile as possible.
test_worst_precompile_fixed_cost state_test 24 Test running a block filled with a precompile with fixed cost.
test_worst_jumps state_test 1 Test running a JUMP-intensive contract.
test_worst_jumpdests state_test 1 Test running a JUMPDEST-intensive contract.
test_worst_binop_simple state_test 23 Test running a block with as many binary instructions (takes two args, produces one value)
test_worst_unop state_test 2 Test running a block with as many unary instructions (takes one arg, produces one value)
test_worst_tload state_test 4 Test running a block with as many TLOAD calls as possible.
test_worst_tstore state_test 4 Test running a block with as many TSTORE calls as possible.
test_worst_shifts state_test 2 Test running a block with as many shift instructions with non-trivial arguments.
test_worst_blobhash state_test 4 Test running a block with as many BLOBHASH instructions as possible.
test_worst_mod state_test 8 Test running a block with as many MOD instructions with arguments of the parametrized range.
test_worst_memory_access state_test 36 Test running a block with as many memory access instructions as possible.
test_worst_modarith state_test 8 Test running a block with as many "op" instructions with arguments of the parametrized range.
test_empty_block blockchain_test 1 Test running an empty block as a baseline for fixed proving costs.
test_amortized_bn128_pairings state_test 1 Test running a block with as many BN128 pairings as possible.
test_worst_calldataload state_test 3 Test running a block with as many CALLDATALOAD as possible.
test_worst_swap state_test 16 Test running a block with as many SWAP as possible.
test_worst_dup state_test 16 Test running a block with as many DUP as possible.
test_worst_push state_test 33 Test running a block with as many PUSH as possible.