Check constancy when calling to external function#1480
Merged
jacqueswww merged 7 commits intoAug 24, 2019
Conversation
jacqueswww
suggested changes
Jun 12, 2019
jacqueswww
left a comment
Contributor
There was a problem hiding this comment.
Add a test in /syntax/ and it's good to go.
Member
Author
|
Note to self: we decided at last meeting to add an assert_no_modify (or something) to the language and so this PR needs to be expanded to add that. Also I need to fix the tests |
Member
Author
|
@jacqueswww should be ready to go |
Member
Author
|
pinging @fubuloubu @davesque for review |
fubuloubu
approved these changes
Aug 24, 2019
Contributor
|
Need to add some docs on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Fix #1468 , #1377
How I did it
The compiler was not checking constancy of external calls inside of a constant context. However, it was correctly generating static calls, so calls to modifying functions would fail at runtime when the callee tried to modify state (per https://github.com/ethereum/EIPs/blob/d95612c8206b7e225bec5dc34c4b019c9531e44d/EIPS/eip-214.md). This adds a check when compiling external calls that they cannot be modifying within a constant context.
How to verify it
Description for the changelog
Add constancy check for external calls
Cute Animal Picture