WETH
Giáo trìnhExecution client

EOF

EVM Object Format - định dạng mới cho bytecode EVM

EVM Object Format (EOF)

This article is a stub, help the wiki by contributing and expanding it.

The EVM Object Format (EOF) is an extensible and versioned container format for EVM bytecode with a once-off validation at deploy time.

Currently, EVM Bytecode is an unstructured sequence of instructions. EOF introduces the concept of a container, which brings structure to byte code, making it easier to parse by EVM and analyze.

Purpose and Benefits

EOF was designed to address several limitations of the original EVM bytecode format:

  • Better Validation: Enables more thorough static analysis and validation of smart contracts before execution
  • Improved Execution Efficiency: Facilitates optimization of EVM execution through better-defined code sections
  • Enhanced Security: Reduces attack vectors by enforcing stricter code structure rules
  • Future-Proofing: Provides a foundation for future EVM improvements and features through versioned containers

EOF is specified in several EIPs covering different features, changes to various opcodes and introducing new ones. All these EIPs are tracked by a single meta EIP listing all of them; EIP-7692

Some of the EIPs included in EIP-7692 are:

  • (EIP-3540)[https://eips.ethereum.org/EIPS/eip-3540]: Introduces EOF Version 1, establishing the initial structure for structured bytecode.
  • (EIP-7620)[https://eips.ethereum.org/EIPS/eip-7620]: Removes the possibility to create contracts using CREATE or CREATE2 instructions. It introduces a new/replacement method in form of pair of instructions : EOFCREATE and RETURNCODE to provide a way to create contracts using EOF containers.

Differences from Legacy EVM Bytecode

FeatureLegacy EVMEOF
Container StructureUnstructured bytecodeClearly defined sections
Code ValidationLimited, runtimeComprehensive, pre-execution
Jump MechanicsDynamic: JUMP/JUMPIIncludes static jumps
TypingNoneFunction signatures and typing
Data HandlingMixed with codeSeparate data section

Resources

On this page