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

VM: RunCode() and runCall() edits state #799

Closed
jochem-brouwer opened this issue Jun 29, 2020 · 2 comments
Closed

VM: RunCode() and runCall() edits state #799

jochem-brouwer opened this issue Jun 29, 2020 · 2 comments

Comments

@jochem-brouwer
Copy link
Member

As opposed to what I would expect, RunCode and RunCall actually edits the state. When coming from the web3 world, where one can call/send, we know that if we call then the state does not change, but if we send and the transaction gets mined, then the state does change.

I know that we are talking about the context of Transactions in the web3 variant, but I think the assumption that runCall / runCode does not change state is a logical one when coming from the web3 world.

I therefore propose that we add a flag to RunCodeOpts and RunCallOpts which is false by default: editState or something similar would this option be called. When set to true, the state is committed at the end of runCode / runCall, if not, the state is rolled back at the end of those function calls. Of course, if this happens internally in the VM, we set this option to true.

Related: #613, I think we could merge these two issues into a single PR after we had a discussion here.

@holgerd77
Copy link
Member

Would you still stick to this suggestion (do not have made up my mind yet)?

@holgerd77 holgerd77 changed the title RunCode and RunCall edits state VM: RunCode and RunCall edits state Jan 13, 2022
@holgerd77 holgerd77 changed the title VM: RunCode and RunCall edits state VM: RunCode() and runCall() edits state Jan 13, 2022
@holgerd77
Copy link
Member

As mentioned, related to #613, can very well be part of an eventual solution space if needed, but will close here for simplicity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants