22 Nov 2026, Sun

Solidity v0.8.39 Released: Critical Storage Bugfix, EVM Amsterdam Limits, and a Glimpse at Version 0.9.0

The development team behind Solidity, the preeminent programming language for writing smart contracts on the Ethereum blockchain and compatible networks, has officially announced the launch of Solidity v0.8.39. Marking what is expected to be the final installment in the long-running 0.8 major version series, this latest release delivers crucial security and stability patches, introduces preparatory warnings for upcoming Ethereum Virtual Machine (EVM) upgrades, and provides fresh clarity on the roadmap leading toward Solidity 0.9.0.

Chief among the changes in v0.8.39 is the resolution of a medium-severity bug that could result in silent storage corruption. According to the release details, the vulnerability was triggered under specific conditions involving recursive structs—data structures that can contain references to values of their own type, such as a hypothetical Node struct housing an array of child nodes alongside standard unsigned integers.

The bug manifested when such a recursive struct, or a broader array of these recursive structures, was copied within storage directly over a location that overlapped with the source. Common manifestations in Solidity code include assignments such as root equals root.children at index zero, or roots equals roots at index zero dot children, where root represents a Node type and roots represents an array of Node types residing in storage. Because the overlap was not always immediately apparent in the assignment expression—such as when the source was accessed indirectly via a storage pointer, a mapping key, or a complex array index—the underlying compiler mechanics would rewrite the storage area holding the source before the copy operation had finished reading it.

The consequences of this failure were severe: nested elements within the source were lost entirely, and struct members declared immediately after the array reverted to zero values. Crucially, the compiler emitted no errors or warnings to alert developers to the data corruption.

Investigations by the Solidity engineering team revealed that both the legacy evmasm pipeline and the modern IR (Intermediate Representation) pipeline were affected, regardless of optimizer settings or target EVM versions. For the evmasm pipeline, versions ranging from 0.4.9 through 0.8.38 were vulnerable, while the IR pipeline was affected from version 0.8.13 through 0.8.38. To resolve this, version 0.8.39 introduces a runtime check applied to every storage-to-storage copy operation involving a recursive struct or an array of recursive structs.

While this runtime check successfully prevents data corruption, it comes with trade-offs. Developers will notice a slight increase in gas costs for storage copy operations, even in cases where the source and target do not physically overlap. Additionally, the runtime check consumes additional stack space while walking the target data structures. As a result, operations involving deeply nested targets may encounter stack-depth limitations sooner than they did under previous compiler iterations, potentially causing transactions to fail. In one benchmark example compiled using via-ir and the optimizer enabled, the maximum nesting depth dropped significantly from 252 levels down to 126 levels.

Despite the broad historical vulnerability window, a scan of verified contracts within the Sourcify database revealed no currently deployed mainnet contracts performing an affected copy operation. The underlying issue was discovered and responsibly disclosed by security researcher cyberthirst through the Ethereum Foundation’s official bug bounty program.

In addition to the recursive struct fix, Solidity v0.8.39 addresses a secondary miscompilation issue within the evmasm pipeline involving nested tuple assignments. Under specific and uncommon conditions where a nested tuple on the right-hand side of an assignment contained a string literal adjacent to another value—and that literal was targeted at a bytes32, bytes, or string variable—values could be incorrectly swapped or assigned to the wrong variables. For example, assigning a complex nested tuple could result in numeric values being routed to hash variables and string representations being assigned to numeric integers.

The compiler team noted that this miscompilation is not categorized as a security vulnerability due to the highly unusual code patterns required to trigger it. Nested tuples in Solidity are primarily utilized to capture multiple return values from function calls, and native Solidity functions cannot return raw string literals. Furthermore, standard testing and memory-reference checks would typically cause out-of-gas reverts if malformed string literal references made their way into execution, ensuring developers would catch the issue during the testing phase.

Beyond bug fixes, Solidity v0.8.39 brings important updates regarding EVM compatibility and code size limits. With the inclusion of the –evm-version amsterdam compiler flag, the toolchain now issues warnings when compiled contract code exceeds 64 KiB and when initialization code (initcode) exceeds 128 KiB. These expanded thresholds align with proposed Ethereum Improvement Proposals, specifically EIP-7954—which raises the historic EIP-170 contract code limit from 24 KiB to 64 KiB—and EIP-3860, which elevates the initcode limit from 48 KiB to 128 KiB. For all other EVM versions, including the current default Osaka environment, the compiler continues to enforce the legacy limits. Support for the Amsterdam EVM target remains experimental in this release.

Furthermore, the compiler now extends code size warnings to standalone Yul code generation, bringing it in line with the diagnostic checks already applied to native Solidity code. In the realm of developer tooling, the experimental ethdebug format receives an important enhancement. By passing the –ethdebug-resources flag alongside –experimental, developers can now instruct the compiler to emit the full info/resources schema of the ethdebug specification. This schema provides external debuggers with comprehensive type descriptions and memory layout information, serving as a critical foundational step for passing rich debugging metadata through the Yul pipeline.

Looking forward, the release of v0.8.39 sets the stage for a major shift in the project’s release lifecycle. For years, the core contributors anticipated Solidity 0.9.0 as a monumental, monolithic breaking release that would finally establish the modern IR pipeline as the default code generator. Consequently, many developers expected version 0.9.0 to introduce massive sweeping disruptions to existing codebases.

The core team has adjusted this strategy. While transitioning the IR pipeline and the SSA CFG code generator to default status remains a high priority, these milestones will no longer be artificially tethered to the 0.9.0 version boundary. Holding back updates for a single massive release was found to delay other necessary breaking changes that could be safely integrated sooner. Moving forward, the Solidity team intends to adopt a cadence of more frequent, smaller breaking releases. Under this new philosophy, the version number alone will no longer signal the sheer volume of modifications, and breaking changes can be introduced incrementally. This approach also allows the maintainers to systematically purge legacy features that have lingered throughout the extended 0.8 release lifecycle, such as ABI coder v1, virtual modifiers, the legacy ABIEncoderV2 pragma, the SMTChecker’s BMC engine, and EVM versions older than Constantinople. A detailed explanation of the new release schedule is slated for publication in a separate post, and a dedicated pre-release of version 0.9.0 is expected to precede the final rollout.

Developers wishing to adopt Solidity v0.8.39 can access the update via the official documentation portal. When building directly from source repositories, users are advised to avoid auto-generated GitHub source archives and instead utilize the official solidity_0.8.39.tar.gz source tarball or check out the tagged v0.8.39 branch directly via git to ensure a successful compilation.

Leave a Reply

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