-
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
MetaVM: initial base class for an extensible EVM #441
Conversation
I think this is somewhat conflicting/replicating #424. If it does, it would be better to join efforts. Can you have a look? |
@pinkiebell yes, you should definitely coordinate with @s1na. It is generally risky to start such heavy rewrites/refactoring work without (deeper) prior discussion, though this looks promising. Nevertheless this can lead to a PR being rejected at the end (due to other work conflicting/too heavy API changes/introduction of new language features which can't be supported yet/...). |
@axic @holgerd77 My primary intention with this PR is the ability to overwrite opcode handlers, in a way that is most flexible for other developers to take advantage of that. This is something the EEI does not cover. Would be nice to get a discussion/decision about this feature, as the solEVM-enforcer depends on this functionality for example. |
Haven't had a deeper look, but I have a first impression that this is all functionality that might be better settled directly on Especially since there is a tendency (see comment) to separate this inner //cc @s1na Thoughts? |
The for use-cases like this are becoming pretty straightforward:
|
Introducing the `VM.MetaVM` class to support developers implementing special logic (override specific opcode handlers) along other things for state manipulation. Related #410
dist-files are now using some core-js polyfills
Thanks for the PR. It really helps to hear pain points from users of the library. I'm sure we can join forces to satisfy you requirements somehow. In the meanwhile, a few points come to mind:
I see the My current thinking on the design is to have an |
Sounds great and is probably the same I intended for the MetaVM, except the EEI, stateManager and the high-level connector stuff. |
@s1na @pinkiebell I would agree with Sina and see the VM as a high-level connector class and rather not go up to some meta VM but down to |
How can we proceed here? This is a great and work-intensive PR and we should spent some time to think about possible integration paths. @s1na can you identify parts of the code here which can be integrated within the structure you have got in mind? Is it possible that you do some structural preparation, e.g. by opening a PR just introducing the relevant structural updates, and then you and @pinkiebell can work together on the PR? |
Side notes for @pinkiebell:
|
Sorry for being inactive here for some time. This topic is definitely on my mind and I'm thinking about how best we can proceed here. It would be much easier if we could meet at ethcc to discuss in person, @pinkiebell let me know if you'll be there. Regarding the VM and higher-level stuff: In the current design the library has a single entry point ( I think we can discuss the design in #456, then use this PR as inspiration, and introduce multiple small subsequent PRs to merge the logic gradually. This is also what I've been doing with #424, I only started drafting a structure there, and have been trying to gradually merge ideas from that in smaller PRs (e.g. #442, #425). I'll start working on a rough sketch for the structure that we can use as a starting point for discussion. |
I'm not attending ethcc, but @johannbarbie and maybe others from leapDAO going to be there ;).
Yes, if we could have something like a
👍 |
Hi @krzkaczor if you could join the discussion here with all your experience on VM prototyping and refactoring that would be really valuable! 😃 |
I went through your code in more detail and here's how I suggest we proceed here (as a first step):
Please feel free to discuss any of them, if you disagree. |
Sounds good. The only thing we have to consider is the event emitting stuff like in We can bubble-up events but that is ugly by design, we can introduce a |
Hmm, good point 🤔 I think we eventually have to pass the One reason I'm resisting a direct coupling between |
If I'm not mistaken in my thinking/analysis I think it should be the other way around, the Interpreter + execution engine should be passed as an option to the outer processing engine (atm called: the VM), similar to the state manager. If someone wants to use events/do other modifications one is passing ones own inner VM, otherwise it gets instantiated with the EVM interpreter as default. Does this make sense? |
Maybe an I'll be thinking about how we can refactor |
Initial impression (these can be done in later PRs):
I'm now thinking whether it makes sense to have |
This limitation of |
Can you try some concept-grasping outline what the different tasks of the I have a rough feeling that this |
Hey @pinkiebell, just wanted to clarify that the last few comments are not directly for this PR and were for the future (will move the discussion to #456). Please let me know if any problem arose, or you can't work on this in the near-term future, because my work depends on this. |
@s1na |
@pinkiebell thanks for the work already done! 😀 So is it ok if we directly copy over parts of your code? Sorry that you don't get direct attribution then. 😕 |
@holgerd77 |
@pinkiebell as Holger said, your work is definitely valuable and I'm really grateful :) Sorry it turned out this way, as you might have noticed we're in the middle of an overhaul... I hope I can still ping you for comments, specially for the evm debugging and state manipulation parts.
Yeah I've also faced that in another library, I think adding |
👍 Of course you can 😄 |
Introducing the
VM.MetaVM
class to support developers implementingspecial logic (override specific opcode handlers) along other things
for state manipulation.
Related #410