Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

make oyente installable via setup.py #137

Merged
merged 1 commit into from
Jul 24, 2017

Conversation

beaugunderson
Copy link
Contributor

This is a work-in-progress pull request to add the ability to install oyente from pip with e.g. pip install oyente.

(We'd like to run oyente on the Augur contracts as part of our test infrastructure and this becomes much easier if we can install oyente using pip install.)

@CLAassistant
Copy link

CLAassistant commented Jul 8, 2017

CLA assistant check
All committers have signed the CLA.

@loiluu
Copy link
Contributor

loiluu commented Jul 8, 2017

Awesome, looks good to me.
@inian ?

@loiluu loiluu requested a review from inian July 8, 2017 07:14
@inian
Copy link
Contributor

inian commented Jul 8, 2017

LGTM. @beaugunderson can you merge with master again? I will merge the PR once you have.

@beaugunderson
Copy link
Contributor Author

beaugunderson commented Jul 10, 2017

@inian I'll rebase on master now 👍

I made this a 'work in progress' PR because I wasn't sure if you'd want to change how the settings are setup though (the ones in global_params.py); they could be made into command-line arguments, or environment variables, or be read from a file like ~/.oyenterc...

(The reason being that if a user installs via pip install the global_params.py file will be somewhere under /usr/local/lib/python2.7/site-packages)

Edit: I see that many of the variables in global_params.py can be overridden already with command-line flags 👍

@beaugunderson
Copy link
Contributor Author

I fixed test_evm somewhat; it seems like it was not 100% working before my changes...

@inian
Copy link
Contributor

inian commented Jul 11, 2017

Yup, all the params in global_params.py can be taken in as command-line params, so that shouldn't be a problem.
Are the tests working now? If so, I can merge this.

@beaugunderson
Copy link
Contributor Author

@inian I tried running the tests against current master and they failed, so my branch is at least an improvement on that (most of the tests run)

@beaugunderson beaugunderson changed the title [WIP] make oyente installable via setup.py make oyente installable via setup.py Jul 11, 2017
@inian inian requested a review from luongnt95 July 13, 2017 07:58
@luongnt95
Copy link
Contributor

@beaugunderson This error No module named test_evm.evm_unit_test occurred after pulling your PR and running the tests

@loiluu
Copy link
Contributor

loiluu commented Jul 17, 2017

@inian can you please merge this PR?

@beaugunderson
Copy link
Contributor Author

I've rebased to remove conflicts and also verified that tests work:

$ python test_evm.py
*****************************************************
                  *************
                      Start


===============Loading: addmodDivByZero1====================
WARNING:root:You are using an untested version of z3. 4.5.0 is the officially tested version
WARNING:root:You are using evm version 1.6.7. The supported version is 1.6.6
WARNING:root:You are using solc version 0.4.11, The supported version is 0.4.13
INFO:symExec:Running, please wait...
INFO:symExec:	============ Results ===========
INFO:symExec:	  CallStack Attack: 	 False
INFO:symExec:	  Concurrency Bug: 	 False
INFO:symExec:	  Time Dependency: 	 False
INFO:symExec:	  Reentrancy bug exists: False
INFO:symExec:	====== Analysis Completed ======
no exit code returned


===============Loading: sdivByZero0====================
WARNING:root:You are using an untested version of z3. 4.5.0 is the officially tested version
WARNING:root:You are using evm version 1.6.7. The supported version is 1.6.6
WARNING:root:You are using solc version 0.4.11, The supported version is 0.4.13
INFO:symExec:Running, please wait...
INFO:symExec:	============ Results ===========
INFO:symExec:	  CallStack Attack: 	 False
INFO:symExec:	  Concurrency Bug: 	 False
INFO:symExec:	  Time Dependency: 	 False
INFO:symExec:	  Reentrancy bug exists: False
INFO:symExec:	====== Analysis Completed ======
no exit code returned

etc.

@luongnt95
Copy link
Contributor

luongnt95 commented Jul 22, 2017

Hey, @beaugunderson. It seems that you didn't set the global params variable UNIT_TEST to 2 or 3. Please check it again. Here is our document. If you keep UNIT_TEST = 0, it's expected that all the tests will fail. When you set UNIT_TEST = 2, the final result should be something like this:
test
If UNIT_TEST = 3, the number of tests fail will increase because z3 can't handle EXP (exponential) opcode.
Because the tests are only used to test the implementation of opcodes, not the security bugs, these bugs shouldn't be displayed.

@beaugunderson
Copy link
Contributor Author

@luongnt95 thanks for explaining how UNIT_TESTS works; I've updated the code to ensure that my results are the same as in the screenshot you posted :)

@luongnt95
Copy link
Contributor

Thanks @beaugunderson . It works now

@luongnt95 luongnt95 merged commit 52bf194 into enzymefinance:master Jul 24, 2017
@luongnt95
Copy link
Contributor

luongnt95 commented Jul 25, 2017

@beaugunderson Can you remove the package on pypi so that I can update to the latest version of oyente?

@beaugunderson
Copy link
Contributor Author

@luongnt95 what's your PyPi username? I'll add you as an owner

@luongnt95
Copy link
Contributor

luongnt95 commented Jul 26, 2017

@beaugunderson my username: luongnt. Can you update oyente to the latest version?

@beaugunderson
Copy link
Contributor Author

@luongnt95 ok, I've made you an owner and I also published 0.2.0 to PyPi :)

@luongnt95
Copy link
Contributor

@beaugunderson Great!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants