-
Notifications
You must be signed in to change notification settings - Fork 784
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: Run transaction with custom EVM/Interpreter / API Discussion #636
Comments
Depending on what exactly we want to make part of the public API there are a few small issues that need to be worked around, due to how the code is structured now. How it works now:
So the first question is which of these classes do we want to make public and configurable. Depends on use-cases, but my guess is probably Second, since they're created for every tx and thrown away, probably a factory class should be passed in to the VM so that Let's say I want to test changing the logic of an opcode (or adding new ones, etc.). What I'll have to do then is:
Alternatively, we could add something like a Hopefully someone can come up with a better approach |
I've been thinking about this lately, and I wonder what is the motivation for this change. The only one I remember is that @cgewecke wanted to override the behavior of |
@alcuadrado I've been able to do everything I need to do using the I had some ideas about conditionally making some opcodes free because I'm injecting Solidity statements into people's code to track execution which distorts the cost. But I think buidlerevm demonstrates that passive tracing is accurate and effective - ultimately that's how my use-case should be done. |
Sorry for the late response. That's a valid question @alcuadrado and this decision shouldn't be taken lightly as it'll expose a large fraction of the internal api publicly. The main reasons that come to my mind are to allow the usage of VM in similar (but slightly different) configurations: like testnets, similar chains (I think the Remix folks were asking about this, can't find the issue right now) where you want to modify the list of the opcodes/precompiles and their logic a bit. It's not clear to me what's the extent of changes we'll need to enable these use-cases. Also when the VM is flexible it can be used as a tool for experimenters and researchers without needing to fork the code. A concrete example that I can bring which would help myself right now is for a code merklization experiment, where I need to manually supply the list of valid jumpdests to Also related: #441 |
Outdated and superseeded/partially solved by VM v6 breaking release EVM/VM refactor, will close. |
After the v4 refactoring,
runTx
instantiates theEVM
class which in turn when executing a message instantiates theInterpreter
class. One benefit of this would be to allow users to use their custom interpreter implementation. But it was decided to make this part of the API public only in a subsequent release.The text was updated successfully, but these errors were encountered: