-
Notifications
You must be signed in to change notification settings - Fork 81
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
EVM-C: better error reporting in evm_call_fn #86
Comments
I can propose to extend the return value of The error codes would be: "call depth limit reached", "insufficient funds" + codes we have in However, I'm not convinced that would provide any addition value to the VM. What is the VM supposed to do with this error code? The user already knows about it because it provides it. Moreover, calls are in general a big mess, because it is not clear who (the VM or the user) is responsible to check which call preconditions. |
I think this would be a good trade off as a start.
In eWASM it is possible to return these error codes back to the contract. |
Can't you use output for passing errors? |
I would rather not make it any more messy than it already is. |
I was thinking a bit more about this issue. How about returning However, there is one drawback: |
I will need to proceed with this one now, because it turned out the current design might be not enough. What do you think about putting the pointer to
It will work like virtual destructor in C++. |
@chfast should be fine. Does it needs to be specific for call vs. tx and single release cannot be reused? |
Single release will not work if you want to compose VMs. E.g. in one VM you have a call result coming from some other VM. |
@chfast I see, it's fine having it in the struct. |
How the evm_result should work for CREATE? |
Returning |
After this change Python gave up on this struct :). And there are a lots of issues in go. But last night I had an idea to split the CREATE to "code eval" and "create account" parts. It might work. |
Are they having an issue with unions? Wouldn't a simple solution like removing the union and just having those 3 as members of the result struct work? |
It would, but I'm trying to keep the structs within 64 bytes to fit in the cache line. |
Since |
I'm about to make the last change in the EVM-C by changing
to
In case of CREATE, the host application should allocate 20 bytes of dynamic memory to pass the address of the created account. But I need #112 first. |
This is addressed in #118. |
@chfast I think we could consider this finished now? |
We could consider how much of the
evm_result
/evm_result_code
should/could be shared withevm_call_fn
.evm_result
(as a pointer to function) to allow VM compositing and results from different VMs. It will work like C++ virtual destructor.evm_result
as the output ofevm_call_fn()
.The text was updated successfully, but these errors were encountered: