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

Added explicit delay in shrinking and improved pp functions #518

Merged
merged 4 commits into from
Nov 5, 2020

Conversation

ggrieco-tob
Copy link
Member

This small PR allows Echidna to use a special transaction to discover during shrinking when a function called is actually useless and only the time/block delay is triggering an failure. It will also improve a little how calls are printed to make them easier to understand.

@ggrieco-tob ggrieco-tob marked this pull request as ready for review October 30, 2020 19:40
@@ -19,6 +19,7 @@ import Echidna.Types.Signature (SolCall)
data TxCall = SolCreate ByteString
| SolCall SolCall
| SolCalldata ByteString
| NoCall
Copy link
Member

Choose a reason for hiding this comment

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

I get the semantics from the context of this PR but I think this data constructor can be confusing in future. Can we document the semantics here?

Looking further, as this is not really a call but rather other event altering the VM state maybe we could refactor that into something like:

data TemporalEvent = AddDelay
data EventType = TxCall TxCall | TemporalEvent TemporalEvent

This would also eliminate the need of _ -> error "NoCall" in setupTx. This could involve a bigger refactor to make space for future expansions as setupTx and Tx type don't handle just Tx calls anymore.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that's a reasonable idea, but yes, it will require a larger refactor, for such a small feature. This should be the only "special" event

@ggrieco-tob ggrieco-tob merged commit 42abcdd into master Nov 5, 2020
@ggrieco-tob ggrieco-tob deleted the dev-delay branch November 5, 2020 16:01
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.

2 participants