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!: move BypassMinFeeMsgTypes and MaxTotalBypassMinFeeMsgGasUsage to params #2424

Merged
merged 59 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
7a20fb0
feat: update proto files
Apr 3, 2023
92eb6f1
feat: update proto-docs
Apr 3, 2023
94906df
refactor: update query request and response
Apr 3, 2023
15e0bc8
refactor: add bypass-min-fee-msg-types and max_total_bypass_minFee_ms…
Apr 3, 2023
4e7478e
test: update test
Apr 3, 2023
a244a85
feat: add migration
Apr 3, 2023
edd0e51
docs: update changelog
Apr 3, 2023
c9b9b98
add BypassMinFeeMsgTypes param to store
sainoe Apr 3, 2023
e7b49a5
feat: add validateBypassMinFeeMsgTypes
Apr 4, 2023
c57f7e9
update fee decorator and global fee genesis
sainoe Apr 4, 2023
7ed0455
merge main, fix tests
Apr 4, 2023
671cf76
merge main
Apr 4, 2023
97b7e7b
test: fix e2e test
Apr 4, 2023
1be66af
test: add migration_test
Apr 4, 2023
1a42713
chore: add comments
Apr 4, 2023
784dce9
remove bypass from config
sainoe Apr 4, 2023
e5b3b01
fix: proto typo
Apr 5, 2023
3fbdbfe
skip bypass test
Apr 5, 2023
6f33945
save
sainoe Apr 5, 2023
be046e3
update ditrosless image url in Dockerfiles
sainoe Apr 5, 2023
ee64b8a
fix typo in makefil
sainoe Apr 6, 2023
0bb684d
Merge branch 'yaru/bypass-fee-migration' into sainoe/bypass-msg
sainoe Apr 6, 2023
a91a954
Merge branch 'main' into sainoe/bypass-msg
sainoe Apr 6, 2023
3383e37
save
sainoe Apr 6, 2023
942725b
update doc
sainoe Apr 12, 2023
82002d8
update params
sainoe Apr 14, 2023
f4bf009
Merge branch 'main' into sainoe/bypass-msg
sainoe Apr 14, 2023
a36a561
fix e2e bypass msg test
sainoe Apr 17, 2023
a2113e4
save
sainoe Apr 17, 2023
751aee4
save
sainoe Apr 18, 2023
daf0775
update e2e bypass min fee test
sainoe Apr 19, 2023
2f1873d
remove print
sainoe Apr 19, 2023
f14e64d
remove migration tests; revert 97b7e7b
sainoe Apr 20, 2023
bbeb3eb
remove migration ; revert a244a85f
sainoe Apr 20, 2023
d999e1e
Revert "remove bypass from config"
sainoe Apr 20, 2023
bf70090
Merge branch 'main' into sainoe/global-fee-params
sainoe Apr 20, 2023
2d56919
update changelog
sainoe Apr 20, 2023
d372c4b
Update CHANGELOG.md
sainoe Apr 26, 2023
875ae95
Merge branch 'main' into sainoe/global-fee-params
mmulji-ic Apr 26, 2023
b63f219
update nits
sainoe May 1, 2023
664ed26
clean up script
sainoe May 2, 2023
537e0f1
fix changelog
sainoe May 2, 2023
903ed51
Merge branch 'main' into sainoe/global-fee-params
sainoe May 2, 2023
7cc206f
fix linter
sainoe May 2, 2023
19aa84b
Merge branch 'main' into sainoe/global-fee-params
sainoe May 2, 2023
973ef4d
nits
sainoe May 5, 2023
3b3391d
Merge branch 'main' into sainoe/global-fee-params
sainoe May 5, 2023
ad85e58
improve comments
sainoe May 5, 2023
943a63a
Merge branch 'main' into sainoe/global-fee-params
sainoe May 8, 2023
261f408
Change global fee query name
sainoe May 8, 2023
c3af86f
update e2e bypass test
sainoe May 8, 2023
e779b34
bump link checker
sainoe May 8, 2023
39c15ab
Revert "bump link checker"
sainoe May 8, 2023
7b76bd9
update e2e testBypassMinFeeWithdrawReward
sainoe May 8, 2023
303269b
merge main
May 11, 2023
98a7052
Add condition to return zero GlobalFee parameters when Genutil InitGe…
sainoe May 11, 2023
922615f
fix: panics
May 12, 2023
78964da
fix: revert back
May 12, 2023
83f7295
fix: lint
May 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (test) [#2440](https://github.com/cosmos/gaia/pull/2440) Add vulncheck to nightly builds

### State Machine Breaking
* (feat!) [#2424] Add `bypass-min-fee-msg-types` and `maxTotalBypassMinFeeMsgGagUsage` to globalfee params. Note that this change is both state breaking and API breaking.
* (gaia) Bump Golang prerequisite from 1.18 to 1.20 see (https://go.dev/blog/go1.20) for details.
* (gaia) [#2442](https://github.com/cosmos/gaia/pull/2442) Bump [Interchain-Security](https://github.com/cosmos/interchain-security) to [v1.1.1](https://github.com/cosmos/interchain-security/tree/v1.1.1).

Expand Down
9 changes: 1 addition & 8 deletions ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ import (
gaiafeeante "github.com/cosmos/gaia/v9/x/globalfee/ante"
)

// maxTotalBypassMinFeeMsgGasUsage is the allowed maximum gas usage
// for all the bypass msgs in a transactions.
// A transaction that contains only bypass message types and the gas usage does not
// exceed maxTotalBypassMinFeeMsgGasUsage can be accepted with a zero fee.
// For details, see gaiafeeante.NewFeeDecorator()
var maxTotalBypassMinFeeMsgGasUsage uint64 = 1_000_000

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
// channel keeper.
type HandlerOptions struct {
Expand Down Expand Up @@ -68,7 +61,7 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) {
ante.NewValidateMemoDecorator(opts.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(opts.AccountKeeper),
NewGovPreventSpamDecorator(opts.Codec, opts.GovKeeper),
gaiafeeante.NewFeeDecorator(opts.BypassMinFeeMsgTypes, opts.GlobalFeeSubspace, opts.StakingSubspace, maxTotalBypassMinFeeMsgGasUsage),
gaiafeeante.NewFeeDecorator(opts.GlobalFeeSubspace, opts.StakingSubspace),
ante.NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper),
ante.NewSetPubKeyDecorator(opts.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(opts.AccountKeeper),
Expand Down
61 changes: 46 additions & 15 deletions docs/proto/proto-docs.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,115 @@
<!-- This file is auto-generated. Please do not modify it yourself. -->
# Protobuf Documentation

<a name="top"></a>

## Table of Contents

- [gaia/globalfee/v1beta1/query.proto](#gaia/globalfee/v1beta1/query.proto)
- [QueryMinimumGasPricesRequest](#gaia.globalfee.v1beta1.QueryMinimumGasPricesRequest)
- [QueryMinimumGasPricesResponse](#gaia.globalfee.v1beta1.QueryMinimumGasPricesResponse)
- [QueryParamsRequest](#gaia.globalfee.v1beta1.QueryParamsRequest)
- [QueryParamsResponse](#gaia.globalfee.v1beta1.QueryParamsResponse)

- [Query](#gaia.globalfee.v1beta1.Query)
- [Query](#gaia.globalfee.v1beta1.Query)

- [gaia/globalfee/v1beta1/genesis.proto](#gaia/globalfee/v1beta1/genesis.proto)
- [GenesisState](#gaia.globalfee.v1beta1.GenesisState)
- [Params](#gaia.globalfee.v1beta1.Params)
- [GenesisState](#gaia.globalfee.v1beta1.GenesisState)
- [Params](#gaia.globalfee.v1beta1.Params)

- [Scalar Value Types](#scalar-value-types)



<a name="gaia/globalfee/v1beta1/query.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## gaia/globalfee/v1beta1/query.proto

<a name="gaia.globalfee.v1beta1.QueryMinimumGasPricesRequest"></a>

### QueryMinimumGasPricesRequest

<a name="gaia.globalfee.v1beta1.QueryParamsRequest"></a>

### QueryParamsRequest
QueryMinimumGasPricesRequest is the request type for the
Query/MinimumGasPrices RPC method.

<a name="gaia.globalfee.v1beta1.QueryMinimumGasPricesResponse"></a>

### QueryMinimumGasPricesResponse




<a name="gaia.globalfee.v1beta1.QueryParamsResponse"></a>

### QueryParamsResponse
QueryMinimumGasPricesResponse is the response type for the
Query/MinimumGasPrices RPC method.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `minimum_gas_prices` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | |
| `bypass_min_fee_msg_types` | [string](#string) | repeated | |
| `max_total_bypass_min_fee_msg_gas_usage` | [uint64](#uint64) | | |





<!-- end messages -->

<!-- end enums -->

<!-- end HasExtensions -->


<a name="gaia.globalfee.v1beta1.Query"></a>

### Query

Query defines the gRPC querier service.

| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `MinimumGasPrices` | [QueryMinimumGasPricesRequest](#gaia.globalfee.v1beta1.QueryMinimumGasPricesRequest) | [QueryMinimumGasPricesResponse](#gaia.globalfee.v1beta1.QueryMinimumGasPricesResponse) | | GET|/gaia/globalfee/v1beta1/minimum_gas_prices|
| `Params` | [QueryParamsRequest](#gaia.globalfee.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#gaia.globalfee.v1beta1.QueryParamsResponse) | | GET|/gaia/globalfee/v1beta1/params|

<!-- end services -->



<a name="gaia/globalfee/v1beta1/genesis.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## gaia/globalfee/v1beta1/genesis.proto



<a name="gaia.globalfee.v1beta1.GenesisState"></a>

### GenesisState

GenesisState - initial state of module


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `params` | [Params](#gaia.globalfee.v1beta1.Params) | | Params of this module |






<a name="gaia.globalfee.v1beta1.Params"></a>

### Params

Params defines the set of module parameters.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `minimum_gas_prices` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | Minimum stores the minimum gas price(s) for all TX on the chain. When multiple coins are defined then they are accepted alternatively. The list must be sorted by denoms asc. No duplicate denoms or zero amount values allowed. For more information see <https://docs.cosmos.network/main/modules/auth#concepts> |
| `minimum_gas_prices` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | minimum_gas_prices stores the minimum gas price(s) for all TX on the chain. When multiple coins are defined then they are accepted alternatively. The list must be sorted by denoms asc. No duplicate denoms or zero amount values allowed. For more information see https://docs.cosmos.network/main/modules/auth#concepts |
| `bypass_min_fee_msg_types` | [string](#string) | repeated | bypass_min_fee_msg_types defines a list of message type urls that are free of fee charge. |
| `max_total_bypass_min_fee_msg_gas_usage` | [uint64](#uint64) | | max_total_bypass_min_fee_msg_gas_usage defines the total maximum gas usage allowed for a transaction containing only messages of types in bypass_min_fee_msg_types to bypass fee charge. |





<!-- end messages -->

Expand All @@ -91,6 +119,8 @@ Params defines the set of module parameters.

<!-- end services -->



## Scalar Value Types

| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
Expand All @@ -110,3 +140,4 @@ Params defines the set of module parameters.
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ require (
github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect
github.com/hexops/gotextdiff v1.0.3 // indirect
github.com/iancoleman/orderedmap v0.2.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/improbable-eng/grpc-web v0.15.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jgautheron/goconst v1.5.1 // indirect
Expand Down Expand Up @@ -284,7 +284,7 @@ require (
go.uber.org/goleak v1.1.12 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/exp v0.0.0-20221205204356-47842c84f3db // indirect
golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2 // indirect
golang.org/x/mod v0.9.0 // indirect
Expand Down
11 changes: 4 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,8 @@ github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6
github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM=
github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=
github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ=
github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8=
Expand Down Expand Up @@ -1023,8 +1023,6 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ
github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA=
github.com/ory/dockertest/v3 v3.9.1 h1:v4dkG+dlu76goxMiTT2j8zV7s4oPPEppKT8K8p2f1kY=
github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM=
github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4=
github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg=
github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw=
Expand Down Expand Up @@ -1409,8 +1407,8 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE=
golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU=
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -1915,7 +1913,6 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
Expand Down
13 changes: 12 additions & 1 deletion proto/gaia/globalfee/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ message GenesisState {

// Params defines the set of module parameters.
message Params {
// Minimum stores the minimum gas price(s) for all TX on the chain.
// minimum_gas_prices stores the minimum gas price(s) for all TX on the chain.
// When multiple coins are defined then they are accepted alternatively.
// The list must be sorted by denoms asc. No duplicate denoms or zero amount
// values allowed. For more information see
Expand All @@ -28,4 +28,15 @@ message Params {
(gogoproto.moretags) = "yaml:\"minimum_gas_prices\"",
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"
];
// bypass_min_fee_msg_types defines a list of message type urls
// that are free of fee charge.
repeated string bypass_min_fee_msg_types = 2 [
(gogoproto.jsontag) = "bypass_min_fee_msg_types,omitempty",
(gogoproto.moretags) = "yaml:\"bypass_min_fee_msg_types\""
];

// max_total_bypass_min_fee_msg_gas_usage defines the total maximum gas usage
sainoe marked this conversation as resolved.
Show resolved Hide resolved
// allowed for a transaction containing only messages of types in bypass_min_fee_msg_types
// to bypass fee charge.
uint64 max_total_bypass_min_fee_msg_gas_usage = 3;
}
13 changes: 8 additions & 5 deletions proto/gaia/globalfee/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,27 @@ option go_package = "github.com/cosmos/gaia/x/globalfee/types";

// Query defines the gRPC querier service.
service Query {
rpc MinimumGasPrices(QueryMinimumGasPricesRequest)
returns (QueryMinimumGasPricesResponse) {
rpc Params(QueryParamsRequest)
returns (QueryParamsResponse) {
option (google.api.http).get =
"/gaia/globalfee/v1beta1/minimum_gas_prices";
"/gaia/globalfee/v1beta1/params";
}
}

// QueryMinimumGasPricesRequest is the request type for the
// Query/MinimumGasPrices RPC method.
message QueryMinimumGasPricesRequest {}
message QueryParamsRequest {}

// QueryMinimumGasPricesResponse is the response type for the
// Query/MinimumGasPrices RPC method.
message QueryMinimumGasPricesResponse {
message QueryParamsResponse {
repeated cosmos.base.v1beta1.DecCoin minimum_gas_prices = 1 [
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "minimum_gas_prices,omitempty",
(gogoproto.moretags) = "yaml:\"minimum_gas_prices\"",
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"
];

repeated string bypass_min_fee_msg_types = 2 [(gogoproto.moretags) = "yaml:\"bypass_min_fee_msg_types\""];
uint64 max_total_bypass_min_fee_msg_gas_usage = 3;
}
Empty file modified proto/scripts/protoc-doc-gen.sh
100644 → 100755
sainoe marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
24 changes: 23 additions & 1 deletion tests/e2e/e2e_bypassminfee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@ package e2e

import (
"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
)

func (s *IntegrationTestSuite) testByPassMinFeeWithdrawReward() {
func (s *IntegrationTestSuite) testBypassMinFeeWithdrawReward() {
MSalopek marked this conversation as resolved.
Show resolved Hide resolved
// submit gov prop to change bypass-msg param to MsgWithdrawDelegatorReward
submitterAddr := s.chainA.validators[0].keyInfo.GetAddress()
submitter := submitterAddr.String()
proposalCounter++
s.govProposeNewBypassMsgs([]string{sdk.MsgTypeURL(&distributiontypes.MsgWithdrawDelegatorReward{})}, proposalCounter, submitter, standardFees.String())

// Note that the global fee min gas prices is equal to minGasPrice+uatomDenom
paidFeeAmt := math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String()
payee := s.chainA.validators[0].keyInfo.GetAddress()

// pass
s.T().Logf("bypass-msg with fee in the denom of global fee, pass")
s.execWithdrawAllRewards(s.chainA, 0, payee.String(), paidFeeAmt+uatomDenom, false)
Expand All @@ -19,4 +29,16 @@ func (s *IntegrationTestSuite) testByPassMinFeeWithdrawReward() {
// fail
s.T().Logf("bypass-msg with non-zero coin not in the denom of global fee, fail")
s.execWithdrawAllRewards(s.chainA, 0, payee.String(), paidFeeAmt+photonDenom, true)

proposalCounter++
// change MaxTotalBypassMinFeeMsgGasUsage through governance proposal from 1_000_0000 to 1
s.govProposeNewMaxTotalBypassMinFeeMsgGasUsage(1, proposalCounter, submitter)

// fail
s.T().Logf("bypass-msg has zero coin and maxTotalBypassMinFeeMsgGasUsage set to 1, fail")
s.execWithdrawAllRewards(s.chainA, 0, payee.String(), "0"+uatomDenom, true)

// pass
s.T().Logf("bypass-msg has non zero coin and maxTotalBypassMinFeeMsgGasUsage set to 1, pass")
s.execWithdrawAllRewards(s.chainA, 0, payee.String(), paidFeeAmt+uatomDenom, false)
sainoe marked this conversation as resolved.
Show resolved Hide resolved
}
Loading