EIP-7979: Call and Return Opcodes for the EVM
Abstract
This is the smallest possible change to the EVM to support calls and returns.
This proposal introduces two new control-flow opcodes
JUMPSUB
— jump to thePC
on top of the stackRETURNSUB
— return to thePC
after the most recentJUMPSUB
and restricts valid
control flow to static uses of JUMP, JUMPI, and JUMPSUB.
Valid
code will not execute invalid instructions, jump to invalid locations, underflow stack, or use unbounded stack in the absence of recursion.