Closed ytrezq closed 2 years ago
I don’t think pysha3 is extensively being used, it’s better to use hashlib over these
@norhh ported Pysha3 to pypy along vectorizing it partially with avx512 support (using the autopar of the compiler so this isn’t clean and real vectorization like with https://github.com/vinayps/cs205_project). And guess what? mythx analysis run 7 to 20 times faster (alas using 25 to 30 times more RAM as it took 24 Gb for the dao). I didn’t perform benchmarks but it was able to complete analysis of the dao in 6 hours whereas it wasn’t finished in a day with the same command using the official Python implementation running on a computer having twice faster single thread performance than the computer running the PyPy implementation.
Though I’m not sure if the accuracy is the same as with CPython.
Ok. Whatsover, I used the official latest binary (7.2.0) of PyPy, so the only libraries required are the ones for running the official PyPy binaries. The remaining works standalone.
The target cpu has pretty much all latest avx512 features enabled so this won’t run on older cores.
Just extract this archive to /usr/lib64
(though paths aren’t static) it also contains the patched version of sha3 (the provided binary doesn’t use the patched loop at all). For the purpose of benchmarking, vmprof
is also included in the archive.
Then run myth
using pypy3 where both file are in the /bin
directory within the archive.
I suppose it will help you testing.
The current version on Mythril significantly spends time in solver calls(>95%), so this can be closed.
Not only this would be faster, but this would be the last step to have mythril compatible with pypy because pysha3 is incompatible with pypy.
Both are unmaintained though.