-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat: make fee deduction from gas charging free #50
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe recent changes introduce a new fee management system in the Cosmos SDK application, transitioning to a gas-free fee structure with the implementation of the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant App
participant GasFreeFeeDecorator
participant DeductFeeDecorator
User->>App: Submit transaction with fee
App->>GasFreeFeeDecorator: Process transaction
GasFreeFeeDecorator->>DeductFeeDecorator: Check fee conditions
DeductFeeDecorator-->>GasFreeFeeDecorator: Fee deduction logic
GasFreeFeeDecorator-->>App: Return transaction result
App-->>User: Transaction complete, no extra gas used
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #50 +/- ##
==========================================
+ Coverage 26.32% 26.46% +0.13%
==========================================
Files 111 112 +1
Lines 11868 11893 +25
==========================================
+ Hits 3124 3147 +23
Misses 8299 8299
- Partials 445 447 +2
|
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.
Actionable comments posted: 3
Outside diff range, codebase verification and nitpick comments (1)
app/app.go (1)
Line range hint
282-284
: Fix invalid reference toapp.Simulate
.The
Simulate
method has been removed from theMinitiaApp
struct, butRegisterTxService
still references it. This will cause a compilation error.Consider updating the
RegisterTxService
method to remove or replace the reference toapp.Simulate
.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (7)
- app/ante/ante.go (1 hunks)
- app/ante/ante_test.go (1 hunks)
- app/ante/fee.go (1 hunks)
- app/ante/fee_test.go (1 hunks)
- app/app.go (1 hunks)
- app/const.go (1 hunks)
- x/evm/keeper/params.go (1 hunks)
Files skipped from review due to trivial changes (1)
- app/const.go
Additional context used
GitHub Check: codecov/patch
x/evm/keeper/params.go
[warning] 19-23: x/evm/keeper/params.go#L19-L23
Added lines #L19 - L23 were not covered by tests
[warning] 25-25: x/evm/keeper/params.go#L25
Added line #L25 was not covered by testsapp/ante/fee.go
[warning] 42-43: app/ante/fee.go#L42-L43
Added lines #L42 - L43 were not covered by tests
[warning] 49-53: app/ante/fee.go#L49-L53
Added lines #L49 - L53 were not covered by tests
Additional comments not posted (5)
x/evm/keeper/params.go (1)
19-25
: LGTM!The
GetFeeDenom
method correctly retrieves the fee denomination and handles errors.Tools
GitHub Check: codecov/patch
[warning] 19-23: x/evm/keeper/params.go#L19-L23
Added lines #L19 - L23 were not covered by tests
[warning] 25-25: x/evm/keeper/params.go#L25
Added line #L25 was not covered by testsapp/ante/fee.go (1)
18-63
: LGTM!The
GasFreeFeeDecorator
is implemented correctly, modifying gas meter behavior based on transaction fees.Tools
GitHub Check: codecov/patch
[warning] 42-43: app/ante/fee.go#L42-L43
Added lines #L42 - L43 were not covered by tests
[warning] 49-53: app/ante/fee.go#L49-L53
Added lines #L49 - L53 were not covered by testsapp/ante/fee_test.go (1)
1-63
: LGTM!The tests for
GasFreeFeeDecorator
cover various scenarios effectively, ensuring correct behavior.app/ante/ante.go (1)
91-91
: LGTM!The integration of
NewGasFreeFeeDecorator
intoNewAnteHandler
is correctly implemented.app/ante/ante_test.go (1)
1-136
: LGTM!The test suite setup for ante handler tests is comprehensive and well-structured.
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.
LGTM
Description
We only charge gas at fee deduction only for the transaction which contains unknown fee denoms.
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
Summary by CodeRabbit
New Features
GasFreeFeeDecorator
for improved transaction fee handling, allowing for gas-free transactions under certain conditions.GetFeeDenom
method to enhance fee denomination retrieval in the EVM context.Bug Fixes
Simulate
method from theMinitiaApp
, streamlining transaction simulation and potentially improving gas management.Chores
FeeDeductionGasAmount
constant, simplifying constant declarations.Tests
GasFreeFeeDecorator
andAnteHandler
to ensure correct functionality and gas management during transactions.