Close Menu
Chain Tech Daily

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Big Breakout in Injective Crypto Coin: Buy Now

    July 3, 2025

    Polymarket’s $58M Zelenskyy suit bet will be decided today

    July 3, 2025

    WhiteRock plummets amid arrest of founder linked to $30m Zkasino fraud

    July 3, 2025
    Facebook X (Twitter) Instagram
    Chain Tech Daily
    • Altcoins
      • Litecoin
      • Coinbase
      • Crypto
      • Blockchain
    • Bitcoin
    • Ethereum
    • Lithosphere News Releases
    Facebook X (Twitter) Instagram YouTube
    Chain Tech Daily
    Home » Solidity optimizer bug | Ethereum Foundation Blog
    Ethereum

    Solidity optimizer bug | Ethereum Foundation Blog

    Olivia MartinezBy Olivia MartinezFebruary 11, 20253 Mins Read
    Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Tumblr Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    A bug in the Solidity optimizer was reported through the Ethereum Foundation Bounty program, by Christoph Jentzsch. This bug is patched as of 2017-05-03, with the release of Solidity 0.4.11.

    Background

    The bug in question concerned how the optimizer optimizes on constants in the byte code. By “byte code constants”, we mean anything which is PUSHed on the stack (not to be confused with Solidity constants). For example, if the value 0xfffffffffffffffffffffffffffffffffffffffffffffffe is PUSHed, then the optimizer can either do PUSH32 0xfffffffffffffffffffffffffffffffffffffffffffffffe, or choose to encode this as PUSH1 1; NOT;.

    An error in the optimizer made optimizations of byte code constants fail for certain cases by producing a routine that did not properly recreate the original constant.

    The behavior described in the reported bug was found in a contract in which one method ceased functioning when another – totally unrelated – method was added to the contract. After analysis, it was determined that a number of conditions must exist at once for the bug to trigger. Any combination of conditions that would trigger the bug would consistently have the following two conditions:

    1. The constant needs to start with 0xFF… and end with a long series of zeroes (or vice versa).
    2. The same constant needs to be used in multiple locations, for the optimizer to choose to optimize this particular constant. Alternatively, it needs to be used in the constructor, which optimises for size rather than gas.

    In addition to the two conditions above, there are further, more complicated conditions that are required.

    Analysis

    This bug is present in all released versions of Solidity from at least as far back as summer 2015 to the present. Although the bug has been present since 2015, it seems very hard to trigger by “random” code:

    We performed a static analysis of all contract code deployed on the blockchain, and found no occurrence of such an invalidly generated routine. Note, the fact that we have not found a bug in all the contract code does not guarantee the absence of such occurrences.

    Improvements

    In order to provide better transparency and increased awareness of bugs in Solidity, we have started exporting information about Solidity-related vulnerabilities as JSON-files in the Solidity code repository(1,2). We hope that block explorers will integrate this information along with other contract-related information.

    Etherscan has already implemented this, which can be seen here and here.

    Concerning the bug itself, we added a mini-EVM to the optimizer which verifies the correctness of each generated routine at compile time.

    Furthermore, work has already started on a fully-specified and more high-level intermediate language. Future optimizer routines on this language will be much easier to understand and audit and it will replace the current optimizer.



    Source link

    Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Tumblr Email
    Olivia Martinez

    Related Posts

    Ethereum June 30, 2025

    Katana mainnet launch nears as pre-deposit closes with $200M in active deposits

    Ethereum June 22, 2025

    World Experience: Updates from the Next Billion Fellowship

    Ethereum June 21, 2025

    Checkpoint #4: Berlinterop | Ethereum Foundation Blog

    Ethereum June 19, 2025

    Truth Social files for a Bitcoin and Ethereum ETF

    Ethereum June 19, 2025

    Truth Social files for a Bitcoin and Ethereum ETF

    Ethereum June 18, 2025

    Ethereum ETFs hit ATH, SPX6900 cools off, XRP outlook remains bullish

    Leave A Reply Cancel Reply

    Don't Miss
    Crypto July 3, 2025

    Big Breakout in Injective Crypto Coin: Buy Now

    Injective (INJ), a DeFi-focused Layer 1 blockchain with a unified VM, is trading near $11.60,…

    Polymarket’s $58M Zelenskyy suit bet will be decided today

    July 3, 2025

    WhiteRock plummets amid arrest of founder linked to $30m Zkasino fraud

    July 3, 2025

    ZKasino rug pull suspect arrested in United Arab Emirates

    July 3, 2025
    Stay In Touch
    • Facebook
    • Twitter
    • YouTube
    • LinkedIn
    Our Picks

    Big Breakout in Injective Crypto Coin: Buy Now

    July 3, 2025

    Polymarket’s $58M Zelenskyy suit bet will be decided today

    July 3, 2025

    WhiteRock plummets amid arrest of founder linked to $30m Zkasino fraud

    July 3, 2025

    ZKasino rug pull suspect arrested in United Arab Emirates

    July 3, 2025

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    Don't Miss
    Crypto July 3, 2025

    Big Breakout in Injective Crypto Coin: Buy Now

    Injective (INJ), a DeFi-focused Layer 1 blockchain with a unified VM, is trading near $11.60,…

    Polymarket’s $58M Zelenskyy suit bet will be decided today

    July 3, 2025

    WhiteRock plummets amid arrest of founder linked to $30m Zkasino fraud

    July 3, 2025

    ZKasino rug pull suspect arrested in United Arab Emirates

    July 3, 2025

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    About Us
    About Us

    ChainTechDaily.xyz delivers the latest updates and trends in the world of cryptocurrency. Stay informed with daily news, insights, and analysis tailored for crypto enthusiasts.

    Our Picks

    For Many Women, The Pain Of The Pandemic Led To Stronger Friendships

    January 15, 2020

    How A ‘Healthy’ Lifestyle Can Be Making You Tired

    January 15, 2020

    Fashion Influencers To Follow On Instagram In 2021

    January 15, 2020
    Lithosphere News Releases

    Imagen AI (IMAGE) Developer to Enable Ripple Labs Stablecoin RLUSD for Service Payments

    July 3, 2025

    Imagen Network Begins Strategic Expansion with Bitcoin-Funded AI Infrastructure Rollout

    July 2, 2025

    Imagen Network Taps Solana to Roll Out AI-Powered Social Features for Decentralized Growth

    June 30, 2025

    Social Tools Built on Solana Set to Launch as Imagen Network Accelerates AI-Driven Development

    June 26, 2025
    X (Twitter) Instagram YouTube LinkedIn
    © 2025 Copyright

    Type above and press Enter to search. Press Esc to cancel.