6 Dec 2026, Sun

Solidity v0.8.38 Released with Yul Optimizer Fixes and Preparation for the Amsterdam Network Upgrade

The development team behind Solidity has officially announced the release of Solidity v0.8.38, introducing a crucial bugfix for the Yul optimizer, performance enhancements across key compilation phases, and vital preparatory measures for upcoming Ethereum network changes. This latest version addresses a low-severity bookkeeping vulnerability discovered in versions 0.8.19 through 0.8.37, while also streamlining compilation speed and laying the groundwork for the upcoming Amsterdam network upgrade.

As smart contract developers continue to rely on the Solidity compiler to secure billions of dollars in decentralized applications, maintenance releases like v0.8.38 play an essential role in preserving the integrity, reliability, and efficiency of Ethereum-based ecosystems.

Important Bugfixes: Yul Optimizer Knowledge Base Stale Bookkeeping

The standout technical focus of the v0.8.38 release is a targeted fix addressing a subtle yet critical bug in the Yul optimizer, officially categorized under stale knowledge base bookkeeping.

The Yul optimizer functions by closely tracking the contents of memory and storage during the compilation process. This sophisticated tracking allows the compiler to optimize execution paths intelligently by replacing costly load operations with known values and removing redundant store operations that fail to alter state. However, a vulnerability existed when a Yul variable used specifically to compute memory or storage addresses underwent reassignment. Under these specific conditions, the optimizer occasionally failed to register that its internal knowledge base regarding those particular addresses had become stale.

Consequently, this lapse could potentially lead the optimizer to replace a memory or storage load with an outdated value, or incorrectly remove a necessary store operation. The scope of affected code is specifically restricted to compilations where the Yul optimizer is actively enabled. When utilizing the --via-ir compilation pipeline, any relevant code could theoretically be exposed to the bug. Conversely, when employing the default evmasm pipeline, vulnerability was limited primarily to compiler-generated Yul utility functions and specific inline assembly blocks. Versions 0.8.19 through 0.8.37 are impacted by this issue.

Despite the theoretical risks associated with stale bookkeeping in a compiler optimizer, empirical analysis suggests that actual exploitation or accidental triggering in real-world contracts is exceptionally rare. To measure the practical impact of the vulnerability, the development team compiled the entire corpus of verified smart contracts residing within the Sourcify database both with and without the security fix applied. The resulting bytecode proved identical across all analyzed contracts, indicating that the bug manifested rarely, if ever, in the wild.

The discovery of this issue underscores the vital importance of crowdsourced security and collaborative code auditing. The vulnerability was initially reported by developer Daniel Boye through the official Ethereum Foundation bug bounty program. A subsequent independent report submitted by Surya Prakash Akula further demonstrated that the underlying flaw could be triggered directly from standard Solidity source code without requiring explicit inline assembly blocks, prompting accelerated remediation efforts by the core team. A comprehensive technical write-up detailing the mechanics of the bug has been published on the official Solidity blog.

Performance Improvements and EVM Pipeline Optimizations

Beyond addressing the knowledge base bookkeeping flaw, Solidity v0.8.38 delivers notable performance enhancements and code generation improvements designed to make the compilation process faster and more gas-efficient.

The release introduces significant performance optimizations to the DataFlowAnalyzer, a foundational component upon which several individual Yul optimizer steps are constructed. By optimizing the internal operations of the DataFlowAnalyzer, the overall compilation time for smart contracts utilizing the Yul optimizer has been meaningfully reduced. Developers working on large-scale decentralized protocols with extensive codebases can expect faster build cycles and improved developer ergonomics during iterative testing and deployment phases.

Further refinements have been introduced within the Intermediate Representation (IR) pipeline. Specifically, the function dispatcher has been optimized to check whether incoming calldata is sufficiently long to hold a function selector using one fewer instruction. While subtle, efficiency gains at the EVM instruction level contribute to lower deployment and execution overhead for modern smart contracts relying on the IR pipeline.

Preparation for the Amsterdam Network Upgrade and EIP-8024

Solidity v0.8.38 also takes proactive steps to align the compiler with future protocol-level upgrades on the Ethereum network. The compiler now emits targeted warnings whenever developers utilize swapn, dupn, or exchange as identifiers within Yul or inline assembly blocks.

These specific keywords correspond directly to new EVM opcodes introduced by EIP-8024 in connection with the upcoming Amsterdam network upgrade. To ensure a smooth transition and prevent future breaking changes or naming collisions, these terms are scheduled to become strictly reserved identifiers starting from the official Amsterdam EVM version.

Much like the existing SWAP1 through SWAP16 and DUP1 through DUP16 opcodes, these new Amsterdam-specific opcodes will remain unavailable for use as custom Yul or inline assembly keywords once the upgrade takes effect. However, standard Solidity-level identifiers bearing these names remain completely unaffected by the new compiler warnings and restrictions, ensuring that existing high-level contract logic will not experience unexpected compilation errors.

How to Install and Upgrade

Developers and protocol maintainers wishing to upgrade their development environments to the latest compiler version are encouraged to consult the comprehensive installation instructions maintained in the official Solidity documentation.

The v0.8.38 release binaries and source packages are publicly available for download directly through the project’s GitHub repository. Developers intending to build the compiler directly from source code are explicitly advised to avoid utilizing the generic source archives automatically generated by GitHub. Instead, the team recommends downloading the official solidity_0.8.38.tar.gz source tarball or checking out the tagged v0.8.38 commit via git to ensure a correct and reproducible build environment.

The Solidity core team extends its gratitude to all independent security researchers, community contributors, and core developers whose ongoing efforts continue to strengthen the security, performance, and reliability of the Ethereum ecosystem.

Leave a Reply

Your email address will not be published. Required fields are marked *