EIP-8452 EVM Multi-Branch and Call Table (Jump and Call Tables for the EVM)

No call decision · EVM & execution · EIP status Draft · created 2026-10-20

Adds JUMPV and CALLSUBV, multi-branch and call instructions usable even in validated code, which jump to one of several destinations or call a subroutine in one step via a table placed inside the code.

Why it is needed

For validated code (EIP-8337), every jump and call destination must be a fixed value within the code for safety to be provable in linear time. But dispatch, where one of several destinations is chosen by value, requires repeating N comparisons and jumps or building a comparison tree to pick one of N destinations, unlike legacy code, which could handle a memory jump table with a single computed JUMP. Every contract pays this cost each time it selects a function selector, and interpreters and state machines pay it every time they cycle through an inner loop; compilers also cannot take the path of optimizing a switch statement into a jump table. This EIP returns dispatch to its proper cost while preserving verifiability, by placing the destinations as data in a table inside the code and pushing only that table's location onto the stack for jumping or calling.

What changes

Today

After EIP-8452

Who is affected

In depth

JUMPV: Branching to a table

JUMPV (0xBE) first pops the table's location from the data stack, then pops the case value. It jumps by moving the PC to the destination that the case selects from the table. If the case exceeds the table's count, it goes to the last destination. If the destination is outside the code range or is not a JUMPDEST/CALLDEST, it becomes an exceptional halt and consumes all gas. Jumping to a CALLDEST enters a subroutine without pushing a return address, the same way JUMP does. The gas cost is high (10).

CALLSUBV: Calling a subroutine via a table

CALLSUBV (0xBD) also pops the table location and case from the stack to pick the destination, but before jumping it first pushes the return address (PC+1) onto the return stack. The destination must be a CALLDEST, and if the table is outside the code or the return stack is already full with 1024 entries, it becomes an exceptional halt. The gas cost is also high (10), same as JUMPV.

Structure of the table

A table consists of a 1-byte count followed by count+1 destinations (each 2 bytes, big-endian, counted from the first byte of the code). The table is data that can be placed anywhere in the code, and its location is passed on the stack as the instruction's operand. The case is counted from 0 to select a destination, and a case exceeding the count points to the last destination. Since neither instruction takes immediate data, the JUMPDEST analysis method does not change, and both behave the same in ordinary code and MAGIC code.

Validation rules

This extends the validation constraints of EIP-8337. A reachable JUMPV or CALLSUBV must be immediately preceded by a PUSH that places the table location. The table must be inside the code, and exactly one instruction may point to that table. The destination of JUMPV must be a JUMPDEST or CALLDEST, and the destination of CALLSUBV must be a CALLDEST. Each destination of JUMPV is treated as a successor of that JUMPV, and there is no fall-through. All destinations of CALLSUBV return to the instruction following CALLSUBV, so because Constraint 4 allows only one stack offset per instruction, they must all have the same net stack effect.

Gas cost and workload

Both instructions have a gas cost of high (10), the same tier as JUMPI. In practice what they do is one bounds comparison, reading 2 bytes from the code, and the destination check that JUMP performs, with CALLSUBV adding the push that CALLSUB performs. The source states that whether this cost is actually balanced needs benchmarking.

Why the table sits in the code and the location sits on the stack

An instruction with immediate data would change the JUMPDEST analysis method, risking a change in meaning for existing deployed contracts that happen to contain the new opcode value as data. By having the data table referenced by a stack location, existing clients' scanning method stays unchanged, and a deployed contract that happens to hit 0xBD/0xBE still halts exceptionally as it does now. Also, by placing the location on the stack while forcing a PUSH immediately before JUMPV/CALLSUBV, the dispatch becomes a dynamic jump in ordinary code but a static one in MAGIC code, where the verifier can read the table from the code and prove all destinations in advance.

Why the default is the last destination, and why a table may belong to only one instruction

If the case exceeds the table's count, it always goes to the last destination, so every case is guaranteed to jump or call somewhere. EIP-8013's RJUMPV used fall-through as its default, but that cannot be used for CALLSUBV because a path that skips the call would reach the return point without the callee's net stack effect, failing validation. In addition, restricting each table to being pointed to by exactly one instruction caps the control-flow edges a table of k entries can add at k. If multiple instructions shared it, the edges would multiply by the number of sharers, potentially exceeding the linearity bound on validation that EIP-8337 measured and priced.

Status

This EIP is currently in Draft status and presupposes EIP-7979 and EIP-8337. The specification and gas costs (particularly whether high=10 is appropriate) may change depending on benchmarking results. There is no core developer call record of a decision on fork inclusion.

Original EIP · ← EIPs