EIP-7979: Call and Return Opcodes for the EVM

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 the PC on top of the stack
  • RETURNSUB — return to the PC after the most recent JUMPSUB

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.