Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

Post about Compiler Binaries #138

@franzihei

Description

@franzihei

From @cameel's explanation:

Should we also describe the situation with binaries and rebuilds here? It goes more or less like this:

  • Originally solc-bin contained only platform-independent emscripten binaries that run via solc-js. For example Remix IDE uses them to compile code in the browser. These were asm.js binaries, which means it's just JavaScript and not very fast.
  • Around 0.6.2 we started building emscripten binaries as wasm. They're faster and for that reason @ekpyron rebuilt older binaries in solc-bin to wasm.
  • Somewhere in the 0.7.x release cycle people requested adding native binaries to solc-bin as well (Adding solc binaries to solc-bin solidity#9226). I gathered them from the release pages and added them to solc-bin. I also reorganized the directory structure a bit.
  • This did not include macOS native builds for many versions because we only started doing them in 0.6.9. So I did builds for older versions (down to 0.3.6) and added them to solc-bin.
  • Around the same time I also replaced Emscripten 0.4.15, 0.5.9, 0.5.11 in solc-bin with versions from the release page because they were different (Alternative versions of 0.4.15, 0.5.9, 0.5.11 from github release page solc-bin#57).
  • Late last year we discovered that macOS binaries for 0.3.6-0.6.0 do not produce identical bytecode as the others which hinders verification (Solidity 0.5.17 installed with Homebrew produces a different output than the version downloaded from solc-bin.ethereum.org solidity#10183). The bytecode they produce is valid but they have a slightly different version string which makes the metadata hash included in the bytecode different.
  • I have rebuilt the macOS binaries and replaced the ones that were already in solc-bin (macOS binaries with correct version strings solc-bin#76).
    • As a result checksums on the file list changed. Anyone using the old list to verify the binaries would get an errror trying to verify it against the new binaries.
      • Our policy is to avoid removing or modifying files already added to solc-bin but we have decided that leaving faulty ones there would cause more harm than good.
    • Many tools cache the list and do not redownload it if it's already available. That's for example what Hardhat used to do and it caused hard to understand breakage for people using it. As a result they decided to work around it by redownloading the list when the hash does not match (Smaller downloader fix NomicFoundation/hardhat#1392).
      • The fix PR also included a change from solc-bin.ethereum.org to binaries.soliditylang.org. The change was fine but not really necessary to fix the issue. It, however, made people think that the domain was the cause of the breakage.
  • As a part of macOS rebuilds I made an effort to actually verify that release binaries for the same version actually do produce the same bytecode on all platforms.

This is probably way too detailed to post as a whole but we could at least mention something about the problem with checksums.

Link to the original discussion here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions