-
Notifications
You must be signed in to change notification settings - Fork 173
feat!: ibc transfer quota #1568
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
84 commits
Select commit
Hold shift + click to select a range
6ed9e1f
WIP: add ibc rate limit middleware to ibc transfer
gsk967 4ce49c9
Merge main
gsk967 aada85f
WIP: add cll tx,query cmds
gsk967 08e3d08
Merge branch 'main' into sai/ibc-rate-limit
gsk967 16b50cd
Merge branch 'main' into sai/ibc-rate-limit
gsk967 57870ca
Merge branch 'main' into sai/ibc-rate-limit
gsk967 8412c70
Merge branch 'main' into sai/ibc-rate-limit
gsk967 9a4d380
Merge branch 'main' into sai/ibc-rate-limit
gsk967 28e2422
Merge branch 'main' into sai/ibc-rate-limit
gsk967 8e24765
WIP: add check rate limits for ibc denom
gsk967 4ad23eb
remove ibc-rate-limits and move rate limits into ibctransfer module
gsk967 9bf0109
move the umme ibctransfer into ics20 folder
gsk967 a87ff0d
fix: fix the lint
gsk967 bdeaec3
refactor: change the module structure to 'authz' type of cosmos-sdk
gsk967 aba25e0
Merge branch 'main' into sai/ibc-rate-limit
gsk967 7981d0d
Merge branch 'main' into sai/ibc-rate-limit
gsk967 37b15b3
remove inflow_limit in rate limits
gsk967 ea1316e
Merge branch 'main' into sai/ibc-rate-limit
gsk967 ac8381c
Merge remote-tracking branch 'origin/sai/ibc-rate-limit' into sai/ibc…
gsk967 a8206d3
chore: check the rate limits by exchange rate
gsk967 990db76
Merge branch 'main' into sai/ibc-rate-limit
gsk967 49c2bbb
add denom exponent to calculate amount in USD
gsk967 b5435b1
calculating the sent amount with exponent of registerd token
gsk967 3143115
fix: fix the amount calculation
gsk967 db358cf
Merge branch 'main' into sai/ibc-rate-limit
gsk967 0b30201
Merge branch 'main' into sai/ibc-rate-limit
gsk967 bce7a99
Merge main
gsk967 30bbdfc
fix: fix the rate-limit reset issue
gsk967 c2d0bc5
Merge branch 'main' into sai/ibc-rate-limit
gsk967 01ce260
refactor: update the params
gsk967 223f094
Merge branch 'main' into sai/ibc-rate-limit
gsk967 7b55068
Merge branch 'main' into sai/ibc-rate-limit
gsk967 c4b7de8
Merge branch 'main' into sai/ibc-rate-limit
gsk967 b27ff0d
Merge branch 'main' into sai/ibc-rate-limit
gsk967 e75b6f9
Merge branch 'main' into sai/ibc-rate-limit
gsk967 90f82b5
fix: fix the build
gsk967 47f09be
Merge branch 'main' into sai/ibc-rate-limit
gsk967 ff6239a
chore: update the limits and quota interval
gsk967 ecacc9e
chore: fix the lint issues
gsk967 6968250
chore: fix the lint issues
gsk967 0e2ef16
Merge branch 'main' into sai/ibc-rate-limit
gsk967 eea2115
Merge branch 'main' into sai/ibc-rate-limit
gsk967 be02147
chore: addree the pr comments
gsk967 e9a8717
chore: remove the param subspace from uibc
gsk967 be8bc11
Merge branch 'main' into sai/ibc-rate-limit
gsk967 267e958
refactor: refactor the proto and logic
gsk967 1aeb647
chore: address the pr comments
gsk967 b952683
fix: fix the buf lint
gsk967 1b119c7
Merge branch 'main' into sai/ibc-rate-limit
gsk967 1db2900
Merge branch 'main' into sai/ibc-rate-limit
gsk967 aa1daea
Merge branch 'main' into sai/ibc-rate-limit
gsk967 c5bfd75
chore: get the exchange price from TokenValue of leverage
gsk967 860795b
Merge remote-tracking branch 'origin/sai/ibc-rate-limit' into sai/ibc…
gsk967 b28f8f4
Merge branch 'main' into sai/ibc-rate-limit
gsk967 e485b2a
chore: convert uToken to baseToken in ibc-transfer quota checking
gsk967 3ae43d4
chore: add typed events for emit events
gsk967 f1d1e54
Merge branch 'main' into sai/ibc-rate-limit
gsk967 64600ef
Merge branch 'main' into sai/ibc-rate-limit
gsk967 4da6298
Merge branch 'main' into sai/ibc-rate-limit
gsk967 85e7486
address the review comments
gsk967 16e6488
refactor the code
gsk967 db8e103
Merge branch 'main' into sai/ibc-rate-limit
gsk967 a3f01de
Merge branch 'main' into sai/ibc-rate-limit
gsk967 07d05c5
Merge branch 'main' into sai/ibc-rate-limit
gsk967 14cdcd3
address the pr comments
gsk967 1dee0e7
chore: fix the build issue
gsk967 8f052ec
chore: add tests for params
gsk967 0d71fd2
Merge branch 'main' into sai/ibc-rate-limit
gsk967 07fe9b4
Merge branch 'main' into sai/ibc-rate-limit
gsk967 8f1cbe9
fix: fix the update quota params
gsk967 14c2558
Merge remote-tracking branch 'origin/sai/ibc-rate-limit' into sai/ibc…
gsk967 a3c1e58
Merge branch 'main' into sai/ibc-rate-limit
gsk967 14badea
chore: address the pr comments
gsk967 78184a5
chore: fix the lint
gsk967 e7ca80f
Merge branch 'main' into sai/ibc-rate-limit
gsk967 6e8cde5
address the pr comments++
gsk967 d558dc9
Merge branch 'main' into sai/ibc-rate-limit
gsk967 b62b3db
address the pr comments
gsk967 9cc1660
Merge remote-tracking branch 'origin' into sai/ibc-rate-limit
gsk967 afcf52a
Merge remote-tracking branch 'origin/sai/ibc-rate-limit' into sai/ibc…
gsk967 16642e6
update reset quota
robert-zaremba f0ecf0a
move to Marshal to MustMarshal in uibc
gsk967 87d72ae
add TODO for ibc middleware acknowledgement
gsk967 8feec2a
add comment to outflow_sum
gsk967 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| syntax = "proto3"; | ||
| package umee.ibcratelimit.v1beta1; | ||
|
|
||
| import "gogoproto/gogo.proto"; | ||
| import "umee/ibc_rate_limit/v1beta1/ibc_rate_limit.proto"; | ||
gsk967 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| option go_package = "github.com/umee-network/umee/v3/x/ibc-rate-limit/types"; | ||
| option (gogoproto.goproto_getters_all) = false; | ||
|
|
||
| message GenesisState { | ||
| Params params = 1 [(gogoproto.nullable) = false]; | ||
| repeated RateLimit rate_limits = 2 [(gogoproto.nullable) = false]; | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| syntax = "proto3"; | ||
| package umee.ibcratelimit.v1beta1; | ||
|
|
||
| import "gogoproto/gogo.proto"; | ||
|
|
||
| option go_package = "github.com/umee-network/umee/v3/x/ibc-rate-limit/types"; | ||
|
|
||
| // RateLimit | ||
| message RateLimit { | ||
| string ibc_denom = 1; | ||
| uint64 outflow_limit = 2; | ||
| uint64 window = 3; | ||
| } | ||
|
|
||
| // Params | ||
| message Params { | ||
| bool ibc_pause = 1; | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| syntax = "proto3"; | ||
| package umee.ibcratelimit.v1beta1; | ||
|
|
||
| import "gogoproto/gogo.proto"; | ||
|
|
||
| option go_package = "github.com/umee-network/umee/v3/x/ibc-rate-limit/types"; | ||
|
|
||
| // Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring | ||
| // See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning | ||
| message Metadata { | ||
| // fee_version defines the ICS29 fee version | ||
| string fee_version = 1 [(gogoproto.moretags) = "yaml:\"fee_version\""]; | ||
| // app_version defines the underlying application version, which may or may not be a JSON encoded bytestring | ||
| string app_version = 2 [(gogoproto.moretags) = "yaml:\"app_version\""]; | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| syntax = "proto3"; | ||
| package umee.ibcratelimit.v1beta1; | ||
|
|
||
| import "google/api/annotations.proto"; | ||
| import "gogoproto/gogo.proto"; | ||
| import "umee/ibc_rate_limit/v1beta1/ibc_rate_limit.proto"; | ||
|
|
||
|
|
||
| option go_package = "github.com/umee-network/umee/v3/x/ibc-rate-limit/types"; | ||
|
|
||
| option (gogoproto.goproto_getters_all) = false; | ||
|
|
||
| // Query defines the gRPC querier service. | ||
| service Query { | ||
| // Params queries the parameters of the x/ibc-rate-limit module. | ||
| rpc Params(QueryParams) returns (QueryParamsResponse) { | ||
| option (google.api.http).get = "/umee/ibc_rate_limit/v1/params"; | ||
| } | ||
|
|
||
| // RateLimitsOfIBCDenoms queries the rate limits of ibc denoms. | ||
| rpc RateLimitsOfIBCDenoms(QueryRateLimitsOfIBCDenoms) returns (QueryRateLimitsOfIBCDenomsResponse) { | ||
| option (google.api.http).get = "/umee/ibc_rate_limit/v1/rate_limits"; | ||
| } | ||
|
|
||
| // RateLimitsOfIBCDenom queries the rate limits of ibc denom. | ||
| rpc RateLimitsOfIBCDenom(QueryRateLimitsOfIBCDenom) returns (QueryRateLimitsOfIBCDenomResponse) { | ||
| option (google.api.http).get = "/umee/ibc_rate_limit/v1/rate_limits/{ibc_denom}"; | ||
| } | ||
| } | ||
|
|
||
| // QueryParams defines the request structure for the Params gRPC service | ||
| // handler. | ||
| message QueryParams {} | ||
|
|
||
| // QueryParamsResponse defines the response structure for the Params gRPC | ||
| // service handler. | ||
| message QueryParamsResponse { | ||
| Params params = 1 [(gogoproto.nullable) = false]; | ||
| } | ||
|
|
||
| // QueryRateLimitsOfIBCDenoms defines request type | ||
| message QueryRateLimitsOfIBCDenoms{} | ||
|
|
||
| // QueryRateLimitsOfIBCDenomsResponse defines response type | ||
| message QueryRateLimitsOfIBCDenomsResponse{ | ||
| repeated RateLimit rate_limits = 1 [(gogoproto.nullable) = false]; | ||
| } | ||
|
|
||
| // QueryRateLimitsOfIBCDenom defines request type | ||
| message QueryRateLimitsOfIBCDenom{ | ||
| string ibc_denom = 1; | ||
| } | ||
|
|
||
| // QueryRateLimitsOfIBCDenomResponse defines response type of QueryRateLimitsOfIBCDenom | ||
| message QueryRateLimitsOfIBCDenomResponse{ | ||
| RateLimit rate_limit = 1 [(gogoproto.nullable) = false]; | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| syntax = "proto3"; | ||
| package umee.ibcratelimit.v1beta1; | ||
|
|
||
|
|
||
| import "gogoproto/gogo.proto"; | ||
| import "cosmos/msg/v1/msg.proto"; | ||
| import "cosmos_proto/cosmos.proto"; | ||
| import "umee/ibc_rate_limit/v1beta1/ibc_rate_limit.proto"; | ||
|
|
||
| option go_package = "github.com/umee-network/umee/v3/x/ibc-rate-limit/types"; | ||
|
|
||
| option (gogoproto.goproto_getters_all) = false; | ||
| option (gogoproto.messagename_all) = true; | ||
|
|
||
| // Msg defines the x/ibctransfer module's Msg service. | ||
| service Msg { | ||
| // UpdateIBCDenomsRateLimit adds new rate limits for ibc denoms or | ||
| // updates the rate limits for existed ibc denoms. | ||
| rpc UpdateIBCDenomsRateLimit(MsgUpdateIBCDenomsRateLimit) returns (MsgUpdateIBCDenomsRateLimitResponse); | ||
|
|
||
| // UpdateIBCTransferPauseStatus | ||
| rpc UpdateIBCTransferPauseStatus(MsgUpdateIBCTransferPauseStatus) returns (MsgUpdateIBCTransferPauseStatusResponse); | ||
| } | ||
|
|
||
| // MsgUpdateIBCDenomsRateLimit defines the Msg/UpdateIBCDenomsRateLimit request type. | ||
| message MsgUpdateIBCDenomsRateLimit { | ||
| option (gogoproto.goproto_getters) = false; | ||
| option (gogoproto.goproto_stringer) = false; | ||
| option (cosmos.msg.v1.signer) = "authority"; | ||
|
|
||
| // authority is the address of the governance account. | ||
| string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; | ||
| string title = 2; | ||
| string description = 3; | ||
| // new_ibc_denoms_rate_limits defines the rate limits for ibc denoms tokens. | ||
| repeated RateLimit new_ibc_denoms_rate_limits = 4 [(gogoproto.nullable) = false]; | ||
| // update_ibc_denoms_rate_limits defines the new rate limits for ibc denoms tokens. | ||
| repeated RateLimit update_ibc_denoms_rate_limits = 5 [(gogoproto.nullable) = false]; | ||
| } | ||
|
|
||
| // MsgUpdateIBCDenomsRateLimitResponse defines response type for the Msg/UpdateIBCDenomsRateLimit | ||
| message MsgUpdateIBCDenomsRateLimitResponse {}; | ||
|
|
||
| // MsgUpdateIBCTransferPauseStatus defines request type for UpdateIBCTransferStatus | ||
| message MsgUpdateIBCTransferPauseStatus { | ||
| option (gogoproto.goproto_getters) = false; | ||
| option (gogoproto.goproto_stringer) = false; | ||
| option (cosmos.msg.v1.signer) = "authority"; | ||
| // authority is the address of the governance account. | ||
| string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; | ||
| string title = 2; | ||
| string description = 3; | ||
| // ibc_pause_status defines ibc transfer pause status | ||
| bool ibc_pause_status = 4; | ||
| } | ||
|
|
||
| // MsgUpdateIBCTransferPauseStatusResponse definesresponse type for Msg/MsgUpdateIBCTransferPauseStatus | ||
| message MsgUpdateIBCTransferPauseStatusResponse {} |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package ibc_rate_limit | ||
|
|
||
| import ( | ||
| sdk "github.com/cosmos/cosmos-sdk/types" | ||
| abci "github.com/tendermint/tendermint/abci/types" | ||
| "github.com/umee-network/umee/v3/x/ibc-rate-limit/keeper" | ||
| ) | ||
|
|
||
| // EndBlocker implements EndBlock for the x/leverage module. | ||
| func EndBlocker(ctx sdk.Context, k keeper.Keeper) []abci.ValidatorUpdate { | ||
| return []abci.ValidatorUpdate{} | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.