Skip to content

test_jumpf_stack_size_1024_at_push()

Documentation for tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_jumpf_execution.py::test_jumpf_stack_size_1024_at_push@3719e927.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_jumpf_execution.py::test_jumpf_stack_size_1024_at_push --fork Osaka

Test stack reaching 1024 items in JUMPF target function at PUSH0 instruction.

Source code in tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_jumpf_execution.py
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
def test_jumpf_stack_size_1024_at_push(
    eof_state_test: EOFStateTestFiller,
):
    """Test stack reaching 1024 items in JUMPF target function at PUSH0 instruction."""
    eof_state_test(
        container=Container(
            sections=[
                Section.Code(
                    code=Op.PUSH0 * 1023
                    + Op.CALLF[1]
                    + Op.POP * 1023
                    + Op.SSTORE(slot_code_worked, value_code_worked)
                    + Op.RETURN(0, 0),
                    max_stack_height=1023,
                ),
                Section.Code(
                    # stack has 1023 items
                    Op.JUMPF[2],
                    code_inputs=0,
                    code_outputs=0,
                    max_stack_height=0,
                ),
                Section.Code(
                    Op.PUSH0
                    +
                    # stack has 1024 items
                    Op.POP
                    + Op.RETF,
                    code_inputs=0,
                    code_outputs=0,
                    max_stack_height=1,
                ),
            ],
        ),
        container_post=Account(storage={slot_code_worked: value_code_worked}),
    )

Parametrized Test Cases

This test case is only parametrized by fork and fixture format.

Test ID (Abbreviated)
...fork_Osaka-eof_test
...fork_Osaka-eof_state_test
...fork_Osaka-eof_blockchain_test