Skip to content

test_jumpf_with_inputs_stack_overflow()

Documentation for tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_jumpf_execution.py::test_jumpf_with_inputs_stack_overflow@21fb11c8.

Generate fixtures for these test cases for Osaka with:

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

Test stack overflowing 1024 items in JUMPF target function with inputs.

Source code in tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_jumpf_execution.py
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
def test_jumpf_with_inputs_stack_overflow(
    eof_state_test: EOFStateTestFiller,
):
    """Test stack overflowing 1024 items in JUMPF target function with inputs."""
    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=3,
                    code_outputs=3,
                    max_stack_height=3,
                ),
                Section.Code(
                    Op.PUSH0
                    + Op.PUSH0
                    +
                    # Runtime stackoverflow
                    Op.POP
                    + Op.POP
                    + Op.RETF,
                    code_inputs=3,
                    code_outputs=3,
                    max_stack_height=5,
                ),
            ],
        ),
        container_post=Account(storage={slot_code_worked: 0}),
    )

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