Skip to content

Commit 359a461

Browse files
committed
add ics & lsm
1 parent 66ef45b commit 359a461

File tree

9 files changed

+467
-22
lines changed

9 files changed

+467
-22
lines changed

configs/cosmos.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"https://github.com/cosmos/cosmos-sdk.git": {
33
"include": true,
4-
"branch": "v0.45.16-ics",
4+
"branch": "v0.45.16-ics-lsm",
55
"paths": ["proto/cosmos"]
66
},
77
"https://github.com/cometbft/cometbft.git": {

src/cosmospy_protobuf/cosmos/base/store/v1beta1/listening.proto

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ message StoreKVPair {
2020
// BlockMetadata contains all the abci event data of a block
2121
// the file streamer dump them into files together with the state changes.
2222
message BlockMetadata {
23-
// DeliverTx encapulate deliver tx request and response.
24-
message DeliverTx {
25-
tendermint.abci.RequestDeliverTx request = 1;
26-
tendermint.abci.ResponseDeliverTx response = 2;
27-
}
28-
tendermint.abci.RequestBeginBlock request_begin_block = 1;
29-
tendermint.abci.ResponseBeginBlock response_begin_block = 2;
30-
repeated DeliverTx deliver_txs = 3;
31-
tendermint.abci.RequestEndBlock request_end_block = 4;
32-
tendermint.abci.ResponseEndBlock response_end_block = 5;
33-
tendermint.abci.ResponseCommit response_commit = 6;
23+
// DeliverTx encapulate deliver tx request and response.
24+
message DeliverTx {
25+
tendermint.abci.RequestDeliverTx request = 1;
26+
tendermint.abci.ResponseDeliverTx response = 2;
27+
}
28+
tendermint.abci.RequestBeginBlock request_begin_block = 1;
29+
tendermint.abci.ResponseBeginBlock response_begin_block = 2;
30+
repeated DeliverTx deliver_txs = 3;
31+
tendermint.abci.RequestEndBlock request_end_block = 4;
32+
tendermint.abci.ResponseEndBlock response_end_block = 5;
33+
tendermint.abci.ResponseCommit response_commit = 6;
3434
}

src/cosmospy_protobuf/cosmos/distribution/v1beta1/distribution.proto

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,17 @@ message DelegationDelegatorReward {
143143
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
144144
}
145145

146+
// TokenizeShareRecordReward represents the properties of tokenize share
147+
message TokenizeShareRecordReward {
148+
option (gogoproto.goproto_getters) = false;
149+
option (gogoproto.goproto_stringer) = true;
150+
151+
uint64 record_id = 1;
152+
153+
repeated cosmos.base.v1beta1.DecCoin reward = 2
154+
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
155+
}
156+
146157
// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal
147158
// with a deposit
148159
message CommunityPoolSpendProposalWithDeposit {

src/cosmospy_protobuf/cosmos/distribution/v1beta1/query.proto

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ service Query {
6262
rpc CommunityPool(QueryCommunityPoolRequest) returns (QueryCommunityPoolResponse) {
6363
option (google.api.http).get = "/cosmos/distribution/v1beta1/community_pool";
6464
}
65+
66+
// TokenizeShareRecordReward queries the tokenize share record rewards
67+
rpc TokenizeShareRecordReward(QueryTokenizeShareRecordRewardRequest)
68+
returns (QueryTokenizeShareRecordRewardResponse) {
69+
option (google.api.http).get = "/cosmos/distribution/v1beta1/{owner_address}/tokenize_share_record_rewards";
70+
}
6571
}
6672

6773
// QueryParamsRequest is the request type for the Query/Params RPC method.
@@ -216,3 +222,22 @@ message QueryCommunityPoolResponse {
216222
repeated cosmos.base.v1beta1.DecCoin pool = 1
217223
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
218224
}
225+
226+
// QueryTokenizeShareRecordRewardRequest is the request type for the Query/TokenizeShareRecordReward RPC
227+
// method.
228+
message QueryTokenizeShareRecordRewardRequest {
229+
option (gogoproto.equal) = false;
230+
option (gogoproto.goproto_getters) = false;
231+
232+
string owner_address = 1 [(gogoproto.moretags) = "yaml:\"owner_address\""];
233+
}
234+
235+
// QueryTokenizeShareRecordRewardResponse is the response type for the Query/TokenizeShareRecordReward
236+
// RPC method.
237+
message QueryTokenizeShareRecordRewardResponse {
238+
// rewards defines all the rewards accrued by a delegator.
239+
repeated TokenizeShareRecordReward rewards = 1 [(gogoproto.nullable) = false];
240+
// total defines the sum of all the rewards.
241+
repeated cosmos.base.v1beta1.DecCoin total = 2
242+
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"];
243+
}

src/cosmospy_protobuf/cosmos/distribution/v1beta1/tx.proto

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ service Msg {
2121
// full commission to the validator address.
2222
rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse);
2323

24+
// WithdrawTokenizeShareRecordReward defines a method to withdraw reward for an owning TokenizeShareRecord
25+
rpc WithdrawTokenizeShareRecordReward(MsgWithdrawTokenizeShareRecordReward)
26+
returns (MsgWithdrawTokenizeShareRecordRewardResponse);
27+
28+
// WithdrawAllTokenizeShareRecordReward defines a method to withdraw reward for all owning TokenizeShareRecord
29+
rpc WithdrawAllTokenizeShareRecordReward(MsgWithdrawAllTokenizeShareRecordReward)
30+
returns (MsgWithdrawAllTokenizeShareRecordRewardResponse);
31+
2432
// FundCommunityPool defines a method to allow an account to directly
2533
// fund the community pool.
2634
rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse);
@@ -64,6 +72,30 @@ message MsgWithdrawValidatorCommission {
6472
// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type.
6573
message MsgWithdrawValidatorCommissionResponse {}
6674

75+
// MsgWithdrawTokenizeShareRecordReward withdraws tokenize share rewards for a specific record
76+
message MsgWithdrawTokenizeShareRecordReward {
77+
option (gogoproto.equal) = false;
78+
option (gogoproto.goproto_getters) = false;
79+
80+
string owner_address = 1 [(gogoproto.moretags) = "yaml:\"owner_address\""];
81+
uint64 record_id = 2;
82+
}
83+
84+
// MsgWithdrawTokenizeShareRecordReward defines the Msg/WithdrawTokenizeShareRecordReward response type.
85+
message MsgWithdrawTokenizeShareRecordRewardResponse {}
86+
87+
// MsgWithdrawAllTokenizeShareRecordReward withdraws tokenize share rewards or all
88+
// records owned by the designated owner
89+
message MsgWithdrawAllTokenizeShareRecordReward {
90+
option (gogoproto.equal) = false;
91+
option (gogoproto.goproto_getters) = false;
92+
93+
string owner_address = 1 [(gogoproto.moretags) = "yaml:\"owner_address\""];
94+
}
95+
96+
// MsgWithdrawAllTokenizeShareRecordRewardResponse defines the Msg/WithdrawTokenizeShareRecordReward response type.
97+
message MsgWithdrawAllTokenizeShareRecordRewardResponse {}
98+
6799
// MsgFundCommunityPool allows an account to directly
68100
// fund the community pool.
69101
message MsgFundCommunityPool {

src/cosmospy_protobuf/cosmos/staking/v1beta1/genesis.proto

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types";
55

66
import "gogoproto/gogo.proto";
77
import "cosmos/staking/v1beta1/staking.proto";
8+
import "google/protobuf/timestamp.proto";
89

910
// GenesisState defines the staking module's genesis state.
1011
message GenesisState {
@@ -38,6 +39,33 @@ message GenesisState {
3839
repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false];
3940

4041
bool exported = 8;
42+
43+
// store tokenize share records to provide reward to record owners
44+
repeated TokenizeShareRecord tokenize_share_records = 9 [(gogoproto.nullable) = false];
45+
46+
// last tokenize share record id, used for next share record id calculation
47+
uint64 last_tokenize_share_record_id = 10;
48+
49+
// total number of liquid staked tokens at genesis
50+
bytes total_liquid_staked_tokens = 11 [
51+
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
52+
(gogoproto.moretags) = "yaml:\"total_liquid_staked_tokens\"",
53+
(gogoproto.nullable) = false
54+
];
55+
56+
// tokenize shares locks at genesis
57+
repeated TokenizeShareLock tokenize_share_locks = 12 [(gogoproto.nullable) = false];
58+
}
59+
60+
// TokenizeSharesLock required for specifying account locks at genesis
61+
message TokenizeShareLock {
62+
// Address of the account that is locked
63+
string address = 1;
64+
// Status of the lock (LOCKED or LOCK_EXPIRING)
65+
string status = 2;
66+
// Completion time if the lock is expiring
67+
google.protobuf.Timestamp completion_time = 3
68+
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""];
4169
}
4270

4371
// LastValidatorPower required for validator set update logic.

src/cosmospy_protobuf/cosmos/staking/v1beta1/query.proto

Lines changed: 141 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import "cosmos/base/query/v1beta1/pagination.proto";
55
import "gogoproto/gogo.proto";
66
import "google/api/annotations.proto";
77
import "cosmos/staking/v1beta1/staking.proto";
8+
import "cosmos/base/v1beta1/coin.proto";
89

910
option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types";
1011

@@ -90,6 +91,50 @@ service Query {
9091
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
9192
option (google.api.http).get = "/cosmos/staking/v1beta1/params";
9293
}
94+
95+
// Query for individual tokenize share record information by share by id
96+
rpc TokenizeShareRecordById(QueryTokenizeShareRecordByIdRequest) returns (QueryTokenizeShareRecordByIdResponse) {
97+
option (google.api.http).get = "/cosmos/staking/v1beta1/tokenize_share_record_by_id/{id}";
98+
}
99+
100+
// Query for individual tokenize share record information by share denom
101+
rpc TokenizeShareRecordByDenom(QueryTokenizeShareRecordByDenomRequest)
102+
returns (QueryTokenizeShareRecordByDenomResponse) {
103+
option (google.api.http).get = "/cosmos/staking/v1beta1/tokenize_share_record_by_denom/{denom}";
104+
}
105+
106+
// Query tokenize share records by address
107+
rpc TokenizeShareRecordsOwned(QueryTokenizeShareRecordsOwnedRequest)
108+
returns (QueryTokenizeShareRecordsOwnedResponse) {
109+
option (google.api.http).get = "/cosmos/staking/v1beta1/tokenize_share_record_owned/{owner}";
110+
}
111+
112+
// Query for all tokenize share records
113+
rpc AllTokenizeShareRecords(QueryAllTokenizeShareRecordsRequest) returns (QueryAllTokenizeShareRecordsResponse) {
114+
option (google.api.http).get = "/cosmos/staking/v1beta1/tokenize_share_records";
115+
}
116+
117+
// Query for last tokenize share record id
118+
rpc LastTokenizeShareRecordId(QueryLastTokenizeShareRecordIdRequest)
119+
returns (QueryLastTokenizeShareRecordIdResponse) {
120+
option (google.api.http).get = "/cosmos/staking/v1beta1/last_tokenize_share_record_id";
121+
}
122+
123+
// Query for total tokenized staked assets
124+
rpc TotalTokenizeSharedAssets(QueryTotalTokenizeSharedAssetsRequest)
125+
returns (QueryTotalTokenizeSharedAssetsResponse) {
126+
option (google.api.http).get = "/cosmos/staking/v1beta1/total_tokenize_shared_assets";
127+
}
128+
129+
// Query for total liquid staked (including tokenized shares or owned by an liquid staking provider)
130+
rpc TotalLiquidStaked(QueryTotalLiquidStaked) returns (QueryTotalLiquidStakedResponse) {
131+
option (google.api.http).get = "/cosmos/staking/v1beta1/total_liquid_staked";
132+
}
133+
134+
// Query tokenize share locks
135+
rpc TokenizeShareLockInfo(QueryTokenizeShareLockInfo) returns (QueryTokenizeShareLockInfoResponse) {
136+
option (google.api.http).get = "/cosmos/staking/v1beta1/tokenize_share_lock_info/{address}";
137+
}
93138
}
94139

95140
// QueryValidatorsRequest is request type for Query/Validators RPC method.
@@ -118,7 +163,7 @@ message QueryValidatorRequest {
118163

119164
// QueryValidatorResponse is response type for the Query/Validator RPC method
120165
message QueryValidatorResponse {
121-
// validator defines the the validator info.
166+
// validator defines the validator info.
122167
Validator validator = 1 [(gogoproto.nullable) = false];
123168
}
124169

@@ -288,7 +333,7 @@ message QueryDelegatorValidatorsRequest {
288333
// QueryDelegatorValidatorsResponse is response type for the
289334
// Query/DelegatorValidators RPC method.
290335
message QueryDelegatorValidatorsResponse {
291-
// validators defines the the validators' info of a delegator.
336+
// validators defines the validators' info of a delegator.
292337
repeated Validator validators = 1 [(gogoproto.nullable) = false];
293338

294339
// pagination defines the pagination in the response.
@@ -311,7 +356,7 @@ message QueryDelegatorValidatorRequest {
311356
// QueryDelegatorValidatorResponse response type for the
312357
// Query/DelegatorValidator RPC method.
313358
message QueryDelegatorValidatorResponse {
314-
// validator defines the the validator info.
359+
// validator defines the validator info.
315360
Validator validator = 1 [(gogoproto.nullable) = false];
316361
}
317362

@@ -346,3 +391,96 @@ message QueryParamsResponse {
346391
// params holds all the parameters of this module.
347392
Params params = 1 [(gogoproto.nullable) = false];
348393
}
394+
395+
// QueryTokenizeShareRecordByIdRequest is request type for the
396+
// Query/QueryTokenizeShareRecordById RPC method.
397+
message QueryTokenizeShareRecordByIdRequest {
398+
uint64 id = 1;
399+
}
400+
401+
// QueryTokenizeShareRecordByIdRequest is response type for the
402+
// Query/QueryTokenizeShareRecordById RPC method.
403+
message QueryTokenizeShareRecordByIdResponse {
404+
TokenizeShareRecord record = 1 [(gogoproto.nullable) = false];
405+
}
406+
407+
// QueryTokenizeShareRecordByDenomRequest is request type for the
408+
// Query/QueryTokenizeShareRecordByDenom RPC method.
409+
message QueryTokenizeShareRecordByDenomRequest {
410+
string denom = 1;
411+
}
412+
413+
// QueryTokenizeShareRecordByDenomResponse is response type for the
414+
// Query/QueryTokenizeShareRecordByDenom RPC method.
415+
message QueryTokenizeShareRecordByDenomResponse {
416+
TokenizeShareRecord record = 1 [(gogoproto.nullable) = false];
417+
}
418+
419+
// QueryTokenizeShareRecordsOwnedRequest is request type for the
420+
// Query/QueryTokenizeShareRecordsOwned RPC method.
421+
message QueryTokenizeShareRecordsOwnedRequest {
422+
string owner = 1;
423+
}
424+
425+
// QueryTokenizeShareRecordsOwnedResponse is response type for the
426+
// Query/QueryTokenizeShareRecordsOwned RPC method.
427+
message QueryTokenizeShareRecordsOwnedResponse {
428+
repeated TokenizeShareRecord records = 1 [(gogoproto.nullable) = false];
429+
}
430+
431+
// QueryAllTokenizeShareRecordsRequest is request type for the
432+
// Query/QueryAllTokenizeShareRecords RPC method.
433+
message QueryAllTokenizeShareRecordsRequest {
434+
// pagination defines an optional pagination for the request.
435+
cosmos.base.query.v1beta1.PageRequest pagination = 1;
436+
}
437+
438+
// QueryAllTokenizeShareRecordsResponse is response type for the
439+
// Query/QueryAllTokenizeShareRecords RPC method.
440+
message QueryAllTokenizeShareRecordsResponse {
441+
repeated TokenizeShareRecord records = 1 [(gogoproto.nullable) = false];
442+
// pagination defines the pagination in the response.
443+
cosmos.base.query.v1beta1.PageResponse pagination = 2;
444+
}
445+
446+
// QueryLastTokenizeShareRecordIdRequest is request type for the
447+
// Query/QueryLastTokenizeShareRecordId RPC method.
448+
message QueryLastTokenizeShareRecordIdRequest {}
449+
450+
// QueryLastTokenizeShareRecordIdResponse is response type for the
451+
// Query/QueryLastTokenizeShareRecordId RPC method.
452+
message QueryLastTokenizeShareRecordIdResponse {
453+
uint64 id = 1;
454+
}
455+
456+
// QueryTotalTokenizeSharedAssetsRequest is request type for the
457+
// Query/QueryTotalTokenizeSharedAssets RPC method.
458+
message QueryTotalTokenizeSharedAssetsRequest {}
459+
460+
// QueryTotalTokenizeSharedAssetsResponse is response type for the
461+
// Query/QueryTotalTokenizeSharedAssets RPC method.
462+
message QueryTotalTokenizeSharedAssetsResponse {
463+
cosmos.base.v1beta1.Coin value = 1 [(gogoproto.nullable) = false];
464+
}
465+
466+
// QueryTotalLiquidStakedRequest is request type for the
467+
// Query/QueryQueryTotalLiquidStaked RPC method.
468+
message QueryTotalLiquidStaked {}
469+
470+
// QueryTotalLiquidStakedResponse is response type for the
471+
// Query/QueryQueryTotalLiquidStaked RPC method.
472+
message QueryTotalLiquidStakedResponse {
473+
string tokens = 1;
474+
}
475+
476+
// QueryTokenizeShareLockInfo queries the tokenize share lock information
477+
// associated with given account
478+
message QueryTokenizeShareLockInfo {
479+
string address = 1;
480+
}
481+
// QueryTokenizeShareLockInfoResponse is the response from the
482+
// QueryTokenizeShareLockInfo query
483+
message QueryTokenizeShareLockInfoResponse {
484+
string status = 1;
485+
string expiration_time = 2;
486+
}

0 commit comments

Comments
 (0)