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

Add motivating example from Smartian to research examples #850

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

webthethird
Copy link

Add echidna-fied version of Smartian motivating example.
Original: https://github.com/SoftSec-KAIST/Smartian/blob/main/examples/sol/motiv.sol

Add echidna-fied version of Smartian motivating example.
Original: https://github.com/SoftSec-KAIST/Smartian/blob/main/examples/sol/motiv.sol
Add config file for Smartian motivating example
Set a higher testLimit, since the default 50,000 isn't cutting it
@ggrieco-tob
Copy link
Member

Thanks a lot for the contribution. We want to add this example, however, since every research example is added into the CI testing and echidna does not quickly trigger this issue. If that is solved, then we can add this example.

@webthethird
Copy link
Author

That makes sense!

@webthethird
Copy link
Author

webthethird commented Nov 21, 2022

It seems like making use of the msg_sender and/or functions_relations properties in the SlitherInfo input would help trigger the bug faster. As you mentioned on Slack, re: the generationGraph created when parsing the functions' "impacts" and "impacted by" properties,

Echidna is not using that yet. However, we are unsure about it. It seems to be easier to just randomly select functions instead. We want to see that this will help in general, not only this micro benchmark.

My (possibly naive) understanding is that the Smartian paper essentially proved that such data-flow analysis does help in general, at least on the benchmarks they evaluated it against (see section V.B in that paper, where they compared the tool against itself with the analyses disabled).
Is there a branch of the Echidna repo in which this generation graph is used, which one could test on a wider variety of contracts to determine if it does help in general?
Aside from the functions_relations and related generationGraph, it seems like the msg_sender property would be much easier to utilize, and should clearly be helpful in general since it would avoid sending transactions that are sure to fail. Is there any work being done to integrate this? Seems like it would be a very useful contribution!

@ggrieco-tob
Copy link
Member

My (possibly naive) understanding is that the Smartian paper essentially proved that such data-flow analysis does help in general, at least on the benchmarks they evaluated it against (see section V.B in that paper, where they compared the tool against itself with the analyses disabled).

Smartian and Echidna are different tools and therefore, it could be the case that the improvements that such data-flow analysis are absorbed by other things we do, however, we want to see concrete evidence on small and large contracts to decide.

Is there a branch of the Echidna repo in which this generation graph is used, which one could test on a wider variety of contracts to determine if it does help in general?

We don't have code yet, the graph should be parsed from slither and then the generation should be tweaked to use probabilities given the last generated transactions (e.g. just executed A, let's execute B or C).

Aside from the functions_relations and related generationGraph, it seems like the msg_sender property would be much easier to utilize, and should clearly be helpful in general since it would avoid sending transactions that are sure to fail. Is there any work being done to integrate this? Seems like it would be a very useful contribution!

Another potential improvement that we have not integrated yet, happy to heard ideas about that. In particular, to know exactly what to do if code depends on msg.sender.

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.

None yet

2 participants