---
eip: 6206
label: EIP-6206
title: EOF - JUMPF and non-returning functions
status: Stagnant
type: Standards Track
category: Core
created: 2022-12-21
requires: 4750, 5450
official: https://eips.ethereum.org/EIPS/eip-6206
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-6206.md
canonical: https://eips.huatuo.xyz/eip-6206/
lang: en
tldr: Adds JUMPF, an EOF instruction that jumps into another function without a return frame (a tail call), and lets functions be marked non-returning for smaller, cheaper code.
tags: [evm, eof, opcodes, compilers, core]
---

# EIP-6206: EOF - JUMPF and non-returning functions

> Introduces instruction for chaining function calls.

**TL;DR:** Adds JUMPF, an EOF instruction that jumps into another function without a return frame (a tail call), and lets functions be marked non-returning for smaller, cheaper code.

## What problem does it solve?

The EVM Object Format (EOF) introduces real functions: code is split into sections, `CALLF` calls a section and `RETF` returns ([EIP-4750](/eip-4750/)). That leaves two inefficiencies:

1. **Tail calls.** A function that ends by calling another function and immediately returning still pays for a `CALLF` + `RETF` round trip and a return-stack frame.
2. **Error helpers.** Shared helpers that always end in `REVERT` are common. Because stack validation ([EIP-5450](/eip-5450/)) requires exact stack heights on return, callers would have to clean up extra stack items before calling them, even though control never comes back.

EIP-6206 solves both with one new instruction and a "non-returning" flag.

## How it works

**`JUMPF` (opcode `0xe5`)** takes a 2-byte immediate `target_section_index`. It sets the current section to the target and `PC` to 0 **without** pushing a return frame. It costs 5 gas and does not touch the operand stack. Before jumping, it checks that the target's declared `max_stack_increase` cannot overflow the 1024-item stack limit.

**Non-returning sections.** In the EOF type section, a code section's `outputs` value can be `0x80`, meaning it never returns to its caller. A section must be marked non-returning if and only if it contains no `RETF` and no `JUMPF` into a returning section. The first code section must have 0 inputs and be non-returning.

**Validation rules (at deploy time):**

- `JUMPF` into a returning section: the stack height must be exactly `current.outputs - target.outputs + target.inputs`, and `current.outputs >= target.outputs`. A section with more outputs can reuse a helper with fewer outputs if it leaves the difference on the stack.
- `JUMPF` into a non-returning section: the stack only needs at least `target.inputs` items. Extra items can be left behind.
- `CALLF` into a non-returning section is invalid; use `JUMPF`.
- `JUMPF` is a terminating instruction, like `RETF` or `STOP`.

In legacy (non-EOF) bytecode, `0xe5` remains invalid.

## Sample code

EOF assembly pseudocode: two functions share one non-returning error helper.

```text
; type section: section 0 -> inputs 0, outputs 0x80 (non-returning)
;               section 1 -> inputs 1, outputs 1
;               section 2 -> inputs 0, outputs 0x80 (non-returning: revert helper)

code_section_1:            ; f(x) -> y
    DUP1
    ISZERO
    RJUMPI @bad            ; if x == 0, jump to error path
    PUSH1 2
    MUL
    RETF
bad:
    JUMPF 2                ; tail-jump to helper; leftover x on stack is fine

code_section_2:            ; revert helper, never returns
    PUSH0
    PUSH0
    REVERT
```

## Things to know

- **Status: Stagnant.** EOF as a whole ([EIP-3540](/eip-3540/) and the [EIP-7692](/eip-7692/) meta list) is Stagnant and is not active on Ethereum mainnet; `JUMPF` only exists in an EOF context.
- Because EOF rejects unknown opcodes at deploy time, adding `JUMPF` cannot change any existing EOF contract's behavior.
- `RJUMP*` offsets ([EIP-4200](/eip-4200/)) may not point into `JUMPF`'s 2-byte immediate.
- The main beneficiaries are compiler authors: smaller bytecode and lower gas for shared code paths, not new capabilities for contract developers.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-6206
