-
-
Notifications
You must be signed in to change notification settings - Fork 805
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
Unable to reproduce bytecode between contract generated from docker and binary #3369
Comments
There is also an issue where we intermittently end up generating different bytecodes with minor differences (e.g. attached three outputs, all compiled using vyper037.exe CurveTricryptoOptimizedWETH.vy -f bytecode > filename) - Though I reckon this is secondary and resolving diffs between docker <> binary would also sort this out.... |
I replicated the following behavior:
Left is binary and right is docker output: https://difff.jp/en/33ari.html I don't have the same diffs as Etherscan (very weird) but there are some diffs. I used the same contract but just renamed it to |
been digging into this -- apparently, the topsort order for function codegen is not stable. this means that sections of bytecode might be generated in different orders across runs (although observed behavior of the contract as a whole will be the same). the underlying reason for this seems to be, while vyper/vyper/semantics/types/function.py Line 126 in 4b44ee7
it might be possible to force the insertion order to be stable by fixing |
Thank youuuu Charrleeesss aaaaaaaaa ❤️ Yea I would reckon setting PYTHONHASHSEED helps - Though a quick run yesterday by setting it on our Environment Variables didn't seem to generate a stable bytecode across two machines (despite during python runtime print(os.environ["PYTHONHASHSEED"] showed 0) - Not too sure what's the deal with that but we will be digging around this a bit more. |
Thank you very much indeed, Charles. Please note that until a new version of the compiler is released source verification on etherscan of some vyper contracts will continue to fail. |
File in question: https://gist.github.com/Enigmatic331/5d85f73ec4b8e85ace1a2fa36c86790f
It seems that we are having issues reproducing the same bytecode for this contract when compiling between using the Vyper binaries and docker instances...
Compiled from vyper 0.3.7 binaries
vyper037.exe CurveTricryptoOptimizedWETH.vy -f bytecode > output_037.txt
, results are as such: https://gist.github.com/Enigmatic331/c58aeafd6a3a36f9791b22b4098aff43Compiled from vyper 0.3.7 docker,
docker run vyperlang/vyper:0.3.7 /code/CurveTricryptoOptimizedWETH.vy -f "bytecode" > docker_output_037.txt
, results are as such: https://gist.github.com/Enigmatic331/085372a589a8509483b67b2977d6909dRunning the diffs: https://difff.jp/en/9bis6.html
Not sure if I might be missing anything - Since on both cases am compiling the contract without additional settings except to output "bytecode"..... Any idea what I might be missing? 🙏
The text was updated successfully, but these errors were encountered: