-
Notifications
You must be signed in to change notification settings - Fork 193
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
[bug] Make RefundGas safer (potential issue) #2059
Comments
Related comment on the part that references a
|
The recent PR addresses each point highlighted in the original issue |
The Ask
Commit and Scope: The
RefundGas
function from evm/keeper/gas_fees.goDeadline: 2024-10-15
gethcore.Message
uses raw gas price instead of effective gas price. We need to switch it effective.Edit 2024-10-12: Added details from C4 audit
Warning Generated by Coderabbit
[Click to Expand]
Prevent negative gas refund calculation
The calculation
msg.Gas() - evmResp.GasUsed
could result in a negative value ifevmResp.GasUsed
exceedsmsg.Gas()
. This could lead to unintended behavior or panic due to negative gas values.Consider ensuring the refund amount is non-negative:
📝 Committable suggestion
Originally posted by @coderabbitai[bot] in #2053 (comment)
The text was updated successfully, but these errors were encountered: