perf(ProcessProposal): skip IsTxGasless in checkTotalBlockGas for non-gasless txs#3380
Merged
masih merged 4 commits intoMay 5, 2026
Merged
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3380 +/- ##
==========================================
- Coverage 59.07% 59.06% -0.01%
==========================================
Files 2099 2098 -1
Lines 172970 172951 -19
==========================================
- Hits 102183 102161 -22
- Misses 61922 61931 +9
+ Partials 8865 8859 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
arajasek
approved these changes
May 4, 2026
codchen
approved these changes
May 5, 2026
|
|
||
| totalGas, totalGasWanted := uint64(0), uint64(0) | ||
| nonzeroTxsCnt := 0 | ||
| for _, decodedTx := range typedTxs { |
Collaborator
There was a problem hiding this comment.
another optimization we can make is for this loop to run concurrently and add to total block gas as an atomic int. The only advantage of sequential is if the loop early returns, which is rare.
Contributor
Author
There was a problem hiding this comment.
Thanks for feedback. Created a follow up ticket: https://linear.app/seilabs/issue/PLT-324/
masih
approved these changes
May 5, 2026
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
checkTotalBlockGaspreviously calledantedecorators.IsTxGaslessunconditionally for every tx before doing EVM/Cosmos gas accounting. For typicalMsgEVMTransactiontxs,IsTxGaslessalways returned(false, nil)immediately via the default branch — but still paid the cost of adefer/recoverframe and a message-type walk on every tx.This PR mirrors the
couldBeGaslessTransactionheuristic already used inDeliverTxWithResultand OCC paths:IsEVMMessageis hoisted to the top of the loop (it was already called later for gas accounting). For confirmed single-message EVM txs (isEVM && evmErr == nil),IsTxGaslessis skipped entirely —MsgEVMTransactioncan never be gasless under the current rules.couldBeGaslessTransactionis checked first. Only oracle vote andMsgAssociatetxs proceed to the full keeper-backedIsTxGaslesscall.Semantics are unchanged: txs for which
IsTxGaslesswould have returned(false, nil)are now classified as non-gasless without the extra overhead.