Currently use 0.8.27 or 0.8.34. Avoid all versions in between.
0.8.27: Use if you don't need custom storage namespaces (ERC-7201, Diamond) or Solidity custom layouts (layout at).0.8.34: Use if you need features introduced>=0.8.28.
| Feature / Issue | Solidity v0.8.26 | Solidity v0.8.27 (Recommended) |
|---|---|---|
| Internal Compiler Errors | Vulnerable to crashes | Fixed |
| via-IR Compilation Speed | Standard | Faster (optimized IR caching) |
| Custom Error Support | Restricted to via-IR | Expanded to legacy pipeline |
v0.8.28 Exploit Risk (transient) |
Safe | Safe (halts bytecode generation) |
| Storage Overflow Bug | Vulnerable | Vulnerable |
Solidity 0.8.34 contains all known fixes.
Versions 0.8.28 through 0.8.33 introduced features like transient storage and custom layouts but contained catastrophic code generation bugs.
| Feature / Vulnerability | <= 0.8.27 (Legacy) |
0.8.28 - 0.8.33 (Danger Zone) |
0.8.34 (Modern Safe) |
|---|---|---|---|
Transient Storage (tstore) |
Unsupported | Critically Vulnerable | Supported & Safe |
Custom Layouts (layout at) |
Unsupported | Supported | Supported |
| Storage Array Overflow | Vulnerable | Vulnerable (Fixed in 0.8.32) |
Safe |
| Default EVM Target | Cancun / Older | Prague / Osaka | Osaka |
Affects: 0.8.28 - 0.8.33 (with --via-ir)
The Bug: The compiler names clearing routines based only on the variable's type, ignoring storage location. This causes persistent and transient routines to silently overwrite each other.
pragma solidity ^0.8.28;
contract TransientCollision {
uint256 persistentData;
uint256 transient t_temporaryData;
function clearData() external {
// Compiler generates identical Yul names for both 'uint256' variables.
delete t_temporaryData; // Might mistakenly write to persistent storage
delete persistentData; // Might clear transient storage, leaving persistent data intact
}
}Affects: < 0.8.32
The Bug: If an array anchors at the EVM's maximum storage limit and wraps to slot zero, the compiler's clearing loop fails instantly, leaving old data intact.
pragma solidity ^0.8.29;
contract ArrayOverflow {
// Array placed at the edge of EVM storage
uint256[] layout at 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff edgeArray;
function triggerBug() external {
edgeArray.push(1);
edgeArray.push(2);
// Math overflow causes the background clearing loop to fail immediately.
delete edgeArray; // FAILS: Data remains permanently in storage!
}
}