Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article covers the changes in Solidity 0.8.29, based on the official release announcement below. Network availability, experimental features, and planned changes are described in their March 2025 release context, not as statements about the current compiler or network.

Changes

  • Support for EOF
  • Support for custom storage layouts
  • Initial support for ethdebug

EOF support

Solidity 0.8.29 includes experimental support for the new EVM Object Format (EOF). Using EOF requires selecting the Osaka EVM version, which at the time of the release had not been deployed to mainnet or testnets.

What is the EVM Object Format (EOF)?

EOF is a new binary format for the Ethereum Virtual Machine (EVM). It aims to improve security and performance compared with conventional EVM bytecode.

Why is EOF needed?

Conventional EVM bytecode (non-EOF) has several limitations.

  • Poor gas efficiency
    • Many opcodes are not optimized, which can lead to unnecessary computation.
  • Difficult code analysis
    • The EVM lacks an explicit structured description of code and data, making debugging and security analysis more difficult.
  • Difficulty improving safety
    • Bytecode is sufficiently flexible that writing code with security problems is relatively easy.

EOF introduces a structured format to address these issues.

EOF features

A well-defined binary structure

EOF divides the program into sections such as the following.

  • Header
    • Information identifying the bytecode as EOF.
  • Code section
    • The program executed by the EVM.
  • Data section
    • Data such as constants. This section is distinct from persistent contract storage.

This structure makes code easier for the EVM to analyze and is intended to improve safety and performance.

Removal of problematic opcodes

EOF removes some operations and access patterns that cause problems in conventional EVM bytecode.

  • GAS and GASLEFT()
    • EOF does not allow direct inspection of the remaining gas in this manner.
  • <address>.code
    • EOF restricts access to a contract's code in this manner.

These changes aim to make EVM execution safer and more predictable.

Changes to contract address derivation

EOF uses a salt when deploying a contract.

Where conventional EVM contract creation can derive an address from the account's nonce, EOF uses a salt-based mechanism. Reusing the same salt under the same address-derivation conditions yields the same address. The default is salt = 0, although explicitly specifying the salt could become mandatory in the future.

The EOF compiler backend was still under development, with some features not yet implemented, but was sufficiently complete to compile Solidity code. Future use of new opcodes such as RJUMPV and EXCHANGE was expected to improve generated code efficiency further.

Because EOF discontinues some existing features, however, existing code may not compile unchanged. For example, access to gas or code through gasleft() and <address>.code is unavailable. Contract creation through the new operator also follows changed rules for specifying a salt (the default value is 0).

Compilation targeting EOF must go through the intermediate representation (IR), with optimization enabled. Low-level optimizations had not yet been implemented, so code size could increase. This was expected to improve in future releases.

To experiment with EOF, specify the following options.

bash
solc --experimental-eof-version 1 --evm-version osaka

Alternatively, use the following Standard JSON settings.

json
"settings": {
  "eofVersion": 1,
  "evmVersion": "osaka"
}

Custom storage layout support

Solidity 0.8.29 introduces syntax for placing a contract's storage variables at a specified position.

This feature had been requested for some time, but its implementation was delayed by competing requirements and use cases. The inclusion of EIP7702, a proposal enabling code to be assigned to an externally owned account, in the Pectra upgrade renewed interest in account abstraction and helped prioritize the feature.

For more on EIP7702, see the following article.

For more on account abstraction, see the following article.

https://mirror.xyz/0xcE77b9fCd390847627c84359fC1Bc02fC78f0e58/HaPTTeXZeXRG3K5JfXesmKet9eKTbcFUixW6IaMvt4c

At this stage, the feature is limited to fixed integer literal expressions, rather than values computed dynamically using variables or functions. The specified layout applies to the entire inheritance hierarchy of the most-derived contract, so different starting slots cannot be assigned independently to the parent and child within that layout.

The following example specifies the base storage slot for the contract using layout at (2**255 - 42). The storage slot for uint x starts at 2**255 - 42. Inherited storage is laid out relative to the specified base slot.

solidity
contract C layout at 2**255 - 42 {
    uint x;
}

Future releases were expected to add support for constants and layouts such as ERC7201, which defines namespaced storage layouts.

For more on ERC7201, see the following article.

More flexible configuration may eventually become possible, but the plan was to introduce the necessary features incrementally.

For details, see the custom storage layout documentation.

Custom storage layout documentation

Here is a brief summary of the documentation.

What is a custom storage layout?

Solidity 0.8.29 adds a way to specify the starting position of a contract's storage variables. Previously, storage started at slot 0 by default; the new feature allows a different base slot.

Usage

Specify a custom storage layout using the syntax layout at <starting slot>. The following example sets the starting slot to 0xAAAA + 0x11.

solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.29;

contract C layout at 0xAAAA + 0x11 {
    uint[3] x; // x[0] -> 0xAABB, x[1] -> 0xAABC, x[2] -> 0xAABD
}

The three elements of array x occupy slots 0xAABB through 0xAABD.

Rules and constraints

  • Specify layout at in the contract definition

    • Use syntax such as contract C layout at <slot>.
    • When using inheritance (is), layout at can appear before or after the inheritance specifier.
  • Only integer literal expressions are supported

    • The value used with layout at must be an integer literal expression evaluable at compile time.
    • Variables and function calls cannot be used to specify it dynamically.
  • The layout applies to the entire inheritance tree

    • Storage variables inherited from base contracts are also laid out relative to the specified starting position.
    • Different starting positions cannot be specified independently for parent and child storage in the same layout.
  • Storage cannot wrap around

    • Exceeding the 256-bit storage address space results in an error.
    • For example, a starting position so large that variables would extend beyond the EVM's storage range causes a compilation error.
  • Not available for abstract contracts, interfaces, or libraries

    • layout at applies to concrete contracts.
  • Does not affect temporary data locations

    • Variables stored in memory or calldata, such as function arguments and temporary values, are unaffected by layout at. Transient storage also has a separate layout.

Considerations

  • Avoid slots close to the end of the EVM storage address space
    • Extremely large starting slots may cause problems in future upgrades.
  • layout and at were planned to become reserved words
    • Although they were not yet full keywords, avoid using them as variable names because they may become reserved in the future.

Initial ethdebug support

Solidity 0.8.29 also adds experimental support for a new debug format, ethdebug.

ethdebug is a debugging information format for smart contracts, and its specification was still under development. Follow the ethdebug GitHub repository or the Matrix channel for development updates. At the time of the article, regular meetings were held on the second and fourth Thursdays of each month at 17:00 Berlin time.

An initial version of the compiler supporting ethdebug had been released, capable of emitting instruction information and source code ranges. However, it supported only compilation through IR without optimization, and many features were not yet implemented.

To experiment with it, compile with the following options.

bash
solc --ethdebug --via-ir

Alternatively, specify the following Standard JSON settings.

json
"settings": {
  "viaIR": true,
  "outputSelection": {
    "*": {
      "evm.bytecode.ethdebug": ["*"],
      "evm.deployedBytecode.ethdebug": ["*"]
    }
  }
}

The wildcard * does not enable ethdebug output, so it must be explicitly requested as shown above.

Additional features were planned for future releases.

ethdebug

A brief summary of the GitHub repository follows.

What is the ethdebug format?

The project designs a standard format to make debugging Ethereum smart contracts easier.

As in conventional programming environments, the goal is to represent debugging information in a unified format so developers, auditors, and users can better understand EVM behavior.

Why is ethdebug needed?

  • EVM execution is observable but difficult for humans to understand

A strength of Ethereum smart contracts is execution transparency. However, directly observing EVM execution makes it difficult to determine which part of the original Solidity source it corresponds to.

  • Conventional debug formats such as DWARF are not applicable to the EVM

In conventional programming environments, debug formats such as DWARF allow the compiler to record relationships between human-written code and machine-executed code. Without an equivalent standard format for the EVM, developers have to analyze low-level bytecode directly.

  • EVM debugging requires specialist expertise

Although EVM instructions can be observed and replayed directly, understanding them well enough to find bugs is difficult without specialist expertise. ethdebug provides a mechanism for connecting EVM execution with high-level code, reducing the burden of development and auditing.

The goal of ethdebug

The goal is a standard debug format for smart contracts.

Widespread adoption could make compilers, editors, and debuggers easier to integrate and simplify EVM debugging.

Repository contents

The project repository contains components related to the design and implementation of ethdebug.

  • schemas/ (schema definitions)

    • JSON Schema definitions, written in YAML, formally describing the format.
  • NPM packages (tools)

    • @ethdebug/format
      • A package for using the schemas from TypeScript and JavaScript, with type-safe loading.
    • @ethdebug/pointers
      • Tools for resolving ethdebug pointers against EVM execution state.
    • @ethdebug/format-web (unpublished)
      • Materials for a Docusaurus documentation site.

Solidity 0.8.29 changes (full changelog)

Language features

  • Custom contract storage positions
    • Use layout at to specify the base slot for storage variables.

Compiler features

  • Improved error messages

    • Previously, the exact source location of some code generation errors was unavailable. The compiler now reports the originating contract location.
  • EVM: Osaka support

    • Supports the new Osaka EVM version used to experiment with EOF.
  • Optional opcode-based optimization of EVM assembly

    • Allows further improvements to EVM bytecode efficiency.
  • Experimental EOF backend

    • Enables EOF compilation when going through IR with optimization enabled.
  • SMTChecker (formal verification) improvements

    • Adds support for block.blobbasefee and blobhash (part of EIP4844).
    • Allows --model-checker-print-query without --model-checker-solvers smtlib2.
    • Makes Z3, an SMT solver, a runtime dependency rather than a build-time dependency.
  • Yul parser (low-level IR)

    • Name collisions with reserved words now produce warnings instead of compilation errors.

Bug fixes

  • CLI (command line)

    • Reports StackTooDeep as a proper error.
  • Improved error messages

    • Correctly displays error locations even when the source file name is empty.
  • Internal compiler errors

    • Fixes errors when requesting IR AST output, particularly for interfaces and abstract contracts.
  • Metadata

    • Fixes an issue where custom cleanup steps were not applied with default optimizer settings.
  • SMTChecker fixes

    • Fixes errors in overflow calculations.
    • Fixes issues in safety checks across different contracts.
    • Fixes analysis errors in cross-contract getter calls.
    • Fixes issues when converting string literals to fixed bytes.
    • Fixes analysis of external calls containing redundant parentheses.
    • Fixes initialization errors for fixed-size byte arrays using string literals.
    • Fixes invariant analysis involving array store and select operations.
    • Fixes encoding of string literals in calls to the ecrecover precompile.
  • JSON interface

    • Fixes internal generation of generatedSources and sourceMap when these outputs were not explicitly requested.
  • Type checking

    • Fixes storage size calculations that incorrectly included transient storage variables.
    • This prevents unnecessary compilation errors.
  • Yul fixes

    • Reports code generation errors correctly.
    • Fixes incorrect referencing of option values during debugging (a Yul optimizer bug).

Build system changes

  • Fully statically linked Linux release builds

    • Removes the dependency on glibc.
  • Migration from C++17 to C++20

    • The compiler codebase now targets C++20.
  • Solc-JS (JavaScript Solidity compiler)

    • Requires Node.js v12 or later and no longer supports older versions.

Conclusion

This article has covered the changes in Solidity 0.8.29.

You can find more of my technical writing and projects at the following links.

https://chaldene.net/