-
Notifications
You must be signed in to change notification settings - Fork 710
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
refactor: bypass-msgs #2218
refactor: bypass-msgs #2218
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2218 +/- ##
==========================================
+ Coverage 83.83% 83.84% +0.01%
==========================================
Files 22 22
Lines 1540 1541 +1
==========================================
+ Hits 1291 1292 +1
Misses 201 201
Partials 48 48
|
x/globalfee/ante/fee.go
Outdated
// Otherwise, minimum fees and global fees are checked to prevent spam. | ||
containsOnlyBypassMinFeeMsgs := mfd.bypassMinFeeMsgs(msgs) | ||
doesNotExceedMaxGasUsage := gas <= uint64(len(msgs))*mfd.MaxBypassMinFeeMsgGasUsage | ||
doesNotExceedMaxGasUsage := gas <= mfd.MaxTotalBypassMinFeeMsgGasUsage | ||
allowedToBypassMinFee := containsOnlyBypassMinFeeMsgs && doesNotExceedMaxGasUsage |
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.
Hi @alexanderbez , can you please help confirm here, it is ok to refactor uint64(len(msgs))*mfd.MaxBypassMinFeeMsgGasUsage
to MaxTotalBypassMinFeeMsgGasUsage
?
without upgrade
MaxBypassMinFeeMsgGasUsage
is 200_000,
MaxTotalBypassMinFeeMsgGasUsage
is 1_000_000
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.
No, you cannot change gas consumed in a soft upgrade (i.e. a point release). If a node is replaying or catching up, it will yield in a consensus fault (e.g. you said gas was X but it's Y for me)
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.
Even if MaxTotalBypassMinFeeMsgGasUsage
isn't checked in DeliverTx ?
Lines 79 to 84 in 44d5e05
// Only check for minimum fees and global fee if the execution mode is CheckTx | |
if !ctx.IsCheckTx() || simulate { | |
return next(ctx, tx, simulate) | |
} | |
if !allowedToBypassMinFee { |
docs/modules/globalfee.md
Outdated
|
||
Nodes created using Gaiad `v7.0.1` or earlier do not have `bypass-min-fee-msg-types` configured in `config/app.toml` - they are also using default values. The `bypass-min-fee-msg-types` config option can be added to `config/app.toml` before the `[telemetry]` field. | ||
- Nodes created using Gaiad `v7.0.2` or later use `["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.channel.v1.MsgAcknowledgement","/ibc.applications.transfer.v1.MsgTransfer"]` as defaults. | ||
- Nodes created using Gaiad `v9.0.1` or later use `["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.channel.v1.MsgAcknowledgement","/ibc.applications.transfer.v1.MsgTransfer", "/ibc.core.channel.v1.MsgTimeout", "/ibc.core.channel.v1.MsgTimeoutOnClose"]` as defaults. |
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.
This version need to be updated, it will not be included in v9.0.1. This PR is consensus breaking.
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.
You can see our (Umee) ante handler implementation for bypassing fee for certain type (and max gas) of messages: https://github.com/umee-network/umee/blob/main/ante/fee.go#L22
|
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
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.
Looks good but some changes are necessary. We should not drop NewGovPreventSpamDecorator
.
Co-authored-by: MSalopek <35486649+MSalopek@users.noreply.github.com>
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.
Looks good!
Thank you for making the changes.
closes: #2213
Issue description please check #2213
please note this is not the final refactor of bypass-msg, bypass-msg will go to store as global params.