EIP-7960 EOF type section extension (EOF - Extended types section)
No call decision · EVM & execution · EIP status Draft · created 2025-05-28
Adds a type value to the EOF container's types_section indicating the kind of each code section, and raises the EOF version from 0x01 to 0x02. This lays the groundwork for executing different sections with different interpreters.
Why it is needed
EOF (EVM Object Format) is a new container format that splits contract code into multiple code sections. The current definition (EIP-3540) presumes that every code section is interpreted the same way by the EVM, so there is no way to mark what kind of code a given section is. As a result, there is no way to run only the compute-heavy parts on a faster alternative interpreter (such as EVM64), or to support other execution models like RISC-V on a per-section basis in the future. This EIP attaches a type value to each section so interpreters can interpret each code section differently. It also raises the version itself to 0x02, since EOF came close to deployment before being withdrawn from Fusaka, meaning third-party chains may already have deployed the existing format in production, and the version bump is meant to avoid compatibility problems with such chains.
What changes
Today
- The types_section entry currently holds only (inputs, outputs, max_stack_increase)
- All code sections are interpreted the same way, and there is no way to mark a section's kind
- The EOF container's version is 0x01
After EIP-7960
- The types_section entry changes to (type, reserved, inputs, outputs, max_stack_increase)
- A path opens for interpreters to look at each section's type and interpret each code section differently
- The version changes to 0x02 and the existing 0x01 becomes invalid
Who is affected
- Client teams: EOF container validation must additionally implement rules checking that type is a known value and that reserved is all zero.
- Compiler and tooling developers: EOF generation and analysis tools must be updated to reflect the new format of types_section (64 bits per entry) and version 0x02.
- Third-party chains that have already deployed EOF: With the version bump to 0x02, existing version 0x01 containers become invalid under this EIP.
In depth
The new format of types_section
Each entry of the types_section defined in EIP-3540 changes to the format (type, reserved, inputs, outputs, max_stack_increase). type is a uint8, reserved is 24 bits, and inputs, outputs, and max_stack_increase remain uint8, uint8, and uint16 respectively, as before. reserved exists to fix the padding, and with this change each types_section entry is exactly 64 bits.
Only one valid type value: 0x01
The only valid type this EIP defines is 0x01. Other code section types are left open to be defined by separate EIPs. In other words, this EIP itself does not add a new execution model; it only creates a slot where variants such as EVM64 can be attached on a per-section basis in the future.
Added validation rules
Two rules are added to EOF container validation. Validation fails if the type in types_section is not a known type. And reserved must be all zero. Containers with an unknown type or a nonzero reserved field are rejected at deployment time.
Reason for raising the version to 0x02
EIP-3540's version changes to 0x02 and 0x01 becomes invalid. EOF, including EIP-3540, came close to deployment before being withdrawn from Fusaka. The source text explains that, given that status, it is highly likely that third-party chains have already deployed EOF in production, and the version is raised to avoid backward-compatibility problems with such chains. It states that no other backward compatibility issues have been found.
Design intent: per-section interpreter dispatch
The new type parameter lets a contract 'dispatch' each code section to the interpreter variant it needs. The source gives this example: run the parts that mainly interact with Ethereum addresses, balances, and storage on the regular EVM, and run the compute-heavy parts on the faster EVM64, even though that part loses the ability to interact directly with addresses or balances. Letting type be defined per section lets a single contract move quickly between computational work and system/runtime work while staying concise.
Still-open parts and current status
Test cases and reference implementation have not yet been written, and security considerations are only noted as needing discussion. This EIP is in Draft status, so the specification may still change. There is no record of a core developer call deciding on fork inclusion.