Skip to content

Implement EOF bytecode format (EIP-3540 / EIP-7692) #87

@mw2000

Description

@mw2000

Summary

Implement the EVM Object Format (EOF) — a structured bytecode container with typed sections, static jump validation, and no runtime JUMPDEST analysis. EOF is a major EVM upgrade expected post-Prague.

Specification

EOF bytecode starts with 0xEF00 magic bytes followed by:

  • Version byte (currently 0x01)
  • Section headers: type, code, container, data sections
  • Each code section has input/output stack heights validated at deploy time

Key Changes

  • No JUMPDEST scanning at runtime — jumps validated at deploy time
  • New opcodes: RJUMP, RJUMPI, RJUMPV (relative jumps), CALLF/RETF (function calls), JUMPF, DUPN, SWAPN, EXCHANGE, EOFCREATE, RETURNCONTRACT, TXCREATE, RETURNDATALOAD, EXTCALL, EXTDELEGATECALL, EXTSTATICCALL, DATALOAD, DATALOADN, DATASIZE, DATACOPY
  • Stack validation at deploy time — no runtime underflow possible
  • Separate code and data sections

Implementation Guide

This is a large feature. Suggested breakdown:

  1. EOF container parser — parse header, validate magic/version, extract sections
  2. Stack validation — validate stack heights at deploy time for each code section
  3. New opcodes — implement RJUMP, RJUMPI, CALLF, RETF, etc.
  4. Deploy-time validation — reject invalid EOF containers in CREATE/CREATE2
  5. Runtime execution — modified executor for EOF bytecode (no JUMPDEST scanning)

Acceptance Criteria

  • EOF container parsing and validation
  • Stack height validation at deploy time
  • New relative jump opcodes
  • Function call/return opcodes (CALLF/RETF)
  • EOF-specific CREATE opcodes
  • Tests against EIP-7692 test vectors

Reference

Note

EOF is NOT yet active on mainnet. This is a forward-looking implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreCore EVM functionalityeipEIP specification implementationnot-planned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions