fix(baseapp): don't report block-level gas for failed tx decodes#3202
Closed
wen-coding wants to merge 1 commit intomainfrom
Closed
fix(baseapp): don't report block-level gas for failed tx decodes#3202wen-coding wants to merge 1 commit intomainfrom
wen-coding wants to merge 1 commit intomainfrom
Conversation
When ante handling never runs (e.g. decode failure), the deferred epilogue in runTx was reading the block-level gas meter instead of a per-tx meter. Guard against this by checking whether a tx-scoped meter was installed before reporting GasUsed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3202 +/- ##
=======================================
Coverage 58.65% 58.65%
=======================================
Files 2055 2055
Lines 168498 168501 +3
=======================================
+ Hits 98835 98841 +6
+ Misses 60878 60876 -2
+ Partials 8785 8784 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
2 tasks
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
) ## Summary - When a transaction fails to decode (nil tx), the deferred epilogue was reading `GasUsed` from the block-level gas meter instead of a per-tx meter, since the ante handler never ran to install one. - Added a guard in all three tx execution paths: if the gas meter hasn't changed from the block-level meter, skip reporting gas for that transaction. - `app/legacyabci/deliver_tx.go` (production DeliverTx) - `app/legacyabci/check_tx.go` (production CheckTx) - `sei-cosmos/baseapp/baseapp.go` (simulation/CheckTx via runTx) Supersedes #3202. ## Test plan - [x] `TestDecodeFailureTxReportsZeroGas` (app) — successful bank send reports nonzero gas, decode failure reports zero, insufficient-funds tx (ante handler ran) reports nonzero gas - [x] `TestRunTxDecodeError` (baseapp) — nil tx with prior block-level gas reports zero GasUsed 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
runTx's deferred epilogue was readingGasUsedfrom the block-level gas meter instead of a per-tx meter, since the ante handler never ran to install one.TestRunTxDecodeErrorto verify decode failures always report zero gas regardless of block-level meter state.Test plan
TestRunTxDecodeError— verifies zero GasUsed for nil tx even when block meter has accumulated gasTestTxGasLimitsandTestRunInvalidTransactionstill pass🤖 Generated with Claude Code