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

Warn if multiple procedure calls have the same effect as one call (procedure idempotence) #1157

Closed
anton-trunov opened this issue Aug 24, 2022 · 1 comment · Fixed by #1192
Assignees
Labels
enhancement New feature or request gas Issue related to gas accounting static analysis
Milestone

Comments

@anton-trunov
Copy link
Contributor

Warn if a parameterless procedure gets called in a loop, possibly transitively, but the procedure only reads unmodified contract fields and it does not modify the contract's state nor it issues events and/or messages, i.e. its behavior is the same across all loop iterations.

A usual use case for such procedures is access control, handling pausing/unpausing of the contract, etc. These procedures usually check some property on contract fields that cannot be modified in the same transition and abort contract execution in case the property is violated.

The point of the analysis is to warn excessive gas usage by such iterative procedure calls.

@anton-trunov anton-trunov added enhancement New feature or request static analysis gas Issue related to gas accounting labels Aug 24, 2022
@anton-trunov anton-trunov added this to the Scilla 0.13.0 milestone Aug 24, 2022
@jubnzv jubnzv self-assigned this Sep 13, 2022
@jjcnn jjcnn modified the milestones: Scilla 0.13.0, Scilla 0.14.0 Oct 17, 2022
@jubnzv
Copy link
Contributor

jubnzv commented Oct 19, 2022

We should take into account that we only need to report such procedures that do not return a value (when #578 is finished).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gas Issue related to gas accounting static analysis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants