diff --git a/precompiles/avsTask/task_test.go b/precompiles/avsTask/task_test.go index 125710751..614f1e43c 100644 --- a/precompiles/avsTask/task_test.go +++ b/precompiles/avsTask/task_test.go @@ -2,9 +2,10 @@ package task_test import ( "encoding/hex" + "math/big" + "github.com/ExocoreNetwork/exocore/x/avs/types" sdk "github.com/cosmos/cosmos-sdk/types" - "math/big" "github.com/ExocoreNetwork/exocore/app" "github.com/ExocoreNetwork/exocore/precompiles/avsTask" diff --git a/proto/exocore/delegation/v1/query.proto b/proto/exocore/delegation/v1/query.proto index 7bffde827..36ca12c5a 100644 --- a/proto/exocore/delegation/v1/query.proto +++ b/proto/exocore/delegation/v1/query.proto @@ -3,6 +3,7 @@ package exocore.delegation.v1; import "cosmos/query/v1/query.proto"; import "cosmos_proto/cosmos.proto"; +import "exocore/delegation/v1/tx.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; @@ -81,6 +82,28 @@ message UndelegationHoldCountResponse { uint64 hold_count = 1; } +// UndelegationsReq is the request to obtain all delegations +// by staker id and asset id. +message UndelegationsReq { + // staker_id is the staker id. + string staker_id = 1 [(gogoproto.customname) = "StakerID"]; + // asset_id is the asset id. + string asset_id = 2 [(gogoproto.customname) = "AssetID"]; +} + +// UndelegationsByHeightReq is the request to obtain all undelegations waiting to be completed +// by height. +message UndelegationsByHeightReq { + // block_height is the block height to query. + uint64 block_height = 1; +} + +// UndelegationRecordList is the response to query undelegations. +message UndelegationRecordList { + // UndelegationRecord is the returned undelegations + repeated UndelegationRecord undelegations = 1; +} + // Query is the service API for the delegation module. service Query { // DelegationInfo queries the delegation information for {stakerID, assetID}. @@ -100,5 +123,19 @@ service Query { option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/exocore/delegation/v1/QueryUndelegationHoldCount/{record_key}"; } + + // QueryUndelegations queries all undelegations for + // {staker, asset}. + rpc QueryUndelegations(UndelegationsReq) returns (UndelegationRecordList) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/exocore/delegation/v1/QueryUndelegations"; + } + + // QueryUndelegationsByHeight queries all undelegations waiting to be completed by + // {height}. + rpc QueryUndelegationsByHeight(UndelegationsByHeightReq) returns (UndelegationRecordList) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/exocore/delegation/v1/QueryUndelegationsByHeight"; + } } diff --git a/proto/exocore/operator/v1/query.proto b/proto/exocore/operator/v1/query.proto index 757d093c8..2a7794415 100644 --- a/proto/exocore/operator/v1/query.proto +++ b/proto/exocore/operator/v1/query.proto @@ -31,7 +31,54 @@ message QueryAllOperatorsResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } -// QueryOperatorConsKeyRequest is a request to obtain the consensus public key of the operator. +// OperatorAVSAddressDetails includes the address of operator and AVS +message OperatorAVSAddressDetails { + // operator_addr should be the string type of sdk.AccAddress + string operator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // avs_address is the address of the AVS - either an 0x address or a chainID. + string avs_address = 2 [(gogoproto.customname) = "AVSAddress"]; +} + +// QueryOperatorUSDValueRequest is the request to obtain the USD value for operator. +message QueryOperatorUSDValueRequest { + // details is the operator and AVS address + OperatorAVSAddressDetails details = 1; +} + +// QueryAVSUSDValueRequest is the request to obtain the USD value for AVS. +message QueryAVSUSDValueRequest { + // avs_address is the AVS address opted-in by the operator + string avs_address = 1 + [(gogoproto.customname) = "AVSAddress"]; +} + +// QueryOperatorSlashInfoRequest is the request to obtain the slash information for the specified +// operator and AVS +message QueryOperatorSlashInfoRequest { + // details is the operator and AVS address + OperatorAVSAddressDetails details = 1; + // pagination related options. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// OperatorSlashInfoByID includes the slash information and the slashID +message OperatorSlashInfoByID { + // slash_id is stored as the key of the slash information, + // so it will be parsed and padding here. + string slash_id = 1 [(gogoproto.customname) = "SlashID"]; + // info is the specified detailed information for the slashing event. + OperatorSlashInfo info = 2; +} + +// QueryOperatorSlashInfoResponse is the response for GetOperatorSlashInfoRequest +message QueryOperatorSlashInfoResponse{ + // all_slash_info is a list of the slash information for the specified operator and AVS + repeated OperatorSlashInfoByID all_slash_info = 1; + // pagination related response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryOperatorConsKeyRequest is the request to obtain the consensus public key of the operator message QueryOperatorConsKeyRequest { // operator_acc_addr is the operator account address. string operator_acc_addr = 1; @@ -44,7 +91,7 @@ message QueryOperatorConsKeyRequest { // QueryOperatorConsKeyResponse is the response for QueryOperatorConsKeyRequest. message QueryOperatorConsKeyResponse { // public_key is the consensus public key of the operator. - tendermint.crypto.PublicKey public_key = 1 [ (gogoproto.nullable) = false ]; + tendermint.crypto.PublicKey public_key = 1 [(gogoproto.nullable) = false]; // opting_out is a flag to indicate if the operator is opting out of consensus. bool opting_out = 2; } @@ -147,8 +194,8 @@ service Query { // QueryOperatorConsKeyForChainID queries the consensus public key for the operator rpc QueryOperatorConsKeyForChainID(QueryOperatorConsKeyRequest) returns ( - QueryOperatorConsKeyResponse - ) { + QueryOperatorConsKeyResponse + ) { option (google.api.http) = { get: "/exocore/operator/v1/operator_cons_key/{operator_acc_addr}/{chain}" }; @@ -156,8 +203,8 @@ service Query { // QueryOperatorConsAddressForChainID queries the consensus address for the operator. rpc QueryOperatorConsAddressForChainID(QueryOperatorConsAddressRequest) returns ( - QueryOperatorConsAddressResponse - ) { + QueryOperatorConsAddressResponse + ) { option (google.api.http) = { get: "/exocore/operator/v1/operator_cons_addr/{operator_acc_addr}/{chain}" }; @@ -166,18 +213,33 @@ service Query { // QueryAllOperatorConsKeysByChainID queries all operators and their consensus public keys // for a specific chain ID rpc QueryAllOperatorConsKeysByChainID(QueryAllOperatorConsKeysByChainIDRequest) returns ( - QueryAllOperatorConsKeysByChainIDResponse - ) { + QueryAllOperatorConsKeysByChainIDResponse + ) { option (google.api.http) = { get: "/exocore/operator/v1/all_operator_cons_keys/{chain}" }; } + // QueryOperatorUSDValue queries the opted-in USD value for the operator + rpc QueryOperatorUSDValue(QueryOperatorUSDValueRequest) returns(DecValueField){ + option (google.api.http).get = "/exocore/operator/v1/QueryOperatorUSDValue"; + } + + // QueryAVSUSDValue queries the USD value for the AVS + rpc QueryAVSUSDValue(QueryAVSUSDValueRequest) returns(DecValueField){ + option (google.api.http).get = "/exocore/operator/v1/QueryAVSUSDValue"; + } + + // QueryOperatorSlashInfo queries the slash information for the specified operator and AVS + rpc QueryOperatorSlashInfo(QueryOperatorSlashInfoRequest) returns(QueryOperatorSlashInfoResponse){ + option (google.api.http).get = "/exocore/operator/v1/QueryOperatorSlashInfo"; + } + // QueryAllOperatorConsAddrsByChainID queries all operators and their consensus addresses // for a specific chain ID rpc QueryAllOperatorConsAddrsByChainID(QueryAllOperatorConsAddrsByChainIDRequest) returns ( - QueryAllOperatorConsAddrsByChainIDResponse - ) { + QueryAllOperatorConsAddrsByChainIDResponse + ) { option (google.api.http) = { get: "/exocore/operator/v1/all_operator_cons_addrs/{chain}" }; diff --git a/proto/exocore/operator/v1/tx.proto b/proto/exocore/operator/v1/tx.proto index 889a7ac4e..8fab56906 100644 --- a/proto/exocore/operator/v1/tx.proto +++ b/proto/exocore/operator/v1/tx.proto @@ -93,6 +93,56 @@ enum SlashType { SLASH_TYPE_NO_INSTANTANEOUS_SLASH = 2; } +// SlashFromUndelegation records the slash detail from the undelegation +message SlashFromUndelegation { + // staker_id is the staker id. + string staker_id = 1 [(gogoproto.customname) = "StakerID"]; + // asset_id is the asset id. + string asset_id = 2 [(gogoproto.customname) = "AssetID"]; + // amount is the slashed amount from the undelegation. + string amount = 3 + [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} +// SlashFromAssetsPool records the slash detail from the operator assets pool +message SlashFromAssetsPool { + // asset_id is the asset id. + string asset_id = 1 [(gogoproto.customname) = "AssetID"]; + // amount is the slashed amount from the assets pool. + string amount = 2 + [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + + +// SlashExecutionInfo is the actual execution state for a slash event +message SlashExecutionInfo { + // slash_proportion is the new calculated proportion when execute the slash + string slash_proportion = 1 + [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // slash_value is the usd value of all slashed assets + string slash_value = 2 + [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // SlashUndelegations records all slash info related to the undelegation + repeated SlashFromUndelegation slash_undelegations = 3; + // SlashFromAssetsPool records all slash info related to the assets pool + repeated SlashFromAssetsPool slash_assets_pool = 4; +} + // OperatorSlashInfo is the slash info of operator message OperatorSlashInfo { // slash_contract is the address of slash contract @@ -101,19 +151,19 @@ message OperatorSlashInfo { int64 submitted_height = 2; // event_height is the exocore block height at which the slash event occurs int64 event_height = 3; - // processed_height is the exocore block height at which the slash event is processed - int64 processed_height = 4; // is_vetoed is a flag to indicate if this slash is vetoed - bool is_vetoed = 5; + bool is_vetoed = 4; // slash_proportion is the proportion of assets that need to be slashed - string slash_proportion = 6 + string slash_proportion = 5 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; - // type indicates the slash type. - SlashType slash_type = 7; + // slash_type indicates the slash type of specified AVS. + uint32 slash_type = 6; + // SlashExecutionInfo stores the slashed execution information + SlashExecutionInfo execution_info = 7; } // RegisterOperatorReq is the request to register a new operator. diff --git a/x/assets/keeper/operator_asset.go b/x/assets/keeper/operator_asset.go index 64bfff253..b1a6b798b 100644 --- a/x/assets/keeper/operator_asset.go +++ b/x/assets/keeper/operator_asset.go @@ -16,7 +16,7 @@ func (k Keeper) GetOperatorAssetInfos(ctx sdk.Context, operatorAddr sdk.Address, ret[assetID] = state return nil } - err = k.IteratorAssetsForOperator(ctx, operatorAddr.String(), assetsFilter, opFunc) + err = k.IteratorAssetsForOperator(ctx, false, operatorAddr.String(), assetsFilter, opFunc) if err != nil { return nil, err } @@ -96,7 +96,7 @@ func (k Keeper) UpdateOperatorAssetState(ctx sdk.Context, operatorAddr sdk.Addre // IteratorAssetsForOperator iterates all assets for the specified operator // if `assetsFilter` is nil, the `opFunc` will handle all assets, it equals to an iterator without filter // if `assetsFilter` isn't nil, the `opFunc` will only handle the assets that is in the filter map. -func (k Keeper) IteratorAssetsForOperator(ctx sdk.Context, operator string, assetsFilter map[string]interface{}, opFunc func(assetID string, state *assetstype.OperatorAssetInfo) error) error { +func (k Keeper) IteratorAssetsForOperator(ctx sdk.Context, isUpdate bool, operator string, assetsFilter map[string]interface{}, opFunc func(assetID string, state *assetstype.OperatorAssetInfo) error) error { store := prefix.NewStore(ctx.KVStore(k.storeKey), assetstype.KeyPrefixOperatorAssetInfos) iterator := sdk.KVStorePrefixIterator(store, []byte(operator)) defer iterator.Close() @@ -116,6 +116,11 @@ func (k Keeper) IteratorAssetsForOperator(ctx sdk.Context, operator string, asse if err != nil { return err } + if isUpdate { + // store the updated state + bz := k.cdc.MustMarshal(&amounts) + store.Set(iterator.Key(), bz) + } } return nil } diff --git a/x/assets/types/codec.go b/x/assets/types/codec.go index 7900dd893..8a4a2b2cc 100644 --- a/x/assets/types/codec.go +++ b/x/assets/types/codec.go @@ -10,10 +10,10 @@ import ( var ( amino = codec.NewLegacyAmino() - // ModuleCdc references the global erc20 module codec. Note, the codec should + // ModuleCdc references the global module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // - // The actual codec used for serialization should be provided to modules/erc20 and + // The actual codec used for serialization should be provided to modules and // defined at the application level. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) diff --git a/x/assets/types/keys.go b/x/assets/types/keys.go index f0acdbbab..99f0caafb 100644 --- a/x/assets/types/keys.go +++ b/x/assets/types/keys.go @@ -87,6 +87,12 @@ func GetJoinedStoreKey(keys ...string) []byte { return []byte(strings.Join(keys, "/")) } +func GetJoinedStoreKeyForPrefix(keys ...string) []byte { + ret := []byte(strings.Join(keys, "/")) + ret = append(ret, '/') + return ret +} + func ParseJoinedKey(key []byte) (keys []string, err error) { stringList := strings.Split(string(key), "/") return stringList, nil diff --git a/x/avs/keeper/avs_test.go b/x/avs/keeper/avs_test.go index 2552051fe..c3a298a9f 100644 --- a/x/avs/keeper/avs_test.go +++ b/x/avs/keeper/avs_test.go @@ -33,7 +33,6 @@ func (suite *AVSTestSuite) TestAVS() { suite.NoError(err) suite.Equal(avsAddres, info.GetInfo().AvsAddress) - } func (suite *AVSTestSuite) TestAVSInfoUpdate_Register() { @@ -64,8 +63,8 @@ func (suite *AVSTestSuite) TestAVSInfoUpdate_Register() { err = suite.App.AVSManagerKeeper.AVSInfoUpdate(suite.Ctx, avsParams) suite.Error(err) suite.Contains(err.Error(), types.ErrAlreadyRegistered.Error()) - } + func (suite *AVSTestSuite) TestAVSInfoUpdate_DeRegister() { // Test case setup avsName, avsAddres, slashAddress := "avsTest", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutkjr", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutash" @@ -100,7 +99,6 @@ func (suite *AVSTestSuite) TestAVSInfoUpdate_DeRegister() { info, err = suite.App.AVSManagerKeeper.GetAVSInfo(suite.Ctx, avsAddres) suite.Error(err) suite.Contains(err.Error(), types.ErrNoKeyInTheStore.Error()) - } func (suite *AVSTestSuite) TestAVSInfoUpdateWithOperator_Register() { @@ -116,7 +114,7 @@ func (suite *AVSTestSuite) TestAVSInfoUpdateWithOperator_Register() { suite.Error(err) suite.Contains(err.Error(), delegationtypes.ErrOperatorNotExist.Error()) - //register operator but avs not register + // register operator but avs not register info := &operatortype.OperatorInfo{ EarningsAddr: suite.AccAddress.String(), ApproveAddr: "", @@ -135,7 +133,7 @@ func (suite *AVSTestSuite) TestAVSInfoUpdateWithOperator_Register() { suite.Error(err) suite.Contains(err.Error(), types.ErrNoKeyInTheStore.Error()) - //register avs + // register avs avsName, avsAddres, slashAddress := "avsTest", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutkjr", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutash" avsOwnerAddress := []string{"exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutkjr", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutkj1", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutkj2"} assetID := []string{"11", "22", "33"} @@ -158,19 +156,18 @@ func (suite *AVSTestSuite) TestAVSInfoUpdateWithOperator_Register() { operatorParams.AvsAddress = avsAddres err = suite.App.AVSManagerKeeper.AVSInfoUpdateWithOperator(suite.Ctx, operatorParams) suite.NoError(err) - //duplicate register operator + // duplicate register operator err = suite.App.AVSManagerKeeper.AVSInfoUpdateWithOperator(suite.Ctx, operatorParams) suite.Error(err) suite.Contains(err.Error(), types.ErrAlreadyRegistered.Error()) - //deregister operator + // deregister operator operatorParams.Action = avstypes.DeRegisterAction err = suite.App.AVSManagerKeeper.AVSInfoUpdateWithOperator(suite.Ctx, operatorParams) suite.NoError(err) - //duplicate deregister operator + // duplicate deregister operator operatorParams.Action = avstypes.DeRegisterAction err = suite.App.AVSManagerKeeper.AVSInfoUpdateWithOperator(suite.Ctx, operatorParams) suite.Error(err) suite.Contains(err.Error(), types.ErrUnregisterNonExistent.Error()) - } diff --git a/x/avstask/types/codec.go b/x/avstask/types/codec.go index 373487f3a..d4b79d95f 100644 --- a/x/avstask/types/codec.go +++ b/x/avstask/types/codec.go @@ -10,10 +10,10 @@ import ( var ( amino = codec.NewLegacyAmino() - // ModuleCdc references the global erc20 module codec. Note, the codec should + // ModuleCdc references the global module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // - // The actual codec used for serialization should be provided to modules/erc20 and + // The actual codec used for serialization should be provided to modules and // defined at the application level. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) diff --git a/x/delegation/client/cli/query.go b/x/delegation/client/cli/query.go index 40e10a22e..b404283e4 100644 --- a/x/delegation/client/cli/query.go +++ b/x/delegation/client/cli/query.go @@ -28,6 +28,8 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand( QuerySingleDelegationInfo(), QueryDelegationInfo(), + QueryUndelegations(), + QueryUndelegationsByHeight(), QueryUndelegationHoldCount(), ) return cmd @@ -110,6 +112,76 @@ func QueryDelegationInfo() *cobra.Command { return cmd } +// QueryUndelegations queries all undelegations for staker and asset +func QueryUndelegations() *cobra.Command { + cmd := &cobra.Command{ + Use: "QueryUndelegations stakerID assetID", + Short: "Get undelegations", + Long: "Get undelegations", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := delegationtype.NewQueryClient(clientCtx) + _, _, err = types.ValidateID(args[0], false, false) + if err != nil { + return err + } + _, _, err = types.ValidateID(args[1], false, false) + if err != nil { + return err + } + req := &delegationtype.UndelegationsReq{ + StakerID: strings.ToLower(args[0]), + AssetID: strings.ToLower(args[1]), + } + res, err := queryClient.QueryUndelegations(context.Background(), req) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// QueryUndelegationsByHeight queries all undelegations waiting to be completed by height +func QueryUndelegationsByHeight() *cobra.Command { + cmd := &cobra.Command{ + Use: "QueryUndelegationsByHeight height", + Short: "Get undelegations waiting to be completed", + Long: "Get undelegations waiting to be completed", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + height, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + queryClient := delegationtype.NewQueryClient(clientCtx) + req := &delegationtype.UndelegationsByHeightReq{ + BlockHeight: height, + } + res, err := queryClient.QueryUndelegationsByHeight(context.Background(), req) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + // QueryUndelegationHoldCount queries undelegation hold count for a record key. func QueryUndelegationHoldCount() *cobra.Command { cmd := &cobra.Command{ diff --git a/x/delegation/keeper/abci.go b/x/delegation/keeper/abci.go index 9075fe220..6f54e2237 100644 --- a/x/delegation/keeper/abci.go +++ b/x/delegation/keeper/abci.go @@ -10,7 +10,7 @@ import ( // EndBlock : completed Undelegation events according to the canCompleted blockHeight // This function will be triggered at the end of every block, it will query the undelegation state to get the records that need to be handled and try to complete the undelegation task. func (k *Keeper) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - records, err := k.GetWaitCompleteUndelegationRecords(ctx, uint64(ctx.BlockHeight())) + records, err := k.GetPendingUndelegationRecords(ctx, uint64(ctx.BlockHeight())) if err != nil { panic(err) } @@ -45,7 +45,7 @@ func (k *Keeper) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Valida panic(err) } // and the other is the fact that it matures at the next block - err = k.StoreWaitCompleteRecord(ctx, recordKey, record) + err = k.StorePendingUndelegationRecord(ctx, recordKey, record) if err != nil { panic(err) } diff --git a/x/delegation/keeper/delegation_op_test.go b/x/delegation/keeper/delegation_op_test.go index 6baaea248..dcdb52f61 100644 --- a/x/delegation/keeper/delegation_op_test.go +++ b/x/delegation/keeper/delegation_op_test.go @@ -184,7 +184,7 @@ func (suite *DelegationTestSuite) TestUndelegateFrom() { suite.Equal(UndelegationRecord, records[0]) suite.Ctx.Logger().Info("the complete block number is:", "height", UndelegationRecord.CompleteBlockNumber) - waitUndelegationRecords, err := suite.App.DelegationKeeper.GetWaitCompleteUndelegationRecords(suite.Ctx, UndelegationRecord.CompleteBlockNumber) + waitUndelegationRecords, err := suite.App.DelegationKeeper.GetPendingUndelegationRecords(suite.Ctx, UndelegationRecord.CompleteBlockNumber) suite.NoError(err) suite.Equal(1, len(waitUndelegationRecords)) suite.Equal(UndelegationRecord, waitUndelegationRecords[0]) @@ -241,7 +241,7 @@ func (suite *DelegationTestSuite) TestCompleteUndelegation() { suite.NoError(err) suite.Equal(0, len(records)) - waitUndelegationRecords, err := suite.App.DelegationKeeper.GetWaitCompleteUndelegationRecords(suite.Ctx, uint64(completeBlockNumber)) + waitUndelegationRecords, err := suite.App.DelegationKeeper.GetPendingUndelegationRecords(suite.Ctx, uint64(completeBlockNumber)) suite.NoError(err) suite.Equal(0, len(waitUndelegationRecords)) } diff --git a/x/delegation/keeper/grpc_query.go b/x/delegation/keeper/grpc_query.go index 649bceb4d..a97b14c34 100644 --- a/x/delegation/keeper/grpc_query.go +++ b/x/delegation/keeper/grpc_query.go @@ -19,6 +19,28 @@ func (k *Keeper) QueryDelegationInfo(ctx context.Context, info *delegationtype.D return k.GetDelegationInfo(c, info.StakerID, info.AssetID) } +func (k *Keeper) QueryUndelegations(ctx context.Context, req *delegationtype.UndelegationsReq) (*delegationtype.UndelegationRecordList, error) { + c := sdk.UnwrapSDKContext(ctx) + undelegations, err := k.GetStakerUndelegationRecords(c, req.StakerID, req.AssetID) + if err != nil { + return nil, err + } + return &delegationtype.UndelegationRecordList{ + Undelegations: undelegations, + }, nil +} + +func (k *Keeper) QueryUndelegationsByHeight(ctx context.Context, req *delegationtype.UndelegationsByHeightReq) (*delegationtype.UndelegationRecordList, error) { + c := sdk.UnwrapSDKContext(ctx) + undelegations, err := k.GetPendingUndelegationRecords(c, req.BlockHeight) + if err != nil { + return nil, err + } + return &delegationtype.UndelegationRecordList{ + Undelegations: undelegations, + }, nil +} + func (k Keeper) QueryUndelegationHoldCount(ctx context.Context, req *delegationtype.UndelegationHoldCountReq) (*delegationtype.UndelegationHoldCountResponse, error) { c := sdk.UnwrapSDKContext(ctx) res := k.GetUndelegationHoldCount(c, []byte(req.RecordKey)) diff --git a/x/delegation/keeper/un_delegation_state.go b/x/delegation/keeper/un_delegation_state.go index 0f731e6ea..8853817d7 100644 --- a/x/delegation/keeper/un_delegation_state.go +++ b/x/delegation/keeper/un_delegation_state.go @@ -14,11 +14,11 @@ import ( ) // SetUndelegationRecords function saves the undelegation records to be handled when the handle time expires. -// When we save the undelegation records, we save them in three kv stores which are `KeyPrefixUndelegationInfo` `KeyPrefixStakerUndelegationInfo` and `KeyPrefixWaitCompleteUndelegations` +// When we save the undelegation records, we save them in three kv stores which are `KeyPrefixUndelegationInfo` `KeyPrefixStakerUndelegationInfo` and `KeyPrefixPendingUndelegations` func (k *Keeper) SetUndelegationRecords(ctx sdk.Context, records []*types.UndelegationRecord) error { singleRecordStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixUndelegationInfo) stakerUndelegationStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixStakerUndelegationInfo) - waitCompleteStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixWaitCompleteUndelegations) + pendingUndelegationStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixPendingUndelegations) // key := common.HexToAddress(incentive.Contract) for _, record := range records { bz := k.cdc.MustMarshal(record) @@ -30,8 +30,8 @@ func (k *Keeper) SetUndelegationRecords(ctx sdk.Context, records []*types.Undele stakerKey := types.GetStakerUndelegationRecordKey(record.StakerID, record.AssetID, record.LzTxNonce) stakerUndelegationStore.Set(stakerKey, singleRecKey) - waitCompleteKey := types.GetWaitCompleteRecordKey(record.CompleteBlockNumber, record.LzTxNonce) - waitCompleteStore.Set(waitCompleteKey, singleRecKey) + pendingUndelegationKey := types.GetPendingUndelegationRecordKey(record.CompleteBlockNumber, record.LzTxNonce) + pendingUndelegationStore.Set(pendingUndelegationKey, singleRecKey) } return nil } @@ -39,7 +39,7 @@ func (k *Keeper) SetUndelegationRecords(ctx sdk.Context, records []*types.Undele func (k *Keeper) DeleteUndelegationRecord(ctx sdk.Context, record *types.UndelegationRecord) error { singleRecordStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixUndelegationInfo) stakerUndelegationStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixStakerUndelegationInfo) - waitCompleteStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixWaitCompleteUndelegations) + pendingUndelegationStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixPendingUndelegations) singleRecKey := types.GetUndelegationRecordKey(record.BlockNumber, record.LzTxNonce, record.TxHash, record.OperatorAddr) singleRecordStore.Delete(singleRecKey) @@ -47,8 +47,8 @@ func (k *Keeper) DeleteUndelegationRecord(ctx sdk.Context, record *types.Undeleg stakerKey := types.GetStakerUndelegationRecordKey(record.StakerID, record.AssetID, record.LzTxNonce) stakerUndelegationStore.Delete(stakerKey) - waitCompleteKey := types.GetWaitCompleteRecordKey(record.CompleteBlockNumber, record.LzTxNonce) - waitCompleteStore.Delete(waitCompleteKey) + pendingUndelegationKey := types.GetPendingUndelegationRecordKey(record.CompleteBlockNumber, record.LzTxNonce) + pendingUndelegationStore.Delete(pendingUndelegationKey) return nil } @@ -60,13 +60,13 @@ func (k *Keeper) SetSingleUndelegationRecord(ctx sdk.Context, record *types.Unde return key, nil } -// StoreWaitCompleteRecord add it to handle the delay of completing undelegation caused by onHoldCount +// StorePendingUndelegationRecord add it to handle the delay of completing undelegation caused by onHoldCount // In the event that the undelegation is held by another module, this function is used within the EndBlocker to increment the scheduled completion block number by 1. // Then the completion time of the undelegation will be delayed to the next block. -func (k *Keeper) StoreWaitCompleteRecord(ctx sdk.Context, singleRecKey []byte, record *types.UndelegationRecord) error { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixWaitCompleteUndelegations) - waitCompleteKey := types.GetWaitCompleteRecordKey(record.CompleteBlockNumber, record.LzTxNonce) - store.Set(waitCompleteKey, singleRecKey) +func (k *Keeper) StorePendingUndelegationRecord(ctx sdk.Context, singleRecKey []byte, record *types.UndelegationRecord) error { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixPendingUndelegations) + pendingUndelegationKey := types.GetPendingUndelegationRecordKey(record.CompleteBlockNumber, record.LzTxNonce) + store.Set(pendingUndelegationKey, singleRecKey) return nil } @@ -150,15 +150,15 @@ func (k *Keeper) GetStakerUndelegationRecords(ctx sdk.Context, stakerID, assetID return k.GetUndelegationRecords(ctx, recordKeys) } -func (k *Keeper) SetWaitCompleteUndelegationInfo(ctx sdk.Context, height, lzNonce uint64, recordKey string) error { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixWaitCompleteUndelegations) - key := types.GetWaitCompleteRecordKey(height, lzNonce) +func (k *Keeper) SetPendingUndelegationInfo(ctx sdk.Context, height, lzNonce uint64, recordKey string) error { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixPendingUndelegations) + key := types.GetPendingUndelegationRecordKey(height, lzNonce) store.Set(key, []byte(recordKey)) return nil } -func (k *Keeper) GetWaitCompleteUndelegationRecKeys(ctx sdk.Context, height uint64) (recordKeyList []string, err error) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixWaitCompleteUndelegations) +func (k *Keeper) GetPendingUndelegationRecKeys(ctx sdk.Context, height uint64) (recordKeyList []string, err error) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixPendingUndelegations) iterator := sdk.KVStorePrefixIterator(store, []byte(hexutil.EncodeUint64(height))) defer iterator.Close() @@ -169,8 +169,8 @@ func (k *Keeper) GetWaitCompleteUndelegationRecKeys(ctx sdk.Context, height uint return ret, nil } -func (k *Keeper) GetWaitCompleteUndelegationRecords(ctx sdk.Context, height uint64) (records []*types.UndelegationRecord, err error) { - recordKeys, err := k.GetWaitCompleteUndelegationRecKeys(ctx, height) +func (k *Keeper) GetPendingUndelegationRecords(ctx sdk.Context, height uint64) (records []*types.UndelegationRecord, err error) { + recordKeys, err := k.GetPendingUndelegationRecKeys(ctx, height) if err != nil { return nil, err } @@ -178,7 +178,7 @@ func (k *Keeper) GetWaitCompleteUndelegationRecords(ctx sdk.Context, height uint records = make([]*types.UndelegationRecord, 0) return records, nil } - // The states of records stored by WaitCompleteUndelegations kvStore should always be IsPending,so using AllRecords as getType here is ok. + // The states of records stored by KeyPrefixPendingUndelegations kvStore should always be IsPending,so using AllRecords as getType here is ok. return k.GetUndelegationRecords(ctx, recordKeys) } diff --git a/x/delegation/types/codec.go b/x/delegation/types/codec.go index 740b222ea..1c18cb390 100644 --- a/x/delegation/types/codec.go +++ b/x/delegation/types/codec.go @@ -10,10 +10,10 @@ import ( var ( amino = codec.NewLegacyAmino() - // ModuleCdc references the global erc20 module codec. Note, the codec should + // ModuleCdc references the global module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // - // The actual codec used for serialization should be provided to modules/erc20 and + // The actual codec used for serialization should be provided to modules and // defined at the application level. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) diff --git a/x/delegation/types/keys.go b/x/delegation/types/keys.go index 9fb5ba84a..1bd4ab109 100644 --- a/x/delegation/types/keys.go +++ b/x/delegation/types/keys.go @@ -36,7 +36,7 @@ const ( prefixStakerUndelegationInfo - prefixWaitCompleteUndelegations + prefixPendingUndelegations // used to store the undelegation hold count prefixUndelegationOnHold @@ -57,8 +57,8 @@ var ( KeyPrefixUndelegationInfo = []byte{prefixUndelegationInfo} // KeyPrefixStakerUndelegationInfo restakerID+'/'+assetID+'/'+LzNonce -> singleRecordKey KeyPrefixStakerUndelegationInfo = []byte{prefixStakerUndelegationInfo} - // KeyPrefixWaitCompleteUndelegations completeHeight +'/'+LzNonce -> singleRecordKey - KeyPrefixWaitCompleteUndelegations = []byte{prefixWaitCompleteUndelegations} + // KeyPrefixPendingUndelegations completeHeight +'/'+LzNonce -> singleRecordKey + KeyPrefixPendingUndelegations = []byte{prefixPendingUndelegations} ) func GetDelegationStateIteratorPrefix(stakerID, assetID string) []byte { @@ -118,7 +118,7 @@ func GetStakerUndelegationRecordKey(stakerID, assetID string, lzNonce uint64) [] return []byte(strings.Join([]string{stakerID, assetID, hexutil.EncodeUint64(lzNonce)}, "/")) } -func GetWaitCompleteRecordKey(height, lzNonce uint64) []byte { +func GetPendingUndelegationRecordKey(height, lzNonce uint64) []byte { return []byte(strings.Join([]string{hexutil.EncodeUint64(height), hexutil.EncodeUint64(lzNonce)}, "/")) } diff --git a/x/delegation/types/query.pb.go b/x/delegation/types/query.pb.go index d5b83e649..c429a4626 100644 --- a/x/delegation/types/query.pb.go +++ b/x/delegation/types/query.pb.go @@ -388,6 +388,155 @@ func (m *UndelegationHoldCountResponse) GetHoldCount() uint64 { return 0 } +// UndelegationsReq is the request to obtain all delegations +// by staker id and asset id. +type UndelegationsReq struct { + // staker_id is the staker id. + StakerID string `protobuf:"bytes,1,opt,name=staker_id,json=stakerId,proto3" json:"staker_id,omitempty"` + // asset_id is the asset id. + AssetID string `protobuf:"bytes,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` +} + +func (m *UndelegationsReq) Reset() { *m = UndelegationsReq{} } +func (m *UndelegationsReq) String() string { return proto.CompactTextString(m) } +func (*UndelegationsReq) ProtoMessage() {} +func (*UndelegationsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_aab345e1cf20490c, []int{7} +} +func (m *UndelegationsReq) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UndelegationsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UndelegationsReq.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UndelegationsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UndelegationsReq.Merge(m, src) +} +func (m *UndelegationsReq) XXX_Size() int { + return m.Size() +} +func (m *UndelegationsReq) XXX_DiscardUnknown() { + xxx_messageInfo_UndelegationsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UndelegationsReq proto.InternalMessageInfo + +func (m *UndelegationsReq) GetStakerID() string { + if m != nil { + return m.StakerID + } + return "" +} + +func (m *UndelegationsReq) GetAssetID() string { + if m != nil { + return m.AssetID + } + return "" +} + +// UndelegationsByHeightReq is the request to obtain all undelegations waiting to be completed +// by height. +type UndelegationsByHeightReq struct { + // block_height is the block height to query. + BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` +} + +func (m *UndelegationsByHeightReq) Reset() { *m = UndelegationsByHeightReq{} } +func (m *UndelegationsByHeightReq) String() string { return proto.CompactTextString(m) } +func (*UndelegationsByHeightReq) ProtoMessage() {} +func (*UndelegationsByHeightReq) Descriptor() ([]byte, []int) { + return fileDescriptor_aab345e1cf20490c, []int{8} +} +func (m *UndelegationsByHeightReq) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UndelegationsByHeightReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UndelegationsByHeightReq.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UndelegationsByHeightReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UndelegationsByHeightReq.Merge(m, src) +} +func (m *UndelegationsByHeightReq) XXX_Size() int { + return m.Size() +} +func (m *UndelegationsByHeightReq) XXX_DiscardUnknown() { + xxx_messageInfo_UndelegationsByHeightReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UndelegationsByHeightReq proto.InternalMessageInfo + +func (m *UndelegationsByHeightReq) GetBlockHeight() uint64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +// UndelegationRecordList is the response to query undelegations. +type UndelegationRecordList struct { + // UndelegationRecord is the returned undelegations + Undelegations []*UndelegationRecord `protobuf:"bytes,1,rep,name=undelegations,proto3" json:"undelegations,omitempty"` +} + +func (m *UndelegationRecordList) Reset() { *m = UndelegationRecordList{} } +func (m *UndelegationRecordList) String() string { return proto.CompactTextString(m) } +func (*UndelegationRecordList) ProtoMessage() {} +func (*UndelegationRecordList) Descriptor() ([]byte, []int) { + return fileDescriptor_aab345e1cf20490c, []int{9} +} +func (m *UndelegationRecordList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UndelegationRecordList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UndelegationRecordList.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UndelegationRecordList) XXX_Merge(src proto.Message) { + xxx_messageInfo_UndelegationRecordList.Merge(m, src) +} +func (m *UndelegationRecordList) XXX_Size() int { + return m.Size() +} +func (m *UndelegationRecordList) XXX_DiscardUnknown() { + xxx_messageInfo_UndelegationRecordList.DiscardUnknown(m) +} + +var xxx_messageInfo_UndelegationRecordList proto.InternalMessageInfo + +func (m *UndelegationRecordList) GetUndelegations() []*UndelegationRecord { + if m != nil { + return m.Undelegations + } + return nil +} + func init() { proto.RegisterType((*DelegationInfoReq)(nil), "exocore.delegation.v1.DelegationInfoReq") proto.RegisterType((*StakerList)(nil), "exocore.delegation.v1.StakerList") @@ -397,58 +546,69 @@ func init() { proto.RegisterType((*SingleDelegationInfoReq)(nil), "exocore.delegation.v1.SingleDelegationInfoReq") proto.RegisterType((*UndelegationHoldCountReq)(nil), "exocore.delegation.v1.UndelegationHoldCountReq") proto.RegisterType((*UndelegationHoldCountResponse)(nil), "exocore.delegation.v1.UndelegationHoldCountResponse") + proto.RegisterType((*UndelegationsReq)(nil), "exocore.delegation.v1.UndelegationsReq") + proto.RegisterType((*UndelegationsByHeightReq)(nil), "exocore.delegation.v1.UndelegationsByHeightReq") + proto.RegisterType((*UndelegationRecordList)(nil), "exocore.delegation.v1.UndelegationRecordList") } func init() { proto.RegisterFile("exocore/delegation/v1/query.proto", fileDescriptor_aab345e1cf20490c) } var fileDescriptor_aab345e1cf20490c = []byte{ - // 727 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x4f, 0x13, 0x4f, - 0x1c, 0xed, 0xf0, 0xe3, 0x0b, 0x1d, 0xf8, 0x46, 0x1c, 0x50, 0x4b, 0x91, 0x16, 0xf7, 0x40, 0x2a, - 0x09, 0xbb, 0x52, 0x31, 0x51, 0x23, 0x44, 0xb0, 0x04, 0x1b, 0x0c, 0x89, 0xdb, 0x78, 0xf1, 0xb2, - 0x59, 0xba, 0xc3, 0x76, 0xd3, 0xed, 0x4c, 0x99, 0x99, 0x16, 0x1a, 0xe3, 0xc5, 0x93, 0x47, 0x13, - 0xff, 0x0b, 0xbd, 0x78, 0xe0, 0xec, 0x99, 0x23, 0xc1, 0x8b, 0xf1, 0xd0, 0x98, 0x62, 0xe2, 0xff, - 0xe0, 0x45, 0xb3, 0xbb, 0x03, 0xdd, 0xe2, 0x2e, 0x4a, 0x3c, 0x75, 0xe7, 0xf3, 0xf3, 0xcd, 0x7b, - 0x2f, 0x53, 0x78, 0x03, 0xef, 0xd1, 0x32, 0x65, 0x58, 0xb3, 0xb0, 0x8b, 0x6d, 0x53, 0x38, 0x94, - 0x68, 0xcd, 0x05, 0x6d, 0xa7, 0x81, 0x59, 0x4b, 0xad, 0x33, 0x2a, 0x28, 0xba, 0x22, 0x4b, 0xd4, - 0x6e, 0x89, 0xda, 0x5c, 0x48, 0x4f, 0x95, 0x29, 0xaf, 0x51, 0x1e, 0x94, 0x9e, 0xe9, 0x49, 0x4f, - 0x06, 0x49, 0xc3, 0x3f, 0x69, 0xc1, 0x41, 0xa6, 0x26, 0x6c, 0x6a, 0xd3, 0x20, 0xee, 0x7d, 0xc9, - 0xe8, 0x75, 0x9b, 0x52, 0xdb, 0xc5, 0x9a, 0x59, 0x77, 0x34, 0x93, 0x10, 0x2a, 0xfc, 0x3d, 0xb2, - 0x47, 0xd9, 0x86, 0x97, 0x0b,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 0x79, 0xfd, 0x03, 0x7a, 0xb2, 0x72, 0x52, 0x96, 0xff, 0x38, 0x00, 0x07, 0x7d, - 0x71, 0xd1, 0x3b, 0x00, 0xc7, 0x23, 0x64, 0x46, 0x7f, 0xe6, 0x5f, 0x12, 0x9b, 0xce, 0x5f, 0xdc, - 0x3c, 0xca, 0x9d, 0xd7, 0xdf, 0x3f, 0xcc, 0x81, 0x57, 0x9f, 0xbe, 0xbd, 0xed, 0x9b, 0x43, 0x39, - 0x2d, 0xfa, 0xad, 0x5b, 0xc7, 0xe2, 0x0c, 0xa8, 0x7d, 0x00, 0x27, 0xfd, 0xb1, 0x51, 0x22, 0x23, - 0x35, 0x06, 0x48, 0x8c, 0x23, 0xd2, 0x7f, 0x6d, 0x31, 0x65, 0xa9, 0x0b, 0x37, 0x8f, 0x6e, 0xc5, - 0xc0, 0x8d, 0x07, 0x76, 0x08, 0x60, 0xda, 0xcf, 0x46, 0x6a, 0x86, 0xb4, 0x18, 0x1c, 0x71, 0xe6, - 0x48, 0x2f, 0x5e, 0xac, 0x41, 0x72, 0xbe, 0xd1, 0xbd, 0xc4, 0x43, 0xb4, 0x7c, 0xde, 0x25, 0x22, - 0xe7, 0x68, 0x2f, 0xba, 0x86, 0x7c, 0xb9, 0xba, 0x79, 0xd0, 0xc9, 0x80, 0xc3, 0x4e, 0x06, 0x7c, - 0xed, 0x64, 0xc0, 0x9b, 0xe3, 0x4c, 0xe2, 0xf0, 0x38, 0x93, 0xf8, 0x7c, 0x9c, 0x49, 0x3c, 0x5f, - 0x0c, 0xbd, 0x69, 0x6b, 0xc1, 0x8e, 0x4d, 0x2c, 0x76, 0x29, 0xab, 0x9e, 0xae, 0xdc, 0x0b, 0x2f, - 0xf5, 0x5f, 0xb9, 0xad, 0xff, 0xfc, 0xff, 0x93, 0xdb, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd6, - 0xd3, 0x4d, 0x1e, 0xf7, 0x06, 0x00, 0x00, + // 862 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0x8f, 0x5b, 0x96, 0x34, 0x2f, 0x5d, 0x51, 0x66, 0xcb, 0x92, 0xf5, 0xd2, 0x64, 0xd7, 0x87, + 0x92, 0x2e, 0x8a, 0x4d, 0xb3, 0x0b, 0x02, 0x44, 0x23, 0x5a, 0xb2, 0xda, 0x8d, 0x16, 0x15, 0xe1, + 0x88, 0x0b, 0x17, 0xcb, 0xb1, 0xa7, 0x8e, 0x15, 0xc7, 0x93, 0x7a, 0x26, 0x69, 0x23, 0xc4, 0x85, + 0x13, 0x47, 0x24, 0xbe, 0x42, 0x4f, 0x70, 0xe1, 0xd0, 0x23, 0x1f, 0xa0, 0xc7, 0xaa, 0x5c, 0x10, + 0x87, 0x08, 0xa5, 0x48, 0x7c, 0x07, 0x2e, 0x20, 0x8f, 0x27, 0x89, 0xd3, 0x3a, 0x25, 0x11, 0xda, + 0x53, 0x3c, 0xef, 0xcf, 0x6f, 0x7e, 0xef, 0xbd, 0xdf, 0xb3, 0x03, 0x0f, 0xf1, 0x31, 0xb1, 0x48, + 0x80, 0x35, 0x1b, 0x7b, 0xd8, 0x31, 0x99, 0x4b, 0x7c, 0xad, 0xb7, 0xad, 0x1d, 0x76, 0x71, 0xd0, + 0x57, 0x3b, 0x01, 0x61, 0x04, 0xbd, 0x21, 0x42, 0xd4, 0x49, 0x88, 0xda, 0xdb, 0x96, 0xef, 0x5b, + 0x84, 0xb6, 0x09, 0x8d, 0x42, 0xaf, 0xe4, 0xc8, 0xf7, 0x22, 0xa7, 0xc1, 0x4f, 0x5a, 0x74, 0x10, + 0xae, 0x7c, 0xf2, 0x8d, 0xec, 0x58, 0xf8, 0xd7, 0x1d, 0xe2, 0x90, 0x28, 0x2f, 0x7c, 0x12, 0xd6, + 0xb7, 0x1c, 0x42, 0x1c, 0x0f, 0x6b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 0x12, 0x44, 0xcf, 0x5f, 0x4c, 0x8a, 0xf8, 0x04, 0x55, 0x6e, 0x2a, 0x22, + 0x11, 0x47, 0xfb, 0x7a, 0xb2, 0xa1, 0xdf, 0xa0, 0x13, 0x09, 0xd0, 0xb5, 0x58, 0x8a, 0xde, 0x9e, + 0x83, 0x59, 0xb8, 0x7d, 0x72, 0x69, 0x6e, 0xe9, 0x86, 0x0b, 0xa0, 0xbc, 0x3f, 0xe1, 0xfe, 0x0e, + 0xda, 0x9a, 0x97, 0x3b, 0x45, 0xbf, 0x24, 0x75, 0x7e, 0xbc, 0x97, 0x73, 0x75, 0x3e, 0xbe, 0xc5, + 0x8b, 0xd2, 0xae, 0x4c, 0x68, 0x3f, 0x46, 0xdb, 0x73, 0xd3, 0x1e, 0xdd, 0xb8, 0xb7, 0x7f, 0x36, + 0xcc, 0x4b, 0xe7, 0xc3, 0xbc, 0xf4, 0xc7, 0x30, 0x2f, 0x7d, 0x7f, 0x99, 0x4f, 0x9d, 0x5f, 0xe6, + 0x53, 0xbf, 0x5d, 0xe6, 0x53, 0x5f, 0x3d, 0x89, 0x7d, 0x4a, 0x9f, 0x46, 0xb0, 0xfb, 0x98, 0x1d, + 0x91, 0xa0, 0x35, 0xbe, 0xe5, 0x38, 0x7e, 0x0f, 0xff, 0xb8, 0x36, 0x5e, 0xe5, 0x7f, 0x63, 0x1e, + 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x6f, 0x58, 0xb3, 0xa5, 0x8e, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -470,6 +630,12 @@ type QueryClient interface { QuerySingleDelegationInfo(ctx context.Context, in *SingleDelegationInfoReq, opts ...grpc.CallOption) (*DelegationAmounts, error) // QueryUndelegationHoldCount queries the undelegation hold count. QueryUndelegationHoldCount(ctx context.Context, in *UndelegationHoldCountReq, opts ...grpc.CallOption) (*UndelegationHoldCountResponse, error) + // QueryUndelegations queries all undelegations for + // {staker, asset}. + QueryUndelegations(ctx context.Context, in *UndelegationsReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) + // QueryUndelegationsByHeight queries all undelegations waiting to be completed by + // {height}. + QueryUndelegationsByHeight(ctx context.Context, in *UndelegationsByHeightReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) } type queryClient struct { @@ -507,6 +673,24 @@ func (c *queryClient) QueryUndelegationHoldCount(ctx context.Context, in *Undele return out, nil } +func (c *queryClient) QueryUndelegations(ctx context.Context, in *UndelegationsReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) { + out := new(UndelegationRecordList) + err := c.cc.Invoke(ctx, "/exocore.delegation.v1.Query/QueryUndelegations", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryUndelegationsByHeight(ctx context.Context, in *UndelegationsByHeightReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) { + out := new(UndelegationRecordList) + err := c.cc.Invoke(ctx, "/exocore.delegation.v1.Query/QueryUndelegationsByHeight", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // DelegationInfo queries the delegation information for {stakerID, assetID}. @@ -516,6 +700,12 @@ type QueryServer interface { QuerySingleDelegationInfo(context.Context, *SingleDelegationInfoReq) (*DelegationAmounts, error) // QueryUndelegationHoldCount queries the undelegation hold count. QueryUndelegationHoldCount(context.Context, *UndelegationHoldCountReq) (*UndelegationHoldCountResponse, error) + // QueryUndelegations queries all undelegations for + // {staker, asset}. + QueryUndelegations(context.Context, *UndelegationsReq) (*UndelegationRecordList, error) + // QueryUndelegationsByHeight queries all undelegations waiting to be completed by + // {height}. + QueryUndelegationsByHeight(context.Context, *UndelegationsByHeightReq) (*UndelegationRecordList, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -531,6 +721,12 @@ func (*UnimplementedQueryServer) QuerySingleDelegationInfo(ctx context.Context, func (*UnimplementedQueryServer) QueryUndelegationHoldCount(ctx context.Context, req *UndelegationHoldCountReq) (*UndelegationHoldCountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryUndelegationHoldCount not implemented") } +func (*UnimplementedQueryServer) QueryUndelegations(ctx context.Context, req *UndelegationsReq) (*UndelegationRecordList, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryUndelegations not implemented") +} +func (*UnimplementedQueryServer) QueryUndelegationsByHeight(ctx context.Context, req *UndelegationsByHeightReq) (*UndelegationRecordList, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryUndelegationsByHeight not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -590,6 +786,42 @@ func _Query_QueryUndelegationHoldCount_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +func _Query_QueryUndelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UndelegationsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryUndelegations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.delegation.v1.Query/QueryUndelegations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryUndelegations(ctx, req.(*UndelegationsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryUndelegationsByHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UndelegationsByHeightReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryUndelegationsByHeight(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.delegation.v1.Query/QueryUndelegationsByHeight", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryUndelegationsByHeight(ctx, req.(*UndelegationsByHeightReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "exocore.delegation.v1.Query", HandlerType: (*QueryServer)(nil), @@ -606,6 +838,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryUndelegationHoldCount", Handler: _Query_QueryUndelegationHoldCount_Handler, }, + { + MethodName: "QueryUndelegations", + Handler: _Query_QueryUndelegations_Handler, + }, + { + MethodName: "QueryUndelegationsByHeight", + Handler: _Query_QueryUndelegationsByHeight_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "exocore/delegation/v1/query.proto", @@ -874,6 +1114,108 @@ func (m *UndelegationHoldCountResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *UndelegationsReq) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UndelegationsReq) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UndelegationsReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AssetID) > 0 { + i -= len(m.AssetID) + copy(dAtA[i:], m.AssetID) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AssetID))) + i-- + dAtA[i] = 0x12 + } + if len(m.StakerID) > 0 { + i -= len(m.StakerID) + copy(dAtA[i:], m.StakerID) + i = encodeVarintQuery(dAtA, i, uint64(len(m.StakerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UndelegationsByHeightReq) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UndelegationsByHeightReq) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UndelegationsByHeightReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlockHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *UndelegationRecordList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UndelegationRecordList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UndelegationRecordList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Undelegations) > 0 { + for iNdEx := len(m.Undelegations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Undelegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -998,6 +1340,50 @@ func (m *UndelegationHoldCountResponse) Size() (n int) { return n } +func (m *UndelegationsReq) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.StakerID) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AssetID) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *UndelegationsByHeightReq) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockHeight != 0 { + n += 1 + sovQuery(uint64(m.BlockHeight)) + } + return n +} + +func (m *UndelegationRecordList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Undelegations) > 0 { + for _, e := range m.Undelegations { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1794,6 +2180,273 @@ func (m *UndelegationHoldCountResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *UndelegationsReq) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UndelegationsReq: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UndelegationsReq: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakerID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StakerID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssetID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UndelegationsByHeightReq) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UndelegationsByHeightReq: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UndelegationsByHeightReq: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UndelegationRecordList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UndelegationRecordList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UndelegationRecordList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Undelegations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Undelegations = append(m.Undelegations, &UndelegationRecord{}) + if err := m.Undelegations[len(m.Undelegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/delegation/types/query.pb.gw.go b/x/delegation/types/query.pb.gw.go index dac6b2f70..da415c8ec 100644 --- a/x/delegation/types/query.pb.gw.go +++ b/x/delegation/types/query.pb.gw.go @@ -159,6 +159,78 @@ func local_request_Query_QueryUndelegationHoldCount_0(ctx context.Context, marsh } +var ( + filter_Query_QueryUndelegations_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryUndelegations_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UndelegationsReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryUndelegations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryUndelegations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryUndelegations_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UndelegationsReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryUndelegations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryUndelegations(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryUndelegationsByHeight_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryUndelegationsByHeight_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UndelegationsByHeightReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryUndelegationsByHeight_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryUndelegationsByHeight(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryUndelegationsByHeight_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UndelegationsByHeightReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryUndelegationsByHeight_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryUndelegationsByHeight(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -234,6 +306,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryUndelegations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryUndelegations_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryUndelegations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryUndelegationsByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryUndelegationsByHeight_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryUndelegationsByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -335,6 +453,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryUndelegations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryUndelegations_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryUndelegations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryUndelegationsByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryUndelegationsByHeight_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryUndelegationsByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -344,6 +502,10 @@ var ( pattern_Query_QuerySingleDelegationInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "QuerySingleDelegationInfo"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryUndelegationHoldCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"exocore", "delegation", "v1", "QueryUndelegationHoldCount", "record_key"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryUndelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "QueryUndelegations"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryUndelegationsByHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "QueryUndelegationsByHeight"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -352,4 +514,8 @@ var ( forward_Query_QuerySingleDelegationInfo_0 = runtime.ForwardResponseMessage forward_Query_QueryUndelegationHoldCount_0 = runtime.ForwardResponseMessage + + forward_Query_QueryUndelegations_0 = runtime.ForwardResponseMessage + + forward_Query_QueryUndelegationsByHeight_0 = runtime.ForwardResponseMessage ) diff --git a/x/deposit/types/codec.go b/x/deposit/types/codec.go index 5f5da9a15..b1789ef2a 100644 --- a/x/deposit/types/codec.go +++ b/x/deposit/types/codec.go @@ -10,10 +10,10 @@ import ( var ( amino = codec.NewLegacyAmino() - // ModuleCdc references the global erc20 module codec. Note, the codec should + // ModuleCdc references the global module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // - // The actual codec used for serialization should be provided to modules/erc20 and + // The actual codec used for serialization should be provided to modules and // defined at the application level. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) diff --git a/x/deposit/types/query.pb.gw.go b/x/deposit/types/query.pb.gw.go index 2c727832e..4e143091e 100644 --- a/x/deposit/types/query.pb.gw.go +++ b/x/deposit/types/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryParamsRequest @@ -52,12 +54,14 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -65,6 +69,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/x/operator/client/cli/query.go b/x/operator/client/cli/query.go index 28c571036..1537c1696 100644 --- a/x/operator/client/cli/query.go +++ b/x/operator/client/cli/query.go @@ -3,6 +3,9 @@ package cli import ( "context" + sdk "github.com/cosmos/cosmos-sdk/types" + "golang.org/x/xerrors" + operatortypes "github.com/ExocoreNetwork/exocore/x/operator/types" "github.com/cosmos/cosmos-sdk/client" @@ -27,6 +30,9 @@ func GetQueryCmd() *cobra.Command { GetOperatorConsAddress(), GetAllOperatorKeys(), GetAllOperatorConsAddrs(), + QueryOperatorUSDValue(), + QueryAVSUSDValue(), + QueryOperatorSlashInfo(), ) return cmd } @@ -39,6 +45,10 @@ func GetOperatorInfo() *cobra.Command { Long: "Get operator info", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { + _, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return xerrors.Errorf("invalid operator address,err:%s", err.Error()) + } clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err @@ -100,6 +110,10 @@ func GetOperatorConsKey() *cobra.Command { Long: "Get operator consensus key for the provided chain ID", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { + _, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return xerrors.Errorf("invalid operator address,err:%s", err.Error()) + } clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err @@ -171,6 +185,10 @@ func GetOperatorConsAddress() *cobra.Command { if err != nil { return err } + _, err = sdk.AccAddressFromBech32(args[0]) + if err != nil { + return xerrors.Errorf("invalid operator address,err:%s", err.Error()) + } queryClient := operatortypes.NewQueryClient(clientCtx) req := &operatortypes.QueryOperatorConsAddressRequest{ @@ -225,3 +243,106 @@ func GetAllOperatorConsAddrs() *cobra.Command { flags.AddQueryFlagsToCmd(cmd) return cmd } + +// QueryOperatorUSDValue queries the opted-in USD value for the operator +func QueryOperatorUSDValue() *cobra.Command { + cmd := &cobra.Command{ + Use: "QueryOperatorUSDValue operatorAddr avsAddr", + Short: "Get the opted-in USD value for the operator", + Long: "Get the opted-in USD value for the operator", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + _, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return xerrors.Errorf("invalid operator address,err:%s", err.Error()) + } + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := operatortypes.NewQueryClient(clientCtx) + req := &operatortypes.QueryOperatorUSDValueRequest{ + Details: &operatortypes.OperatorAVSAddressDetails{ + OperatorAddr: args[0], + AVSAddress: args[1], + }, + } + res, err := queryClient.QueryOperatorUSDValue(context.Background(), req) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// QueryAVSUSDValue queries the USD value for the avs +func QueryAVSUSDValue() *cobra.Command { + cmd := &cobra.Command{ + Use: "QueryAVSUSDValue avsAddr", + Short: "Get the USD value for the avs", + Long: "Get the USD value for the avs", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := operatortypes.NewQueryClient(clientCtx) + req := &operatortypes.QueryAVSUSDValueRequest{ + AVSAddress: args[0], + } + res, err := queryClient.QueryAVSUSDValue(context.Background(), req) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// QueryOperatorSlashInfo queries the slash information for the specified operator and AVS +func QueryOperatorSlashInfo() *cobra.Command { + cmd := &cobra.Command{ + Use: "QueryOperatorSlashInfo operatorAddr avsAddr", + Short: "Get the the slash information for the operator", + Long: "Get the the slash information for the operator", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + _, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return xerrors.Errorf("invalid operator address,err:%s", err.Error()) + } + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + queryClient := operatortypes.NewQueryClient(clientCtx) + req := &operatortypes.QueryOperatorSlashInfoRequest{ + Details: &operatortypes.OperatorAVSAddressDetails{ + OperatorAddr: args[0], + AVSAddress: args[1], + }, + Pagination: pageReq, + } + res, err := queryClient.QueryOperatorSlashInfo(context.Background(), req) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/operator/keeper/abci.go b/x/operator/keeper/abci.go index 57b9e9407..340bec56f 100644 --- a/x/operator/keeper/abci.go +++ b/x/operator/keeper/abci.go @@ -7,37 +7,75 @@ import ( operatortypes "github.com/ExocoreNetwork/exocore/x/operator/types" abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" + "golang.org/x/xerrors" ) // CalculateUSDValueForOperator calculates the total and self usd value for the // operator according to the input assets filter and prices. +// This function will be used in slashing calculations and voting power updates per epoch. +// The inputs/outputs and calculation logic for these two cases are different, +// so an `isForSlash` flag is used to distinguish between them. +// When it's called by the voting power update, the needed outputs are the current total +// staking amount and the self-staking amount of the operator. The current total +// staking amount excludes the pending unbonding amount, so it's used to calculate the voting power. +// The self-staking amount is also needed to check if the operator's self-staking is sufficient. +// At the same time, the prices of all assets have been retrieved in the caller's function, so they +// are inputted as a parameter. +// When it's called by the slash execution, the needed output is the sum of the current total amount and +// the pending unbonding amount, because the undelegation also needs to be slashed. And the prices of +// all assets haven't been prepared by the caller, so the prices should be retrieved in this function. func (k *Keeper) CalculateUSDValueForOperator( ctx sdk.Context, + isForSlash bool, operator string, assetsFilter map[string]interface{}, decimals map[string]uint32, prices map[string]operatortypes.Price, -) (sdkmath.LegacyDec, sdkmath.LegacyDec, error) { - usdValue := sdkmath.LegacyNewDec(0) - selfUSDValue := sdkmath.LegacyNewDec(0) +) (operatortypes.OperatorUSDValue, error) { + var err error + ret := operatortypes.OperatorUSDValue{ + Staking: sdkmath.LegacyNewDec(0), + SelfStaking: sdkmath.LegacyNewDec(0), + StakingAndWaitUnbonding: sdkmath.LegacyNewDec(0), + } // iterate all assets owned by the operator to calculate its voting power opFuncToIterateAssets := func(assetID string, state *assetstypes.OperatorAssetInfo) error { - price := prices[assetID] - decimal := decimals[assetID] - usdValue = usdValue.Add(CalculateUSDValue(state.TotalAmount, price.Value, decimal, price.Decimal)) - // calculate the token amount from the share for the operator - selfAmount, err := delegationkeeper.TokensFromShares(state.OperatorShare, state.TotalShare, state.TotalAmount) - if err != nil { - return err + var price operatortypes.Price + var decimal uint32 + if isForSlash { + // when calculated the USD value for slashing, the input prices map is null + // so the price needs to be retrieved here + price, err = k.oracleKeeper.GetSpecifiedAssetsPrice(ctx, assetID) + if err != nil { + return err + } + assetInfo, err := k.assetsKeeper.GetStakingAssetInfo(ctx, assetID) + if err != nil { + return err + } + decimal = assetInfo.AssetBasicInfo.Decimals + ret.StakingAndWaitUnbonding = ret.StakingAndWaitUnbonding.Add(CalculateUSDValue(state.TotalAmount.Add(state.WaitUnbondingAmount), price.Value, decimal, price.Decimal)) + } else { + if prices == nil { + return xerrors.Errorf("CalculateUSDValueForOperator, the input prices map is nil") + } + price = prices[assetID] + decimal = decimals[assetID] + ret.Staking = ret.Staking.Add(CalculateUSDValue(state.TotalAmount, price.Value, decimal, price.Decimal)) + // calculate the token amount from the share for the operator + selfAmount, err := delegationkeeper.TokensFromShares(state.OperatorShare, state.TotalShare, state.TotalAmount) + if err != nil { + return err + } + ret.SelfStaking = ret.SelfStaking.Add(CalculateUSDValue(selfAmount, price.Value, decimal, price.Decimal)) } - selfUSDValue = selfUSDValue.Add(CalculateUSDValue(selfAmount, price.Value, decimal, price.Decimal)) return nil } - err := k.assetsKeeper.IteratorAssetsForOperator(ctx, operator, assetsFilter, opFuncToIterateAssets) + err = k.assetsKeeper.IteratorAssetsForOperator(ctx, false, operator, assetsFilter, opFuncToIterateAssets) if err != nil { - return sdkmath.LegacyDec{}, sdkmath.LegacyDec{}, err + return ret, err } - return usdValue, selfUSDValue, nil + return ret, nil } // UpdateVotingPower update the voting power of the specified AVS and its operators at @@ -71,12 +109,12 @@ func (k *Keeper) UpdateVotingPower(ctx sdk.Context, avsAddr string) error { opFunc := func(operator string, votingPower *sdkmath.LegacyDec) error { // clear the old voting power for the operator *votingPower = sdkmath.LegacyNewDec(0) - usdValue, selfUSDValue, err := k.CalculateUSDValueForOperator(ctx, operator, assets, decimals, prices) + usdValues, err := k.CalculateUSDValueForOperator(ctx, false, operator, assets, decimals, prices) if err != nil { return err } - if selfUSDValue.GTE(minimumSelfDelegation) { - *votingPower = votingPower.Add(usdValue) + if usdValues.SelfStaking.GTE(minimumSelfDelegation) { + *votingPower = votingPower.Add(usdValues.Staking) avsVotingPower = avsVotingPower.Add(*votingPower) } return nil diff --git a/x/operator/keeper/grpc_query.go b/x/operator/keeper/grpc_query.go index 30040819b..e838bbf3e 100644 --- a/x/operator/keeper/grpc_query.go +++ b/x/operator/keeper/grpc_query.go @@ -4,6 +4,8 @@ import ( "context" "errors" + assetstype "github.com/ExocoreNetwork/exocore/x/assets/types" + operatortypes "github.com/ExocoreNetwork/exocore/x/operator/types" tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" "github.com/cosmos/cosmos-sdk/store/prefix" @@ -172,3 +174,53 @@ func (k Keeper) QueryAllOperatorConsAddrsByChainID( Pagination: pageRes, }, nil } + +func (k *Keeper) QueryOperatorUSDValue(ctx context.Context, req *operatortypes.QueryOperatorUSDValueRequest) (*operatortypes.DecValueField, error) { + c := sdk.UnwrapSDKContext(ctx) + usdValue, err := k.GetOperatorUSDValue(c, req.Details.AVSAddress, req.Details.OperatorAddr) + if err != nil { + return nil, err + } + return &operatortypes.DecValueField{ + Amount: usdValue, + }, nil +} + +func (k *Keeper) QueryAVSUSDValue(ctx context.Context, req *operatortypes.QueryAVSUSDValueRequest) (*operatortypes.DecValueField, error) { + c := sdk.UnwrapSDKContext(ctx) + usdValue, err := k.GetAVSUSDValue(c, req.AVSAddress) + if err != nil { + return nil, err + } + return &operatortypes.DecValueField{ + Amount: usdValue, + }, nil +} + +func (k *Keeper) QueryOperatorSlashInfo(goCtx context.Context, req *operatortypes.QueryOperatorSlashInfoRequest) (*operatortypes.QueryOperatorSlashInfoResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + res := make([]*operatortypes.OperatorSlashInfoByID, 0) + + slashPrefix := operatortypes.AppendMany(operatortypes.KeyPrefixOperatorSlashInfo, assetstype.GetJoinedStoreKeyForPrefix(req.Details.OperatorAddr, req.Details.AVSAddress)) + store := prefix.NewStore(ctx.KVStore(k.storeKey), slashPrefix) + pageRes, err := query.Paginate(store, req.Pagination, func(key []byte, value []byte) error { + ret := &operatortypes.OperatorSlashInfo{} + // don't use MustUnmarshal to not panic for queries + if err := ret.Unmarshal(value); err != nil { + return err + } + + res = append(res, &operatortypes.OperatorSlashInfoByID{ + SlashID: string(key), + Info: ret, + }) + return nil + }) + if err != nil { + return nil, err + } + return &operatortypes.QueryOperatorSlashInfoResponse{ + AllSlashInfo: res, + Pagination: pageRes, + }, nil +} diff --git a/x/operator/keeper/keeper.go b/x/operator/keeper/keeper.go index 144ae2241..bf0c0a0c9 100644 --- a/x/operator/keeper/keeper.go +++ b/x/operator/keeper/keeper.go @@ -3,9 +3,11 @@ package keeper import ( "context" + sdkmath "cosmossdk.io/math" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ExocoreNetwork/exocore/x/assets/types" - sdkmath "cosmossdk.io/math" operatortypes "github.com/ExocoreNetwork/exocore/x/operator/types" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -69,7 +71,12 @@ type OperatorKeeper interface { OptOut(ctx sdk.Context, OperatorAddress sdk.AccAddress, AVSAddr string) error - NoInstantaneousSlash(ctx sdk.Context, operatorAddress sdk.AccAddress, AVSAddr, slashContract, slashID string, occurredSateHeight int64, slashProportion sdkmath.LegacyDec) error + Slash(ctx sdk.Context, parameter *operatortypes.SlashInputInfo) error + + SlashWithInfractionReason( + ctx sdk.Context, addr sdk.AccAddress, infractionHeight, power int64, + slashFactor sdk.Dec, infraction stakingtypes.Infraction, + ) sdkmath.Int } // SetHooks stores the given hooks implementations. diff --git a/x/operator/keeper/operator_slash_state.go b/x/operator/keeper/operator_slash_state.go index be6a9c82a..4644b7645 100644 --- a/x/operator/keeper/operator_slash_state.go +++ b/x/operator/keeper/operator_slash_state.go @@ -1,8 +1,6 @@ package keeper import ( - "fmt" - assetstype "github.com/ExocoreNetwork/exocore/x/assets/types" errorsmod "cosmossdk.io/errors" @@ -27,18 +25,22 @@ func (k *Keeper) UpdateOperatorSlashInfo(ctx sdk.Context, operatorAddr, avsAddr, } slashInfoKey := assetstype.GetJoinedStoreKey(operatorAddr, avsAddr, slashID) if store.Has(slashInfoKey) { - return errorsmod.Wrap(operatortypes.ErrSlashInfoExist, fmt.Sprintf("slashInfoKey:%s", slashInfoKey)) + return errorsmod.Wrapf(operatortypes.ErrSlashInfoExist, "slashInfoKey:%s", slashInfoKey) } // check the validation of slash info - if slashInfo.SlashContract == "" { - return errorsmod.Wrap(operatortypes.ErrSlashInfo, fmt.Sprintf("err slashContract:%s", slashInfo.SlashContract)) + slashContract, err := k.avsKeeper.GetAVSSlashContract(ctx, avsAddr) + if err != nil { + return err + } + if slashInfo.SlashContract != slashContract { + return errorsmod.Wrapf(operatortypes.ErrSlashInfo, "err slashContract:%s, stored contract:%s", slashInfo.SlashContract, slashContract) } if slashInfo.EventHeight > slashInfo.SubmittedHeight { - return errorsmod.Wrap(operatortypes.ErrSlashInfo, fmt.Sprintf("err SubmittedHeight:%v,EventHeight:%v", slashInfo.SubmittedHeight, slashInfo.EventHeight)) + return errorsmod.Wrapf(operatortypes.ErrSlashInfo, "err SubmittedHeight:%v,EventHeight:%v", slashInfo.SubmittedHeight, slashInfo.EventHeight) } if slashInfo.SlashProportion.IsNil() || slashInfo.SlashProportion.IsNegative() || slashInfo.SlashProportion.GT(sdkmath.LegacyNewDec(1)) { - return errorsmod.Wrap(operatortypes.ErrSlashInfo, fmt.Sprintf("err SlashProportion:%v", slashInfo.SlashProportion)) + return errorsmod.Wrapf(operatortypes.ErrSlashInfo, "err SlashProportion:%v", slashInfo.SlashProportion) } // save single operator delegation state @@ -55,13 +57,33 @@ func (k *Keeper) GetOperatorSlashInfo(ctx sdk.Context, avsAddr, operatorAddr, sl slashInfoKey := assetstype.GetJoinedStoreKey(operatorAddr, avsAddr, slashID) value := store.Get(slashInfoKey) if value == nil { - return nil, errorsmod.Wrap(operatortypes.ErrNoKeyInTheStore, fmt.Sprintf("GetOperatorSlashInfo: key is %s", slashInfoKey)) + return nil, errorsmod.Wrapf(operatortypes.ErrNoKeyInTheStore, "GetOperatorSlashInfo: key is %s", slashInfoKey) } operatorSlashInfo := operatortypes.OperatorSlashInfo{} k.cdc.MustUnmarshal(value, &operatorSlashInfo) return &operatorSlashInfo, nil } +// AllOperatorSlashInfo return all slash information for the specified operator and AVS +func (k *Keeper) AllOperatorSlashInfo(ctx sdk.Context, avsAddr, operatorAddr string) (map[string]*operatortypes.OperatorSlashInfo, error) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixOperatorSlashInfo) + prefix := assetstype.GetJoinedStoreKey(operatorAddr, avsAddr) + + ret := make(map[string]*operatortypes.OperatorSlashInfo, 0) + iterator := sdk.KVStorePrefixIterator(store, prefix) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + var slashInfo operatortypes.OperatorSlashInfo + k.cdc.MustUnmarshal(iterator.Value(), &slashInfo) + keys, err := assetstype.ParseJoinedKey(iterator.Key()) + if err != nil { + return nil, err + } + ret[keys[2]] = &slashInfo + } + return ret, nil +} + // UpdateSlashAssetsState This is a function to update the assets amount that need to be slashed // The stored state is: // KeyPrefixSlashAssetsState key-value: @@ -79,7 +101,7 @@ func (k *Keeper) UpdateSlashAssetsState(ctx sdk.Context, assetID, stakerOrOperat store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixSlashAssetsState) var key []byte if stakerOrOperator == "" || assetID == "" { - return errorsmod.Wrap(operatortypes.ErrParameterInvalid, fmt.Sprintf("assetID:%s,stakerOrOperator:%s", assetID, stakerOrOperator)) + return errorsmod.Wrapf(operatortypes.ErrParameterInvalid, "assetID:%s,stakerOrOperator:%s", assetID, stakerOrOperator) } key = assetstype.GetJoinedStoreKey(hexutil.EncodeUint64(processedHeight), assetID, stakerOrOperator) @@ -126,7 +148,7 @@ func (k *Keeper) GetSlashAssetsState(ctx sdk.Context, assetID, stakerOrOperator } value := store.Get(key) if value == nil { - return sdkmath.Int{}, errorsmod.Wrap(operatortypes.ErrNoKeyInTheStore, fmt.Sprintf("GetSlashAssetsState: key is %s", key)) + return sdkmath.Int{}, errorsmod.Wrapf(operatortypes.ErrNoKeyInTheStore, "GetSlashAssetsState: key is %s", key) } var ret assetstype.ValueField k.cdc.MustUnmarshal(value, &ret) diff --git a/x/operator/keeper/opt.go b/x/operator/keeper/opt.go index 1c474a447..4d4463b1f 100644 --- a/x/operator/keeper/opt.go +++ b/x/operator/keeper/opt.go @@ -85,7 +85,8 @@ func (k *Keeper) OptOut(ctx sdk.Context, operatorAddress sdk.AccAddress, avsAddr // DeleteOperatorUSDValue, delete the operator voting power, it can facilitate to // update the voting powers of all opted-in operators at the end of epoch. - // there isn't going to be any reward for the operator in this opted-out epoch. + // There might still be a reward for the operator in this opted-out epoch, + // which is determined by the reward logic. err = k.DeleteOperatorUSDValue(ctx, avsAddr, operatorAddress.String()) if err != nil { return err diff --git a/x/operator/keeper/opt_test.go b/x/operator/keeper/opt_test.go index 049df7c11..3b2ea59ed 100644 --- a/x/operator/keeper/opt_test.go +++ b/x/operator/keeper/opt_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "fmt" "strings" abci "github.com/cometbft/cometbft/abci/types" @@ -109,6 +110,7 @@ func (suite *OperatorTestSuite) CheckState(expectedState *StateForCheck) { value, err = suite.App.OperatorKeeper.GetOperatorUSDValue(suite.Ctx, suite.avsAddr, suite.operatorAddr.String()) if expectedState.AVSOperatorShare.IsNil() { + fmt.Println("the err is:", err) suite.True(strings.Contains(err.Error(), operatorTypes.ErrNoKeyInTheStore.Error())) } else { suite.NoError(err) @@ -160,7 +162,7 @@ func (suite *OperatorTestSuite) TestOptOut() { OptedOutHeight: uint64(suite.Ctx.BlockHeight()), }, AVSTotalShare: sdkmath.LegacyNewDec(0), - AVSOperatorShare: sdkmath.LegacyDec{}, + AVSOperatorShare: sdkmath.LegacyNewDec(0), AssetState: nil, OperatorShare: sdkmath.LegacyDec{}, StakerShare: sdkmath.LegacyDec{}, @@ -168,17 +170,3 @@ func (suite *OperatorTestSuite) TestOptOut() { suite.App.OperatorKeeper.EndBlock(suite.Ctx, abci.RequestEndBlock{}) suite.CheckState(expectedState) } - -func (suite *OperatorTestSuite) TestSlash() { - suite.prepare() - err := suite.App.OperatorKeeper.OptIn(suite.Ctx, suite.operatorAddr, suite.avsAddr) - suite.NoError(err) - optInHeight := suite.Ctx.BlockHeight() - - // run to the block at specified height - runToHeight := optInHeight + 10 - for i := optInHeight; i < runToHeight; i++ { - suite.NextBlock() - } - suite.Equal(runToHeight, suite.Ctx.BlockHeight()) -} diff --git a/x/operator/keeper/slash.go b/x/operator/keeper/slash.go index aa0c72057..82ce3bfee 100644 --- a/x/operator/keeper/slash.go +++ b/x/operator/keeper/slash.go @@ -3,8 +3,6 @@ package keeper import ( "fmt" - delegationkeeper "github.com/ExocoreNetwork/exocore/x/delegation/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/ethereum/go-ethereum/common/hexutil" @@ -17,26 +15,18 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -type SlashInputInfo struct { - SlashType types.SlashType - Operator sdk.AccAddress - AVSAddr string - SlashContract string - SlashID string - SlashEventHeight int64 - SlashProportion sdkmath.LegacyDec -} - // GetSlashIDForDogfood It use infractionType+'/'+'infractionHeight' as the slashID, because the slash event occurs in dogfood doesn't have a TxID. It isn't submitted through an external transaction. func GetSlashIDForDogfood(infraction stakingtypes.Infraction, infractionHeight int64) string { // #nosec G701 return string(assetstype.GetJoinedStoreKey(hexutil.EncodeUint64(uint64(infraction)), hexutil.EncodeUint64(uint64(infractionHeight)))) } -func SlashFromUndelegation(undelegation *delegationtype.UndelegationRecord, totalSlashAmount, slashAmount sdkmath.Int) (sdkmath.Int, error) { +// SlashFromUndelegation executes the slash from an undelegation +func SlashFromUndelegation(undelegation *delegationtype.UndelegationRecord, slashProportion sdkmath.LegacyDec) *types.SlashFromUndelegation { if undelegation.ActualCompletedAmount.IsZero() { - return totalSlashAmount, nil + return nil } + slashAmount := slashProportion.MulInt(undelegation.Amount).TruncateInt() // reduce the actual_completed_amount in the record if slashAmount.GTE(undelegation.ActualCompletedAmount) { slashAmount = undelegation.ActualCompletedAmount @@ -44,174 +34,63 @@ func SlashFromUndelegation(undelegation *delegationtype.UndelegationRecord, tota } else { undelegation.ActualCompletedAmount = undelegation.ActualCompletedAmount.Sub(slashAmount) } - // slashing from the operator isn't needed if the remainingSlashAmount isn't positive - remainingSlashAmount := totalSlashAmount.Sub(slashAmount) - return remainingSlashAmount, nil + + return &types.SlashFromUndelegation{ + StakerID: undelegation.StakerID, + AssetID: undelegation.AssetID, + Amount: slashAmount, + } } -func (k *Keeper) VerifySlashEvent(ctx sdk.Context, parameter *SlashInputInfo) (sdk.Context, error) { +func (k *Keeper) CheckSlashParameter(ctx sdk.Context, parameter *types.SlashInputInfo) error { height := ctx.BlockHeight() if parameter.SlashEventHeight > height { - return ctx, errorsmod.Wrap(types.ErrSlashOccurredHeight, fmt.Sprintf("slashEventHeight:%d,curHeight:%d", parameter.SlashEventHeight, height)) - } - - // get the state when the slash occurred - // get the opted-in info - // When the slash occurs, retrieves the end block height of the epoch - // where the used voting power resides. - heightForVotingPower, err := k.avsKeeper.GetHeightForVotingPower(ctx, parameter.AVSAddr, parameter.SlashEventHeight) - if err != nil { - return ctx, err - } - if k.historicalCtx == nil { - return ctx, errorsmod.Wrap(types.ErrValueIsNilOrZero, "VerifySlashEvent the historicalCtx is nil") + return errorsmod.Wrap(types.ErrSlashOccurredHeight, fmt.Sprintf("slashEventHeight:%d,curHeight:%d", parameter.SlashEventHeight, height)) } - historicalStateCtx, err := k.historicalCtx(heightForVotingPower, false) - if err != nil { - return ctx, err - } - if !k.IsOptedIn(ctx, parameter.Operator.String(), parameter.AVSAddr) { - return ctx, types.ErrNotOptedIn - } - optedInfo, err := k.GetOptedInfo(historicalStateCtx, parameter.Operator.String(), parameter.AVSAddr) - if err != nil { - return ctx, err - } - if optedInfo.SlashContract != parameter.SlashContract { - return ctx, errorsmod.Wrap(types.ErrSlashContractNotMatch, fmt.Sprintf("input slashContract:%s, opted-in slash contract:%suite", parameter.SlashContract, optedInfo.SlashContract)) - } - - return historicalStateCtx, nil -} -// NoInstantaneousSlash indicates that the slash event will be processed after a certain -// period of time, thus requiring a reduction in the share of the corresponding staker. -// It will slash the assets from the undelegation firstly, then slash the asset from the -// staker's share. -// Compared to the instant slash, the con is the handling isn't efficient, but the pro is -// there isn't any slash mistake for the new-coming delegations after the slash event. -func (k *Keeper) NoInstantaneousSlash(ctx, historicalStateCtx sdk.Context, parameter *SlashInputInfo) error { - // get assetsInfo supported by AVS - assetsFilter, err := k.avsKeeper.GetAVSSupportedAssets(historicalStateCtx, parameter.AVSAddr) - if err != nil { - return err - } - for assetID := range assetsFilter { - historyOperatorAsset, err := k.assetsKeeper.GetOperatorSpecifiedAssetInfo(historicalStateCtx, parameter.Operator, assetID) - if err != nil { - return err - } - stakerList, err := k.delegationKeeper.GetStakersByOperator(historicalStateCtx, parameter.Operator.String(), assetID) - if err != nil { - return err + if parameter.IsDogFood { + if parameter.Power <= 0 { + return errorsmod.Wrapf(types.ErrInvalidSlashPower, "slash for dogfood, the power is:%v", parameter.Power) } - // slash the staker share according to the historical and current state - for _, stakerID := range stakerList.Stakers { - delegationState, err := k.delegationKeeper.GetSingleDelegationInfo(historicalStateCtx, stakerID, assetID, parameter.Operator.String()) - if err != nil { - return err - } - assetAmount, err := delegationkeeper.TokensFromShares(delegationState.UndelegatableShare, historyOperatorAsset.TotalShare, historyOperatorAsset.TotalAmount) - if err != nil { - return err - } - shouldSlashAmount := parameter.SlashProportion.MulInt(assetAmount).TruncateInt() - // slash the asset from the undelegation firstly. - undelegations, err := k.delegationKeeper.GetStakerUndelegationRecords(ctx, stakerID, assetID) - if err != nil { - return err - } - isSlashFromShare := true - for _, undelegation := range undelegations { - if undelegation.OperatorAddr == parameter.Operator.String() { - remainingSlashAmount, err := SlashFromUndelegation(undelegation, shouldSlashAmount, shouldSlashAmount) - if err != nil { - return err - } - // update the undelegation state - _, err = k.delegationKeeper.SetSingleUndelegationRecord(ctx, undelegation) - if err != nil { - return err - } - if remainingSlashAmount.IsZero() { - // all amount has been slashed from the undelegaion, - // so the share of staker shouldn't be slashed. - isSlashFromShare = false - break - } - // slash the remaining amount from the next undelegation - shouldSlashAmount = remainingSlashAmount - } - } - // slash the asset from the staker's asset share if there is still remaining slash amount after - // slashing from the undelegation. - if isSlashFromShare { - slashShare, err := k.delegationKeeper.CalculateSlashShare(ctx, parameter.Operator, stakerID, assetID, shouldSlashAmount) - if err != nil { - return err - } - _, err = k.delegationKeeper.RemoveShare(ctx, false, parameter.Operator, stakerID, assetID, slashShare) - if err != nil { - return err - } - } + } else { + if parameter.Power != 0 { + return errorsmod.Wrapf(types.ErrInvalidSlashPower, "slash for other AVSs, the power is:%v", parameter.Power) } + // todo: get the historical voting power from the snapshot for the other AVSs } return nil } -// InstantSlash represents the slash events that will be handled instantly after occurring -// so the slash will reduce the amount of related operator's assets pool. -// The implementation is similar to the cosmos-sdk, but the difference is the comos-sdk -// slashes a proportion from every undelegations, which may result in the actual total slash amount is greater -// than intended. But this function won't slash the remaining undelegation if the total slash amount -// is reached. So some undelegations might escape from the slash because of the other new-coming -// delegations. -// The new delegated assets after the slash event might be slashed incorrectly, which is same as cosmos-sdk. -// So this function only apply to the situation that the slash events will be handled instantly after occurring. -// The pro is that the handling is more efficient compared to the no-instantaneous slash. -func (k *Keeper) InstantSlash(ctx, historicalStateCtx sdk.Context, parameter *SlashInputInfo) error { - // todo: should we check if the slashEventHeight is too smaller than the current block height? - // Then force the AVS using the `NoInstantaneousSlash` if the slash event is too old - // This may depend on the level of authority we want to grant to AVS when - // setting their own slash logic. - - slashAssets := make(map[string]sdkmath.Int, 0) - // get assetsInfo supported by AVS - assetsFilter, err := k.avsKeeper.GetAVSSupportedAssets(historicalStateCtx, parameter.AVSAddr) +// SlashAssets slash the assets according to the new calculated proportion +// It slashs the undelegation first, then slash the assets pool of the related operator +// If the remaining amount of the assets pool after slash is zero, the share of related +// stakers should be cleared, because the divisor will be zero when calculating the share +// of new delegation after the slash. +func (k *Keeper) SlashAssets(ctx sdk.Context, parameter *types.SlashInputInfo) (*types.SlashExecutionInfo, error) { + // calculate the new slash proportion according to the historical power and current assets state + slashUSDValue := sdkmath.LegacyNewDec(parameter.Power).Mul(parameter.SlashProportion) + // calculate the current usd value of all assets pool for the operator + usdValues, err := k.CalculateUSDValueForOperator(ctx, true, parameter.Operator.String(), nil, nil, nil) if err != nil { - return err + return nil, err } + // calculate the new slash proportion + newSlashProportion := slashUSDValue.Quo(usdValues.StakingAndWaitUnbonding) + newSlashProportion = sdkmath.LegacyMinDec(sdkmath.LegacyNewDec(1), newSlashProportion) - // get the Assets opted in the operator - historyOperatorAssets, err := k.assetsKeeper.GetOperatorAssetInfos(historicalStateCtx, parameter.Operator, assetsFilter) - if err != nil { - return err + executionInfo := &types.SlashExecutionInfo{ + SlashProportion: newSlashProportion, + SlashValue: slashUSDValue, + SlashUndelegations: make([]*types.SlashFromUndelegation, 0), + SlashAssetsPool: make([]*types.SlashFromAssetsPool, 0), } - - // calculate the assets amount that should be slashed - for assetID, state := range historyOperatorAssets { - slashAmount := parameter.SlashProportion.MulInt(state.TotalAmount).TruncateInt() - slashAssets[assetID] = slashAmount - } - // slash from the unbonding stakers if parameter.SlashEventHeight < ctx.BlockHeight() { // get the undelegations that are submitted after the slash. opFunc := func(undelegation *delegationtype.UndelegationRecord) error { - totalSlashAmount, ok := slashAssets[undelegation.AssetID] - if ok { - slashAmount := parameter.SlashProportion.MulInt(undelegation.Amount).TruncateInt() - remainingSlashAmount, err := SlashFromUndelegation(undelegation, totalSlashAmount, slashAmount) - if err != nil { - return err - } - // slashing from the operator isn't needed if the remainingSlashAmount isn't positive - if !remainingSlashAmount.IsPositive() { - delete(slashAssets, undelegation.AssetID) - } else { - slashAssets[undelegation.AssetID] = remainingSlashAmount - } + slashFromUndelegation := SlashFromUndelegation(undelegation, newSlashProportion) + if slashFromUndelegation != nil { + executionInfo.SlashUndelegations = append(executionInfo.SlashUndelegations, slashFromUndelegation) } return nil } @@ -219,29 +98,21 @@ func (k *Keeper) InstantSlash(ctx, historicalStateCtx sdk.Context, parameter *Sl heightFilter := uint64(parameter.SlashEventHeight) err = k.delegationKeeper.IterateUndelegationsByOperator(ctx, parameter.Operator.String(), &heightFilter, true, opFunc) if err != nil { - return err + return nil, err } } - // slash the remaining from the assets pool of the operator - for assetID, slashAmount := range slashAssets { - operatorAsset, err := k.assetsKeeper.GetOperatorSpecifiedAssetInfo(ctx, parameter.Operator, assetID) - if err != nil { - return err - } - isClearUselessShare := false - if slashAmount.GTE(operatorAsset.TotalAmount) { - slashAmount = operatorAsset.TotalAmount - isClearUselessShare = true - } + // slash from the assets pool of the operator + opFuncToIterateAssets := func(assetID string, state *assetstype.OperatorAssetInfo) error { + slashAmount := newSlashProportion.MulInt(state.TotalAmount).TruncateInt() + remainingAmount := state.TotalAmount.Sub(slashAmount) + // todo: consider slash all assets if the remaining amount is too small, + // which can avoid the unbalance between share and amount - changeAmount := assetstype.DeltaOperatorSingleAsset{ - TotalAmount: slashAmount.Neg(), - } // all shares need to be cleared if the asset amount is slashed to zero, // otherwise there will be a problem in updating the shares when handling // the new delegations. - if isClearUselessShare { + if remainingAmount.IsZero() { // clear the share of other stakers stakerList, err := k.delegationKeeper.GetStakersByOperator(ctx, parameter.Operator.String(), assetID) if err != nil { @@ -255,46 +126,45 @@ func (k *Keeper) InstantSlash(ctx, historicalStateCtx sdk.Context, parameter *Sl if err != nil { return err } - changeAmount.TotalShare = sdkmath.LegacyNewDec(0) - changeAmount.OperatorAmount = sdkmath.NewInt(0) - changeAmount.OperatorShare = sdkmath.LegacyNewDec(0) - } - - err = k.assetsKeeper.UpdateOperatorAssetState(ctx, parameter.Operator, assetID, changeAmount) - if err != nil { - return err + state.TotalShare = sdkmath.LegacyNewDec(0) + state.OperatorAmount = sdkmath.NewInt(0) + state.OperatorShare = sdkmath.LegacyNewDec(0) } + state.TotalAmount = remainingAmount + executionInfo.SlashAssetsPool = append(executionInfo.SlashAssetsPool, &types.SlashFromAssetsPool{ + AssetID: assetID, + Amount: slashAmount, + }) + return nil } - return nil + err = k.assetsKeeper.IteratorAssetsForOperator(ctx, true, parameter.Operator.String(), nil, opFuncToIterateAssets) + if err != nil { + return nil, err + } + return executionInfo, nil } -// Slash performs all slash events include instant slash and no-instantaneous slash. -func (k *Keeper) Slash(ctx sdk.Context, parameter *SlashInputInfo) error { - historicalStateCtx, err := k.VerifySlashEvent(ctx, parameter) +// Slash performs all slash events and stores the execution result +func (k *Keeper) Slash(ctx sdk.Context, parameter *types.SlashInputInfo) error { + err := k.CheckSlashParameter(ctx, parameter) if err != nil { return err } - switch parameter.SlashType { - case types.SlashType_SLASH_TYPE_INSTANT_SLASH: - err = k.InstantSlash(ctx, historicalStateCtx, parameter) - case types.SlashType_SLASH_TYPE_NO_INSTANTANEOUS_SLASH: - err = k.NoInstantaneousSlash(ctx, historicalStateCtx, parameter) - default: - return errorsmod.Wrap(types.ErrInvalidSlashType, fmt.Sprintf("the slash type is:%v", parameter.SlashType)) - } + + // slash assets according to the input information + executionInfo, err := k.SlashAssets(ctx, parameter) if err != nil { return err } - - // todo: recording the slash event might be moved to the slash module + // store the slash information height := ctx.BlockHeight() slashInfo := types.OperatorSlashInfo{ + SlashType: parameter.SlashType, SlashContract: parameter.SlashContract, SubmittedHeight: height, EventHeight: parameter.SlashEventHeight, SlashProportion: parameter.SlashProportion, - ProcessedHeight: height + types.SlashVetoDuration, - SlashType: parameter.SlashType, + ExecutionInfo: executionInfo, } err = k.UpdateOperatorSlashInfo(ctx, parameter.Operator.String(), parameter.AVSAddr, parameter.SlashID, slashInfo) if err != nil { @@ -305,37 +175,31 @@ func (k *Keeper) Slash(ctx sdk.Context, parameter *SlashInputInfo) error { // SlashWithInfractionReason is an expected slash interface for the dogfood module. func (k Keeper) SlashWithInfractionReason( - ctx sdk.Context, addr sdk.AccAddress, infractionHeight, _ int64, + ctx sdk.Context, addr sdk.AccAddress, infractionHeight, power int64, slashFactor sdk.Dec, infraction stakingtypes.Infraction, ) sdkmath.Int { - // todo: disable the slash currently, waiting for the new slash implementation - k.Logger(ctx).Info("slash occurs", addr, infractionHeight, slashFactor, infraction) - /* chainID := ctx.ChainID() - avsAddr, err := k.avsKeeper.GetAVSAddrByChainID(ctx, chainID) - if err != nil { - k.Logger(ctx).Error(err.Error(), chainID) - return sdkmath.NewInt(0) - } - slashContract, err := k.avsKeeper.GetAVSSlashContract(ctx, avsAddr) - if err != nil { - k.Logger(ctx).Error(err.Error(), avsAddr) - return sdkmath.NewInt(0) - } - slashID := GetSlashIDForDogfood(infraction, infractionHeight) - slashParam := &SlashInputInfo{ - SlashType: types.SlashType_SLASH_TYPE_INSTANT_SLASH, - Operator: addr, - AVSAddr: avsAddr, - SlashContract: slashContract, - SlashID: slashID, - SlashEventHeight: infractionHeight, - SlashProportion: slashFactor, - } - err = k.Slash(ctx, slashParam) - if err != nil { - k.Logger(ctx).Error(err.Error(), avsAddr) - return sdkmath.NewInt(0) - }*/ + chainID := ctx.ChainID() + avsAddr, err := k.avsKeeper.GetAVSAddrByChainID(ctx, chainID) + if err != nil { + k.Logger(ctx).Error(err.Error(), chainID) + return sdkmath.NewInt(0) + } + slashID := GetSlashIDForDogfood(infraction, infractionHeight) + slashParam := &types.SlashInputInfo{ + IsDogFood: true, + Power: power, + SlashType: uint32(infraction), + Operator: addr, + AVSAddr: avsAddr, + SlashID: slashID, + SlashEventHeight: infractionHeight, + SlashProportion: slashFactor, + } + err = k.Slash(ctx, slashParam) + if err != nil { + k.Logger(ctx).Error(err.Error(), avsAddr) + return sdkmath.NewInt(0) + } // todo: The returned value should be the amount of burned Exo if we considering a slash from the reward // Now it doesn't slash from the reward, so just return 0 return sdkmath.NewInt(0) diff --git a/x/operator/keeper/slash_test.go b/x/operator/keeper/slash_test.go new file mode 100644 index 000000000..dc9b1d4cf --- /dev/null +++ b/x/operator/keeper/slash_test.go @@ -0,0 +1,95 @@ +package keeper_test + +import ( + sdkmath "cosmossdk.io/math" + "github.com/ExocoreNetwork/exocore/x/operator/keeper" + "github.com/ExocoreNetwork/exocore/x/operator/types" + abci "github.com/cometbft/cometbft/abci/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ethereum/go-ethereum/common" +) + +func (suite *OperatorTestSuite) TestSlashWithInfractionReason() { + // prepare the deposit and delegation + suite.prepareOperator() + usdtAddress := common.HexToAddress("0xdAC17F958D2ee523a2206206994597C13D831ec7") + assetDecimal := 6 + depositAmount := sdkmath.NewIntWithDecimal(100, assetDecimal) + suite.prepareDeposit(usdtAddress, depositAmount) + delegationAmount := sdkmath.NewIntWithDecimal(50, assetDecimal) + suite.prepareDelegation(true, suite.assetAddr, delegationAmount) + + // opt into the AVS + avsAddr := suite.Ctx.ChainID() + err := suite.App.OperatorKeeper.OptIn(suite.Ctx, suite.operatorAddr, avsAddr) + suite.NoError(err) + // call the EndBlock to update the voting power + suite.App.OperatorKeeper.EndBlock(suite.Ctx, abci.RequestEndBlock{}) + infractionHeight := suite.Ctx.BlockHeight() + usdValue, err := suite.App.OperatorKeeper.GetOperatorUSDValue(suite.Ctx, avsAddr, suite.operatorAddr.String()) + suite.NoError(err) + // get the historical voting power + power := usdValue.TruncateInt64() + // run to next block + suite.NextBlock() + + // delegates new amount to the operator + newDelegateAmount := sdkmath.NewIntWithDecimal(20, assetDecimal) + suite.prepareDelegation(true, suite.assetAddr, newDelegateAmount) + // updating the voting power + suite.App.OperatorKeeper.EndBlock(suite.Ctx, abci.RequestEndBlock{}) + newUSDValue, err := suite.App.OperatorKeeper.GetOperatorUSDValue(suite.Ctx, avsAddr, suite.operatorAddr.String()) + suite.NoError(err) + // submits an undelegation to test the slashFromUndelegation + undelegationAmount := sdkmath.NewIntWithDecimal(10, assetDecimal) + suite.prepareDelegation(false, suite.assetAddr, undelegationAmount) + delegationRemaining := delegationAmount.Add(newDelegateAmount).Sub(undelegationAmount) + startHeight := uint64(suite.Ctx.BlockHeight()) + completedHeight := suite.App.OperatorKeeper.GetUnbondingExpirationBlockNumber(suite.Ctx, suite.operatorAddr, startHeight) + + // trigger the slash with a downtime event + slashFactor := suite.App.SlashingKeeper.SlashFractionDowntime(suite.Ctx) + slashType := stakingtypes.Infraction_INFRACTION_DOWNTIME + exoSlashValue := suite.App.OperatorKeeper.SlashWithInfractionReason(suite.Ctx, suite.operatorAddr, infractionHeight, power, slashFactor, slashType) + suite.Equal(sdkmath.NewInt(0), exoSlashValue) + + // verify the state after the slash + slashID := keeper.GetSlashIDForDogfood(slashType, infractionHeight) + slashInfo, err := suite.App.OperatorKeeper.GetOperatorSlashInfo(suite.Ctx, avsAddr, suite.operatorAddr.String(), slashID) + suite.NoError(err) + + // check the stored slash records + slashValue := usdValue.Mul(slashFactor) + newSlashProportion := slashValue.Quo(newUSDValue) + suite.Equal(suite.Ctx.BlockHeight(), slashInfo.SubmittedHeight) + suite.Equal(infractionHeight, slashInfo.EventHeight) + suite.Equal(slashFactor, slashInfo.SlashProportion) + suite.Equal(uint32(slashType), slashInfo.SlashType) + suite.Equal(types.SlashFromUndelegation{ + StakerID: suite.stakerID, + AssetID: suite.assetID, + Amount: newSlashProportion.MulInt(undelegationAmount).TruncateInt(), + }, *slashInfo.ExecutionInfo.SlashUndelegations[0]) + suite.Equal(types.SlashFromAssetsPool{ + AssetID: suite.assetID, + Amount: newSlashProportion.MulInt(delegationRemaining).TruncateInt(), + }, *slashInfo.ExecutionInfo.SlashAssetsPool[0]) + + // check the assets state of undelegation and assets pool + assetsInfo, err := suite.App.AssetsKeeper.GetOperatorSpecifiedAssetInfo(suite.Ctx, suite.operatorAddr, suite.assetID) + suite.NoError(err) + suite.Equal(delegationRemaining.Sub(slashInfo.ExecutionInfo.SlashAssetsPool[0].Amount), assetsInfo.TotalAmount) + + undelegations, err := suite.App.DelegationKeeper.GetStakerUndelegationRecords(suite.Ctx, suite.stakerID, suite.assetID) + suite.NoError(err) + suite.Equal(undelegationAmount.Sub(slashInfo.ExecutionInfo.SlashUndelegations[0].Amount), undelegations[0].ActualCompletedAmount) + + // run to the block at which the undelegation is completed + for i := startHeight; i < completedHeight; i++ { + suite.NextBlock() + } + suite.App.DelegationKeeper.EndBlock(suite.Ctx, abci.RequestEndBlock{}) + undelegations, err = suite.App.DelegationKeeper.GetStakerUndelegationRecords(suite.Ctx, suite.stakerID, suite.assetID) + suite.NoError(err) + suite.Equal(0, len(undelegations)) +} diff --git a/x/operator/keeper/usd_value.go b/x/operator/keeper/usd_value.go index 9800e7e15..5c11a717b 100644 --- a/x/operator/keeper/usd_value.go +++ b/x/operator/keeper/usd_value.go @@ -83,6 +83,11 @@ func (k *Keeper) DeleteOperatorUSDValue(ctx sdk.Context, avsAddr, operatorAddr s // of Avs should decrease the USD share of the opted-out operator // This function can also serve as an RPC in the future. func (k *Keeper) GetOperatorUSDValue(ctx sdk.Context, avsAddr, operatorAddr string) (sdkmath.LegacyDec, error) { + // return zero if the operator has opted-out of the AVS + if !k.IsOptedIn(ctx, operatorAddr, avsAddr) { + return sdkmath.LegacyNewDec(0), nil + } + store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixVotingPowerForAVSOperator) var ret operatortypes.DecValueField var key []byte @@ -168,7 +173,6 @@ func (k *Keeper) BatchUpdateUSDValueForAVSAndOperator(ctx sdk.Context, avsOperat // GetAVSUSDValue is a function to retrieve the USD share of specified Avs, // The key and value to retrieve is: // AVSAddr -> types.DecValueField(the total USD share of specified Avs) -// It hasn't been used now. but it can serve as an RPC in the future. func (k *Keeper) GetAVSUSDValue(ctx sdk.Context, avsAddr string) (sdkmath.LegacyDec, error) { store := prefix.NewStore( ctx.KVStore(k.storeKey), diff --git a/x/operator/module.go b/x/operator/module.go index 29999fbee..aad914018 100644 --- a/x/operator/module.go +++ b/x/operator/module.go @@ -32,9 +32,7 @@ func (b AppModuleBasic) Name() string { return operatortypes.ModuleName } -func (b AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { - operatortypes.RegisterLegacyAminoCodec(amino) -} +func (b AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {} func (b AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { operatortypes.RegisterInterfaces(registry) diff --git a/x/operator/types/codec.go b/x/operator/types/codec.go index c070cb825..3f42bd94b 100644 --- a/x/operator/types/codec.go +++ b/x/operator/types/codec.go @@ -7,25 +7,12 @@ import ( "github.com/cosmos/cosmos-sdk/types/msgservice" ) -var ( - amino = codec.NewLegacyAmino() - - // ModuleCdc references the global erc20 module codec. Note, the codec should - // ONLY be used in certain instances of tests and for JSON encoding. - // - // The actual codec used for serialization should be provided to modules/erc20 and - // defined at the application level. - ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) - - // AminoCdc is a amino codec created to support amino JSON compatible msgs. - AminoCdc = codec.NewAminoCodec(amino) -) - -// NOTE: This is required for the GetSignBytes function -func init() { - RegisterLegacyAminoCodec(amino) - amino.Seal() -} +// ModuleCdc references the global module codec. Note, the codec should +// ONLY be used in certain instances of tests and for JSON encoding. +// +// The actual codec used for serialization should be provided to modules and +// defined at the application level. +var ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) // RegisterInterfaces register implementations func RegisterInterfaces(registry codectypes.InterfaceRegistry) { @@ -38,10 +25,3 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } - -// RegisterLegacyAminoCodec registers the necessary x/revenue interfaces and -// concrete types on the provided LegacyAmino codec. These types are used for -// Amino JSON serialization and EIP-712 compatibility. -func RegisterLegacyAminoCodec(_ *codec.LegacyAmino) { - // cdc.RegisterConcrete(&RegisterOperatorReq{}, registerOperator, nil) -} diff --git a/x/operator/types/errors.go b/x/operator/types/errors.go index 80c00c2ab..e3fa9ed12 100644 --- a/x/operator/types/errors.go +++ b/x/operator/types/errors.go @@ -92,9 +92,9 @@ var ( "operator not removing key", ) - ErrInvalidSlashType = errorsmod.Register( + ErrInvalidSlashPower = errorsmod.Register( ModuleName, 18, - "the slash type is invalid", + "the slash power is invalid", ) ErrKeyAlreadyExist = errorsmod.Register( diff --git a/x/operator/types/expected_keepers.go b/x/operator/types/expected_keepers.go index 40c66dd7e..f6a1b6a2f 100644 --- a/x/operator/types/expected_keepers.go +++ b/x/operator/types/expected_keepers.go @@ -23,21 +23,9 @@ type AssetsKeeper interface { ctx sdk.Context, assets map[string]interface{}, ) (decimals map[string]uint32, err error) IteratorAssetsForOperator( - ctx sdk.Context, operator string, assetsFilter map[string]interface{}, + ctx sdk.Context, isUpdate bool, operator string, assetsFilter map[string]interface{}, f func(assetID string, state *assetstype.OperatorAssetInfo) error, ) error - GetOperatorAssetInfos( - ctx sdk.Context, operatorAddr sdk.Address, assetsFilter map[string]interface{}, - ) (assetsInfo map[string]*assetstype.OperatorAssetInfo, err error) - GetOperatorSpecifiedAssetInfo(ctx sdk.Context, operatorAddr sdk.Address, assetID string) (info *assetstype.OperatorAssetInfo, err error) - UpdateStakerAssetState( - ctx sdk.Context, stakerID string, assetID string, - changeAmount assetstype.DeltaStakerSingleAsset, - ) (err error) - UpdateOperatorAssetState( - ctx sdk.Context, operatorAddr sdk.Address, assetID string, - changeAmount assetstype.DeltaOperatorSingleAsset, - ) (err error) ClientChainExists(ctx sdk.Context, index uint64) bool GetAllStakingAssetsInfo(ctx sdk.Context) (allAssets map[string]*assetstype.StakingAssetInfo, err error) } @@ -45,15 +33,6 @@ type AssetsKeeper interface { var _ DelegationKeeper = &keeper.Keeper{} type DelegationKeeper interface { - GetSingleDelegationInfo( - ctx sdk.Context, stakerID, assetID, operatorAddr string, - ) (*delegationtype.DelegationAmounts, error) - DelegationStateByOperatorAssets( - ctx sdk.Context, operatorAddr string, assetsFilter map[string]interface{}, - ) (map[string]map[string]delegationtype.DelegationAmounts, error) - UpdateDelegationState( - ctx sdk.Context, stakerID, assetID, opAddr string, deltaAmounts *delegationtype.DeltaDelegationAmounts, - ) (bool, error) IterateUndelegationsByOperator( ctx sdk.Context, operator string, heightFilter *uint64, isUpdate bool, opFunc func(undelegation *delegationtype.UndelegationRecord) error) error @@ -64,19 +43,6 @@ type DelegationKeeper interface { ctx sdk.Context, operator, assetID string, stakerList delegationtype.StakerList, ) error DeleteStakersListForOperator(ctx sdk.Context, operator, assetID string) error - GetStakerUndelegationRecords( - ctx sdk.Context, stakerID, assetID string, - ) (records []*delegationtype.UndelegationRecord, err error) - SetSingleUndelegationRecord( - ctx sdk.Context, record *delegationtype.UndelegationRecord, - ) (recordKey []byte, err error) - CalculateSlashShare( - ctx sdk.Context, operator sdk.AccAddress, stakerID, assetID string, slashAmount sdkmath.Int, - ) (share sdkmath.LegacyDec, err error) - RemoveShare( - ctx sdk.Context, isUndelegation bool, operator sdk.AccAddress, - stakerID, assetID string, share sdkmath.LegacyDec, - ) (removeToken sdkmath.Int, err error) } type PriceChange struct { @@ -102,11 +68,6 @@ type OracleKeeper interface { // GetMultipleAssetsPrices is a function to retrieve multiple assets prices according to the // assetID. GetMultipleAssetsPrices(ctx sdk.Context, assets map[string]interface{}) (map[string]Price, error) - // GetPriceChangeAssets the operator module expect a function that can retrieve all - // information about assets price change. Then it can update the USD share state according - // to the change information. This function need to return a map, the key is assetID and the - // value is PriceChange - GetPriceChangeAssets(ctx sdk.Context) (map[string]*PriceChange, error) } type MockOracle struct{} @@ -197,9 +158,6 @@ type AVSKeeper interface { // todo: maybe the epoch of different AVSs should be implemented in the AVS module,then // the other modules implement the EpochsHooks to trigger state updating. GetEpochEndAVSs(ctx sdk.Context) ([]string, error) - // GetHeightForVotingPower retrieves the height of the last block in the epoch - // where the voting power used at the current height resides - GetHeightForVotingPower(ctx sdk.Context, avsAddr string, height int64) (int64, error) } type SlashKeeper interface { diff --git a/x/operator/types/general.go b/x/operator/types/general.go index b2a1404d6..dc9aa4ab9 100644 --- a/x/operator/types/general.go +++ b/x/operator/types/general.go @@ -1,4 +1,27 @@ package types +import ( + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" +) + // DeltaOptedInAssetState This is a struct to describe the desired change that matches with the OptedInAssetState type DeltaOptedInAssetState OptedInAssetState + +type OperatorUSDValue struct { + Staking sdkmath.LegacyDec + SelfStaking sdkmath.LegacyDec + StakingAndWaitUnbonding sdkmath.LegacyDec +} + +type SlashInputInfo struct { + IsDogFood bool + Power int64 + SlashType uint32 + Operator sdk.AccAddress + AVSAddr string + SlashContract string + SlashID string + SlashEventHeight int64 + SlashProportion sdkmath.LegacyDec +} diff --git a/x/operator/types/query.pb.go b/x/operator/types/query.pb.go index 63ed4f8e5..1a2147592 100644 --- a/x/operator/types/query.pb.go +++ b/x/operator/types/query.pb.go @@ -179,7 +179,321 @@ func (m *QueryAllOperatorsResponse) GetPagination() *query.PageResponse { return nil } -// QueryOperatorConsKeyRequest is a request to obtain the consensus public key of the operator. +// OperatorAVSAddressDetails includes the address of operator and AVS +type OperatorAVSAddressDetails struct { + // operator_addr should be the string type of sdk.AccAddress + OperatorAddr string `protobuf:"bytes,1,opt,name=operator_addr,json=operatorAddr,proto3" json:"operator_addr,omitempty"` + // avs_address is the address of the AVS - either an 0x address or a chainID. + AVSAddress string `protobuf:"bytes,2,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` +} + +func (m *OperatorAVSAddressDetails) Reset() { *m = OperatorAVSAddressDetails{} } +func (m *OperatorAVSAddressDetails) String() string { return proto.CompactTextString(m) } +func (*OperatorAVSAddressDetails) ProtoMessage() {} +func (*OperatorAVSAddressDetails) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{3} +} +func (m *OperatorAVSAddressDetails) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OperatorAVSAddressDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OperatorAVSAddressDetails.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OperatorAVSAddressDetails) XXX_Merge(src proto.Message) { + xxx_messageInfo_OperatorAVSAddressDetails.Merge(m, src) +} +func (m *OperatorAVSAddressDetails) XXX_Size() int { + return m.Size() +} +func (m *OperatorAVSAddressDetails) XXX_DiscardUnknown() { + xxx_messageInfo_OperatorAVSAddressDetails.DiscardUnknown(m) +} + +var xxx_messageInfo_OperatorAVSAddressDetails proto.InternalMessageInfo + +func (m *OperatorAVSAddressDetails) GetOperatorAddr() string { + if m != nil { + return m.OperatorAddr + } + return "" +} + +func (m *OperatorAVSAddressDetails) GetAVSAddress() string { + if m != nil { + return m.AVSAddress + } + return "" +} + +// QueryOperatorUSDValueRequest is the request to obtain the USD value for operator. +type QueryOperatorUSDValueRequest struct { + // details is the operator and AVS address + Details *OperatorAVSAddressDetails `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"` +} + +func (m *QueryOperatorUSDValueRequest) Reset() { *m = QueryOperatorUSDValueRequest{} } +func (m *QueryOperatorUSDValueRequest) String() string { return proto.CompactTextString(m) } +func (*QueryOperatorUSDValueRequest) ProtoMessage() {} +func (*QueryOperatorUSDValueRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{4} +} +func (m *QueryOperatorUSDValueRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOperatorUSDValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOperatorUSDValueRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOperatorUSDValueRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOperatorUSDValueRequest.Merge(m, src) +} +func (m *QueryOperatorUSDValueRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryOperatorUSDValueRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOperatorUSDValueRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOperatorUSDValueRequest proto.InternalMessageInfo + +func (m *QueryOperatorUSDValueRequest) GetDetails() *OperatorAVSAddressDetails { + if m != nil { + return m.Details + } + return nil +} + +// QueryAVSUSDValueRequest is the request to obtain the USD value for AVS. +type QueryAVSUSDValueRequest struct { + // avs_address is the AVS address opted-in by the operator + AVSAddress string `protobuf:"bytes,1,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` +} + +func (m *QueryAVSUSDValueRequest) Reset() { *m = QueryAVSUSDValueRequest{} } +func (m *QueryAVSUSDValueRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAVSUSDValueRequest) ProtoMessage() {} +func (*QueryAVSUSDValueRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{5} +} +func (m *QueryAVSUSDValueRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAVSUSDValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAVSUSDValueRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAVSUSDValueRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAVSUSDValueRequest.Merge(m, src) +} +func (m *QueryAVSUSDValueRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAVSUSDValueRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAVSUSDValueRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAVSUSDValueRequest proto.InternalMessageInfo + +func (m *QueryAVSUSDValueRequest) GetAVSAddress() string { + if m != nil { + return m.AVSAddress + } + return "" +} + +// QueryOperatorSlashInfoRequest is the request to obtain the slash information for the specified +// operator and AVS +type QueryOperatorSlashInfoRequest struct { + // details is the operator and AVS address + Details *OperatorAVSAddressDetails `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"` + // pagination related options. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryOperatorSlashInfoRequest) Reset() { *m = QueryOperatorSlashInfoRequest{} } +func (m *QueryOperatorSlashInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryOperatorSlashInfoRequest) ProtoMessage() {} +func (*QueryOperatorSlashInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{6} +} +func (m *QueryOperatorSlashInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOperatorSlashInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOperatorSlashInfoRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOperatorSlashInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOperatorSlashInfoRequest.Merge(m, src) +} +func (m *QueryOperatorSlashInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryOperatorSlashInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOperatorSlashInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOperatorSlashInfoRequest proto.InternalMessageInfo + +func (m *QueryOperatorSlashInfoRequest) GetDetails() *OperatorAVSAddressDetails { + if m != nil { + return m.Details + } + return nil +} + +func (m *QueryOperatorSlashInfoRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// OperatorSlashInfoByID includes the slash information and the slashID +type OperatorSlashInfoByID struct { + // slash_id is stored as the key of the slash information, + // so it will be parsed and padding here. + SlashID string `protobuf:"bytes,1,opt,name=slash_id,json=slashId,proto3" json:"slash_id,omitempty"` + // info is the specified detailed information for the slashing event. + Info *OperatorSlashInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` +} + +func (m *OperatorSlashInfoByID) Reset() { *m = OperatorSlashInfoByID{} } +func (m *OperatorSlashInfoByID) String() string { return proto.CompactTextString(m) } +func (*OperatorSlashInfoByID) ProtoMessage() {} +func (*OperatorSlashInfoByID) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{7} +} +func (m *OperatorSlashInfoByID) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OperatorSlashInfoByID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OperatorSlashInfoByID.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OperatorSlashInfoByID) XXX_Merge(src proto.Message) { + xxx_messageInfo_OperatorSlashInfoByID.Merge(m, src) +} +func (m *OperatorSlashInfoByID) XXX_Size() int { + return m.Size() +} +func (m *OperatorSlashInfoByID) XXX_DiscardUnknown() { + xxx_messageInfo_OperatorSlashInfoByID.DiscardUnknown(m) +} + +var xxx_messageInfo_OperatorSlashInfoByID proto.InternalMessageInfo + +func (m *OperatorSlashInfoByID) GetSlashID() string { + if m != nil { + return m.SlashID + } + return "" +} + +func (m *OperatorSlashInfoByID) GetInfo() *OperatorSlashInfo { + if m != nil { + return m.Info + } + return nil +} + +// QueryOperatorSlashInfoResponse is the response for GetOperatorSlashInfoRequest +type QueryOperatorSlashInfoResponse struct { + // all_slash_info is a list of the slash information for the specified operator and AVS + AllSlashInfo []*OperatorSlashInfoByID `protobuf:"bytes,1,rep,name=all_slash_info,json=allSlashInfo,proto3" json:"all_slash_info,omitempty"` + // pagination related response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryOperatorSlashInfoResponse) Reset() { *m = QueryOperatorSlashInfoResponse{} } +func (m *QueryOperatorSlashInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryOperatorSlashInfoResponse) ProtoMessage() {} +func (*QueryOperatorSlashInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{8} +} +func (m *QueryOperatorSlashInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOperatorSlashInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOperatorSlashInfoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOperatorSlashInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOperatorSlashInfoResponse.Merge(m, src) +} +func (m *QueryOperatorSlashInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryOperatorSlashInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOperatorSlashInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOperatorSlashInfoResponse proto.InternalMessageInfo + +func (m *QueryOperatorSlashInfoResponse) GetAllSlashInfo() []*OperatorSlashInfoByID { + if m != nil { + return m.AllSlashInfo + } + return nil +} + +func (m *QueryOperatorSlashInfoResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryOperatorConsKeyRequest is the request to obtain the consensus public key of the operator type QueryOperatorConsKeyRequest struct { // operator_acc_addr is the operator account address. OperatorAccAddr string `protobuf:"bytes,1,opt,name=operator_acc_addr,json=operatorAccAddr,proto3" json:"operator_acc_addr,omitempty"` @@ -193,7 +507,7 @@ func (m *QueryOperatorConsKeyRequest) Reset() { *m = QueryOperatorConsKe func (m *QueryOperatorConsKeyRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsKeyRequest) ProtoMessage() {} func (*QueryOperatorConsKeyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{3} + return fileDescriptor_f91e795a3cecbdbf, []int{9} } func (m *QueryOperatorConsKeyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -248,7 +562,7 @@ func (m *QueryOperatorConsKeyResponse) Reset() { *m = QueryOperatorConsK func (m *QueryOperatorConsKeyResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsKeyResponse) ProtoMessage() {} func (*QueryOperatorConsKeyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{4} + return fileDescriptor_f91e795a3cecbdbf, []int{10} } func (m *QueryOperatorConsKeyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -306,7 +620,7 @@ func (m *QueryOperatorConsAddressRequest) Reset() { *m = QueryOperatorCo func (m *QueryOperatorConsAddressRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsAddressRequest) ProtoMessage() {} func (*QueryOperatorConsAddressRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{5} + return fileDescriptor_f91e795a3cecbdbf, []int{11} } func (m *QueryOperatorConsAddressRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -362,7 +676,7 @@ func (m *QueryOperatorConsAddressResponse) Reset() { *m = QueryOperatorC func (m *QueryOperatorConsAddressResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsAddressResponse) ProtoMessage() {} func (*QueryOperatorConsAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{6} + return fileDescriptor_f91e795a3cecbdbf, []int{12} } func (m *QueryOperatorConsAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -422,7 +736,7 @@ func (m *QueryAllOperatorConsKeysByChainIDRequest) Reset() { func (m *QueryAllOperatorConsKeysByChainIDRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllOperatorConsKeysByChainIDRequest) ProtoMessage() {} func (*QueryAllOperatorConsKeysByChainIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{7} + return fileDescriptor_f91e795a3cecbdbf, []int{13} } func (m *QueryAllOperatorConsKeysByChainIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -482,7 +796,7 @@ func (m *QueryAllOperatorConsKeysByChainIDResponse) String() string { } func (*QueryAllOperatorConsKeysByChainIDResponse) ProtoMessage() {} func (*QueryAllOperatorConsKeysByChainIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{8} + return fileDescriptor_f91e795a3cecbdbf, []int{14} } func (m *QueryAllOperatorConsKeysByChainIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -540,7 +854,7 @@ func (m *OperatorConsKeyPair) Reset() { *m = OperatorConsKeyPair{} } func (m *OperatorConsKeyPair) String() string { return proto.CompactTextString(m) } func (*OperatorConsKeyPair) ProtoMessage() {} func (*OperatorConsKeyPair) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{9} + return fileDescriptor_f91e795a3cecbdbf, []int{15} } func (m *OperatorConsKeyPair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -609,7 +923,7 @@ func (m *QueryAllOperatorConsAddrsByChainIDRequest) String() string { } func (*QueryAllOperatorConsAddrsByChainIDRequest) ProtoMessage() {} func (*QueryAllOperatorConsAddrsByChainIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{10} + return fileDescriptor_f91e795a3cecbdbf, []int{16} } func (m *QueryAllOperatorConsAddrsByChainIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -669,7 +983,7 @@ func (m *QueryAllOperatorConsAddrsByChainIDResponse) String() string { } func (*QueryAllOperatorConsAddrsByChainIDResponse) ProtoMessage() {} func (*QueryAllOperatorConsAddrsByChainIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{11} + return fileDescriptor_f91e795a3cecbdbf, []int{17} } func (m *QueryAllOperatorConsAddrsByChainIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -727,7 +1041,7 @@ func (m *OperatorConsAddrPair) Reset() { *m = OperatorConsAddrPair{} } func (m *OperatorConsAddrPair) String() string { return proto.CompactTextString(m) } func (*OperatorConsAddrPair) ProtoMessage() {} func (*OperatorConsAddrPair) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{12} + return fileDescriptor_f91e795a3cecbdbf, []int{18} } func (m *OperatorConsAddrPair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -781,6 +1095,12 @@ func init() { proto.RegisterType((*GetOperatorInfoReq)(nil), "exocore.operator.v1.GetOperatorInfoReq") proto.RegisterType((*QueryAllOperatorsRequest)(nil), "exocore.operator.v1.QueryAllOperatorsRequest") proto.RegisterType((*QueryAllOperatorsResponse)(nil), "exocore.operator.v1.QueryAllOperatorsResponse") + proto.RegisterType((*OperatorAVSAddressDetails)(nil), "exocore.operator.v1.OperatorAVSAddressDetails") + proto.RegisterType((*QueryOperatorUSDValueRequest)(nil), "exocore.operator.v1.QueryOperatorUSDValueRequest") + proto.RegisterType((*QueryAVSUSDValueRequest)(nil), "exocore.operator.v1.QueryAVSUSDValueRequest") + proto.RegisterType((*QueryOperatorSlashInfoRequest)(nil), "exocore.operator.v1.QueryOperatorSlashInfoRequest") + proto.RegisterType((*OperatorSlashInfoByID)(nil), "exocore.operator.v1.OperatorSlashInfoByID") + proto.RegisterType((*QueryOperatorSlashInfoResponse)(nil), "exocore.operator.v1.QueryOperatorSlashInfoResponse") proto.RegisterType((*QueryOperatorConsKeyRequest)(nil), "exocore.operator.v1.QueryOperatorConsKeyRequest") proto.RegisterType((*QueryOperatorConsKeyResponse)(nil), "exocore.operator.v1.QueryOperatorConsKeyResponse") proto.RegisterType((*QueryOperatorConsAddressRequest)(nil), "exocore.operator.v1.QueryOperatorConsAddressRequest") @@ -796,65 +1116,84 @@ func init() { func init() { proto.RegisterFile("exocore/operator/v1/query.proto", fileDescriptor_f91e795a3cecbdbf) } var fileDescriptor_f91e795a3cecbdbf = []byte{ - // 928 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x4f, 0xe3, 0x46, - 0x14, 0xce, 0x84, 0x52, 0x91, 0xa1, 0x55, 0xcb, 0x90, 0x43, 0x30, 0x34, 0x80, 0x55, 0x95, 0x10, - 0x15, 0xbb, 0x09, 0xd0, 0x43, 0x29, 0xad, 0x08, 0xbf, 0x44, 0xa9, 0x0a, 0x35, 0x52, 0xa5, 0xf6, - 0xd0, 0xc8, 0x71, 0x06, 0x63, 0x11, 0x3c, 0xc6, 0x9e, 0x50, 0x2c, 0x44, 0x55, 0xf5, 0xd4, 0xde, - 0xaa, 0xf6, 0x58, 0xb5, 0x7f, 0xc5, 0xfe, 0x07, 0x7b, 0xe1, 0xb0, 0x07, 0x76, 0xf7, 0xb2, 0x27, - 0x76, 0x45, 0xf6, 0x0f, 0x59, 0x79, 0x3c, 0x4e, 0xe2, 0xe0, 0x24, 0x0e, 0x42, 0x7b, 0x8b, 0xed, - 0x37, 0xef, 0xfb, 0xbe, 0xf7, 0xbe, 0x79, 0x2f, 0x70, 0x1a, 0x9f, 0x13, 0x8d, 0xd8, 0x58, 0x26, - 0x16, 0xb6, 0x55, 0x4a, 0x6c, 0xf9, 0xac, 0x20, 0x9f, 0xd6, 0xb1, 0xed, 0x4a, 0x96, 0x4d, 0x28, - 0x41, 0xe3, 0x3c, 0x40, 0x0a, 0x02, 0xa4, 0xb3, 0x82, 0x90, 0xd7, 0x88, 0x73, 0x42, 0x1c, 0xb9, - 0xa2, 0x3a, 0xd8, 0x8f, 0x96, 0xcf, 0x0a, 0x15, 0x4c, 0xd5, 0x82, 0x6c, 0xa9, 0xba, 0x61, 0xaa, - 0xd4, 0x20, 0xa6, 0x9f, 0x40, 0x98, 0xf0, 0x63, 0xcb, 0xec, 0x49, 0xf6, 0x1f, 0xf8, 0xa7, 0xa9, - 0x28, 0x70, 0x7a, 0xce, 0xbf, 0xa6, 0x75, 0xa2, 0x13, 0xff, 0x94, 0xf7, 0x2b, 0x38, 0xa3, 0x13, - 0xa2, 0xd7, 0xb0, 0xac, 0x5a, 0x86, 0xac, 0x9a, 0x26, 0xa1, 0x0c, 0xab, 0x99, 0x91, 0x62, 0xb3, - 0x8a, 0xed, 0x13, 0xc3, 0xa4, 0xb2, 0x66, 0xbb, 0x16, 0x25, 0xf2, 0x31, 0x76, 0xf9, 0x57, 0xf1, - 0x00, 0xa2, 0x6d, 0x4c, 0xf7, 0x38, 0xd8, 0x8e, 0x79, 0x48, 0x14, 0x7c, 0x8a, 0x56, 0xe1, 0xfb, - 0x01, 0x7e, 0x59, 0xad, 0x56, 0xed, 0x0c, 0x98, 0x01, 0xb9, 0x54, 0x29, 0xf3, 0xec, 0xd1, 0x42, - 0x9a, 0xd3, 0x5d, 0xab, 0x56, 0x6d, 0xec, 0x38, 0x07, 0xd4, 0x36, 0x4c, 0x5d, 0x79, 0x2f, 0x08, - 0xf7, 0x5e, 0x8b, 0x15, 0x98, 0xf9, 0xde, 0xab, 0xc0, 0x5a, 0xad, 0x16, 0x64, 0x76, 0x14, 0x7c, - 0x5a, 0xc7, 0x0e, 0x45, 0x5b, 0x10, 0xb6, 0xea, 0xc1, 0xf2, 0x8e, 0x16, 0x3f, 0x91, 0x78, 0x52, - 0xaf, 0x78, 0x92, 0x5f, 0x6a, 0x5e, 0x3c, 0x69, 0x5f, 0xd5, 0x31, 0x3f, 0xab, 0xb4, 0x9d, 0x14, - 0xff, 0x06, 0x70, 0x22, 0x02, 0xc4, 0xb1, 0x88, 0xe9, 0x60, 0xf4, 0x29, 0x44, 0x2d, 0x01, 0x9a, - 0xc6, 0x44, 0x38, 0x19, 0x30, 0x33, 0x94, 0x4b, 0x29, 0x1f, 0x36, 0xb9, 0x6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9, 0x3b, 0x4c, - 0x7f, 0x21, 0xf6, 0x71, 0x13, 0xe8, 0xbc, 0x05, 0x45, 0x5d, 0x0b, 0x3b, 0x95, 0x77, 0xd9, 0x5f, - 0xfd, 0xc5, 0x37, 0x01, 0x00, 0x00, 0xff, 0xff, 0x3a, 0xfd, 0xf5, 0x2b, 0xd9, 0x0c, 0x00, 0x00, + // 1219 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x41, 0x73, 0xdb, 0xc4, + 0x17, 0xcf, 0xa6, 0xed, 0x3f, 0xf1, 0x4b, 0xdb, 0x7f, 0xb3, 0x49, 0x21, 0x71, 0x53, 0x27, 0xd5, + 0x40, 0x93, 0x9a, 0x44, 0x22, 0x4e, 0xca, 0xa1, 0xa5, 0x30, 0x71, 0xdc, 0x94, 0x34, 0x0c, 0x0d, + 0xf2, 0x90, 0x19, 0x38, 0xe0, 0x91, 0xe5, 0xad, 0xa3, 0x89, 0xa2, 0x75, 0xb4, 0x72, 0x88, 0x27, + 0x13, 0x86, 0xe1, 0x04, 0xc3, 0x85, 0xa1, 0x47, 0x06, 0x0e, 0x7c, 0x03, 0x66, 0x18, 0x38, 0xf0, + 0x05, 0x7a, 0xe0, 0x10, 0xe0, 0xc2, 0x29, 0x30, 0x09, 0x1f, 0x84, 0xd1, 0x6a, 0x65, 0x5b, 0x8a, + 0x64, 0x2b, 0xc1, 0xc3, 0xcd, 0x5a, 0xbd, 0xb7, 0xef, 0xf7, 0xfb, 0xbd, 0xf7, 0xf6, 0xad, 0x0c, + 0x93, 0x64, 0x8f, 0xea, 0xd4, 0x26, 0x0a, 0xad, 0x11, 0x5b, 0x73, 0xa8, 0xad, 0xec, 0xce, 0x2b, + 0x3b, 0x75, 0x62, 0x37, 0xe4, 0x9a, 0x4d, 0x1d, 0x8a, 0x47, 0x84, 0x81, 0xec, 0x1b, 0xc8, 0xbb, + 0xf3, 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x24, 0xda, + 0x68, 0x28, 0xcf, 0x10, 0x5c, 0x0b, 0x7f, 0x42, 0xe0, 0xd9, 0x0e, 0xb2, 0x9d, 0xfa, 0xd2, 0x48, + 0x04, 0x6d, 0x8e, 0x43, 0x9b, 0xc6, 0x2f, 0xc7, 0x43, 0x6b, 0x07, 0xf0, 0x23, 0x82, 0x17, 0xa2, + 0xaf, 0xd6, 0x38, 0xd7, 0x5d, 0xbb, 0xf0, 0x87, 0x4b, 0x7a, 0xe1, 0x4c, 0x3e, 0x22, 0xf7, 0x0b, + 0x1c, 0xf2, 0x1c, 0x7e, 0xa5, 0xbb, 0x9a, 0x2d, 0x74, 0x27, 0x7e, 0xdb, 0x76, 0x1c, 0x93, 0x38, + 0x79, 0x5d, 0x46, 0xce, 0xfa, 0xf4, 0x9b, 0xe7, 0xf6, 0x17, 0xe4, 0x5e, 0xe7, 0xe4, 0x5e, 0xc3, + 0x8b, 0x09, 0x0b, 0x9b, 0x8f, 0x6f, 0xbf, 0xb2, 0xf3, 0x6f, 0x3f, 0x3f, 0xce, 0xa0, 0xc3, 0xe3, + 0x0c, 0xfa, 0xeb, 0x38, 0x83, 0xbe, 0x3c, 0xc9, 0xf4, 0x1d, 0x9e, 0x64, 0xfa, 0xfe, 0x38, 0xc9, + 0xf4, 0x7d, 0x90, 0xab, 0x1a, 0xce, 0x66, 0xbd, 0x2c, 0xeb, 0x74, 0x5b, 0x79, 0xe8, 0xed, 0xfc, + 0x0e, 0x71, 0x3e, 0xa2, 0xf6, 0x56, 0x33, 0xd0, 0x5e, 0x2b, 0x94, 0xd3, 0xa8, 0x11, 0x56, 0xfe, + 0x1f, 0xff, 0x47, 0x64, 0xe1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x4c, 0xa4, 0xb2, 0x00, + 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -880,6 +1219,12 @@ type QueryClient interface { // QueryAllOperatorConsKeysByChainID queries all operators and their consensus public keys // for a specific chain ID QueryAllOperatorConsKeysByChainID(ctx context.Context, in *QueryAllOperatorConsKeysByChainIDRequest, opts ...grpc.CallOption) (*QueryAllOperatorConsKeysByChainIDResponse, error) + // QueryOperatorUSDValue queries the opted-in USD value for the operator + QueryOperatorUSDValue(ctx context.Context, in *QueryOperatorUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) + // QueryAVSUSDValue queries the USD value for the AVS + QueryAVSUSDValue(ctx context.Context, in *QueryAVSUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) + // QueryOperatorSlashInfo queries the slash information for the specified operator and AVS + QueryOperatorSlashInfo(ctx context.Context, in *QueryOperatorSlashInfoRequest, opts ...grpc.CallOption) (*QueryOperatorSlashInfoResponse, error) // QueryAllOperatorConsAddrsByChainID queries all operators and their consensus addresses // for a specific chain ID QueryAllOperatorConsAddrsByChainID(ctx context.Context, in *QueryAllOperatorConsAddrsByChainIDRequest, opts ...grpc.CallOption) (*QueryAllOperatorConsAddrsByChainIDResponse, error) @@ -938,6 +1283,33 @@ func (c *queryClient) QueryAllOperatorConsKeysByChainID(ctx context.Context, in return out, nil } +func (c *queryClient) QueryOperatorUSDValue(ctx context.Context, in *QueryOperatorUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) { + out := new(DecValueField) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryOperatorUSDValue", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryAVSUSDValue(ctx context.Context, in *QueryAVSUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) { + out := new(DecValueField) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryAVSUSDValue", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryOperatorSlashInfo(ctx context.Context, in *QueryOperatorSlashInfoRequest, opts ...grpc.CallOption) (*QueryOperatorSlashInfoResponse, error) { + out := new(QueryOperatorSlashInfoResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryOperatorSlashInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) QueryAllOperatorConsAddrsByChainID(ctx context.Context, in *QueryAllOperatorConsAddrsByChainIDRequest, opts ...grpc.CallOption) (*QueryAllOperatorConsAddrsByChainIDResponse, error) { out := new(QueryAllOperatorConsAddrsByChainIDResponse) err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryAllOperatorConsAddrsByChainID", in, out, opts...) @@ -960,6 +1332,12 @@ type QueryServer interface { // QueryAllOperatorConsKeysByChainID queries all operators and their consensus public keys // for a specific chain ID QueryAllOperatorConsKeysByChainID(context.Context, *QueryAllOperatorConsKeysByChainIDRequest) (*QueryAllOperatorConsKeysByChainIDResponse, error) + // QueryOperatorUSDValue queries the opted-in USD value for the operator + QueryOperatorUSDValue(context.Context, *QueryOperatorUSDValueRequest) (*DecValueField, error) + // QueryAVSUSDValue queries the USD value for the AVS + QueryAVSUSDValue(context.Context, *QueryAVSUSDValueRequest) (*DecValueField, error) + // QueryOperatorSlashInfo queries the slash information for the specified operator and AVS + QueryOperatorSlashInfo(context.Context, *QueryOperatorSlashInfoRequest) (*QueryOperatorSlashInfoResponse, error) // QueryAllOperatorConsAddrsByChainID queries all operators and their consensus addresses // for a specific chain ID QueryAllOperatorConsAddrsByChainID(context.Context, *QueryAllOperatorConsAddrsByChainIDRequest) (*QueryAllOperatorConsAddrsByChainIDResponse, error) @@ -984,6 +1362,15 @@ func (*UnimplementedQueryServer) QueryOperatorConsAddressForChainID(ctx context. func (*UnimplementedQueryServer) QueryAllOperatorConsKeysByChainID(ctx context.Context, req *QueryAllOperatorConsKeysByChainIDRequest) (*QueryAllOperatorConsKeysByChainIDResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryAllOperatorConsKeysByChainID not implemented") } +func (*UnimplementedQueryServer) QueryOperatorUSDValue(ctx context.Context, req *QueryOperatorUSDValueRequest) (*DecValueField, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorUSDValue not implemented") +} +func (*UnimplementedQueryServer) QueryAVSUSDValue(ctx context.Context, req *QueryAVSUSDValueRequest) (*DecValueField, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAVSUSDValue not implemented") +} +func (*UnimplementedQueryServer) QueryOperatorSlashInfo(ctx context.Context, req *QueryOperatorSlashInfoRequest) (*QueryOperatorSlashInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorSlashInfo not implemented") +} func (*UnimplementedQueryServer) QueryAllOperatorConsAddrsByChainID(ctx context.Context, req *QueryAllOperatorConsAddrsByChainIDRequest) (*QueryAllOperatorConsAddrsByChainIDResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryAllOperatorConsAddrsByChainID not implemented") } @@ -1082,50 +1469,116 @@ func _Query_QueryAllOperatorConsKeysByChainID_Handler(srv interface{}, ctx conte return interceptor(ctx, in, info, handler) } -func _Query_QueryAllOperatorConsAddrsByChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllOperatorConsAddrsByChainIDRequest) +func _Query_QueryOperatorUSDValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOperatorUSDValueRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).QueryAllOperatorConsAddrsByChainID(ctx, in) + return srv.(QueryServer).QueryOperatorUSDValue(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/exocore.operator.v1.Query/QueryAllOperatorConsAddrsByChainID", + FullMethod: "/exocore.operator.v1.Query/QueryOperatorUSDValue", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryAllOperatorConsAddrsByChainID(ctx, req.(*QueryAllOperatorConsAddrsByChainIDRequest)) + return srv.(QueryServer).QueryOperatorUSDValue(ctx, req.(*QueryOperatorUSDValueRequest)) } return interceptor(ctx, in, info, handler) } -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "exocore.operator.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "QueryOperatorInfo", - Handler: _Query_QueryOperatorInfo_Handler, - }, - { - MethodName: "QueryAllOperators", - Handler: _Query_QueryAllOperators_Handler, - }, - { - MethodName: "QueryOperatorConsKeyForChainID", - Handler: _Query_QueryOperatorConsKeyForChainID_Handler, - }, - { - MethodName: "QueryOperatorConsAddressForChainID", - Handler: _Query_QueryOperatorConsAddressForChainID_Handler, - }, - { - MethodName: "QueryAllOperatorConsKeysByChainID", - Handler: _Query_QueryAllOperatorConsKeysByChainID_Handler, - }, - { - MethodName: "QueryAllOperatorConsAddrsByChainID", +func _Query_QueryAVSUSDValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAVSUSDValueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAVSUSDValue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryAVSUSDValue", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAVSUSDValue(ctx, req.(*QueryAVSUSDValueRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryOperatorSlashInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOperatorSlashInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryOperatorSlashInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryOperatorSlashInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryOperatorSlashInfo(ctx, req.(*QueryOperatorSlashInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAllOperatorConsAddrsByChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllOperatorConsAddrsByChainIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAllOperatorConsAddrsByChainID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryAllOperatorConsAddrsByChainID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAllOperatorConsAddrsByChainID(ctx, req.(*QueryAllOperatorConsAddrsByChainIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "exocore.operator.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "QueryOperatorInfo", + Handler: _Query_QueryOperatorInfo_Handler, + }, + { + MethodName: "QueryAllOperators", + Handler: _Query_QueryAllOperators_Handler, + }, + { + MethodName: "QueryOperatorConsKeyForChainID", + Handler: _Query_QueryOperatorConsKeyForChainID_Handler, + }, + { + MethodName: "QueryOperatorConsAddressForChainID", + Handler: _Query_QueryOperatorConsAddressForChainID_Handler, + }, + { + MethodName: "QueryAllOperatorConsKeysByChainID", + Handler: _Query_QueryAllOperatorConsKeysByChainID_Handler, + }, + { + MethodName: "QueryOperatorUSDValue", + Handler: _Query_QueryOperatorUSDValue_Handler, + }, + { + MethodName: "QueryAVSUSDValue", + Handler: _Query_QueryAVSUSDValue_Handler, + }, + { + MethodName: "QueryOperatorSlashInfo", + Handler: _Query_QueryOperatorSlashInfo_Handler, + }, + { + MethodName: "QueryAllOperatorConsAddrsByChainID", Handler: _Query_QueryAllOperatorConsAddrsByChainID_Handler, }, }, @@ -1242,7 +1695,7 @@ func (m *QueryAllOperatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *QueryOperatorConsKeyRequest) Marshal() (dAtA []byte, err error) { +func (m *OperatorAVSAddressDetails) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1252,34 +1705,34 @@ func (m *QueryOperatorConsKeyRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryOperatorConsKeyRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *OperatorAVSAddressDetails) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryOperatorConsKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *OperatorAVSAddressDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Chain) > 0 { - i -= len(m.Chain) - copy(dAtA[i:], m.Chain) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) + if len(m.AVSAddress) > 0 { + i -= len(m.AVSAddress) + copy(dAtA[i:], m.AVSAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddress))) i-- dAtA[i] = 0x12 } - if len(m.OperatorAccAddr) > 0 { - i -= len(m.OperatorAccAddr) - copy(dAtA[i:], m.OperatorAccAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAccAddr))) + if len(m.OperatorAddr) > 0 { + i -= len(m.OperatorAddr) + copy(dAtA[i:], m.OperatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddr))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryOperatorConsKeyResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryOperatorUSDValueRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1289,40 +1742,32 @@ func (m *QueryOperatorConsKeyResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryOperatorConsKeyResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryOperatorUSDValueRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryOperatorConsKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryOperatorUSDValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.OptingOut { - i-- - if m.OptingOut { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.Details != nil { + { + size, err := m.Details.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x10 - } - { - size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryOperatorConsAddressRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAVSUSDValueRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1332,34 +1777,27 @@ func (m *QueryOperatorConsAddressRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryOperatorConsAddressRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAVSUSDValueRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryOperatorConsAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAVSUSDValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Chain) > 0 { - i -= len(m.Chain) - copy(dAtA[i:], m.Chain) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) - i-- - dAtA[i] = 0x12 - } - if len(m.OperatorAccAddr) > 0 { - i -= len(m.OperatorAccAddr) - copy(dAtA[i:], m.OperatorAccAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAccAddr))) + if len(m.AVSAddress) > 0 { + i -= len(m.AVSAddress) + copy(dAtA[i:], m.AVSAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddress))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryOperatorConsAddressResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryOperatorSlashInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1369,37 +1807,44 @@ func (m *QueryOperatorConsAddressResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryOperatorConsAddressResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryOperatorSlashInfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryOperatorConsAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryOperatorSlashInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.OptingOut { - i-- - if m.OptingOut { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } - if len(m.ConsAddr) > 0 { - i -= len(m.ConsAddr) - copy(dAtA[i:], m.ConsAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsAddr))) + if m.Details != nil { + { + size, err := m.Details.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryAllOperatorConsKeysByChainIDRequest) Marshal() (dAtA []byte, err error) { +func (m *OperatorSlashInfoByID) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1409,19 +1854,19 @@ func (m *QueryAllOperatorConsKeysByChainIDRequest) Marshal() (dAtA []byte, err e return dAtA[:n], nil } -func (m *QueryAllOperatorConsKeysByChainIDRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *OperatorSlashInfoByID) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllOperatorConsKeysByChainIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *OperatorSlashInfoByID) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { + if m.Info != nil { { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Info.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1431,17 +1876,17 @@ func (m *QueryAllOperatorConsKeysByChainIDRequest) MarshalToSizedBuffer(dAtA []b i-- dAtA[i] = 0x12 } - if len(m.Chain) > 0 { - i -= len(m.Chain) - copy(dAtA[i:], m.Chain) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) + if len(m.SlashID) > 0 { + i -= len(m.SlashID) + copy(dAtA[i:], m.SlashID) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SlashID))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryAllOperatorConsKeysByChainIDResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryOperatorSlashInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1451,12 +1896,12 @@ func (m *QueryAllOperatorConsKeysByChainIDResponse) Marshal() (dAtA []byte, err return dAtA[:n], nil } -func (m *QueryAllOperatorConsKeysByChainIDResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryOperatorSlashInfoResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllOperatorConsKeysByChainIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryOperatorSlashInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1473,10 +1918,10 @@ func (m *QueryAllOperatorConsKeysByChainIDResponse) MarshalToSizedBuffer(dAtA [] i-- dAtA[i] = 0x12 } - if len(m.OperatorConsKeys) > 0 { - for iNdEx := len(m.OperatorConsKeys) - 1; iNdEx >= 0; iNdEx-- { + if len(m.AllSlashInfo) > 0 { + for iNdEx := len(m.AllSlashInfo) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.OperatorConsKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.AllSlashInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1490,7 +1935,7 @@ func (m *QueryAllOperatorConsKeysByChainIDResponse) MarshalToSizedBuffer(dAtA [] return len(dAtA) - i, nil } -func (m *OperatorConsKeyPair) Marshal() (dAtA []byte, err error) { +func (m *QueryOperatorConsKeyRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1500,35 +1945,20 @@ func (m *OperatorConsKeyPair) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *OperatorConsKeyPair) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryOperatorConsKeyRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *OperatorConsKeyPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryOperatorConsKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.OptingOut { - i-- - if m.OptingOut { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.PublicKey != nil { - { - size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } + if len(m.Chain) > 0 { + i -= len(m.Chain) + copy(dAtA[i:], m.Chain) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) i-- dAtA[i] = 0x12 } @@ -1542,7 +1972,7 @@ func (m *OperatorConsKeyPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAllOperatorConsAddrsByChainIDRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryOperatorConsKeyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1552,39 +1982,40 @@ func (m *QueryAllOperatorConsAddrsByChainIDRequest) Marshal() (dAtA []byte, err return dAtA[:n], nil } -func (m *QueryAllOperatorConsAddrsByChainIDRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryOperatorConsKeyResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllOperatorConsAddrsByChainIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryOperatorConsKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + if m.OptingOut { + i-- + if m.OptingOut { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if len(m.Chain) > 0 { - i -= len(m.Chain) - copy(dAtA[i:], m.Chain) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) - i-- - dAtA[i] = 0xa + { + size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryAllOperatorConsAddrsByChainIDResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryOperatorConsAddressRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1594,46 +2025,34 @@ func (m *QueryAllOperatorConsAddrsByChainIDResponse) Marshal() (dAtA []byte, err return dAtA[:n], nil } -func (m *QueryAllOperatorConsAddrsByChainIDResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryOperatorConsAddressRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllOperatorConsAddrsByChainIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryOperatorConsAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } + if len(m.Chain) > 0 { + i -= len(m.Chain) + copy(dAtA[i:], m.Chain) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) i-- dAtA[i] = 0x12 } - if len(m.OperatorConsAddrs) > 0 { - for iNdEx := len(m.OperatorConsAddrs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.OperatorConsAddrs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + if len(m.OperatorAccAddr) > 0 { + i -= len(m.OperatorAccAddr) + copy(dAtA[i:], m.OperatorAccAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAccAddr))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *OperatorConsAddrPair) Marshal() (dAtA []byte, err error) { +func (m *QueryOperatorConsAddressResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1643,12 +2062,12 @@ func (m *OperatorConsAddrPair) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *OperatorConsAddrPair) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryOperatorConsAddressResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *OperatorConsAddrPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryOperatorConsAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1661,211 +2080,329 @@ func (m *OperatorConsAddrPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x18 + dAtA[i] = 0x10 } if len(m.ConsAddr) > 0 { i -= len(m.ConsAddr) copy(dAtA[i:], m.ConsAddr) i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsAddr))) i-- - dAtA[i] = 0x12 - } - if len(m.OperatorAccAddr) > 0 { - i -= len(m.OperatorAccAddr) - copy(dAtA[i:], m.OperatorAccAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAccAddr))) - i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GetOperatorInfoReq) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.OperatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) +func (m *QueryAllOperatorConsKeysByChainIDRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *QueryAllOperatorsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n +func (m *QueryAllOperatorConsKeysByChainIDRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllOperatorsResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryAllOperatorConsKeysByChainIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.OperatorAccAddrs) > 0 { - for _, s := range m.OperatorAccAddrs { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if len(m.Chain) > 0 { + i -= len(m.Chain) + copy(dAtA[i:], m.Chain) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryOperatorConsKeyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.OperatorAccAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Chain) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) +func (m *QueryAllOperatorConsKeysByChainIDResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *QueryOperatorConsKeyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.PublicKey.Size() - n += 1 + l + sovQuery(uint64(l)) - if m.OptingOut { - n += 2 - } - return n +func (m *QueryAllOperatorConsKeysByChainIDResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryOperatorConsAddressRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryAllOperatorConsKeysByChainIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.OperatorAccAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - l = len(m.Chain) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if len(m.OperatorConsKeys) > 0 { + for iNdEx := len(m.OperatorConsKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.OperatorConsKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return n + return len(dAtA) - i, nil } -func (m *QueryOperatorConsAddressResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConsAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.OptingOut { - n += 2 +func (m *OperatorConsKeyPair) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *QueryAllOperatorConsKeysByChainIDRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Chain) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n +func (m *OperatorConsKeyPair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllOperatorConsKeysByChainIDResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *OperatorConsKeyPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.OperatorConsKeys) > 0 { - for _, e := range m.OperatorConsKeys { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.OptingOut { + i-- + if m.OptingOut { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i-- + dAtA[i] = 0x18 } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *OperatorConsKeyPair) Size() (n int) { - if m == nil { - return 0 + if m.PublicKey != nil { + { + size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.OperatorAccAddr) > 0 { + i -= len(m.OperatorAccAddr) + copy(dAtA[i:], m.OperatorAccAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAccAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllOperatorConsAddrsByChainIDRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *QueryAllOperatorConsAddrsByChainIDRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllOperatorConsAddrsByChainIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.OperatorAccAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - if m.PublicKey != nil { - l = m.PublicKey.Size() - n += 1 + l + sovQuery(uint64(l)) + if len(m.Chain) > 0 { + i -= len(m.Chain) + copy(dAtA[i:], m.Chain) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllOperatorConsAddrsByChainIDResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllOperatorConsAddrsByChainIDResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllOperatorConsAddrsByChainIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.OperatorConsAddrs) > 0 { + for iNdEx := len(m.OperatorConsAddrs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.OperatorConsAddrs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *OperatorConsAddrPair) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *OperatorConsAddrPair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OperatorConsAddrPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l if m.OptingOut { - n += 2 + i-- + if m.OptingOut { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 } - return n + if len(m.ConsAddr) > 0 { + i -= len(m.ConsAddr) + copy(dAtA[i:], m.ConsAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.OperatorAccAddr) > 0 { + i -= len(m.OperatorAccAddr) + copy(dAtA[i:], m.OperatorAccAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAccAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *QueryAllOperatorConsAddrsByChainIDRequest) Size() (n int) { +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GetOperatorInfoReq) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Chain) + l = len(m.OperatorAddr) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + return n +} + +func (m *QueryAllOperatorsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l if m.Pagination != nil { l = m.Pagination.Size() n += 1 + l + sovQuery(uint64(l)) @@ -1873,15 +2410,15 @@ func (m *QueryAllOperatorConsAddrsByChainIDRequest) Size() (n int) { return n } -func (m *QueryAllOperatorConsAddrsByChainIDResponse) Size() (n int) { +func (m *QueryAllOperatorsResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.OperatorConsAddrs) > 0 { - for _, e := range m.OperatorConsAddrs { - l = e.Size() + if len(m.OperatorAccAddrs) > 0 { + for _, s := range m.OperatorAccAddrs { + l = len(s) n += 1 + l + sovQuery(uint64(l)) } } @@ -1892,33 +2429,771 @@ func (m *QueryAllOperatorConsAddrsByChainIDResponse) Size() (n int) { return n } -func (m *OperatorConsAddrPair) Size() (n int) { +func (m *OperatorAVSAddressDetails) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.OperatorAccAddr) + l = len(m.OperatorAddr) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.ConsAddr) + l = len(m.AVSAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorUSDValueRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Details != nil { + l = m.Details.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAVSUSDValueRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AVSAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorSlashInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Details != nil { + l = m.Details.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *OperatorSlashInfoByID) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SlashID) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - if m.OptingOut { - n += 2 + if m.Info != nil { + l = m.Info.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorSlashInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AllSlashInfo) > 0 { + for _, e := range m.AllSlashInfo { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorConsKeyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAccAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Chain) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorConsKeyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PublicKey.Size() + n += 1 + l + sovQuery(uint64(l)) + if m.OptingOut { + n += 2 + } + return n +} + +func (m *QueryOperatorConsAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAccAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Chain) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorConsAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConsAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.OptingOut { + n += 2 + } + return n +} + +func (m *QueryAllOperatorConsKeysByChainIDRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Chain) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllOperatorConsKeysByChainIDResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.OperatorConsKeys) > 0 { + for _, e := range m.OperatorConsKeys { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *OperatorConsKeyPair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAccAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.PublicKey != nil { + l = m.PublicKey.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.OptingOut { + n += 2 + } + return n +} + +func (m *QueryAllOperatorConsAddrsByChainIDRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Chain) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllOperatorConsAddrsByChainIDResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.OperatorConsAddrs) > 0 { + for _, e := range m.OperatorConsAddrs { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *OperatorConsAddrPair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAccAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ConsAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.OptingOut { + n += 2 + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetOperatorInfoReq: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetOperatorInfoReq: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OperatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllOperatorsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllOperatorsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllOperatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllOperatorsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllOperatorsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllOperatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAccAddrs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OperatorAccAddrs = append(m.OperatorAccAddrs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OperatorAVSAddressDetails) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OperatorAVSAddressDetails: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OperatorAVSAddressDetails: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OperatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AVSAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF } - return n + return nil } +func (m *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOperatorUSDValueRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOperatorUSDValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Details == nil { + m.Details = &OperatorAVSAddressDetails{} + } + if err := m.Details.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { +func (m *QueryAVSUSDValueRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1941,15 +3216,15 @@ func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetOperatorInfoReq: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAVSUSDValueRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetOperatorInfoReq: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAVSUSDValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1977,7 +3252,7 @@ func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OperatorAddr = string(dAtA[iNdEx:postIndex]) + m.AVSAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2000,7 +3275,7 @@ func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllOperatorsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2023,13 +3298,49 @@ func (m *QueryAllOperatorsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllOperatorsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryOperatorSlashInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllOperatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryOperatorSlashInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Details == nil { + m.Details = &OperatorAVSAddressDetails{} + } + if err := m.Details.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } @@ -2086,7 +3397,7 @@ func (m *QueryAllOperatorsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllOperatorsResponse) Unmarshal(dAtA []byte) error { +func (m *OperatorSlashInfoByID) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2109,15 +3420,15 @@ func (m *QueryAllOperatorsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllOperatorsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: OperatorSlashInfoByID: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllOperatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OperatorSlashInfoByID: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAccAddrs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SlashID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2145,7 +3456,127 @@ func (m *QueryAllOperatorsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OperatorAccAddrs = append(m.OperatorAccAddrs, string(dAtA[iNdEx:postIndex])) + m.SlashID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Info == nil { + m.Info = &OperatorSlashInfo{} + } + if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryOperatorSlashInfoResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOperatorSlashInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOperatorSlashInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllSlashInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllSlashInfo = append(m.AllSlashInfo, &OperatorSlashInfoByID{}) + if err := m.AllSlashInfo[len(m.AllSlashInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { diff --git a/x/operator/types/query.pb.gw.go b/x/operator/types/query.pb.gw.go index e4ce40c91..dd2a98902 100644 --- a/x/operator/types/query.pb.gw.go +++ b/x/operator/types/query.pb.gw.go @@ -347,6 +347,114 @@ func local_request_Query_QueryAllOperatorConsKeysByChainID_0(ctx context.Context } +var ( + filter_Query_QueryOperatorUSDValue_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryOperatorUSDValue_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOperatorUSDValueRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryOperatorUSDValue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryOperatorUSDValue(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryOperatorUSDValue_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOperatorUSDValueRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryOperatorUSDValue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryOperatorUSDValue(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryAVSUSDValue_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryAVSUSDValue_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAVSUSDValueRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAVSUSDValue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryAVSUSDValue(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAVSUSDValue_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAVSUSDValueRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAVSUSDValue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryAVSUSDValue(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryOperatorSlashInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryOperatorSlashInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOperatorSlashInfoRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryOperatorSlashInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryOperatorSlashInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryOperatorSlashInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOperatorSlashInfoRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryOperatorSlashInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryOperatorSlashInfo(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_QueryAllOperatorConsAddrsByChainID_0 = &utilities.DoubleArray{Encoding: map[string]int{"chain": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) @@ -540,6 +648,75 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryOperatorUSDValue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryOperatorUSDValue_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryOperatorUSDValue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAVSUSDValue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryAVSUSDValue_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAVSUSDValue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryOperatorSlashInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryOperatorSlashInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryOperatorSlashInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryAllOperatorConsAddrsByChainID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -704,6 +881,66 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryOperatorUSDValue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryOperatorUSDValue_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryOperatorUSDValue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAVSUSDValue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryAVSUSDValue_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAVSUSDValue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryOperatorSlashInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryOperatorSlashInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryOperatorSlashInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryAllOperatorConsAddrsByChainID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -738,6 +975,12 @@ var ( pattern_Query_QueryAllOperatorConsKeysByChainID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"exocore", "operator", "v1", "all_operator_cons_keys", "chain"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryOperatorUSDValue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "operator", "v1", "QueryOperatorUSDValue"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAVSUSDValue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "operator", "v1", "QueryAVSUSDValue"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryOperatorSlashInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "operator", "v1", "QueryOperatorSlashInfo"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryAllOperatorConsAddrsByChainID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"exocore", "operator", "v1", "all_operator_cons_addrs", "chain"}, "", runtime.AssumeColonVerbOpt(false))) ) @@ -752,5 +995,11 @@ var ( forward_Query_QueryAllOperatorConsKeysByChainID_0 = runtime.ForwardResponseMessage + forward_Query_QueryOperatorUSDValue_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAVSUSDValue_0 = runtime.ForwardResponseMessage + + forward_Query_QueryOperatorSlashInfo_0 = runtime.ForwardResponseMessage + forward_Query_QueryAllOperatorConsAddrsByChainID_0 = runtime.ForwardResponseMessage ) diff --git a/x/operator/types/tx.pb.go b/x/operator/types/tx.pb.go index 97c8639b1..bc37b3ce7 100644 --- a/x/operator/types/tx.pb.go +++ b/x/operator/types/tx.pb.go @@ -406,6 +406,170 @@ func (m *OptedInAssetState) XXX_DiscardUnknown() { var xxx_messageInfo_OptedInAssetState proto.InternalMessageInfo +// SlashFromUndelegation records the slash detail from the undelegation +type SlashFromUndelegation struct { + // staker_id is the staker id. + StakerID string `protobuf:"bytes,1,opt,name=staker_id,json=stakerId,proto3" json:"staker_id,omitempty"` + // asset_id is the asset id. + AssetID string `protobuf:"bytes,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + // amount is the slashed amount from the undelegation. + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` +} + +func (m *SlashFromUndelegation) Reset() { *m = SlashFromUndelegation{} } +func (m *SlashFromUndelegation) String() string { return proto.CompactTextString(m) } +func (*SlashFromUndelegation) ProtoMessage() {} +func (*SlashFromUndelegation) Descriptor() ([]byte, []int) { + return fileDescriptor_b229d5663e4df167, []int{6} +} +func (m *SlashFromUndelegation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlashFromUndelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SlashFromUndelegation.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SlashFromUndelegation) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlashFromUndelegation.Merge(m, src) +} +func (m *SlashFromUndelegation) XXX_Size() int { + return m.Size() +} +func (m *SlashFromUndelegation) XXX_DiscardUnknown() { + xxx_messageInfo_SlashFromUndelegation.DiscardUnknown(m) +} + +var xxx_messageInfo_SlashFromUndelegation proto.InternalMessageInfo + +func (m *SlashFromUndelegation) GetStakerID() string { + if m != nil { + return m.StakerID + } + return "" +} + +func (m *SlashFromUndelegation) GetAssetID() string { + if m != nil { + return m.AssetID + } + return "" +} + +// SlashFromAssetsPool records the slash detail from the operator assets pool +type SlashFromAssetsPool struct { + // asset_id is the asset id. + AssetID string `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + // amount is the slashed amount from the assets pool. + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` +} + +func (m *SlashFromAssetsPool) Reset() { *m = SlashFromAssetsPool{} } +func (m *SlashFromAssetsPool) String() string { return proto.CompactTextString(m) } +func (*SlashFromAssetsPool) ProtoMessage() {} +func (*SlashFromAssetsPool) Descriptor() ([]byte, []int) { + return fileDescriptor_b229d5663e4df167, []int{7} +} +func (m *SlashFromAssetsPool) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlashFromAssetsPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SlashFromAssetsPool.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SlashFromAssetsPool) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlashFromAssetsPool.Merge(m, src) +} +func (m *SlashFromAssetsPool) XXX_Size() int { + return m.Size() +} +func (m *SlashFromAssetsPool) XXX_DiscardUnknown() { + xxx_messageInfo_SlashFromAssetsPool.DiscardUnknown(m) +} + +var xxx_messageInfo_SlashFromAssetsPool proto.InternalMessageInfo + +func (m *SlashFromAssetsPool) GetAssetID() string { + if m != nil { + return m.AssetID + } + return "" +} + +// SlashExecutionInfo is the actual execution state for a slash event +type SlashExecutionInfo struct { + // slash_proportion is the new calculated proportion when execute the slash + SlashProportion github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=slash_proportion,json=slashProportion,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_proportion"` + // slash_value is the usd value of all slashed assets + SlashValue github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=slash_value,json=slashValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_value"` + // SlashUndelegations records all slash info related to the undelegation + SlashUndelegations []*SlashFromUndelegation `protobuf:"bytes,3,rep,name=slash_undelegations,json=slashUndelegations,proto3" json:"slash_undelegations,omitempty"` + // SlashFromAssetsPool records all slash info related to the assets pool + SlashAssetsPool []*SlashFromAssetsPool `protobuf:"bytes,4,rep,name=slash_assets_pool,json=slashAssetsPool,proto3" json:"slash_assets_pool,omitempty"` +} + +func (m *SlashExecutionInfo) Reset() { *m = SlashExecutionInfo{} } +func (m *SlashExecutionInfo) String() string { return proto.CompactTextString(m) } +func (*SlashExecutionInfo) ProtoMessage() {} +func (*SlashExecutionInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_b229d5663e4df167, []int{8} +} +func (m *SlashExecutionInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlashExecutionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SlashExecutionInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SlashExecutionInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlashExecutionInfo.Merge(m, src) +} +func (m *SlashExecutionInfo) XXX_Size() int { + return m.Size() +} +func (m *SlashExecutionInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SlashExecutionInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SlashExecutionInfo proto.InternalMessageInfo + +func (m *SlashExecutionInfo) GetSlashUndelegations() []*SlashFromUndelegation { + if m != nil { + return m.SlashUndelegations + } + return nil +} + +func (m *SlashExecutionInfo) GetSlashAssetsPool() []*SlashFromAssetsPool { + if m != nil { + return m.SlashAssetsPool + } + return nil +} + // OperatorSlashInfo is the slash info of operator type OperatorSlashInfo struct { // slash_contract is the address of slash contract @@ -414,21 +578,21 @@ type OperatorSlashInfo struct { SubmittedHeight int64 `protobuf:"varint,2,opt,name=submitted_height,json=submittedHeight,proto3" json:"submitted_height,omitempty"` // event_height is the exocore block height at which the slash event occurs EventHeight int64 `protobuf:"varint,3,opt,name=event_height,json=eventHeight,proto3" json:"event_height,omitempty"` - // processed_height is the exocore block height at which the slash event is processed - ProcessedHeight int64 `protobuf:"varint,4,opt,name=processed_height,json=processedHeight,proto3" json:"processed_height,omitempty"` // is_vetoed is a flag to indicate if this slash is vetoed - IsVetoed bool `protobuf:"varint,5,opt,name=is_vetoed,json=isVetoed,proto3" json:"is_vetoed,omitempty"` + IsVetoed bool `protobuf:"varint,4,opt,name=is_vetoed,json=isVetoed,proto3" json:"is_vetoed,omitempty"` // slash_proportion is the proportion of assets that need to be slashed - SlashProportion github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=slash_proportion,json=slashProportion,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_proportion"` - // type indicates the slash type. - SlashType SlashType `protobuf:"varint,7,opt,name=slash_type,json=slashType,proto3,enum=exocore.operator.v1.SlashType" json:"slash_type,omitempty"` + SlashProportion github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=slash_proportion,json=slashProportion,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_proportion"` + // slash_type indicates the slash type of specified AVS. + SlashType uint32 `protobuf:"varint,6,opt,name=slash_type,json=slashType,proto3" json:"slash_type,omitempty"` + // SlashExecutionInfo stores the slashed execution information + ExecutionInfo *SlashExecutionInfo `protobuf:"bytes,7,opt,name=execution_info,json=executionInfo,proto3" json:"execution_info,omitempty"` } func (m *OperatorSlashInfo) Reset() { *m = OperatorSlashInfo{} } func (m *OperatorSlashInfo) String() string { return proto.CompactTextString(m) } func (*OperatorSlashInfo) ProtoMessage() {} func (*OperatorSlashInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{6} + return fileDescriptor_b229d5663e4df167, []int{9} } func (m *OperatorSlashInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -478,13 +642,6 @@ func (m *OperatorSlashInfo) GetEventHeight() int64 { return 0 } -func (m *OperatorSlashInfo) GetProcessedHeight() int64 { - if m != nil { - return m.ProcessedHeight - } - return 0 -} - func (m *OperatorSlashInfo) GetIsVetoed() bool { if m != nil { return m.IsVetoed @@ -492,11 +649,18 @@ func (m *OperatorSlashInfo) GetIsVetoed() bool { return false } -func (m *OperatorSlashInfo) GetSlashType() SlashType { +func (m *OperatorSlashInfo) GetSlashType() uint32 { if m != nil { return m.SlashType } - return SlashType_SLASH_TYPE_UNSPECIFIED + return 0 +} + +func (m *OperatorSlashInfo) GetExecutionInfo() *SlashExecutionInfo { + if m != nil { + return m.ExecutionInfo + } + return nil } // RegisterOperatorReq is the request to register a new operator. @@ -511,7 +675,7 @@ func (m *RegisterOperatorReq) Reset() { *m = RegisterOperatorReq{} } func (m *RegisterOperatorReq) String() string { return proto.CompactTextString(m) } func (*RegisterOperatorReq) ProtoMessage() {} func (*RegisterOperatorReq) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{7} + return fileDescriptor_b229d5663e4df167, []int{10} } func (m *RegisterOperatorReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -548,7 +712,7 @@ func (m *RegisterOperatorResponse) Reset() { *m = RegisterOperatorRespon func (m *RegisterOperatorResponse) String() string { return proto.CompactTextString(m) } func (*RegisterOperatorResponse) ProtoMessage() {} func (*RegisterOperatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{8} + return fileDescriptor_b229d5663e4df167, []int{11} } func (m *RegisterOperatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -592,7 +756,7 @@ func (m *OptIntoAVSReq) Reset() { *m = OptIntoAVSReq{} } func (m *OptIntoAVSReq) String() string { return proto.CompactTextString(m) } func (*OptIntoAVSReq) ProtoMessage() {} func (*OptIntoAVSReq) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{9} + return fileDescriptor_b229d5663e4df167, []int{12} } func (m *OptIntoAVSReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -629,7 +793,7 @@ func (m *OptIntoAVSResponse) Reset() { *m = OptIntoAVSResponse{} } func (m *OptIntoAVSResponse) String() string { return proto.CompactTextString(m) } func (*OptIntoAVSResponse) ProtoMessage() {} func (*OptIntoAVSResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{10} + return fileDescriptor_b229d5663e4df167, []int{13} } func (m *OptIntoAVSResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -670,7 +834,7 @@ func (m *OptOutOfAVSReq) Reset() { *m = OptOutOfAVSReq{} } func (m *OptOutOfAVSReq) String() string { return proto.CompactTextString(m) } func (*OptOutOfAVSReq) ProtoMessage() {} func (*OptOutOfAVSReq) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{11} + return fileDescriptor_b229d5663e4df167, []int{14} } func (m *OptOutOfAVSReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -707,7 +871,7 @@ func (m *OptOutOfAVSResponse) Reset() { *m = OptOutOfAVSResponse{} } func (m *OptOutOfAVSResponse) String() string { return proto.CompactTextString(m) } func (*OptOutOfAVSResponse) ProtoMessage() {} func (*OptOutOfAVSResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{12} + return fileDescriptor_b229d5663e4df167, []int{15} } func (m *OptOutOfAVSResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -753,7 +917,7 @@ func (m *SetConsKeyReq) Reset() { *m = SetConsKeyReq{} } func (m *SetConsKeyReq) String() string { return proto.CompactTextString(m) } func (*SetConsKeyReq) ProtoMessage() {} func (*SetConsKeyReq) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{13} + return fileDescriptor_b229d5663e4df167, []int{16} } func (m *SetConsKeyReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -790,7 +954,7 @@ func (m *SetConsKeyResponse) Reset() { *m = SetConsKeyResponse{} } func (m *SetConsKeyResponse) String() string { return proto.CompactTextString(m) } func (*SetConsKeyResponse) ProtoMessage() {} func (*SetConsKeyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{14} + return fileDescriptor_b229d5663e4df167, []int{17} } func (m *SetConsKeyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -827,6 +991,9 @@ func init() { proto.RegisterType((*OperatorInfo)(nil), "exocore.operator.v1.OperatorInfo") proto.RegisterType((*OptedInfo)(nil), "exocore.operator.v1.OptedInfo") proto.RegisterType((*OptedInAssetState)(nil), "exocore.operator.v1.OptedInAssetState") + proto.RegisterType((*SlashFromUndelegation)(nil), "exocore.operator.v1.SlashFromUndelegation") + proto.RegisterType((*SlashFromAssetsPool)(nil), "exocore.operator.v1.SlashFromAssetsPool") + proto.RegisterType((*SlashExecutionInfo)(nil), "exocore.operator.v1.SlashExecutionInfo") proto.RegisterType((*OperatorSlashInfo)(nil), "exocore.operator.v1.OperatorSlashInfo") proto.RegisterType((*RegisterOperatorReq)(nil), "exocore.operator.v1.RegisterOperatorReq") proto.RegisterType((*RegisterOperatorResponse)(nil), "exocore.operator.v1.RegisterOperatorResponse") @@ -841,83 +1008,94 @@ func init() { func init() { proto.RegisterFile("exocore/operator/v1/tx.proto", fileDescriptor_b229d5663e4df167) } var fileDescriptor_b229d5663e4df167 = []byte{ - // 1212 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1b, 0x45, -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d, 0xc6, 0x8b, 0x68, - 0x9c, 0xb6, 0x47, 0x06, 0xa0, 0xff, 0x36, 0x06, 0xd3, 0x75, 0x95, 0x97, 0x88, 0xe6, 0x02, 0x24, - 0x94, 0x3b, 0x95, 0xfe, 0xe2, 0x10, 0x8c, 0xe9, 0x00, 0xe4, 0x5e, 0x68, 0x0e, 0xa6, 0x2d, 0xcf, - 0xf3, 0x49, 0x0f, 0x87, 0xf7, 0x88, 0x2b, 0x4c, 0x50, 0xde, 0x05, 0x14, 0xd4, 0xcb, 0xec, 0x60, - 0x66, 0x89, 0xba, 0xa6, 0xa3, 0x82, 0x98, 0x0a, 0x2c, 0x37, 0x31, 0xb3, 0xc4, 0xae, 0x6d, 0xc8, - 0x8c, 0xca, 0x40, 0x85, 0x30, 0x7e, 0x5e, 0x7b, 0xcd, 0x83, 0xe0, 0x75, 0x37, 0xce, 0x1c, 0xcc, - 0x59, 0x86, 0x7f, 0x13, 0xc0, 0x26, 0x9d, 0x8e, 0x43, 0xa9, 0x43, 0xdc, 0xf4, 0x09, 0xa1, 0xae, - 0x17, 0x54, 0xd3, 0x04, 0xed, 0xac, 0xda, 0xbb, 0x50, 0x1e, 0x30, 0x97, 0x63, 0xbc, 0x13, 0x7f, - 0xd9, 0x7b, 0x34, 0xaf, 0x19, 0x21, 0x01, 0xfd, 0x27, 0x0d, 0x62, 0x75, 0x8f, 0xe1, 0xa6, 0x48, - 0xe5, 0x22, 0xcc, 0xd0, 0xb6, 0x45, 0x37, 0x4d, 0x9b, 0xb8, 0xcc, 0xb7, 0x6c, 0xd5, 0xc6, 0x46, - 0x42, 0xa0, 0x65, 0x05, 0xa2, 0x4b, 0x90, 0x24, 0xdc, 0xc7, 0x74, 0x5c, 0x73, 0x13, 0x3b, 0xad, - 0x4d, 0x26, 0xaa, 0x38, 0x6e, 0x24, 0x88, 0x94, 0xba, 0x2e, 0x40, 0x94, 0x87, 0x94, 0xe4, 0x91, - 0x2e, 0x0b, 0x88, 0x51, 0x41, 0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87, 0xa6, 0xe3, 0x10, 0xf1, 0x83, 0x03, - 0x83, 0x3e, 0x87, 0x78, 0xa8, 0x0f, 0xd1, 0x85, 0xc3, 0xfc, 0x42, 0xbd, 0x9b, 0xc9, 0x1f, 0x4d, - 0x92, 0xea, 0x99, 0x13, 0x5f, 0xf3, 0x57, 0xc3, 0xf2, 0xea, 0xd3, 0x9d, 0xac, 0xf6, 0x6c, 0x27, - 0xab, 0xfd, 0xb5, 0x93, 0xd5, 0x7e, 0xd8, 0xcd, 0x46, 0x9e, 0xed, 0x66, 0x23, 0x7f, 0xec, 0x66, - 0x23, 0x9f, 0x2d, 0x85, 0xee, 0xfb, 0x8a, 0x14, 0xad, 0x61, 0xf6, 0x15, 0xf1, 0xb7, 0x8a, 0xc1, - 0xab, 0xfe, 0xfe, 0xfe, 0xbb, 0x5e, 0xdc, 0xff, 0xeb, 0x13, 0xe2, 0x01, 0xfd, 0xde, 0xbf, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x31, 0x4a, 0x45, 0x23, 0xf8, 0x0b, 0x00, 0x00, + // 1382 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcb, 0x6f, 0x13, 0x57, + 0x17, 0xf7, 0xc4, 0x79, 0xf9, 0x38, 0x4e, 0x9c, 0x1b, 0x1e, 0xc6, 0x1f, 0xc4, 0x64, 0xf8, 0x80, + 0x10, 0x7d, 0xb1, 0x95, 0x7c, 0xa5, 0x52, 0x69, 0x17, 0x75, 0x62, 0x47, 0x58, 0x04, 0x3b, 0x1a, + 0x07, 0x24, 0x4a, 0xab, 0xd1, 0x64, 0x7c, 0xe3, 0x4c, 0x33, 0x9e, 0x3b, 0x9d, 0x7b, 0xed, 0x26, + 0xac, 0xaa, 0xae, 0xaa, 0x6e, 0xa8, 0xd4, 0x55, 0xa5, 0x2e, 0x58, 0x55, 0x5d, 0xb2, 0x60, 0x8b, + 0x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 0xb9, 0x8e, 0x99, + 0x25, 0x4e, 0x75, 0x21, 0xdb, 0x2f, 0x02, 0xe5, 0xc2, 0xe0, 0x59, 0xed, 0x0d, 0x2f, 0x82, 0xe7, + 0xdd, 0x38, 0xf9, 0x62, 0xcc, 0xd2, 0xfd, 0xeb, 0x00, 0x36, 0x69, 0xb5, 0x1c, 0x4a, 0x1d, 0xe2, + 0x65, 0x86, 0x84, 0xba, 0x9e, 0x57, 0x45, 0x13, 0x96, 0xb3, 0x2a, 0xef, 0xfc, 0x72, 0x97, 0xb9, + 0x94, 0xe0, 0x95, 0xf8, 0xe3, 0xb3, 0xfb, 0x73, 0x9a, 0x11, 0x11, 0xd0, 0xbf, 0xd7, 0x20, 0x51, + 0xf3, 0x19, 0x6e, 0x88, 0x50, 0xce, 0xc3, 0x38, 0x75, 0x2d, 0xba, 0x65, 0xda, 0xc4, 0x63, 0x81, + 0x65, 0xab, 0x32, 0x36, 0x52, 0x02, 0x5d, 0x56, 0x20, 0xba, 0x00, 0x13, 0x84, 0xdb, 0x98, 0x8e, + 0x67, 0x6e, 0x61, 0xa7, 0xb9, 0xc5, 0x44, 0x16, 0x07, 0x8d, 0x14, 0x91, 0x52, 0x57, 0x05, 0x88, + 0x66, 0x21, 0x2d, 0x79, 0xa4, 0xcd, 0x42, 0x62, 0x5c, 0x10, 0xc7, 0x05, 0x5e, 0x6b, 0x33, 0xc5, + 0x3c, 0x01, 0xc3, 0x9f, 0x5a, 0x8e, 0x8b, 0x1b, 0x22, 0x5f, 0xa3, 0x86, 0x5a, 0xe9, 0x0f, 0x35, + 0x98, 0x54, 0xee, 0x15, 0x29, 0xc5, 0xac, 0xce, 0x2c, 0x86, 0xdf, 0xaa, 0xcb, 0x2a, 0x1e, 0x8b, + 0x74, 0x59, 0xc5, 0x63, 0x61, 0x97, 0x21, 0x03, 0x86, 0x3a, 0xbc, 0x93, 0x65, 0x45, 0xbc, 0x65, + 0xeb, 0x4a, 0x29, 0xfd, 0x67, 0x0d, 0x8e, 0xd7, 0x79, 0xee, 0x56, 0x02, 0xd2, 0xba, 0xe1, 0x35, + 0xb0, 0x8b, 0x9b, 0x16, 0x73, 0x88, 0x87, 0x2e, 0x41, 0x82, 0xdf, 0x16, 0x0e, 0xc2, 0x86, 0x49, + 0x2c, 0x8d, 0xed, 0xef, 0xe5, 0x46, 0xeb, 0x02, 0xac, 0x94, 0x8c, 0x51, 0xb9, 0x5d, 0x69, 0xa0, + 0x0b, 0x30, 0x6a, 0xf1, 0xe0, 0x39, 0x53, 0xfa, 0x96, 0xdc, 0xdf, 0xcb, 0x8d, 0x88, 0x84, 0x54, + 0x4a, 0xc6, 0x88, 0xd8, 0xac, 0x44, 0x87, 0x4f, 0xfc, 0xe8, 0xd2, 0xa2, 0x7f, 0xab, 0xc1, 0x54, + 0x37, 0x04, 0x71, 0x26, 0x5d, 0x23, 0xc4, 0xed, 0xf1, 0x4a, 0x7b, 0x2d, 0xaf, 0x06, 0x8e, 0xd0, + 0xab, 0xbb, 0x71, 0x40, 0xc2, 0xab, 0xf2, 0x0e, 0xb6, 0xdb, 0x3c, 0xa3, 0xa2, 0x80, 0x9b, 0x90, + 0x96, 0x05, 0xec, 0x07, 0xc4, 0x27, 0x01, 0xc7, 0x8f, 0x64, 0x12, 0x4f, 0x08, 0xd5, 0xb5, 0xae, + 0x28, 0xfa, 0x04, 0x92, 0xf2, 0xa0, 0xa3, 0x2b, 0x19, 0x10, 0x82, 0xe2, 0x31, 0x41, 0xb7, 0x61, + 0x4a, 0xca, 0xb7, 0x23, 0x35, 0x43, 0x33, 0x71, 0x31, 0xd5, 0xe7, 0xfa, 0x0e, 0x93, 0xbe, 0x65, + 0x66, 0x20, 0x21, 0x13, 0x85, 0x28, 0x5a, 0x87, 0x49, 0x29, 0x2e, 0xae, 0x88, 0x9a, 0x3e, 0x21, + 0x6e, 0x66, 0x50, 0x48, 0xcf, 0xbe, 0x5c, 0xfa, 0xe0, 0xfa, 0x55, 0x46, 0x0e, 0x00, 0xfd,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0x2b, + 0xde, 0x8b, 0x8d, 0x61, 0xf1, 0x83, 0xf1, 0xff, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0xa9, 0xe3, + 0x84, 0x58, 0xe8, 0x0e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1384,6 +1562,164 @@ func (m *OptedInAssetState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *SlashFromUndelegation) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SlashFromUndelegation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlashFromUndelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.AssetID) > 0 { + i -= len(m.AssetID) + copy(dAtA[i:], m.AssetID) + i = encodeVarintTx(dAtA, i, uint64(len(m.AssetID))) + i-- + dAtA[i] = 0x12 + } + if len(m.StakerID) > 0 { + i -= len(m.StakerID) + copy(dAtA[i:], m.StakerID) + i = encodeVarintTx(dAtA, i, uint64(len(m.StakerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SlashFromAssetsPool) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SlashFromAssetsPool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlashFromAssetsPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.AssetID) > 0 { + i -= len(m.AssetID) + copy(dAtA[i:], m.AssetID) + i = encodeVarintTx(dAtA, i, uint64(len(m.AssetID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SlashExecutionInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SlashExecutionInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlashExecutionInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SlashAssetsPool) > 0 { + for iNdEx := len(m.SlashAssetsPool) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SlashAssetsPool[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.SlashUndelegations) > 0 { + for iNdEx := len(m.SlashUndelegations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SlashUndelegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + { + size := m.SlashValue.Size() + i -= size + if _, err := m.SlashValue.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.SlashProportion.Size() + i -= size + if _, err := m.SlashProportion.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *OperatorSlashInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1404,10 +1740,22 @@ func (m *OperatorSlashInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ExecutionInfo != nil { + { + size, err := m.ExecutionInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } if m.SlashType != 0 { i = encodeVarintTx(dAtA, i, uint64(m.SlashType)) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x30 } { size := m.SlashProportion.Size() @@ -1418,7 +1766,7 @@ func (m *OperatorSlashInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x32 + dAtA[i] = 0x2a if m.IsVetoed { i-- if m.IsVetoed { @@ -1427,11 +1775,6 @@ func (m *OperatorSlashInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x28 - } - if m.ProcessedHeight != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProcessedHeight)) - i-- dAtA[i] = 0x20 } if m.EventHeight != 0 { @@ -1828,25 +2171,81 @@ func (m *OptedInAssetState) Size() (n int) { return n } -func (m *OperatorSlashInfo) Size() (n int) { +func (m *SlashFromUndelegation) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.SlashContract) + l = len(m.StakerID) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.SubmittedHeight != 0 { + l = len(m.AssetID) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *SlashFromAssetsPool) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AssetID) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *SlashExecutionInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.SlashProportion.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.SlashValue.Size() + n += 1 + l + sovTx(uint64(l)) + if len(m.SlashUndelegations) > 0 { + for _, e := range m.SlashUndelegations { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.SlashAssetsPool) > 0 { + for _, e := range m.SlashAssetsPool { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *OperatorSlashInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SlashContract) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.SubmittedHeight != 0 { n += 1 + sovTx(uint64(m.SubmittedHeight)) } if m.EventHeight != 0 { n += 1 + sovTx(uint64(m.EventHeight)) } - if m.ProcessedHeight != 0 { - n += 1 + sovTx(uint64(m.ProcessedHeight)) - } if m.IsVetoed { n += 2 } @@ -1855,6 +2254,10 @@ func (m *OperatorSlashInfo) Size() (n int) { if m.SlashType != 0 { n += 1 + sovTx(uint64(m.SlashType)) } + if m.ExecutionInfo != nil { + l = m.ExecutionInfo.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2718,7 +3121,7 @@ func (m *OptedInAssetState) Unmarshal(dAtA []byte) error { } return nil } -func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { +func (m *SlashFromUndelegation) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2741,15 +3144,15 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: OperatorSlashInfo: wiretype end group for non-group") + return fmt.Errorf("proto: SlashFromUndelegation: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: OperatorSlashInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SlashFromUndelegation: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlashContract", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakerID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2777,13 +3180,13 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SlashContract = string(dAtA[iNdEx:postIndex]) + m.StakerID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SubmittedHeight", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetID", wireType) } - m.SubmittedHeight = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2793,16 +3196,29 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.SubmittedHeight |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssetID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EventHeight", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } - m.EventHeight = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2812,16 +3228,81 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.EventHeight |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessedHeight", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SlashFromAssetsPool) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SlashFromAssetsPool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SlashFromAssetsPool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetID", wireType) } - m.ProcessedHeight = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2831,16 +3312,29 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ProcessedHeight |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsVetoed", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx } - var v int + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssetID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2850,13 +3344,77 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.IsVetoed = bool(v != 0) - case 6: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SlashExecutionInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SlashExecutionInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SlashExecutionInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SlashProportion", wireType) } @@ -2890,11 +3448,11 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SlashType", wireType) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashValue", wireType) } - m.SlashType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2904,11 +3462,323 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.SlashType |= SlashType(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SlashValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashUndelegations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SlashUndelegations = append(m.SlashUndelegations, &SlashFromUndelegation{}) + if err := m.SlashUndelegations[len(m.SlashUndelegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashAssetsPool", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SlashAssetsPool = append(m.SlashAssetsPool, &SlashFromAssetsPool{}) + if err := m.SlashAssetsPool[len(m.SlashAssetsPool)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OperatorSlashInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OperatorSlashInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashContract", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SlashContract = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SubmittedHeight", wireType) + } + m.SubmittedHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SubmittedHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EventHeight", wireType) + } + m.EventHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EventHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsVetoed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsVetoed = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashProportion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SlashProportion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashType", wireType) + } + m.SlashType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SlashType |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutionInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExecutionInfo == nil { + m.ExecutionInfo = &SlashExecutionInfo{} + } + if err := m.ExecutionInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/oracle/types/params.pb.go b/x/oracle/types/params.pb.go index a5eb2565e..bbfb6facc 100644 --- a/x/oracle/types/params.pb.go +++ b/x/oracle/types/params.pb.go @@ -43,7 +43,7 @@ type Params struct { ThresholdB int32 `protobuf:"varint,8,opt,name=threshold_b,json=thresholdB,proto3" json:"threshold_b,omitempty"` // for v1, mode=1, get final price as soon as voting power reach threshold_a/threshold_b Mode int32 `protobuf:"varint,9,opt,name=mode,proto3" json:"mode,omitempty"` - // for each round, a validator only allowed to provide at most max_det_id continuos rounds of prices from deterministic source + // for each round, a validator only allowed to provide at most max_det_id continuos rounds of prices for DS MaxDetId int32 `protobuf:"varint,10,opt,name=max_det_id,json=maxDetId,proto3" json:"max_det_id,omitempty"` } diff --git a/x/reward/types/codec.go b/x/reward/types/codec.go index 19151ace3..5de656e44 100644 --- a/x/reward/types/codec.go +++ b/x/reward/types/codec.go @@ -10,10 +10,10 @@ import ( var ( amino = codec.NewLegacyAmino() - // ModuleCdc references the global erc20 module codec. Note, the codec should + // ModuleCdc references the global module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // - // The actual codec used for serialization should be provided to modules/erc20 and + // The actual codec used for serialization should be provided to modules and // defined at the application level. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) diff --git a/x/reward/types/query.pb.gw.go b/x/reward/types/query.pb.gw.go index 17252797c..67784ea28 100644 --- a/x/reward/types/query.pb.gw.go +++ b/x/reward/types/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryParamsRequest @@ -52,12 +54,14 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -65,6 +69,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/x/slash/types/codec.go b/x/slash/types/codec.go index a9a1a9d9a..af71901aa 100644 --- a/x/slash/types/codec.go +++ b/x/slash/types/codec.go @@ -10,10 +10,10 @@ import ( var ( amino = codec.NewLegacyAmino() - // ModuleCdc references the global erc20 module codec. Note, the codec should + // ModuleCdc references the global module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // - // The actual codec used for serialization should be provided to modules/erc20 and + // The actual codec used for serialization should be provided to modules and // defined at the application level. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) diff --git a/x/slash/types/query.pb.gw.go b/x/slash/types/query.pb.gw.go index 9edbdedb6..82bdc46cb 100644 --- a/x/slash/types/query.pb.gw.go +++ b/x/slash/types/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryParamsRequest @@ -52,12 +54,14 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -65,6 +69,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)