-
Notifications
You must be signed in to change notification settings - Fork 54
fix: enhance gas estimation with execution_gas_used field #810
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
base: release/v0.22.x
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/v0.22.x #810 +/- ##
===================================================
- Coverage 47.00% 46.99% -0.02%
===================================================
Files 187 187
Lines 15224 15228 +4
===================================================
Hits 7156 7156
- Misses 7278 7280 +2
- Partials 790 792 +2
🚀 New features to boost your workflow:
|
thomas-nguy
left a comment
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.
looks good overall 👌
| // limit for these cases anyway. | ||
| // Use ExecutionGasUsed (actual gas before minGasMultiplier adjustment) for accurate estimation. | ||
| if result.ExecutionGasUsed > 0 { | ||
| lo = result.ExecutionGasUsed - 1 |
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.
why is it -1?
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.
the binary search will start with lo+1
|
|
||
| # Compare results from ethermint and geth | ||
| for result in (ethermint_result, geth_result): | ||
| assert result["gas_diff"] == 0, ( |
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.
assert gas_diff equals to 0 only works for a tx that doesn't trigger gas refunds.
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.
yes, in this call there is no refund
Closes: #XXX
Description
For contributor use:
docs/) or specification (x/<module>/spec/)godoccomments.Unreleasedsection inCHANGELOG.mdFiles changedin the Github PR explorerFor admin use:
WIP,R4R,docs, etc)