-
Notifications
You must be signed in to change notification settings - Fork 114
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
API for VM-Kernel interaction #734
Comments
The API should consist of two elements: data types (for which the implementation is provided in the API) and interfaces. The following is a list of core aspects of the VM API. There may of course be oversights here and this list may grow, though I don't expect it to grow substantially and I also do not expect much of what is here to not make it into the actual API: (note, some names on here may soon end up becoming stale)
Interfaces
|
I'm moving onto One question we have to answer soon is: Where should new contract addresses be generated? Currently transactions generate them, which doesn't make much sense. Also, depending on how we solve the problem of knowing which vm to use to run a contract call, this responsibility may have to fall on the virtual machines themselves. |
The classes we have to finish the replacements for before we move on to
|
Going to begin work on integrating |
I think it may be worth discussing the implications of Different virtual machines should have the liberty to define their own error codes. Not every VM has the same error scenarios in the first place, and we don't want a single centralized place where every error code gets dumped, since each VM uses just a subset of them. Instead I think If you're fine with this change @AlexandraRoatis then I can do this, since it was part of my |
I'm also noticing we really have two ways of classifying transactions, and right now we are poorly and quite confusingly calling these the transaction The real difference between these is that On the other hand, We need to formalize this distinction properly for our api layer. |
The VM API is in a more-or-less finalized form for this phase of the integration. At this point it consists only of interfaces without any shared data types. This may not be the final phase of the API, I suspect that it will make sense to pull some data types out into it, but that's not a priority at the moment. As for the shape of the kernel integration, we are currently very close to having The kernel & fastvm have a number of cosmetic & design related refactorings left to do. However, these are not a priority at the moment, our priority is now getting the kernel-fvm relationship set up properly and adding the Avm in. Some tasks left to do:
|
Hey, have a small request for the API. There is a plumbing issue for when transactions fail currently -- somewhere in or between the kernel and the VM, some details of the error are lost. Would be good to make sure the new API can fix it, or at least is set up in a way that helps us fix it. The problem is that when transactions fail because of either invalid nonce, invalid energy limit, or insufficient balance, all three cases get reported back to the kernel as "transaction dropped." As a result, when users send in a transaction from RPC (i.e. via Web3), the kernel just reports "transaction dropped" instead of something like "insufficient balance."
Basically, I think in the new API, AionTxExecSummary (or its replacement) needs to have a field that holds a reason for why a tx is dropped/rejected. Then TransactionExecutor#finish (or its replacement) needs to save that reason into the summary object. |
AVM kernel integration progress tracking and remaining to do list:
|
Transaction type checks were disabled in b84bdcd and should be re-enabled after establishing when they will be introduced to both kernel implementations. |
Refactor the current code to extract a common interface layer to a new API for the VM repository in order to decouple the kernel implementation from the specific VM used by it.
The kernel will use the new VM-API jar and a specific implementation jar (no longer relying on git submodules).
FVM, AVM and the hybrid combination of the two would be options for the implementation jar.
Changes which must be made on the kernel side:
The text was updated successfully, but these errors were encountered: