-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
R4R: Fix runTx Gas Consumption during Tx Aborting #3244
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3244 +/- ##
===========================================
- Coverage 54.88% 54.87% -0.01%
===========================================
Files 133 133
Lines 9555 9553 -2
===========================================
- Hits 5244 5242 -2
Misses 3989 3989
Partials 322 322 |
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.
utACK
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.
stdTx, ok := tx.(StdTx)
if !ok {
return ctx, sdk.ErrInternal("tx must be StdTx").Result(), true
}
One could still provoke the infinite gas meter to be used by including a non stdtx
Updated @SLAMPER |
Nice! Is there any way we can add a test for this behavior? |
It would have to bypass checkTx I think? So I'm not totally sure. |
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.
Despite the lack of a test case, I give my nihil obstat. I think we are excused here to go ahead and validate this anyway, having seen the difficulty of testing this in an automated fashion. Furthermore, the bug fixed by this PR is easily reproducible by hand.
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.
Good fix @alexanderbez
Can a follow-up issue be written up for getting a test for this? It is very critical that we have tests for these fundamental baseapp responsibilities, we've had lots of severe bugs regarding this lately. |
Completely agree @ValarDragon -- suggestions on how to test something like this? |
For a given block, if a tx fails/aborts, we currently do not update the context and as such the
defer
ed function call inBaseApp#runTx
still uses theinfiniteGasMeter
and subsequent txs may well exceed the limit.closes: #3242
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added entries in
PENDING.md
with issue #rereviewed
Files changed
in the github PR explorerFor Admin Use: