Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
115 changes: 115 additions & 0 deletions proto/hyperlane/core/post_dispatch/v1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,121 @@ message EventCreateAggregationHook {
];
}

// EventCreateRateLimitedHook ...
message EventCreateRateLimitedHook {

// id ...
string rate_limited_hook_id = 1 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];

// owner ...
string owner = 2;

// mailbox_id ...
string mailbox_id = 3 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];
}

// EventSetRateLimit ...
message EventSetRateLimit {

// rate_limited_hook_id ...
string rate_limited_hook_id = 1 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];

// owner ...
string owner = 2;

// token_id ...
string token_id = 3 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];

// max_capacity ...
string max_capacity = 4 [
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];

// refill_rate ...
string refill_rate = 5 [
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
}

// EventRemoveRateLimit ...
message EventRemoveRateLimit {

// rate_limited_hook_id ...
string rate_limited_hook_id = 1 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];

// owner ...
string owner = 2;

// token_id ...
string token_id = 3 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];
}

// EventConsumeRateLimit ...
message EventConsumeRateLimit {

// rate_limited_hook_id ...
string rate_limited_hook_id = 1 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];

// token_id ...
string token_id = 2 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];

// message_id ...
string message_id = 3 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];

// amount ...
string amount = 4 [
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];

// filled_level ...
string filled_level = 5 [
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];

// last_updated ...
uint64 last_updated = 6;
}

// EventCreateIgp ...
message EventCreateIgp {
string igp_id = 1 [
Expand Down
4 changes: 4 additions & 0 deletions proto/hyperlane/core/post_dispatch/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ message GenesisState {
repeated NoopHook noop_hooks = 4 [ (gogoproto.nullable) = false ];
repeated AggregationHook aggregation_hooks = 5
[ (gogoproto.nullable) = false ];
repeated RateLimitedHook rate_limited_hooks = 6
[ (gogoproto.nullable) = false ];
repeated TokenRateLimit token_rate_limits = 7
[ (gogoproto.nullable) = false ];
}

// GenesisDestinationGasConfigWrapper ...
Expand Down
96 changes: 88 additions & 8 deletions proto/hyperlane/core/post_dispatch/v1/query.proto
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
syntax = "proto3";
package hyperlane.core.post_dispatch.v1;

option go_package = "github.com/bcp-innovations/hyperlane-cosmos/x/core/02_post_dispatch/types";

import "cosmos/base/query/v1beta1/pagination.proto";
import "google/api/annotations.proto";
import "amino/amino.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "hyperlane/core/post_dispatch/v1/types.proto";
import "cosmos/base/v1beta1/coin.proto";

option go_package = "github.com/bcp-innovations/hyperlane-cosmos/x/core/02_post_dispatch/types";

// Msg defines the module Msg service.
service Query {

// Igps ...
rpc Igps(QueryIgpsRequest) returns (QueryIgpsResponse) {
option (google.api.http).get = "/hyperlane/v1/igps";
Expand Down Expand Up @@ -70,6 +69,32 @@ service Query {
returns (QueryAggregationHookResponse) {
option (google.api.http).get = "/hyperlane/v1/aggregation_hooks/{id}";
}

// RateLimitedHooks ...
rpc RateLimitedHooks(QueryRateLimitedHooksRequest)
returns (QueryRateLimitedHooksResponse) {
option (google.api.http).get = "/hyperlane/v1/rate_limited_hooks";
}

// RateLimitedHook ...
rpc RateLimitedHook(QueryRateLimitedHookRequest)
returns (QueryRateLimitedHookResponse) {
option (google.api.http).get = "/hyperlane/v1/rate_limited_hooks/{id}";
}

// TokenRateLimits ...
rpc TokenRateLimits(QueryTokenRateLimitsRequest)
returns (QueryTokenRateLimitsResponse) {
option (google.api.http).get =
"/hyperlane/v1/rate_limited_hooks/{hook_id}/token_rate_limits";
}

// TokenRateLimit ...
rpc TokenRateLimit(QueryTokenRateLimitRequest)
returns (QueryTokenRateLimitResponse) {
option (google.api.http).get = "/hyperlane/v1/rate_limited_hooks/{hook_id}/"
"token_rate_limits/{token_id}";
}
}

// QueryIgpsRequest ...
Expand Down Expand Up @@ -134,7 +159,6 @@ message QueryMerkleTreeHooksRequest {
message QueryMerkleTreeHooksResponse {
repeated WrappedMerkleTreeHookResponse merkle_tree_hooks = 1
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
;
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

Expand All @@ -145,7 +169,6 @@ message QueryMerkleTreeHookRequest { string id = 1; }
message QueryMerkleTreeHookResponse {
WrappedMerkleTreeHookResponse merkle_tree_hook = 1
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
;
}

// WrappedMerkleTreeHookResponse
Expand Down Expand Up @@ -204,3 +227,60 @@ message QueryAggregationHooksResponse {
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryRateLimitedHookRequest ...
message QueryRateLimitedHookRequest { string id = 1; }

// QueryRateLimitedHookResponse ...
message QueryRateLimitedHookResponse { RateLimitedHook rate_limited_hook = 1; }

// QueryRateLimitedHooksRequest ...
message QueryRateLimitedHooksRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

// QueryRateLimitedHooksResponse ...
message QueryRateLimitedHooksResponse {
repeated RateLimitedHook rate_limited_hooks = 1
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryTokenRateLimitsRequest ...
message QueryTokenRateLimitsRequest {
string hook_id = 1;
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}

// QueryTokenRateLimitsResponse ...
message QueryTokenRateLimitsResponse {
repeated EffectiveTokenRateLimit effective_token_rate_limits = 1
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryTokenRateLimitRequest ...
message QueryTokenRateLimitRequest {
string hook_id = 1;
string token_id = 2;
}

// QueryTokenRateLimitResponse ...
message QueryTokenRateLimitResponse {
EffectiveTokenRateLimit effective_token_rate_limit = 1
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
}

// EffectiveTokenRateLimit ...
message EffectiveTokenRateLimit {
TokenRateLimit token_rate_limit = 1
[ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ];
string current_level = 2 [
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
string effective_capacity = 3 [
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
}
93 changes: 93 additions & 0 deletions proto/hyperlane/core/post_dispatch/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ service Msg {
// CreateAggregationHook ...
rpc CreateAggregationHook(MsgCreateAggregationHook)
returns (MsgCreateAggregationHookResponse);

// CreateRateLimitedHook ...
rpc CreateRateLimitedHook(MsgCreateRateLimitedHook)
returns (MsgCreateRateLimitedHookResponse);

// SetRateLimit ...
rpc SetRateLimit(MsgSetRateLimit) returns (MsgSetRateLimitResponse);

// RemoveRateLimit ...
rpc RemoveRateLimit(MsgRemoveRateLimit) returns (MsgRemoveRateLimitResponse);
}

// MsgCreateIgp ...
Expand Down Expand Up @@ -234,3 +244,86 @@ message MsgCreateAggregationHookResponse {
(gogoproto.nullable) = false
];
}

// MsgCreateRateLimitedHook ...
message MsgCreateRateLimitedHook {
option (cosmos.msg.v1.signer) = "owner";
option (amino.name) = "hyperlane/v1/MsgCreateRateLimitedHook";

// owner ...
string owner = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// mailbox_id ...
string mailbox_id = 2 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];
}

// MsgCreateRateLimitedHookResponse ...
message MsgCreateRateLimitedHookResponse {
string id = 1 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];
}

// MsgSetRateLimit ...
message MsgSetRateLimit {
option (cosmos.msg.v1.signer) = "owner";
option (amino.name) = "hyperlane/v1/MsgSetRateLimit";

// owner ...
string owner = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// hook_id ...
string hook_id = 2 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];

// token_id ...
string token_id = 3 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];

// max_capacity ...
string max_capacity = 4 [
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
}

// MsgSetRateLimitResponse ...
message MsgSetRateLimitResponse {}

// MsgRemoveRateLimit ...
message MsgRemoveRateLimit {
option (cosmos.msg.v1.signer) = "owner";
option (amino.name) = "hyperlane/v1/MsgRemoveRateLimit";

// owner ...
string owner = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// hook_id ...
string hook_id = 2 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];

// token_id ...
string token_id = 3 [
(gogoproto.customtype) =
"github.com/bcp-innovations/hyperlane-cosmos/util.HexAddress",
(gogoproto.nullable) = false
];
}

// MsgRemoveRateLimitResponse ...
message MsgRemoveRateLimitResponse {}
Loading
Loading