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

Make execution tractable #47

Merged
merged 1 commit into from
Aug 7, 2023
Merged

Make execution tractable #47

merged 1 commit into from
Aug 7, 2023

Conversation

iamrecursion
Copy link
Contributor

Summary

The previous approach to exploring conditional branches meant that contracts with nested conditionals would experience a combinatorial explosion in the number of virtual machine threads waiting to execute.

This commit introduces a new approach that ensures that all instructions in the bytecode are visited, but not all paths to all of those instructions are executed. This drastically cuts the program state space while still ensuring that we gather the required information.

This is done by imposing a (configurable) limit on the number of times a given JUMPDEST can be jumped to by JUMPI instructions. Normal JUMP instructions will always proceed as usual as they do not cause a bifurcation in the state space.

Closes #44

Details

So while it was manifesting as a hang, the analyzer was indeed making work. The issue was that it was producing new branches to evaluate faster than it could consume them. This is now fixed.

Checklist

  • Code is formatted by Rustfmt.
  • Documentation has been updated if necessary.

@iamrecursion iamrecursion added the bug Something isn't working label Aug 3, 2023
@iamrecursion iamrecursion self-assigned this Aug 3, 2023
The previous approach to exploring conditional branches meant that
contracts with nested conditionals would experience a combinatorial
explosion in the number of virtual machine threads waiting to execute.

This commit introduces a new approach that ensures that all instructions
in the bytecode are visited, but not all paths to all of those
instructions are executed. This drastically cuts the program state space
while still ensuring that we gather the required information.

This is done by imposing a (configurable) limit on the number of times a
given `JUMPDEST` can be jumped to by `JUMPI` instructions. Normal `JUMP`
instructions will always proceed as usual as they do not cause a
bifurcation in the state space.
@iamrecursion iamrecursion merged commit 40f7baa into main Aug 7, 2023
5 checks passed
@iamrecursion iamrecursion deleted the wip/ara/bug-44 branch August 7, 2023 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] SLA hangs on some contracts
2 participants