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

Delay contract code and value updates to the end of execution #636

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

turbolent
Copy link
Member

@turbolent turbolent commented Mar 1, 2021

Description

Until now, the behaviour of contract updates was not fully defined, there was a potential for weird side-effects.

Clearly define that a contract update, i.e. the update of contract code and contract value, is delayed until the end of execution. Contract updates shouldn't be effective immediately, as this would effectively result in hot-code patching, which is not supported.

When parsing and checking a contract code update (a new contract or a changed contract), then don't store this new program in the program storage (i.e. don't call SetProgram). Doing so would overwrite a potentially currently used program, or would result in this new program being used immediately when being explicitly imported, or implicitly imported through loading a value from storage.


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@turbolent turbolent merged commit bee0fea into master Mar 3, 2021
@turbolent turbolent deleted the bastian/delay-contract-updates branch May 18, 2021 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants