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

Check constancy when calling to external function #1480

Merged
merged 7 commits into from Aug 24, 2019

Conversation

@charles-cooper
Copy link
Collaborator

charles-cooper commented Jun 12, 2019

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

Put a link to a cute animal picture inside the parenthesis-->

Copy link
Collaborator

jacqueswww left a comment

Add a test in /syntax/ and it's good to go.

vyper/parser/external_call.py Show resolved Hide resolved
@charles-cooper

This comment has been minimized.

Copy link
Collaborator Author

charles-cooper commented Jun 26, 2019

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

@charles-cooper

This comment has been minimized.

Copy link
Collaborator Author

charles-cooper commented Aug 8, 2019

@jacqueswww should be ready to go

@charles-cooper

This comment has been minimized.

Copy link
Collaborator Author

charles-cooper commented Aug 8, 2019

pinging @fubuloubu @davesque for review

@fubuloubu

This comment has been minimized.

Copy link
Member

fubuloubu commented Aug 24, 2019

Need to add some docs on assert_modifiable but I don't see why this cannot be merged now.

Copy link
Collaborator

jacqueswww left a comment

LGTM

@jacqueswww jacqueswww merged commit 40ee664 into vyperlang:master Aug 24, 2019
3 checks passed
3 checks passed
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: py36-core Your tests passed on CircleCI!
Details
ci/circleci: py37-core Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.