-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat(levm): implement Transaction Report #930
base: main
Are you sure you want to change the base?
Conversation
&mut self, | ||
current_call_frame: &mut CallFrame, | ||
) -> Result<OpcodeSuccess, VMError> { | ||
pub fn execute(&mut self, current_call_frame: &mut CallFrame) -> TransactionReport { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't transact
return a TransactionReport
instead? execute
is supposed to be called only from inside of VM
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just seen that transact
is indeed returning a TransactionReport
, but do you think execute
should be returning the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it may not be the most accurate representation but it makes it more simple to use the same, the attributes we need in both scenarios are almost identical.
Maybe the other option would be to have another struct for that purpose (ContextResult?
) and then on transact
we should execute
the VM and generate the TransactionReport
based on the ContextResult
returned by execute
and the final state of the VM. It doesn't sound like a bad idea.
Let me know what you think.
Motivation
Implement interface transaction report and make call work with it.
Description
returndata
. Createdsub_return_data
for subcontext and left return_data for current context.RETURNDATASIZE
andRETURNDATACOPY
to usesub_return_data
Out of scope but implemented:
Closes #926
Closes #923 - partially addressed, there are still changes to make to
generic_call()
Closes #922
Closes #938 - Even though this issue is out of scope, the fix was only a one line change.