Skip to content
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

Add gas refund to evmc_result #666

Merged
merged 2 commits into from
Aug 17, 2022
Merged

Add gas refund to evmc_result #666

merged 2 commits into from
Aug 17, 2022

Conversation

chfast
Copy link
Member

@chfast chfast commented Aug 12, 2022

Add gas_refund field to evmc_result and evmc::Result.

Closes #413.
Replaces #417

The evmc_result::gas_refund represents refunded gas accumulated from
the current execution and its sub-calls.
@@ -345,33 +345,39 @@ class Result : private evmc_result
///
/// @param _status_code The status code.
/// @param _gas_left The amount of gas left.
/// @param _gas_refund The amount of refunded gas.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does gas_left includes the gas_refund value?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. It is mentioned somewhere that gas refund is uncapped. I can try to improve the documentation.

This is implementable, but I decided to leave the transaction-specific logic outside of EVMC yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calculate refunds on VM side
3 participants