Delay contract code and value updates to the end of execution #636
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.
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:
master
branchFiles changed
in the Github PR explorer