Skip to content
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

Symbolic VMTests #1359

Closed
wants to merge 9 commits into from
Closed

Symbolic VMTests #1359

wants to merge 9 commits into from

Conversation

disconnect3d
Copy link
Member

@disconnect3d disconnect3d commented Jan 21, 2019

Changes the EVM tests auto-generator to be able to generate symbolic tests.

VMTests were generated and added to the commit - so we have both concrete and symbolic tests for frontier.

The symbolic tests works by creating all possible symbolic values as BitVecVariables and by preconstraining their value to the initial value. At the end for all the post data (which is specified in VMTests json files) solver is asked for solutions and it is checked whether the value is correct (as expected - as specified in the json file) and if there is only one solution.


This change is Reviewable

@disconnect3d disconnect3d changed the title Symbolic tests Symbolic VMTests Jan 21, 2019
self.assertEqual(to_constant(world.get_storage_data({hex(account_address)}, {key})), {value})'''
for key, value in account['storage'].items():
output += f'''
self.assertEqual(solve(world.get_storage_data({hex(account_address)}, {key})), {value})'''
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So currently we do not call solve on key here but this works so far.

* EVM: Add support for EXP with concrete/solvable exponent

Adds support for EXP aka POW, with concrete or solvable exponent, fixing #1005 effectively.

Not sure if we can do it any better - it seems z3 doesn't have exp/pow for bitvectors.

* Update operators.py

* Update evm.py

* Use concretized_args

* Move Operators.POW to EVM._exp

* Extend travis wait for output to 30m

* Extend travis build to 60m...

* Fix Operators.ITE -> Operators.ITEBV

* Split ethereum travis job to two jobs

* EVM.EXP: concretize base=SAMPLED

* Fix concrete tests: use to_constant

* Fix set storage in concrete tests
@feliam
Copy link
Contributor

feliam commented May 9, 2019

Moved the effort to #1431.

@feliam feliam closed this May 9, 2019
@ehennenfent ehennenfent deleted the symbolic-tests branch January 29, 2020 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants