Skip to content
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(x/globalfee): Ante handler fee decorator #775

Merged
merged 20 commits into from May 3, 2023

Conversation

spoo-bar
Copy link
Collaborator

@spoo-bar spoo-bar commented Apr 6, 2023

Added the ante handler to ensure enough fees have been set.

The fee calculation is based on gaia x/globalfee implementation
https://github.com/cosmos/gaia/blob/6fe097e3280baa360a28b59a29b8cca964a5ae97/x/globalfee/ante/fee.go

No tests. In separate PR 👉🏻 #786

@codecov
Copy link

codecov bot commented Apr 12, 2023

Codecov Report

Patch coverage: 24.84% and project coverage change: +0.19 🎉

Comparison is base (6d74b14) 9.81% compared to head (056752f) 10.01%.

Additional details and impacted files
@@                  Coverage Diff                  @@
##           feature/globalfee     #775      +/-   ##
=====================================================
+ Coverage               9.81%   10.01%   +0.19%     
=====================================================
  Files                     97       97              
  Lines                  13880    14040     +160     
=====================================================
+ Hits                    1363     1406      +43     
- Misses                 12441    12557     +116     
- Partials                  76       77       +1     
Impacted Files Coverage Δ
app/upgrades.go 18.18% <0.00%> (ø)
x/globalfee/keeper/keeper.go 50.00% <0.00%> (-25.00%) ⬇️
x/globalfee/types/contract_authorization.go 10.00% <ø> (ø)
x/globalfee/types/genesis.pb.go 3.55% <4.80%> (+0.99%) ⬆️
app/ante.go 65.71% <100.00%> (+1.00%) ⬆️
app/app.go 85.25% <100.00%> (+0.38%) ⬆️
x/globalfee/types/genesis.go 100.00% <100.00%> (+100.00%) ⬆️
x/globalfee/types/params.go 60.60% <100.00%> (+5.43%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@spoo-bar spoo-bar marked this pull request as ready for review April 17, 2023 10:36
@spoo-bar spoo-bar changed the title Ante handler fee decorator feat(x/globalfee): Ante handler fee decorator Apr 17, 2023
Comment on lines +49 to +52
// Only check for minimum fees and global fee if the execution mode is CheckTx
if !ctx.IsCheckTx() || simulate {
return next(ctx, tx, simulate)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this validators can still propose 0fee txs right ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, in case when the validator has configured minimum-gas-prices = "0ustars"

x/globalfee/ante/fee.go Outdated Show resolved Hide resolved
x/globalfee/ante/fee.go Show resolved Hide resolved
x/globalfee/ante/fee.go Outdated Show resolved Hide resolved
@jhernandezb jhernandezb merged commit 6128043 into feature/globalfee May 3, 2023
7 checks passed
@spoo-bar spoo-bar deleted the ante-handler-globalfee branch May 3, 2023 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants