-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Version build discrepancy vs. canonical list (v0.5.11 and others) #7512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for opening this issue! You are indeed right, the solc-js version seems to be behind by one commit. This commit is only a change in the build scripts, but we should still point solc-js at the proper tag. Note that source verification has to fail anyway if you are not using exactly the same compiler because the metadata includes the commit and platform of the compiler and thus the metadata hash will be different. |
FWIW, only the binary output needs to match to do source verification, since the service regenerates the artifacts on the other end from the source and compares the bin with the contract code on-chain. In this case, I was able to verify a contract compiled with We're trying to programatically verify on this end though by stripping the platform and sending the version off that way, etherscan bases their list of supported compilers on the js versions though. |
@brianmcmichael etherscan does not do full source verification, it strips the metadata hash and only compares the opcodes. This is fine most of the time, but it can fool you with regards to variable names, comments and even worse: Code that uses codecopy to access the metadata hash. My comment above is partly wrong, though, only the commit hash is part of the metadata, not the platform. |
@ekpyron is this related to what you are doing? :) |
@chriseth For the rebuilds in ethereum/solc-bin#22 I specifically used the version defined in https://github.com/ethereum/solc-bin/blob/gh-pages/bin/list.txt - so I generated a new |
It's maybe not so important what is in the list, but we should not delete a previously available compiler binary. |
@ekpyron can this be closed? |
I don't think so - as far as I know, we only ever messed around with the soljson.js releases on solc-bin so far - this issue is about the commit hashes there being different from those of the same compiler version released elsewhere e.g. as docker image or as snap releases (the latter we don't control, though, do we?). So depending on where you get e.g. 0.5.11 you'll end up with different commit hashes... which is bad, but I'm not sure what to do about it, especially retrospectively... |
We could at least add a new binary to solc-bin, but not sure if this would do more harm than good. |
While adding Linux/Mac/Win binaries to
With 0.6.12 we have switched to adding release binaries to What to do about those three cases? Would just adding both variations to Another problem is that we have three cases where binaries were built from the same exact commit but are not byte-for-byte identical:
Maybe I should just replace them in the repo with the ones from the release page? |
Decision from today's call:
|
0.4.15, 0.5.9 and 0.5.11For the first part, here's a PR that adds the binaries built on different commits to solc-bin: ethereum/solc-bin#57 0.2.0, 0.2.1 and 0.4.11For the second, I have edited the releases (0.2.0, 0.2.1, 0.4.11) to remove the old By the way, in 0.2.0 and 0.2.1 the file name included also the date and commit hash, now they're all Original filesIn case we ever need them (or want to roll back this change), here are the original files: original-0.2.0-0.2.1-0.4.11-releases.zip And their hashes (both old and new):
Versions reported by replaced filesJust in case I also used
So it looks like 0.4.11 is a nightly built from the tagged release commit, just like 0.4.15 for windows (#9545). The other two seem to have been built with |
Closing since the PR in solc/bin has been merged and the changes to github releases are done too. |
We encountered a contract with the version I was able to track down the issue here but couldn't find any further information. From what I understood from the conversation here, both versions ( |
Emscripten builds for both exist, but Now, the question is how much of an issue that is. The wrong binary has been in the wild for quite a while so naturally we can expect to find contracts built with it. I guess the problem is that you'd like to run Sourcify completely with native binaries? How much of a burden is it to keep a fallback to the emscripten binary for rare cases like this? |
It's not an issue and actually, it would have already used the fallback, if we hadn't had a wrong read-only setting for the solc-js folder. So not an issue for us. |
Description
The
solc
v0.5.11 that has been distributed widely does not appear to be the same version that is defined on the solc-bin list.txtThe snap distribution and the docker image both appear to be running
0.5.11+commit.22be8592
, while the canonical version of0.5.11
appears to be0.5.11+commit.c082d0b4
The ReadTheDocs versions page also seems to be based on
22be8592
This discrepancy can become a problem because programmatic etherscan contract verification via the api relies on a compiler string matching one of the entries on the
solc-bin/bin/list.txt
source. A contract compiled on the command line using one of the distributed binaries version output would not match a compatible version and fail verification.I also noticed a similar discrepancy with
v0.5.9
and a few earlier versions.v0.5.12 (7709ece9)
andv0.5.10 (5a6ea5b1)
match as expected.Environment
Steps to Reproduce
Compare with list.txt entry.
The text was updated successfully, but these errors were encountered: