diff --git a/app/app.go b/app/app.go index 26fbbd141..1fa133918 100644 --- a/app/app.go +++ b/app/app.go @@ -622,9 +622,9 @@ func NewExocoreApp( // set exoCore staking keepers app.AssetsKeeper = assetsKeeper.NewKeeper(keys[assetsTypes.StoreKey], appCodec) app.DepositKeeper = depositKeeper.NewKeeper(keys[depositTypes.StoreKey], appCodec, app.AssetsKeeper) - app.OperatorKeeper = operatorKeeper.NewKeeper(keys[operatorTypes.StoreKey], appCodec, app.AssetsKeeper, operatorTypes.MockOracle{}, operatorTypes.MockAVS{}, delegationTypes.VirtualISlashKeeper{}) + app.OperatorKeeper = operatorKeeper.NewKeeper(keys[operatorTypes.StoreKey], appCodec, app.AssetsKeeper, operatorTypes.MockOracle{}, operatorTypes.MockAvs{}, delegationTypes.VirtualSlashKeeper{}) // todo: need to replace the virtual keepers with actual keepers after they have been implemented - app.DelegationKeeper = delegationKeeper.NewKeeper(keys[depositTypes.StoreKey], appCodec, app.AssetsKeeper, app.DepositKeeper, delegationTypes.VirtualISlashKeeper{}, &app.OperatorKeeper) + app.DelegationKeeper = delegationKeeper.NewKeeper(keys[depositTypes.StoreKey], appCodec, app.AssetsKeeper, delegationTypes.VirtualSlashKeeper{}, &app.OperatorKeeper) app.OperatorKeeper.RegisterExpectDelegationInterface(&app.DelegationKeeper) app.WithdrawKeeper = *withdrawKeeper.NewKeeper(appCodec, keys[withdrawTypes.StoreKey], app.AssetsKeeper, app.DepositKeeper) diff --git a/proto/exocore/operator/v1/query.proto b/proto/exocore/operator/v1/query.proto index 633f0a2c3..e9e53c643 100644 --- a/proto/exocore/operator/v1/query.proto +++ b/proto/exocore/operator/v1/query.proto @@ -11,7 +11,7 @@ option go_package = "github.com/ExocoreNetwork/exocore/x/operator/types"; // QueryOperatorInfoReq is the request to obtain the operator information. message GetOperatorInfoReq { - // operator_addr is the operator address. + // operator_addr is the operator address,its type should be a sdk.AccAddress string operator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } diff --git a/proto/exocore/operator/v1/tx.proto b/proto/exocore/operator/v1/tx.proto index 2a684ed12..29199fdec 100644 --- a/proto/exocore/operator/v1/tx.proto +++ b/proto/exocore/operator/v1/tx.proto @@ -113,8 +113,8 @@ message RegisterOperatorReq { // RegisterOperatorResponse is the response to a register operator request. message RegisterOperatorResponse{} -// OptInToChainIDRequest defines the OptInToChainID request. -message OptInToChainIDRequest { +// OptInToCosmosChainRequest defines the OptInToCosmosChain request. +message OptInToCosmosChainRequest { option (cosmos.msg.v1.signer) = "address"; // address is the operator address string address = 1; @@ -127,12 +127,12 @@ message OptInToChainIDRequest { string public_key = 3; } -// OptInToChainIDResponse defines the OptInToChainID response. -message OptInToChainIDResponse { +// OptInToCosmosChainResponse defines the OptInToCosmosChain response. +message OptInToCosmosChainResponse { } -// InitiateOptOutFromChainIDRequest defines the InitiateOptOutFromChainID request. -message InitiateOptOutFromChainIDRequest { +// InitiateOptOutFromCosmosChainRequest defines the InitiateOptOutFromCosmosChain request. +message InitiateOptOutFromCosmosChainRequest { option (cosmos.msg.v1.signer) = "address"; // address is the operator address string address = 1; @@ -140,8 +140,8 @@ message InitiateOptOutFromChainIDRequest { string chain_id = 2; } -// InitiateOptOutFromChainIDResponse defines the InitiateOptOutFromChainID response. -message InitiateOptOutFromChainIDResponse { +// InitiateOptOutFromCosmosChainResponse defines the InitiateOptOutFromCosmosChain response. +message InitiateOptOutFromCosmosChainResponse { } // Msg defines the operator Msg service. @@ -151,18 +151,14 @@ service Msg { rpc RegisterOperator(RegisterOperatorReq) returns (RegisterOperatorResponse); // add services for dogfood - // OptInToChainID acts as opt in method for an operator to + // OptInToCosmosChain acts as opt in method for an operator to // start validatring on a chain. The operator must sign the request with // the key with which they registered in the system. - rpc OptInToChainID(OptInToChainIDRequest) returns (OptInToChainIDResponse) {}; - // InitiateOptOutFromChainID is a method with which an operator can initiate + rpc OptInToCosmosChain(OptInToCosmosChainRequest) returns (OptInToCosmosChainResponse) {}; + // InitiateOptOutFromCosmosChain is a method with which an operator can initiate // the opt out process from a chain. The operator must sign the request with // the key with which they registered in the system. The opt-out process takes // as long as the chain's unbonding period to complete, plus some loose change // for message relaying across chains. - rpc InitiateOptOutFromChainID(InitiateOptOutFromChainIDRequest) returns (InitiateOptOutFromChainIDResponse) {}; -} - - - - + rpc InitiateOptOutFromCosmosChain(InitiateOptOutFromCosmosChainRequest) returns (InitiateOptOutFromCosmosChainResponse) {}; +} \ No newline at end of file diff --git a/testutil/abci.go b/testutil/abci.go index ca29b6566..368446e31 100644 --- a/testutil/abci.go +++ b/testutil/abci.go @@ -32,10 +32,10 @@ func Commit(ctx sdk.Context, app *app.ExocoreApp, t time.Duration, vs *tmtypes.V return ctx.WithBlockHeader(header), nil } -// CommitAndCreateNewCtx commits a block at a given time creating a Ctx with the current settings +// CommitAndCreateNewCtx commits a block at a given time creating a ctx with the current settings // This is useful to keep test settings that could be affected by EndBlockers, e.g. // setting a baseFee == 0 and expecting this condition to continue after commit -func CommitAndCreateNewCtx(ctx sdk.Context, app *app.ExocoreApp, t time.Duration, vs *tmtypes.ValidatorSet, isUncachedCtx bool) (sdk.Context, error) { +func CommitAndCreateNewCtx(ctx sdk.Context, app *app.ExocoreApp, t time.Duration, vs *tmtypes.ValidatorSet, useUncachedCtx bool) (sdk.Context, error) { header, err := commit(ctx, app, t, vs) if err != nil { return ctx, err @@ -45,7 +45,7 @@ func CommitAndCreateNewCtx(ctx sdk.Context, app *app.ExocoreApp, t time.Duration // but resets other context fields // GasMeter is set as InfiniteGasMeter var newCtx sdk.Context - if isUncachedCtx { + if useUncachedCtx { newCtx = app.BaseApp.NewUncachedContext(false, header) } else { newCtx = app.BaseApp.NewContext(false, header) @@ -228,7 +228,7 @@ func commit(ctx sdk.Context, app *app.ExocoreApp, t time.Duration, vs *tmtypes.V return header, nil } -// checkTxBytes encodes a transaction and calls checkTx on the App. +// checkTxBytes encodes a transaction and calls checkTx on the app. func checkTxBytes(app *app.ExocoreApp, txEncoder sdk.TxEncoder, tx sdk.Tx) (abci.ResponseCheckTx, error) { bz, err := txEncoder(tx) if err != nil { diff --git a/x/assets/types/keys.go b/x/assets/types/keys.go index 02c17b9d2..9f0d9c7a5 100644 --- a/x/assets/types/keys.go +++ b/x/assets/types/keys.go @@ -4,8 +4,6 @@ import ( "fmt" "strings" - sdk "github.com/cosmos/cosmos-sdk/types" - errorsmod "cosmossdk.io/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/ethereum/go-ethereum/common" @@ -140,17 +138,3 @@ func ParseJoinedStoreKey(key []byte, number int) (keys []string, err error) { } return stringList, nil } - -// add for dogfood -func OperatorSnapshotKey(operatorAddr sdk.AccAddress, height uint64) []byte { - base := []byte{prefixOperatorSnapshot} - base = append(base, operatorAddr.Bytes()...) - base = append(base, sdk.Uint64ToBigEndian(height)...) - return base -} - -func OperatorLastSnapshotHeightKey(operatorAddr sdk.AccAddress) []byte { - base := []byte{prefixOperatorLastSnapshotHeight} - base = append(base, operatorAddr.Bytes()...) - return base -} diff --git a/x/assets/types/tx.pb.go b/x/assets/types/tx.pb.go index 6ad057798..b5a1a7238 100644 --- a/x/assets/types/tx.pb.go +++ b/x/assets/types/tx.pb.go @@ -840,11 +840,10 @@ func (m *RegisterAssetResponse) XXX_DiscardUnknown() { var xxx_messageInfo_RegisterAssetResponse proto.InternalMessageInfo // MsgUpdateParams is the Msg/UpdateParams request type for Erc20 parameters. -// Since: cosmos-sdk 0.47 type MsgUpdateParams struct { // authority is the address of the governance account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the x/evm parameters to update. + // params defines the x/assets parameters to update. // NOTE: All parameters must be supplied. Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` } @@ -898,7 +897,6 @@ func (m *MsgUpdateParams) GetParams() Params { // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. -// Since: cosmos-sdk 0.47 type MsgUpdateParamsResponse struct { } diff --git a/x/delegation/keeper/abci.go b/x/delegation/keeper/abci.go index f19a9fd3a..047d911e0 100644 --- a/x/delegation/keeper/abci.go +++ b/x/delegation/keeper/abci.go @@ -23,7 +23,7 @@ func (k *Keeper) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Valida // todo: don't think about freezing the operator in current implementation /* if k.slashKeeper.IsOperatorFrozen(ctx, operatorAccAddress) { // reSet the completed height if the operator is frozen - record.CompleteBlockNumber = k.expectedOperatorInterface.GetUnbondingExpirationBlockNumber(ctx, operatorAccAddress, record.BlockNumber) + record.CompleteBlockNumber = k.operatorKeeper.GetUnbondingExpirationBlockNumber(ctx, operatorAccAddress, record.BlockNumber) if record.CompleteBlockNumber <= uint64(ctx.BlockHeight()) { panic(fmt.Sprintf("the reset completedHeight isn't in future,setHeight:%v,curHeight:%v", record.CompleteBlockNumber, ctx.BlockHeight())) } @@ -51,12 +51,6 @@ func (k *Keeper) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Valida } continue } - // operator opt out: since operators can not immediately withdraw their funds, that is, - // even operator funds are not immediately available, operator opt out does not require - // any special handling here. if an operator undelegates before they opt out, the undelegation - // will be processed normally. if they undelegate after they opt out, the undelegation will - // be released at the same time as opt out completion, provided there are no other chains that - // the operator is still active on. the same applies to delegators too. // TODO(mike): ensure that operator is required to perform self delegation to match above. // calculate the actual canUndelegated asset amount diff --git a/x/delegation/keeper/cross_chain_tx_process.go b/x/delegation/keeper/cross_chain_tx_process.go index 1879be19f..53933714e 100644 --- a/x/delegation/keeper/cross_chain_tx_process.go +++ b/x/delegation/keeper/cross_chain_tx_process.go @@ -111,8 +111,8 @@ type DelegationOrUndelegationParams struct { // DelegateTo : It doesn't need to check the active status of the operator in middlewares when delegating assets to the operator. This is because it adds assets to the operator's amount. But it needs to check if operator has been slashed or frozen. func (k *Keeper) DelegateTo(ctx sdk.Context, params *DelegationOrUndelegationParams) error { // check if the delegatedTo address is an operator - if !k.expectedOperatorInterface.IsOperator(ctx, params.OperatorAddress) { - return errorsmod.Wrap(delegationtype.ErrOperatorNotExist, fmt.Sprintf("input opreatorAddr is:%s", params.OperatorAddress)) + if !k.operatorKeeper.IsOperator(ctx, params.OperatorAddress) { + return errorsmod.Wrap(delegationtype.ErrOperatorNotExist, fmt.Sprintf("input operatorAddr is:%s", params.OperatorAddress)) } // check if the operator has been slashed or frozen @@ -167,7 +167,7 @@ func (k *Keeper) DelegateTo(ctx sdk.Context, params *DelegationOrUndelegationPar return err } // call operator module to bond the increased assets to the opted-in AVS - err = k.expectedOperatorInterface.UpdateOptedInAssetsState(ctx, stakerID, assetID, params.OperatorAddress.String(), params.OpAmount) + err = k.operatorKeeper.UpdateOptedInAssetsState(ctx, stakerID, assetID, params.OperatorAddress.String(), params.OpAmount) if err != nil { return err } @@ -182,7 +182,7 @@ func (k *Keeper) DelegateTo(ctx sdk.Context, params *DelegationOrUndelegationPar // So we use two steps to handle the undelegation. Fist,record the undelegation request and the corresponding exit time which needs to be obtained from the operator opt-in module. Then,we handle the record when the exit time has expired. func (k *Keeper) UndelegateFrom(ctx sdk.Context, params *DelegationOrUndelegationParams) error { // check if the UndelegatedFrom address is an operator - if !k.expectedOperatorInterface.IsOperator(ctx, params.OperatorAddress) { + if !k.operatorKeeper.IsOperator(ctx, params.OperatorAddress) { return delegationtype.ErrOperatorNotExist } if params.OpAmount.IsNegative() { @@ -210,7 +210,7 @@ func (k *Keeper) UndelegateFrom(ctx sdk.Context, params *DelegationOrUndelegatio Amount: params.OpAmount, ActualCompletedAmount: sdkmath.NewInt(0), } - r.CompleteBlockNumber = k.expectedOperatorInterface.GetUnbondingExpirationBlockNumber(ctx, params.OperatorAddress, r.BlockNumber) + r.CompleteBlockNumber = k.operatorKeeper.GetUnbondingExpirationBlockNumber(ctx, params.OperatorAddress, r.BlockNumber) err = k.SetUndelegationRecords(ctx, []*delegationtype.UndelegationRecord{r}) if err != nil { return err @@ -248,14 +248,13 @@ func (k *Keeper) UndelegateFrom(ctx sdk.Context, params *DelegationOrUndelegatio } // call operator module to decrease the state of opted-in assets - err = k.expectedOperatorInterface.UpdateOptedInAssetsState(ctx, stakerID, assetID, params.OperatorAddress.String(), params.OpAmount.Neg()) + err = k.operatorKeeper.UpdateOptedInAssetsState(ctx, stakerID, assetID, params.OperatorAddress.String(), params.OpAmount.Neg()) if err != nil { return err } // call the hooks registered by the other modules - k.Hooks().AfterUndelegationStarted(ctx, params.OperatorAddress, delegationtype.GetUndelegationRecordKey(r.LzTxNonce, r.TxHash, r.OperatorAddr)) - return nil + return k.Hooks().AfterUndelegationStarted(ctx, params.OperatorAddress, delegationtype.GetUndelegationRecordKey(r.LzTxNonce, r.TxHash, r.OperatorAddr)) } /*func (k *Keeper) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error { diff --git a/x/delegation/keeper/delegation_op_test.go b/x/delegation/keeper/delegation_op_test.go index 5697bb9b9..84edfabda 100644 --- a/x/delegation/keeper/delegation_op_test.go +++ b/x/delegation/keeper/delegation_op_test.go @@ -43,7 +43,7 @@ func (suite *DelegationTestSuite) TestDelegateTo() { TxHash: common.HexToHash("0x24c4a315d757249c12a7a1d7b6fb96261d49deee26f06a3e1787d008b445c3ac"), } err = suite.App.DelegationKeeper.DelegateTo(suite.Ctx, delegationParams) - suite.EqualError(err, errorsmod.Wrap(delegationtype.ErrOperatorNotExist, fmt.Sprintf("input opreatorAddr is:%s", delegationParams.OperatorAddress)).Error()) + suite.EqualError(err, errorsmod.Wrap(delegationtype.ErrOperatorNotExist, fmt.Sprintf("input operatorAddr is:%s", delegationParams.OperatorAddress)).Error()) registerReq := &operatortype.RegisterOperatorReq{ FromAddress: opAccAddr.String(), diff --git a/x/delegation/keeper/delegation_state.go b/x/delegation/keeper/delegation_state.go index b4d975422..022c668b5 100644 --- a/x/delegation/keeper/delegation_state.go +++ b/x/delegation/keeper/delegation_state.go @@ -42,8 +42,7 @@ func (k *Keeper) GetStakerDelegationTotalAmount(ctx sdk.Context, stakerID string store := prefix.NewStore(ctx.KVStore(k.storeKey), delegationtype.KeyPrefixRestakerDelegationInfo) var ret delegationtype.ValueField prefixKey := assetstype.GetJoinedStoreKey(stakerID, assetID) - isExit := store.Has(prefixKey) - if !isExit { + if !store.Has(prefixKey) { return sdkmath.Int{}, errorsmod.Wrap(delegationtype.ErrNoKeyInTheStore, fmt.Sprintf("GetStakerDelegationTotalAmount: key is %s", prefixKey)) } value := store.Get(prefixKey) @@ -147,6 +146,9 @@ func (k *Keeper) GetDelegationInfo(ctx sdk.Context, stakerID, assetID string) (* } // DelegationStateByOperatorAssets get the specified assets state delegated to the specified operator +// assetsFilter: assetID->nil, it's used to filter the specified assets +// the first return value is a nested map, its type is: stakerID->assetID->DelegationAmounts +// It means all delegation information related to the specified operator and filtered by the specified asset IDs func (k *Keeper) DelegationStateByOperatorAssets(ctx sdk.Context, operatorAddr string, assetsFilter map[string]interface{}) (map[string]map[string]delegationtype.DelegationAmounts, error) { store := prefix.NewStore(ctx.KVStore(k.storeKey), delegationtype.KeyPrefixRestakerDelegationInfo) iterator := sdk.KVStorePrefixIterator(store, nil) diff --git a/x/delegation/keeper/keeper.go b/x/delegation/keeper/keeper.go index 8bad0db43..cb189d5a7 100644 --- a/x/delegation/keeper/keeper.go +++ b/x/delegation/keeper/keeper.go @@ -3,9 +3,7 @@ package keeper import ( "context" - "github.com/ExocoreNetwork/exocore/x/assets/keeper" delegationtype "github.com/ExocoreNetwork/exocore/x/delegation/types" - depositkeeper "github.com/ExocoreNetwork/exocore/x/deposit/keeper" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -18,28 +16,25 @@ type Keeper struct { cdc codec.BinaryCodec // other keepers - assetsKeeper keeper.Keeper - depositKeeper depositkeeper.Keeper - slashKeeper delegationtype.ISlashKeeper - expectedOperatorInterface delegationtype.ExpectedOperatorInterface - hooks delegationtype.DelegationHooks + assetsKeeper delegationtype.AssetsKeeper + slashKeeper delegationtype.SlashKeeper + operatorKeeper delegationtype.OperatorKeeper + hooks delegationtype.DelegationHooks } func NewKeeper( storeKey storetypes.StoreKey, cdc codec.BinaryCodec, - assetsKeeper keeper.Keeper, - depositKeeper depositkeeper.Keeper, - slashKeeper delegationtype.ISlashKeeper, - operatorKeeper delegationtype.ExpectedOperatorInterface, + assetsKeeper delegationtype.AssetsKeeper, + slashKeeper delegationtype.SlashKeeper, + operatorKeeper delegationtype.OperatorKeeper, ) Keeper { return Keeper{ - storeKey: storeKey, - cdc: cdc, - assetsKeeper: assetsKeeper, - depositKeeper: depositKeeper, - slashKeeper: slashKeeper, - expectedOperatorInterface: operatorKeeper, + storeKey: storeKey, + cdc: cdc, + assetsKeeper: assetsKeeper, + slashKeeper: slashKeeper, + operatorKeeper: operatorKeeper, } } diff --git a/x/delegation/keeper/un_delegation_state.go b/x/delegation/keeper/un_delegation_state.go index c5fb9c620..b4a315537 100644 --- a/x/delegation/keeper/un_delegation_state.go +++ b/x/delegation/keeper/un_delegation_state.go @@ -53,7 +53,8 @@ func (k *Keeper) SetSingleUndelegationRecord(ctx sdk.Context, record *types.Unde } // StoreWaitCompleteRecord add it to handle the delay of completing undelegation caused by onHoldCount -func (k Keeper) StoreWaitCompleteRecord(ctx sdk.Context, singleRecKey []byte, record *types.UndelegationRecord) error { +// 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) @@ -151,14 +152,15 @@ func (k *Keeper) GetWaitCompleteUndelegationRecords(ctx sdk.Context, height uint return k.GetUndelegationRecords(ctx, recordKeys, AllRecords) } -func (k *Keeper) IncrementUndelegationHoldCount(ctx sdk.Context, recordKey []byte) { +func (k *Keeper) IncrementUndelegationHoldCount(ctx sdk.Context, recordKey []byte) error { prev := k.GetUndelegationHoldCount(ctx, recordKey) if prev == math.MaxUint64 { - panic("cannot increment undelegation hold count above max uint64") + return types.ErrCannotIncHoldCount } now := prev + 1 store := ctx.KVStore(k.storeKey) store.Set(types.GetUndelegationOnHoldKey(recordKey), sdk.Uint64ToBigEndian(now)) + return nil } func (k *Keeper) GetUndelegationHoldCount(ctx sdk.Context, recordKey []byte) uint64 { @@ -167,12 +169,13 @@ func (k *Keeper) GetUndelegationHoldCount(ctx sdk.Context, recordKey []byte) uin return sdk.BigEndianToUint64(bz) } -func (k *Keeper) DecrementUndelegationHoldCount(ctx sdk.Context, recordKey []byte) { +func (k *Keeper) DecrementUndelegationHoldCount(ctx sdk.Context, recordKey []byte) error { prev := k.GetUndelegationHoldCount(ctx, recordKey) if prev == 0 { - panic("cannot decrement undelegation hold count below zero") + return types.ErrCannotDecHoldCount } now := prev - 1 store := ctx.KVStore(k.storeKey) store.Set(types.GetUndelegationOnHoldKey(recordKey), sdk.Uint64ToBigEndian(now)) + return nil } diff --git a/x/delegation/types/errors.go b/x/delegation/types/errors.go index 4e1e4811a..1bb6446c7 100644 --- a/x/delegation/types/errors.go +++ b/x/delegation/types/errors.go @@ -23,4 +23,8 @@ var ( ErrNotSupportYet = errorsmod.Register(ModuleName, 9, "don't have supported it yet") ErrDelegationAmountTooBig = errorsmod.Register(ModuleName, 10, "the delegation amount is bigger than the canWithdraw amount") + + ErrCannotIncHoldCount = errorsmod.Register(ModuleName, 11, "cannot increment undelegation hold count above max uint64") + + ErrCannotDecHoldCount = errorsmod.Register(ModuleName, 12, "cannot decrement undelegation hold count below zero") ) diff --git a/x/delegation/types/expected_keepers.go b/x/delegation/types/expected_keepers.go index 2062c7d3a..f2b7bb2f2 100644 --- a/x/delegation/types/expected_keepers.go +++ b/x/delegation/types/expected_keepers.go @@ -2,28 +2,31 @@ package types import ( sdkmath "cosmossdk.io/math" + assetstype "github.com/ExocoreNetwork/exocore/x/assets/types" sdk "github.com/cosmos/cosmos-sdk/types" ) +var _ SlashKeeper = VirtualSlashKeeper{} + var CanUndelegationDelayHeight = uint64(10) -type ISlashKeeper interface { +type SlashKeeper interface { IsOperatorFrozen(ctx sdk.Context, opAddr sdk.AccAddress) bool OperatorAssetSlashedProportion(ctx sdk.Context, opAddr sdk.AccAddress, assetID string, startHeight, endHeight uint64) sdkmath.LegacyDec } -// VirtualISlashKeeper todo: When the actual keeper functionality has not been implemented yet, temporarily use the virtual keeper. -type VirtualISlashKeeper struct{} +// VirtualSlashKeeper todo: When the actual keeper functionality has not been implemented yet, temporarily use the virtual keeper. +type VirtualSlashKeeper struct{} -func (VirtualISlashKeeper) IsOperatorFrozen(_ sdk.Context, _ sdk.AccAddress) bool { +func (VirtualSlashKeeper) IsOperatorFrozen(_ sdk.Context, _ sdk.AccAddress) bool { return false } -func (VirtualISlashKeeper) OperatorAssetSlashedProportion(_ sdk.Context, _ sdk.AccAddress, _ string, _, _ uint64) sdkmath.LegacyDec { +func (VirtualSlashKeeper) OperatorAssetSlashedProportion(_ sdk.Context, _ sdk.AccAddress, _ string, _, _ uint64) sdkmath.LegacyDec { return sdkmath.LegacyNewDec(0) } -// DelegationHooks add for dogfood +// DelegationHooks are event hooks triggered by the delegation module type DelegationHooks interface { // AfterDelegation we don't want the ability to cancel delegation or undelegation so no return type for // either @@ -31,15 +34,21 @@ type DelegationHooks interface { AfterDelegation(ctx sdk.Context, operator sdk.AccAddress) // AfterUndelegationStarted for undelegation, we use the address of the operator to figure out the list of impacted // chains for that operator. and we need the identifier to hold it until confirmed by subscriber - AfterUndelegationStarted(ctx sdk.Context, addr sdk.AccAddress, recordKey []byte) + AfterUndelegationStarted(ctx sdk.Context, addr sdk.AccAddress, recordKey []byte) error // AfterUndelegationCompleted whenever an undelegation completes, we should update the vote power of the associated operator // on all of the chain ids that are impacted AfterUndelegationCompleted(ctx sdk.Context, addr sdk.AccAddress) } -type ExpectedOperatorInterface interface { +type OperatorKeeper interface { IsOperator(ctx sdk.Context, addr sdk.AccAddress) bool GetUnbondingExpirationBlockNumber(ctx sdk.Context, OperatorAddress sdk.AccAddress, startHeight uint64) uint64 UpdateOptedInAssetsState(ctx sdk.Context, stakerID, assetID, operatorAddr string, opAmount sdkmath.Int) error } + +type AssetsKeeper interface { + UpdateStakerAssetState(ctx sdk.Context, stakerID string, assetID string, changeAmount assetstype.StakerSingleAssetChangeInfo) (err error) + UpdateOperatorAssetState(ctx sdk.Context, operatorAddr sdk.Address, assetID string, changeAmount assetstype.OperatorSingleAssetChangeInfo) (err error) + GetStakerSpecifiedAssetInfo(ctx sdk.Context, stakerID string, assetID string) (info *assetstype.StakerAssetInfo, err error) +} diff --git a/x/delegation/types/hooks.go b/x/delegation/types/hooks.go index 2fd215a96..d0ad3032a 100644 --- a/x/delegation/types/hooks.go +++ b/x/delegation/types/hooks.go @@ -20,10 +20,14 @@ func (hooks MultiDelegationHooks) AfterUndelegationStarted( ctx sdk.Context, addr sdk.AccAddress, recordKey []byte, -) { +) error { for _, hook := range hooks { - hook.AfterUndelegationStarted(ctx, addr, recordKey) + err := hook.AfterUndelegationStarted(ctx, addr, recordKey) + if err != nil { + return err + } } + return nil } func (hooks MultiDelegationHooks) AfterUndelegationCompleted(ctx sdk.Context, addr sdk.AccAddress) { diff --git a/x/deposit/types/deposit.pb.go b/x/deposit/types/deposit.pb.go index 8eb5c7092..67be1c029 100644 --- a/x/deposit/types/deposit.pb.go +++ b/x/deposit/types/deposit.pb.go @@ -5,7 +5,6 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" math "math" @@ -67,17 +66,16 @@ func init() { func init() { proto.RegisterFile("exocore/deposit/v1/deposit.proto", fileDescriptor_bb743e1548b62476) } var fileDescriptor_bb743e1548b62476 = []byte{ - // 151 bytes of a gzipped FileDescriptorProto + // 138 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b,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, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, + 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x98, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, + 0xab, 0xef, 0x0a, 0x31, 0xc2, 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x5b, 0x1f, 0x66, 0x67, 0x05, + 0xdc, 0xd6, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x8d, 0xc6, 0x80, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x16, 0x0b, 0x5f, 0x01, 0x95, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/deposit/types/tx.pb.go b/x/deposit/types/tx.pb.go index 1ea759566..43ba9bf7b 100644 --- a/x/deposit/types/tx.pb.go +++ b/x/deposit/types/tx.pb.go @@ -31,7 +31,6 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgUpdateParams is the Msg/UpdateParams request type for Erc20 parameters. -// Since: cosmos-sdk 0.47 type MsgUpdateParams struct { // authority is the address of the governance account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` @@ -89,7 +88,6 @@ func (m *MsgUpdateParams) GetParams() Params { // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. -// Since: cosmos-sdk 0.47 type MsgUpdateParamsResponse struct { } diff --git a/x/dogfood/keeper/abci.go b/x/dogfood/keeper/abci.go index 27f7fd132..7c7b517ea 100644 --- a/x/dogfood/keeper/abci.go +++ b/x/dogfood/keeper/abci.go @@ -19,7 +19,10 @@ func (k Keeper) EndBlock(ctx sdk.Context) []abci.ValidatorUpdate { // start with clearing the hold on the undelegations. undelegations := k.GetPendingUndelegations(ctx) for _, undelegation := range undelegations.GetList() { - k.delegationKeeper.DecrementUndelegationHoldCount(ctx, undelegation) + err := k.delegationKeeper.DecrementUndelegationHoldCount(ctx, undelegation) + if err != nil { + panic(err) + } } k.ClearPendingUndelegations(ctx) // then, let the operator module know that the opt out has finished. diff --git a/x/dogfood/keeper/impl_delegation_hooks.go b/x/dogfood/keeper/impl_delegation_hooks.go index c23d6be34..bb876dc49 100644 --- a/x/dogfood/keeper/impl_delegation_hooks.go +++ b/x/dogfood/keeper/impl_delegation_hooks.go @@ -32,7 +32,7 @@ func (wrapper DelegationHooksWrapper) AfterDelegation( // AfterUndelegationStarted is called after an undelegation is started. func (wrapper DelegationHooksWrapper) AfterUndelegationStarted( ctx sdk.Context, operator sdk.AccAddress, recordKey []byte, -) { +) error { var unbondingCompletionEpoch int64 if wrapper.keeper.operatorKeeper.IsOperatorOptingOutFromChainID( ctx, operator, ctx.ChainID(), @@ -49,7 +49,7 @@ func (wrapper DelegationHooksWrapper) AfterUndelegationStarted( // so this is not a concern. } wrapper.keeper.AppendUndelegationToMature(ctx, unbondingCompletionEpoch, recordKey) - wrapper.keeper.delegationKeeper.IncrementUndelegationHoldCount(ctx, recordKey) + return wrapper.keeper.delegationKeeper.IncrementUndelegationHoldCount(ctx, recordKey) } // AfterUndelegationCompleted is called after an undelegation is completed. diff --git a/x/dogfood/types/expected_keepers.go b/x/dogfood/types/expected_keepers.go index 0fc1c154f..a14789775 100644 --- a/x/dogfood/types/expected_keepers.go +++ b/x/dogfood/types/expected_keepers.go @@ -36,7 +36,7 @@ type OperatorHooks interface { // DelegationHooks represent the event hooks for delegation module. type DelegationHooks interface { AfterDelegation(sdk.Context, sdk.AccAddress) - AfterUndelegationStarted(sdk.Context, sdk.AccAddress, []byte) + AfterUndelegationStarted(sdk.Context, sdk.AccAddress, []byte) error AfterUndelegationCompleted(sdk.Context, sdk.AccAddress, []byte) } @@ -65,8 +65,8 @@ type OperatorKeeper interface { // DelegationKeeper represents the expected keeper interface for the delegation module. type DelegationKeeper interface { - IncrementUndelegationHoldCount(sdk.Context, []byte) - DecrementUndelegationHoldCount(sdk.Context, []byte) + IncrementUndelegationHoldCount(sdk.Context, []byte) error + DecrementUndelegationHoldCount(sdk.Context, []byte) error } // EpochsHooks represents the event hooks for the epochs module. diff --git a/x/operator/keeper/abci.go b/x/operator/keeper/abci.go index b7eb48311..c39e46675 100644 --- a/x/operator/keeper/abci.go +++ b/x/operator/keeper/abci.go @@ -9,17 +9,31 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) +// SharedParameter is a shared parameter used to record and update the related +// USD share of staker and operators when the prices of assets change type SharedParameter struct { - priceChangeAssets map[string]*operatortypes.PriceChange - assetsDecimal map[string]uint32 - assetsOperatorAVSInfo map[string]map[string]string - stakerShare map[string]sdkmath.LegacyDec + // priceChangeAssets is the price change information of assets, + // which is gotten by the expected Oracle interface. + priceChangeAssets map[string]*operatortypes.PriceChange + // assetsDecimal is a map to record the decimals of the related assets + // It will be used when calculate the USD share of the assets. + assetsDecimal map[string]uint32 + // optedInAssetsInfo : assetID->operator->Avs + // For staker and operator, only the USD share of opted-in assets needs to be updated + // when the prices of assets change. But in the delegation and assets module, the opted-in + // information of assets haven't been stored, so we need this map as a filter when iterate + // the assets state of delegation and operator + // It will be set when calling `IterateUpdateAssetState`, because the information of opted-in assets + // has been stored in types.KeyPrefixOperatorAVSSingleAssetState + optedInAssetsInfo map[string]map[string]string + // stakerShare records the latest share for staker and operator after updating + stakerShare map[string]sdkmath.LegacyDec } func UpdateShareOfStakerAndOperator(sharedParam *SharedParameter, assetID, stakerID, operatorAddr string, assetAmount sdkmath.Int) { priceChange := sharedParam.priceChangeAssets[assetID] assetDecimal := sharedParam.assetsDecimal[assetID] - if avsAddr, ok := sharedParam.assetsOperatorAVSInfo[assetID][operatorAddr]; ok { + if avsAddr, ok := sharedParam.optedInAssetsInfo[assetID][operatorAddr]; ok { newAssetUSDValue := CalculateShare(assetAmount, priceChange.NewPrice, assetDecimal, priceChange.Decimal) key := string(types.GetJoinedStoreKey(avsAddr, stakerID, operatorAddr)) AddShareInMap(sharedParam.stakerShare, key, newAssetUSDValue) @@ -35,8 +49,8 @@ func (k *Keeper) PriceChangeHandle(ctx sdk.Context) error { if len(priceChangeAssets) == 0 { return nil } - avsOperatorShareChange := make(map[string]sdkmath.LegacyDec, 0) - assetsOperatorAVSInfo := make(map[string]map[string]string, 0) + shareChangeForAvsOperator := make(map[string]sdkmath.LegacyDec, 0) + optedInAssetsInfo := make(map[string]map[string]string, 0) assetsDecimal := make(map[string]uint32) for assetID, priceChange := range priceChangeAssets { // get the decimal of asset @@ -45,8 +59,8 @@ func (k *Keeper) PriceChangeHandle(ctx sdk.Context) error { return err } assetsDecimal[assetID] = assetInfo.AssetBasicInfo.Decimals - if _, ok := assetsOperatorAVSInfo[assetID]; !ok { - assetsOperatorAVSInfo[assetID] = make(map[string]string, 0) + if _, ok := optedInAssetsInfo[assetID]; !ok { + optedInAssetsInfo[assetID] = make(map[string]string, 0) } // UpdateStateForAsset f := func(assetID string, keys []string, state *operatortypes.OptedInAssetState) error { @@ -56,9 +70,9 @@ func (k *Keeper) PriceChangeHandle(ctx sdk.Context) error { avsAddr := keys[1] avsOperator := string(types.GetJoinedStoreKey(keys[1], keys[2])) - AddShareInMap(avsOperatorShareChange, avsAddr, changeValue) - AddShareInMap(avsOperatorShareChange, avsOperator, changeValue) - assetsOperatorAVSInfo[assetID][keys[2]] = avsAddr + AddShareInMap(shareChangeForAvsOperator, avsAddr, changeValue) + AddShareInMap(shareChangeForAvsOperator, avsOperator, changeValue) + optedInAssetsInfo[assetID][keys[2]] = avsAddr return nil } err = k.IterateUpdateAssetState(ctx, assetID, f) @@ -67,17 +81,17 @@ func (k *Keeper) PriceChangeHandle(ctx sdk.Context) error { } } // BatchUpdateShareForAVSAndOperator - err = k.BatchUpdateShareForAVSAndOperator(ctx, avsOperatorShareChange) + err = k.BatchUpdateShareForAVSAndOperator(ctx, shareChangeForAvsOperator) if err != nil { return err } - // update staker'suite share + // update the USD share for staker and operator sharedParameter := &SharedParameter{ - priceChangeAssets: priceChangeAssets, - assetsDecimal: assetsDecimal, - assetsOperatorAVSInfo: assetsOperatorAVSInfo, - stakerShare: make(map[string]sdkmath.LegacyDec, 0), + priceChangeAssets: priceChangeAssets, + assetsDecimal: assetsDecimal, + optedInAssetsInfo: optedInAssetsInfo, + stakerShare: make(map[string]sdkmath.LegacyDec, 0), } stakerShareHandleFunc := func(stakerID, assetID, operatorAddr string, state *delegationtype.DelegationAmounts) error { UpdateShareOfStakerAndOperator(sharedParameter, assetID, stakerID, operatorAddr, state.UndelegatableAmount) diff --git a/x/operator/keeper/avs_operator_shares.go b/x/operator/keeper/avs_operator_shares.go index 911423f5a..a2ae08356 100644 --- a/x/operator/keeper/avs_operator_shares.go +++ b/x/operator/keeper/avs_operator_shares.go @@ -13,6 +13,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) +// UpdateOperatorShare is a function to update the USD share for specified operator and Avs, +// The key and value that will be changed is: +// AVSAddr + '/' + operatorAddr -> types.DecValueField (the total USD share of specified operator and Avs) +// This function will be called when some assets supported by Avs are delegated/undelegated or slashed. func (k *Keeper) UpdateOperatorShare(ctx sdk.Context, avsAddr, operatorAddr string, opAmount sdkmath.LegacyDec) error { if opAmount.IsNil() || opAmount.IsZero() { return nil @@ -38,6 +42,11 @@ func (k *Keeper) UpdateOperatorShare(ctx sdk.Context, avsAddr, operatorAddr stri return nil } +// DeleteOperatorShare is a function to delete the USD share related to specified operator and Avs, +// The key and value that will be deleted is: +// AVSAddr + '/' + operatorAddr -> types.DecValueField (the total USD share of specified operator and Avs) +// This function will be called when the operator opts out of the AVS, because the USD share +// doesn't need to be stored. func (k *Keeper) DeleteOperatorShare(ctx sdk.Context, avsAddr, operatorAddr string) error { store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixAVSOperatorAssetsTotalValue) var key []byte @@ -50,6 +59,12 @@ func (k *Keeper) DeleteOperatorShare(ctx sdk.Context, avsAddr, operatorAddr stri return nil } +// GetOperatorShare is a function to retrieve the USD share of specified operator and Avs, +// The key and value to retrieve is: +// AVSAddr + '/' + operatorAddr -> types.DecValueField (the total USD share of specified operator and Avs) +// This function will be called when the operator opts out of the AVS, because the total USD share +// 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) GetOperatorShare(ctx sdk.Context, avsAddr, operatorAddr string) (sdkmath.LegacyDec, error) { store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixAVSOperatorAssetsTotalValue) var ret operatortypes.DecValueField @@ -69,6 +84,12 @@ func (k *Keeper) GetOperatorShare(ctx sdk.Context, avsAddr, operatorAddr string) return ret.Amount, nil } +// UpdateAVSShare is a function to update the total USD share of an Avs, +// The key and value that will be changed is: +// AVSAddr -> types.DecValueField(the total USD share of specified Avs) +// This function will be called when some assets of operator supported by the specified Avs +// are delegated/undelegated or slashed. Additionally, when an operator opts out of +// the Avs, this function also will be called. func (k *Keeper) UpdateAVSShare(ctx sdk.Context, avsAddr string, opAmount sdkmath.LegacyDec) error { if opAmount.IsNil() || opAmount.IsZero() { return nil @@ -89,6 +110,11 @@ func (k *Keeper) UpdateAVSShare(ctx sdk.Context, avsAddr string, opAmount sdkmat return nil } +// BatchUpdateShareForAVSAndOperator is a function to update the USD share for operator and Avs in bulk, +// The key and value that will be changed is: +// AVSAddr -> types.DecValueField(the total USD share of specified Avs) +// AVSAddr + '/' + operatorAddr -> types.DecValueField (the total USD share of specified operator and Avs) +// This function will be called when the prices of assets supported by Avs are changed. func (k *Keeper) BatchUpdateShareForAVSAndOperator(ctx sdk.Context, avsOperatorChange map[string]sdkmath.LegacyDec) error { store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixAVSOperatorAssetsTotalValue) for avs, opAmount := range avsOperatorChange { @@ -109,6 +135,10 @@ func (k *Keeper) BatchUpdateShareForAVSAndOperator(ctx sdk.Context, avsOperatorC return nil } +// GetAVSShare 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) GetAVSShare(ctx sdk.Context, avsAddr string) (sdkmath.LegacyDec, error) { store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixAVSOperatorAssetsTotalValue) var ret operatortypes.DecValueField @@ -123,6 +153,12 @@ func (k *Keeper) GetAVSShare(ctx sdk.Context, avsAddr string) (sdkmath.LegacyDec return ret.Amount, nil } +// UpdateStateForAsset is a function to update the opted-in amount and USD share for +// the specified asset +// The key and value that will be changed is: +// assetID + '/' + AVSAddr + '/' + operatorAddr -> types.OptedInAssetState +// This function will be called when the amount of a specified asset opted-in by the operator +// changes, such as: opt-in, delegation, undelegation and slash. func (k *Keeper) UpdateStateForAsset(ctx sdk.Context, assetID, avsAddr, operatorAddr string, changeState operatortypes.OptedInAssetStateChange) error { store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixOperatorAVSSingleAssetState) if changeState.Amount.IsNil() && changeState.Value.IsNil() { @@ -160,6 +196,11 @@ func (k *Keeper) UpdateStateForAsset(ctx sdk.Context, assetID, avsAddr, operator return nil } +// DeleteAssetState is a function to delete the opted-in amount and USD share for +// the specified asset +// The key and value that will be deleted is: +// assetID + '/' + AVSAddr + '/' + operatorAddr -> types.OptedInAssetState +// This function will be called when the specified operator opts out of the Avs. func (k *Keeper) DeleteAssetState(ctx sdk.Context, assetID, avsAddr, operatorAddr string) error { store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixOperatorAVSSingleAssetState) // check operator address validation @@ -172,6 +213,10 @@ func (k *Keeper) DeleteAssetState(ctx sdk.Context, assetID, avsAddr, operatorAdd return nil } +// GetAssetState is a function to retrieve the opted-in amount and USD share for the specified asset +// The key and value to retrieve is: +// assetID + '/' + AVSAddr + '/' + operatorAddr -> types.OptedInAssetState +// It hasn't been used now. but it can serve as an RPC in the future. func (k *Keeper) GetAssetState(ctx sdk.Context, assetID, avsAddr, operatorAddr string) (changeState *operatortypes.OptedInAssetState, err error) { store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixOperatorAVSSingleAssetState) stateKey := assetstype.GetJoinedStoreKey(assetID, avsAddr, operatorAddr) @@ -186,6 +231,11 @@ func (k *Keeper) GetAssetState(ctx sdk.Context, assetID, avsAddr, operatorAddr s return &optedInAssetState, nil } +// IterateUpdateAssetState is a function to iteratively update the opted-in amount and USD share for +// the specified asset +// The key and value that will be changed is: +// assetID + '/' + AVSAddr + '/' + operatorAddr -> types.OptedInAssetState +// This function will be called when the prices of opted-in assets are changed. func (k *Keeper) IterateUpdateAssetState(ctx sdk.Context, assetID string, f func(assetID string, keys []string, state *operatortypes.OptedInAssetState) error) (err error) { store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixOperatorAVSSingleAssetState) iterator := sdk.KVStorePrefixIterator(store, []byte(assetID)) @@ -208,6 +258,12 @@ func (k *Keeper) IterateUpdateAssetState(ctx sdk.Context, assetID string, f func return nil } +// UpdateStakerShare is a function to update the opted-in USD share for the specified staker and operator , +// The key and value that will be changed is: +// AVSAddr + '/' + ” + '/' + operatorAddr -> types.DecValueField(the opted-in USD share owned by the operator itself) +// AVSAddr + '/' + stakerID + '/' + operatorAddr -> types.DecValueField (the opted-in USD share of the staker) +// This function will be called when the opted-in assets of operator and staker +// are delegated/undelegated or slashed. Additionally, when an operator opts in, this function also will be called. func (k *Keeper) UpdateStakerShare(ctx sdk.Context, avsAddr, stakerID, operatorAddr string, opAmount sdkmath.LegacyDec) error { if opAmount.IsNil() || opAmount.IsZero() { return nil @@ -229,6 +285,11 @@ func (k *Keeper) UpdateStakerShare(ctx sdk.Context, avsAddr, stakerID, operatorA return nil } +// BatchSetStakerShare is a function to set the opted-in USD share for the specified staker and operator in bulk, +// The key and value that will be set is: +// AVSAddr + '/' + ” + '/' + operatorAddr -> types.DecValueField(the opted-in USD share owned by the operator itself) +// AVSAddr + '/' + stakerID + '/' + operatorAddr -> types.DecValueField (the opted-in USD share of the staker) +// This function will be called when the prices of opted-in assets are changed. func (k *Keeper) BatchSetStakerShare(ctx sdk.Context, newValues map[string]sdkmath.LegacyDec) error { store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixAVSOperatorStakerShareState) for key, value := range newValues { @@ -244,6 +305,11 @@ func (k *Keeper) BatchSetStakerShare(ctx sdk.Context, newValues map[string]sdkma return nil } +// DeleteStakerShare is a function to delete the opted-in USD share for the specified staker and operator, +// The key and value that will be set is: +// AVSAddr + '/' + ” + '/' + operatorAddr -> types.DecValueField(the opted-in USD share owned by the operator itself) +// AVSAddr + '/' + stakerID + '/' + operatorAddr -> types.DecValueField (the opted-in USD share of the staker) +// This function will be called when the operator opts out of the Avs. func (k *Keeper) DeleteStakerShare(ctx sdk.Context, avsAddr, stakerID, operatorAddr string) error { store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixAVSOperatorStakerShareState) key := assetstype.GetJoinedStoreKey(avsAddr, stakerID, operatorAddr) @@ -251,6 +317,11 @@ func (k *Keeper) DeleteStakerShare(ctx sdk.Context, avsAddr, stakerID, operatorA return nil } +// GetStakerShare is a function to retrieve the opted-in USD share for the specified staker and operator, +// The key and value that will be set is: +// AVSAddr + '/' + ” + '/' + operatorAddr -> types.DecValueField(the opted-in USD share owned by the operator itself) +// AVSAddr + '/' + stakerID + '/' + operatorAddr -> types.DecValueField (the opted-in USD share of the staker) +// It hasn't been used now. but it can serve as an RPC in the future. func (k *Keeper) GetStakerShare(ctx sdk.Context, avsAddr, stakerID, operatorAddr string) (sdkmath.LegacyDec, error) { store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixAVSOperatorStakerShareState) var ret operatortypes.DecValueField @@ -264,20 +335,3 @@ func (k *Keeper) GetStakerShare(ctx sdk.Context, avsAddr, stakerID, operatorAddr return ret.Amount, nil } - -func (k *Keeper) GetStakerByAVSOperator(ctx sdk.Context, _, _ string) (map[string]interface{}, error) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixAVSOperatorStakerShareState) - stakers := make(map[string]interface{}, 0) - iterator := sdk.KVStorePrefixIterator(store, nil) - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - keys, err := assetstype.ParseJoinedStoreKey(iterator.Key(), 3) - if err != nil { - return nil, err - } - if keys[1] != "" { - stakers[keys[1]] = nil - } - } - return stakers, nil -} diff --git a/x/operator/keeper/dogfood.go b/x/operator/keeper/consensus_keys.go similarity index 100% rename from x/operator/keeper/dogfood.go rename to x/operator/keeper/consensus_keys.go diff --git a/x/operator/keeper/keeper.go b/x/operator/keeper/keeper.go index 78c1ce6bc..1a029d03d 100644 --- a/x/operator/keeper/keeper.go +++ b/x/operator/keeper/keeper.go @@ -4,7 +4,6 @@ import ( "context" sdkmath "cosmossdk.io/math" - "github.com/ExocoreNetwork/exocore/x/assets/keeper" operatortypes "github.com/ExocoreNetwork/exocore/x/operator/types" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -16,10 +15,10 @@ type Keeper struct { cdc codec.BinaryCodec // other keepers - assetsKeeper operatortypes.ExpectAssetsInterface - delegationKeeper operatortypes.ExpectDelegationInterface - oracleKeeper operatortypes.ExpectOracleInterface - avsKeeper operatortypes.ExpectAvsInterface + assetsKeeper operatortypes.AssetsKeeper + delegationKeeper operatortypes.DelegationKeeper + oracleKeeper operatortypes.OracleKeeper + avsKeeper operatortypes.AvsKeeper // add for dogfood hooks operatortypes.OperatorConsentHooks // set separately via call to SetHooks @@ -29,9 +28,9 @@ type Keeper struct { func NewKeeper( storeKey storetypes.StoreKey, cdc codec.BinaryCodec, - assetsKeeper keeper.Keeper, - oracleKeeper operatortypes.ExpectOracleInterface, - avsKeeper operatortypes.ExpectAvsInterface, + assetsKeeper operatortypes.AssetsKeeper, + oracleKeeper operatortypes.OracleKeeper, + avsKeeper operatortypes.AvsKeeper, slashKeeper operatortypes.SlashKeeper, ) Keeper { return Keeper{ @@ -44,11 +43,11 @@ func NewKeeper( } } -func (k *Keeper) RegisterExpectDelegationInterface(delegationKeeper operatortypes.ExpectDelegationInterface) { +func (k *Keeper) RegisterExpectDelegationInterface(delegationKeeper operatortypes.DelegationKeeper) { k.delegationKeeper = delegationKeeper } -func (k *Keeper) OracleInterface() operatortypes.ExpectOracleInterface { +func (k *Keeper) OracleInterface() operatortypes.OracleKeeper { return k.oracleKeeper } diff --git a/x/operator/keeper/msg_server.go b/x/operator/keeper/msg_server.go index 26b76052b..0d74ead53 100644 --- a/x/operator/keeper/msg_server.go +++ b/x/operator/keeper/msg_server.go @@ -21,11 +21,14 @@ func (k *Keeper) RegisterOperator(ctx context.Context, req *types.RegisterOperat return nil, nil } -// OptInToChainID add for dogfood -func (k *Keeper) OptInToChainID( +// OptInToCosmosChain this is an RPC for the operators +// that want to service as a validator for the app chain Avs +// The operator can opt in the cosmos app chain through this RPC +// In this function, the basic function `OptIn` need to be called +func (k *Keeper) OptInToCosmosChain( goCtx context.Context, - req *types.OptInToChainIDRequest, -) (*types.OptInToChainIDResponse, error) { + req *types.OptInToCosmosChainRequest, +) (*types.OptInToCosmosChainResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) addr, err := sdk.AccAddressFromBech32(req.Address) if err != nil { @@ -41,13 +44,15 @@ func (k *Keeper) OptInToChainID( if err != nil { return nil, err } - return &types.OptInToChainIDResponse{}, nil + return &types.OptInToCosmosChainResponse{}, nil } -func (k *Keeper) InitiateOptOutFromChainID( +// InitiateOptOutFromCosmosChain is a method corresponding to OptInToCosmosChain +// It provides a function to opt out from the app chain Avs for the operators. +func (k *Keeper) InitiateOptOutFromCosmosChain( goCtx context.Context, - req *types.InitiateOptOutFromChainIDRequest, -) (*types.InitiateOptOutFromChainIDResponse, error) { + req *types.InitiateOptOutFromCosmosChainRequest, +) (*types.InitiateOptOutFromCosmosChainResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) addr, err := sdk.AccAddressFromBech32(req.Address) if err != nil { @@ -58,7 +63,7 @@ func (k *Keeper) InitiateOptOutFromChainID( ); err != nil { return nil, err } - return &types.InitiateOptOutFromChainIDResponse{}, nil + return &types.InitiateOptOutFromCosmosChainResponse{}, nil } func stringToPubKey(pubKey string) (key tmprotocrypto.PublicKey, err error) { diff --git a/x/operator/keeper/operator.go b/x/operator/keeper/operator.go index eb1e748ed..9ef38595a 100644 --- a/x/operator/keeper/operator.go +++ b/x/operator/keeper/operator.go @@ -14,7 +14,6 @@ import ( // SetOperatorInfo This function is used to register to be an operator in exoCore, the provided info will be stored on the chain. // Once an address has become an operator,the operator can't return to a normal address.But the operator can update the info through this function -// As for the operator opt-in function,it needs to be implemented in operator opt-in or AVS module func (k *Keeper) SetOperatorInfo(ctx sdk.Context, addr string, info *operatortypes.OperatorInfo) (err error) { opAccAddr, err := sdk.AccAddressFromBech32(addr) if err != nil { diff --git a/x/operator/keeper/state_update.go b/x/operator/keeper/state_update.go index 8326be1ee..e047ebb6e 100644 --- a/x/operator/keeper/state_update.go +++ b/x/operator/keeper/state_update.go @@ -27,6 +27,8 @@ type SlashAssets struct { slashOperatorInfo map[string]*slashAmounts } +// UpdateOptedInAssetsState will update the USD share state related to asset, operator and AVS when +// the asset amount changes caused by delegation, undelegation, slashStaker and slashOperator. func (k *Keeper) UpdateOptedInAssetsState(ctx sdk.Context, stakerID, assetID, operatorAddr string, opAmount sdkmath.Int) error { // get the AVS opted-in by the operator avsList, err := k.GetOptedInAVSForOperator(ctx, operatorAddr) @@ -276,29 +278,29 @@ func (k *Keeper) OptOut(ctx sdk.Context, operatorAddress sdk.AccAddress, avsAddr } // GetAssetsAmountToSlash It will slash the assets that are opting into AVS first, and if there isn't enough to slash, then it will slash the assets that have requested to undelegate but still locked. -func (k *Keeper) GetAssetsAmountToSlash(ctx sdk.Context, operatorAddress sdk.AccAddress, avsAddr string, occurredSateHeight int64, slashProportion sdkmath.LegacyDec) (*SlashAssets, error) { +func (k *Keeper) GetAssetsAmountToSlash(ctx sdk.Context, operatorAddress sdk.AccAddress, avsAddr string, slashEventHeight int64, slashProportion sdkmath.LegacyDec) (*SlashAssets, error) { ret := &SlashAssets{ slashStakerInfo: make(map[string]map[string]*slashAmounts, 0), slashOperatorInfo: make(map[string]*slashAmounts, 0), } // get the state when the slash occurred - historicalSateCtx, err := types2.ContextForHistoricalState(ctx, occurredSateHeight) + historicalStateCtx, err := types2.ContextForHistoricalState(ctx, slashEventHeight) if err != nil { return nil, err } // get assetsInfo supported by AVS - assetsFilter, err := k.avsKeeper.GetAvsSupportedAssets(historicalSateCtx, avsAddr) + assetsFilter, err := k.avsKeeper.GetAvsSupportedAssets(historicalStateCtx, avsAddr) if err != nil { return nil, err } - historyStakerAssets, err := k.delegationKeeper.DelegationStateByOperatorAssets(historicalSateCtx, operatorAddress.String(), assetsFilter) + historyStakerAssets, err := k.delegationKeeper.DelegationStateByOperatorAssets(historicalStateCtx, operatorAddress.String(), assetsFilter) if err != nil { return nil, err } // get the Assets opted in the operator - historyOperatorAssetsState, err := k.assetsKeeper.GetOperatorAssetInfos(historicalSateCtx, operatorAddress, assetsFilter) + historyOperatorAssetsState, err := k.assetsKeeper.GetOperatorAssetInfos(historicalStateCtx, operatorAddress, assetsFilter) if err != nil { return nil, err } @@ -439,15 +441,15 @@ func (k *Keeper) SlashOperator(ctx sdk.Context, operatorAddress sdk.AccAddress, } // Slash The occurredSateHeight should be the height that has the latest stable state. -func (k *Keeper) Slash(ctx sdk.Context, operatorAddress sdk.AccAddress, avsAddr, slashContract, slashID string, occurredSateHeight int64, slashProportion sdkmath.LegacyDec) error { +func (k *Keeper) Slash(ctx sdk.Context, operatorAddress sdk.AccAddress, avsAddr, slashContract, slashID string, slashEventHeight int64, slashProportion sdkmath.LegacyDec) error { height := ctx.BlockHeight() - if occurredSateHeight > height { - return errorsmod.Wrap(types.ErrSlashOccurredHeight, fmt.Sprintf("occurredSateHeight:%d,curHeight:%d", occurredSateHeight, height)) + if slashEventHeight > height { + return errorsmod.Wrap(types.ErrSlashOccurredHeight, fmt.Sprintf("slashEventHeight:%d,curHeight:%d", slashEventHeight, height)) } // get the state when the slash occurred // get the opted-in info - historicalSateCtx, err := types2.ContextForHistoricalState(ctx, occurredSateHeight) + historicalSateCtx, err := types2.ContextForHistoricalState(ctx, slashEventHeight) if err != nil { return err } @@ -466,7 +468,7 @@ func (k *Keeper) Slash(ctx sdk.Context, operatorAddress sdk.AccAddress, avsAddr, slashInfo := types.OperatorSlashInfo{ SlashContract: slashContract, SubmittedHeight: height, - EventHeight: occurredSateHeight, + EventHeight: slashEventHeight, SlashProportion: slashProportion, ProcessedHeight: height + types.SlashVetoDuration, } @@ -476,7 +478,7 @@ func (k *Keeper) Slash(ctx sdk.Context, operatorAddress sdk.AccAddress, avsAddr, } // get the assets and amounts that should be slashed - assetsSlashInfo, err := k.GetAssetsAmountToSlash(ctx, operatorAddress, avsAddr, occurredSateHeight, slashProportion) + assetsSlashInfo, err := k.GetAssetsAmountToSlash(ctx, operatorAddress, avsAddr, slashEventHeight, slashProportion) if err != nil { return err } diff --git a/x/operator/types/codec.go b/x/operator/types/codec.go index 89bd73c1a..473377ac4 100644 --- a/x/operator/types/codec.go +++ b/x/operator/types/codec.go @@ -32,8 +32,8 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), &RegisterOperatorReq{}, - &OptInToChainIDRequest{}, - &InitiateOptOutFromChainIDRequest{}, + &OptInToCosmosChainRequest{}, + &InitiateOptOutFromCosmosChainRequest{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/operator/types/expected_keepers.go b/x/operator/types/expected_keepers.go index f1e08401a..5377075f8 100644 --- a/x/operator/types/expected_keepers.go +++ b/x/operator/types/expected_keepers.go @@ -8,7 +8,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -type ExpectAssetsInterface interface { +var ( + _ OracleKeeper = MockOracle{} + _ AvsKeeper = MockAvs{} +) + +type AssetsKeeper interface { GetStakingAssetInfo(ctx sdk.Context, assetID string) (info *assetstype.StakingAssetInfo, err error) IteratorOperatorAssetState(ctx sdk.Context, f func(operatorAddr, assetID string, state *assetstype.OperatorAssetInfo) error) error AppChainInfoIsExist(ctx sdk.Context, chainID string) bool @@ -17,7 +22,7 @@ type ExpectAssetsInterface interface { UpdateOperatorAssetState(ctx sdk.Context, operatorAddr sdk.Address, assetID string, changeAmount assetstype.OperatorSingleAssetChangeInfo) (err error) } -type ExpectDelegationInterface interface { +type DelegationKeeper interface { DelegationStateByOperatorAssets(ctx sdk.Context, operatorAddr string, assetsFilter map[string]interface{}) (map[string]map[string]delegationtype.DelegationAmounts, error) IterateDelegationState(ctx sdk.Context, f func(restakerID, assetID, operatorAddr string, state *delegationtype.DelegationAmounts) error) error UpdateDelegationState(ctx sdk.Context, stakerID string, assetID string, delegationAmounts map[string]*delegationtype.DelegationAmounts) (err error) @@ -30,8 +35,16 @@ type PriceChange struct { NewPrice sdkmath.Int Decimal uint8 } -type ExpectOracleInterface interface { - GetSpecifiedAssetsPrice(ctx sdk.Context, assetsID string) (sdkmath.Int, uint8, error) + +// OracleKeeper is the oracle interface expected by operator module +// These functions need to be implemented by the oracle module +type OracleKeeper interface { + // GetSpecifiedAssetsPrice is a function to retrieve the asset price according to the assetID + // the first return value is price, and the second return value is decimal of the price. + GetSpecifiedAssetsPrice(ctx sdk.Context, assetID string) (sdkmath.Int, uint8, 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) } @@ -53,9 +66,9 @@ func (MockOracle) GetPriceChangeAssets(_ sdk.Context) (map[string]*PriceChange, return nil, nil } -type MockAVS struct{} +type MockAvs struct{} -func (MockAVS) GetAvsSupportedAssets(_ sdk.Context, _ string) (map[string]interface{}, error) { +func (MockAvs) GetAvsSupportedAssets(_ sdk.Context, _ string) (map[string]interface{}, error) { // set USDT as the default asset supported by AVS ret := make(map[string]interface{}) usdtAssetID := "0xdac17f958d2ee523a2206206994597c13d831ec7_0x65" @@ -63,11 +76,11 @@ func (MockAVS) GetAvsSupportedAssets(_ sdk.Context, _ string) (map[string]interf return ret, nil } -func (MockAVS) GetAvsSlashContract(_ sdk.Context, _ string) (string, error) { +func (MockAvs) GetAvsSlashContract(_ sdk.Context, _ string) (string, error) { return "", nil } -type ExpectAvsInterface interface { +type AvsKeeper interface { // GetAvsSupportedAssets The ctx can be historical or current, depending on the state you wish to retrieve. // If the caller want to retrieve a historical assets info supported by Avs, it needs to generate a historical // context through calling `ContextForHistoricalState` implemented in x/assets/types/general.go @@ -81,10 +94,6 @@ type SlashKeeper interface { IsOperatorFrozen(ctx sdk.Context, addr sdk.AccAddress) bool } -type RedelegationKeeper interface { - AppChainInfoIsExist(ctx sdk.Context, chainID string) bool -} - type OperatorConsentHooks interface { // This hook is called when an operator opts in to a chain. AfterOperatorOptIn( diff --git a/x/operator/types/keys.go b/x/operator/types/keys.go index 5cc396660..5e34cf953 100644 --- a/x/operator/types/keys.go +++ b/x/operator/types/keys.go @@ -53,7 +53,7 @@ const ( ) var ( - // KeyPrefixOperatorInfo key-value: operatorAddr->operatorInfo + // KeyPrefixOperatorInfo key-value: operatorAddr->types.OperatorInfo KeyPrefixOperatorInfo = []byte{prefixOperatorInfo} // KeyPrefixOperatorOptedAVSInfo key-value: @@ -61,8 +61,8 @@ var ( KeyPrefixOperatorOptedAVSInfo = []byte{prefixOperatorOptedAVSInfo} // KeyPrefixAVSOperatorAssetsTotalValue key-value: - // AVSAddr -> AVSTotalValue - // AVSAddr + '/' + operatorAddr -> AVSOperatorTotalValue + // AVSAddr -> types.DecValueField(the total USD share of specified Avs) + // AVSAddr + '/' + operatorAddr -> types.DecValueField (the total USD share of specified operator and Avs) KeyPrefixAVSOperatorAssetsTotalValue = []byte{prefixAVSOperatorAssetsTotalValue} // KeyPrefixOperatorAVSSingleAssetState key-value: @@ -70,8 +70,8 @@ var ( KeyPrefixOperatorAVSSingleAssetState = []byte{prefixOperatorAVSSingleAssetState} // KeyPrefixAVSOperatorStakerShareState key-value: - // AVSAddr + '/' + '' + '/' + operatorAddr -> ownAssetsOptedInValue - // AVSAddr + '/' + stakerID + '/' + operatorAddr -> assetsOptedInValue + // AVSAddr + '/' + '' + '/' + operatorAddr -> types.DecValueField(the opted-in USD share owned by the operator itself) + // AVSAddr + '/' + stakerID + '/' + operatorAddr -> types.DecValueField (the opted-in USD share of the staker) KeyPrefixAVSOperatorStakerShareState = []byte{prefixOperatorAVSStakerShareState} // KeyPrefixOperatorSlashInfo key-value: diff --git a/x/operator/types/msg.go b/x/operator/types/msg.go index 8d2bb19e5..b38f28299 100644 --- a/x/operator/types/msg.go +++ b/x/operator/types/msg.go @@ -9,8 +9,8 @@ var ( _ sdk.Msg = &RegisterOperatorReq{} // add for dogfood - _ sdk.Msg = &OptInToChainIDRequest{} - _ sdk.Msg = &InitiateOptOutFromChainIDRequest{} + _ sdk.Msg = &OptInToCosmosChainRequest{} + _ sdk.Msg = &InitiateOptOutFromCosmosChainRequest{} ) // GetSigners returns the expected signers for a MsgUpdateParams message. @@ -32,24 +32,24 @@ func (m *RegisterOperatorReq) GetSignBytes() []byte { return nil } -func (m *OptInToChainIDRequest) GetSigners() []sdk.AccAddress { +func (m *OptInToCosmosChainRequest) GetSigners() []sdk.AccAddress { addr := sdk.MustAccAddressFromBech32(m.Address) return []sdk.AccAddress{addr} } -func (m *OptInToChainIDRequest) ValidateBasic() error { +func (m *OptInToCosmosChainRequest) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(m.Address); err != nil { return errorsmod.Wrap(err, "invalid from address") } return nil } -func (m *InitiateOptOutFromChainIDRequest) GetSigners() []sdk.AccAddress { +func (m *InitiateOptOutFromCosmosChainRequest) GetSigners() []sdk.AccAddress { addr := sdk.MustAccAddressFromBech32(m.Address) return []sdk.AccAddress{addr} } -func (m *InitiateOptOutFromChainIDRequest) ValidateBasic() error { +func (m *InitiateOptOutFromCosmosChainRequest) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(m.Address); err != nil { return errorsmod.Wrap(err, "invalid from address") } diff --git a/x/operator/types/tx.pb.go b/x/operator/types/tx.pb.go index 2d21736dc..6bd9a425a 100644 --- a/x/operator/types/tx.pb.go +++ b/x/operator/types/tx.pb.go @@ -514,8 +514,8 @@ func (m *RegisterOperatorResponse) XXX_DiscardUnknown() { var xxx_messageInfo_RegisterOperatorResponse proto.InternalMessageInfo -// OptInToChainIDRequest defines the OptInToChainID request. -type OptInToChainIDRequest struct { +// OptInToCosmosChainRequest defines the OptInToCosmosChain request. +type OptInToCosmosChainRequest struct { // address is the operator address Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // chain_id is the identifier for the chain that wants to opt in. @@ -527,18 +527,18 @@ type OptInToChainIDRequest struct { PublicKey string `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` } -func (m *OptInToChainIDRequest) Reset() { *m = OptInToChainIDRequest{} } -func (m *OptInToChainIDRequest) String() string { return proto.CompactTextString(m) } -func (*OptInToChainIDRequest) ProtoMessage() {} -func (*OptInToChainIDRequest) Descriptor() ([]byte, []int) { +func (m *OptInToCosmosChainRequest) Reset() { *m = OptInToCosmosChainRequest{} } +func (m *OptInToCosmosChainRequest) String() string { return proto.CompactTextString(m) } +func (*OptInToCosmosChainRequest) ProtoMessage() {} +func (*OptInToCosmosChainRequest) Descriptor() ([]byte, []int) { return fileDescriptor_b229d5663e4df167, []int{9} } -func (m *OptInToChainIDRequest) XXX_Unmarshal(b []byte) error { +func (m *OptInToCosmosChainRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *OptInToChainIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *OptInToCosmosChainRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_OptInToChainIDRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_OptInToCosmosChainRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -548,55 +548,55 @@ func (m *OptInToChainIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *OptInToChainIDRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_OptInToChainIDRequest.Merge(m, src) +func (m *OptInToCosmosChainRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_OptInToCosmosChainRequest.Merge(m, src) } -func (m *OptInToChainIDRequest) XXX_Size() int { +func (m *OptInToCosmosChainRequest) XXX_Size() int { return m.Size() } -func (m *OptInToChainIDRequest) XXX_DiscardUnknown() { - xxx_messageInfo_OptInToChainIDRequest.DiscardUnknown(m) +func (m *OptInToCosmosChainRequest) XXX_DiscardUnknown() { + xxx_messageInfo_OptInToCosmosChainRequest.DiscardUnknown(m) } -var xxx_messageInfo_OptInToChainIDRequest proto.InternalMessageInfo +var xxx_messageInfo_OptInToCosmosChainRequest proto.InternalMessageInfo -func (m *OptInToChainIDRequest) GetAddress() string { +func (m *OptInToCosmosChainRequest) GetAddress() string { if m != nil { return m.Address } return "" } -func (m *OptInToChainIDRequest) GetChainId() string { +func (m *OptInToCosmosChainRequest) GetChainId() string { if m != nil { return m.ChainId } return "" } -func (m *OptInToChainIDRequest) GetPublicKey() string { +func (m *OptInToCosmosChainRequest) GetPublicKey() string { if m != nil { return m.PublicKey } return "" } -// OptInToChainIDResponse defines the OptInToChainID response. -type OptInToChainIDResponse struct { +// OptInToCosmosChainResponse defines the OptInToCosmosChain response. +type OptInToCosmosChainResponse struct { } -func (m *OptInToChainIDResponse) Reset() { *m = OptInToChainIDResponse{} } -func (m *OptInToChainIDResponse) String() string { return proto.CompactTextString(m) } -func (*OptInToChainIDResponse) ProtoMessage() {} -func (*OptInToChainIDResponse) Descriptor() ([]byte, []int) { +func (m *OptInToCosmosChainResponse) Reset() { *m = OptInToCosmosChainResponse{} } +func (m *OptInToCosmosChainResponse) String() string { return proto.CompactTextString(m) } +func (*OptInToCosmosChainResponse) ProtoMessage() {} +func (*OptInToCosmosChainResponse) Descriptor() ([]byte, []int) { return fileDescriptor_b229d5663e4df167, []int{10} } -func (m *OptInToChainIDResponse) XXX_Unmarshal(b []byte) error { +func (m *OptInToCosmosChainResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *OptInToChainIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *OptInToCosmosChainResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_OptInToChainIDResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_OptInToCosmosChainResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -606,38 +606,38 @@ func (m *OptInToChainIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *OptInToChainIDResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_OptInToChainIDResponse.Merge(m, src) +func (m *OptInToCosmosChainResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_OptInToCosmosChainResponse.Merge(m, src) } -func (m *OptInToChainIDResponse) XXX_Size() int { +func (m *OptInToCosmosChainResponse) XXX_Size() int { return m.Size() } -func (m *OptInToChainIDResponse) XXX_DiscardUnknown() { - xxx_messageInfo_OptInToChainIDResponse.DiscardUnknown(m) +func (m *OptInToCosmosChainResponse) XXX_DiscardUnknown() { + xxx_messageInfo_OptInToCosmosChainResponse.DiscardUnknown(m) } -var xxx_messageInfo_OptInToChainIDResponse proto.InternalMessageInfo +var xxx_messageInfo_OptInToCosmosChainResponse proto.InternalMessageInfo -// InitiateOptOutFromChainIDRequest defines the InitiateOptOutFromChainID request. -type InitiateOptOutFromChainIDRequest struct { +// InitiateOptOutFromCosmosChainRequest defines the InitiateOptOutFromCosmosChain request. +type InitiateOptOutFromCosmosChainRequest struct { // address is the operator address Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // chain_id is the identifier for the chain that wants to opt out. ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` } -func (m *InitiateOptOutFromChainIDRequest) Reset() { *m = InitiateOptOutFromChainIDRequest{} } -func (m *InitiateOptOutFromChainIDRequest) String() string { return proto.CompactTextString(m) } -func (*InitiateOptOutFromChainIDRequest) ProtoMessage() {} -func (*InitiateOptOutFromChainIDRequest) Descriptor() ([]byte, []int) { +func (m *InitiateOptOutFromCosmosChainRequest) Reset() { *m = InitiateOptOutFromCosmosChainRequest{} } +func (m *InitiateOptOutFromCosmosChainRequest) String() string { return proto.CompactTextString(m) } +func (*InitiateOptOutFromCosmosChainRequest) ProtoMessage() {} +func (*InitiateOptOutFromCosmosChainRequest) Descriptor() ([]byte, []int) { return fileDescriptor_b229d5663e4df167, []int{11} } -func (m *InitiateOptOutFromChainIDRequest) XXX_Unmarshal(b []byte) error { +func (m *InitiateOptOutFromCosmosChainRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *InitiateOptOutFromChainIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *InitiateOptOutFromCosmosChainRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_InitiateOptOutFromChainIDRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_InitiateOptOutFromCosmosChainRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -647,48 +647,48 @@ func (m *InitiateOptOutFromChainIDRequest) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } -func (m *InitiateOptOutFromChainIDRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_InitiateOptOutFromChainIDRequest.Merge(m, src) +func (m *InitiateOptOutFromCosmosChainRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_InitiateOptOutFromCosmosChainRequest.Merge(m, src) } -func (m *InitiateOptOutFromChainIDRequest) XXX_Size() int { +func (m *InitiateOptOutFromCosmosChainRequest) XXX_Size() int { return m.Size() } -func (m *InitiateOptOutFromChainIDRequest) XXX_DiscardUnknown() { - xxx_messageInfo_InitiateOptOutFromChainIDRequest.DiscardUnknown(m) +func (m *InitiateOptOutFromCosmosChainRequest) XXX_DiscardUnknown() { + xxx_messageInfo_InitiateOptOutFromCosmosChainRequest.DiscardUnknown(m) } -var xxx_messageInfo_InitiateOptOutFromChainIDRequest proto.InternalMessageInfo +var xxx_messageInfo_InitiateOptOutFromCosmosChainRequest proto.InternalMessageInfo -func (m *InitiateOptOutFromChainIDRequest) GetAddress() string { +func (m *InitiateOptOutFromCosmosChainRequest) GetAddress() string { if m != nil { return m.Address } return "" } -func (m *InitiateOptOutFromChainIDRequest) GetChainId() string { +func (m *InitiateOptOutFromCosmosChainRequest) GetChainId() string { if m != nil { return m.ChainId } return "" } -// InitiateOptOutFromChainIDResponse defines the InitiateOptOutFromChainID response. -type InitiateOptOutFromChainIDResponse struct { +// InitiateOptOutFromCosmosChainResponse defines the InitiateOptOutFromCosmosChain response. +type InitiateOptOutFromCosmosChainResponse struct { } -func (m *InitiateOptOutFromChainIDResponse) Reset() { *m = InitiateOptOutFromChainIDResponse{} } -func (m *InitiateOptOutFromChainIDResponse) String() string { return proto.CompactTextString(m) } -func (*InitiateOptOutFromChainIDResponse) ProtoMessage() {} -func (*InitiateOptOutFromChainIDResponse) Descriptor() ([]byte, []int) { +func (m *InitiateOptOutFromCosmosChainResponse) Reset() { *m = InitiateOptOutFromCosmosChainResponse{} } +func (m *InitiateOptOutFromCosmosChainResponse) String() string { return proto.CompactTextString(m) } +func (*InitiateOptOutFromCosmosChainResponse) ProtoMessage() {} +func (*InitiateOptOutFromCosmosChainResponse) Descriptor() ([]byte, []int) { return fileDescriptor_b229d5663e4df167, []int{12} } -func (m *InitiateOptOutFromChainIDResponse) XXX_Unmarshal(b []byte) error { +func (m *InitiateOptOutFromCosmosChainResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *InitiateOptOutFromChainIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *InitiateOptOutFromCosmosChainResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_InitiateOptOutFromChainIDResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_InitiateOptOutFromCosmosChainResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -698,17 +698,17 @@ func (m *InitiateOptOutFromChainIDResponse) XXX_Marshal(b []byte, deterministic return b[:n], nil } } -func (m *InitiateOptOutFromChainIDResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_InitiateOptOutFromChainIDResponse.Merge(m, src) +func (m *InitiateOptOutFromCosmosChainResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_InitiateOptOutFromCosmosChainResponse.Merge(m, src) } -func (m *InitiateOptOutFromChainIDResponse) XXX_Size() int { +func (m *InitiateOptOutFromCosmosChainResponse) XXX_Size() int { return m.Size() } -func (m *InitiateOptOutFromChainIDResponse) XXX_DiscardUnknown() { - xxx_messageInfo_InitiateOptOutFromChainIDResponse.DiscardUnknown(m) +func (m *InitiateOptOutFromCosmosChainResponse) XXX_DiscardUnknown() { + xxx_messageInfo_InitiateOptOutFromCosmosChainResponse.DiscardUnknown(m) } -var xxx_messageInfo_InitiateOptOutFromChainIDResponse proto.InternalMessageInfo +var xxx_messageInfo_InitiateOptOutFromCosmosChainResponse proto.InternalMessageInfo func init() { proto.RegisterType((*DecValueField)(nil), "exocore.operator.v1.DecValueField") @@ -720,78 +720,78 @@ func init() { proto.RegisterType((*OperatorSlashInfo)(nil), "exocore.operator.v1.OperatorSlashInfo") proto.RegisterType((*RegisterOperatorReq)(nil), "exocore.operator.v1.RegisterOperatorReq") proto.RegisterType((*RegisterOperatorResponse)(nil), "exocore.operator.v1.RegisterOperatorResponse") - proto.RegisterType((*OptInToChainIDRequest)(nil), "exocore.operator.v1.OptInToChainIDRequest") - proto.RegisterType((*OptInToChainIDResponse)(nil), "exocore.operator.v1.OptInToChainIDResponse") - proto.RegisterType((*InitiateOptOutFromChainIDRequest)(nil), "exocore.operator.v1.InitiateOptOutFromChainIDRequest") - proto.RegisterType((*InitiateOptOutFromChainIDResponse)(nil), "exocore.operator.v1.InitiateOptOutFromChainIDResponse") + proto.RegisterType((*OptInToCosmosChainRequest)(nil), "exocore.operator.v1.OptInToCosmosChainRequest") + proto.RegisterType((*OptInToCosmosChainResponse)(nil), "exocore.operator.v1.OptInToCosmosChainResponse") + proto.RegisterType((*InitiateOptOutFromCosmosChainRequest)(nil), "exocore.operator.v1.InitiateOptOutFromCosmosChainRequest") + proto.RegisterType((*InitiateOptOutFromCosmosChainResponse)(nil), "exocore.operator.v1.InitiateOptOutFromCosmosChainResponse") } func init() { proto.RegisterFile("exocore/operator/v1/tx.proto", fileDescriptor_b229d5663e4df167) } var fileDescriptor_b229d5663e4df167 = []byte{ - // 984 bytes of a gzipped FileDescriptorProto + // 989 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0xc6, 0x49, 0x9a, 0x3c, 0x3b, 0xb1, 0x33, 0x29, 0x8d, 0x63, 0xc0, 0x4e, 0xb6, 0xa2, - 0x72, 0x03, 0xb1, 0xd5, 0x40, 0x91, 0x28, 0x1c, 0xc8, 0x8f, 0x56, 0x58, 0xa4, 0x18, 0x6d, 0xaa, - 0x1e, 0xe0, 0xb0, 0xda, 0xec, 0x4e, 0xd6, 0x23, 0xdb, 0x3b, 0xdb, 0x9d, 0xb1, 0x89, 0x7b, 0x42, - 0x88, 0x03, 0x42, 0x1c, 0xb8, 0x72, 0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, 0xfd, 0x8a, 0xf1, 0x7c, 0xbf, + 0x62, 0xfc, 0xb9, 0x5f, 0x31, 0x7e, 0x3c, 0xa8, 0x64, 0x9e, 0x1f, 0x54, 0x32, 0xbf, 0x1f, 0x54, + 0x32, 0x5f, 0x2c, 0xf4, 0xdd, 0xff, 0x3b, 0x2a, 0xd1, 0x67, 0x98, 0x3f, 0xa2, 0xc9, 0x96, 0x9d, + 0x7e, 0x58, 0x6d, 0x1f, 0x7f, 0x5a, 0xc9, 0xf7, 0x60, 0x63, 0x44, 0x7e, 0xe9, 0xbc, 0xf7, 0x4f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x06, 0xf5, 0xb5, 0x2e, 0x7b, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -809,16 +809,16 @@ type MsgClient interface { // RegisterOperator registers a new operator. RegisterOperator(ctx context.Context, in *RegisterOperatorReq, opts ...grpc.CallOption) (*RegisterOperatorResponse, error) // add services for dogfood - // OptInToChainID acts as opt in method for an operator to + // OptInToCosmosChain acts as opt in method for an operator to // start validatring on a chain. The operator must sign the request with // the key with which they registered in the system. - OptInToChainID(ctx context.Context, in *OptInToChainIDRequest, opts ...grpc.CallOption) (*OptInToChainIDResponse, error) - // InitiateOptOutFromChainID is a method with which an operator can initiate + OptInToCosmosChain(ctx context.Context, in *OptInToCosmosChainRequest, opts ...grpc.CallOption) (*OptInToCosmosChainResponse, error) + // InitiateOptOutFromCosmosChain is a method with which an operator can initiate // the opt out process from a chain. The operator must sign the request with // the key with which they registered in the system. The opt-out process takes // as long as the chain's unbonding period to complete, plus some loose change // for message relaying across chains. - InitiateOptOutFromChainID(ctx context.Context, in *InitiateOptOutFromChainIDRequest, opts ...grpc.CallOption) (*InitiateOptOutFromChainIDResponse, error) + InitiateOptOutFromCosmosChain(ctx context.Context, in *InitiateOptOutFromCosmosChainRequest, opts ...grpc.CallOption) (*InitiateOptOutFromCosmosChainResponse, error) } type msgClient struct { @@ -838,18 +838,18 @@ func (c *msgClient) RegisterOperator(ctx context.Context, in *RegisterOperatorRe return out, nil } -func (c *msgClient) OptInToChainID(ctx context.Context, in *OptInToChainIDRequest, opts ...grpc.CallOption) (*OptInToChainIDResponse, error) { - out := new(OptInToChainIDResponse) - err := c.cc.Invoke(ctx, "/exocore.operator.v1.Msg/OptInToChainID", in, out, opts...) +func (c *msgClient) OptInToCosmosChain(ctx context.Context, in *OptInToCosmosChainRequest, opts ...grpc.CallOption) (*OptInToCosmosChainResponse, error) { + out := new(OptInToCosmosChainResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Msg/OptInToCosmosChain", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *msgClient) InitiateOptOutFromChainID(ctx context.Context, in *InitiateOptOutFromChainIDRequest, opts ...grpc.CallOption) (*InitiateOptOutFromChainIDResponse, error) { - out := new(InitiateOptOutFromChainIDResponse) - err := c.cc.Invoke(ctx, "/exocore.operator.v1.Msg/InitiateOptOutFromChainID", in, out, opts...) +func (c *msgClient) InitiateOptOutFromCosmosChain(ctx context.Context, in *InitiateOptOutFromCosmosChainRequest, opts ...grpc.CallOption) (*InitiateOptOutFromCosmosChainResponse, error) { + out := new(InitiateOptOutFromCosmosChainResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Msg/InitiateOptOutFromCosmosChain", in, out, opts...) if err != nil { return nil, err } @@ -861,16 +861,16 @@ type MsgServer interface { // RegisterOperator registers a new operator. RegisterOperator(context.Context, *RegisterOperatorReq) (*RegisterOperatorResponse, error) // add services for dogfood - // OptInToChainID acts as opt in method for an operator to + // OptInToCosmosChain acts as opt in method for an operator to // start validatring on a chain. The operator must sign the request with // the key with which they registered in the system. - OptInToChainID(context.Context, *OptInToChainIDRequest) (*OptInToChainIDResponse, error) - // InitiateOptOutFromChainID is a method with which an operator can initiate + OptInToCosmosChain(context.Context, *OptInToCosmosChainRequest) (*OptInToCosmosChainResponse, error) + // InitiateOptOutFromCosmosChain is a method with which an operator can initiate // the opt out process from a chain. The operator must sign the request with // the key with which they registered in the system. The opt-out process takes // as long as the chain's unbonding period to complete, plus some loose change // for message relaying across chains. - InitiateOptOutFromChainID(context.Context, *InitiateOptOutFromChainIDRequest) (*InitiateOptOutFromChainIDResponse, error) + InitiateOptOutFromCosmosChain(context.Context, *InitiateOptOutFromCosmosChainRequest) (*InitiateOptOutFromCosmosChainResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -880,11 +880,11 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) RegisterOperator(ctx context.Context, req *RegisterOperatorReq) (*RegisterOperatorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterOperator not implemented") } -func (*UnimplementedMsgServer) OptInToChainID(ctx context.Context, req *OptInToChainIDRequest) (*OptInToChainIDResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method OptInToChainID not implemented") +func (*UnimplementedMsgServer) OptInToCosmosChain(ctx context.Context, req *OptInToCosmosChainRequest) (*OptInToCosmosChainResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OptInToCosmosChain not implemented") } -func (*UnimplementedMsgServer) InitiateOptOutFromChainID(ctx context.Context, req *InitiateOptOutFromChainIDRequest) (*InitiateOptOutFromChainIDResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InitiateOptOutFromChainID not implemented") +func (*UnimplementedMsgServer) InitiateOptOutFromCosmosChain(ctx context.Context, req *InitiateOptOutFromCosmosChainRequest) (*InitiateOptOutFromCosmosChainResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitiateOptOutFromCosmosChain not implemented") } func RegisterMsgServer(s grpc1.Server, srv MsgServer) { @@ -909,38 +909,38 @@ func _Msg_RegisterOperator_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -func _Msg_OptInToChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(OptInToChainIDRequest) +func _Msg_OptInToCosmosChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OptInToCosmosChainRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).OptInToChainID(ctx, in) + return srv.(MsgServer).OptInToCosmosChain(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/exocore.operator.v1.Msg/OptInToChainID", + FullMethod: "/exocore.operator.v1.Msg/OptInToCosmosChain", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).OptInToChainID(ctx, req.(*OptInToChainIDRequest)) + return srv.(MsgServer).OptInToCosmosChain(ctx, req.(*OptInToCosmosChainRequest)) } return interceptor(ctx, in, info, handler) } -func _Msg_InitiateOptOutFromChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InitiateOptOutFromChainIDRequest) +func _Msg_InitiateOptOutFromCosmosChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InitiateOptOutFromCosmosChainRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).InitiateOptOutFromChainID(ctx, in) + return srv.(MsgServer).InitiateOptOutFromCosmosChain(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/exocore.operator.v1.Msg/InitiateOptOutFromChainID", + FullMethod: "/exocore.operator.v1.Msg/InitiateOptOutFromCosmosChain", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).InitiateOptOutFromChainID(ctx, req.(*InitiateOptOutFromChainIDRequest)) + return srv.(MsgServer).InitiateOptOutFromCosmosChain(ctx, req.(*InitiateOptOutFromCosmosChainRequest)) } return interceptor(ctx, in, info, handler) } @@ -954,12 +954,12 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Handler: _Msg_RegisterOperator_Handler, }, { - MethodName: "OptInToChainID", - Handler: _Msg_OptInToChainID_Handler, + MethodName: "OptInToCosmosChain", + Handler: _Msg_OptInToCosmosChain_Handler, }, { - MethodName: "InitiateOptOutFromChainID", - Handler: _Msg_InitiateOptOutFromChainID_Handler, + MethodName: "InitiateOptOutFromCosmosChain", + Handler: _Msg_InitiateOptOutFromCosmosChain_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -1340,7 +1340,7 @@ func (m *RegisterOperatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *OptInToChainIDRequest) Marshal() (dAtA []byte, err error) { +func (m *OptInToCosmosChainRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1350,12 +1350,12 @@ func (m *OptInToChainIDRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *OptInToChainIDRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *OptInToCosmosChainRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *OptInToChainIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *OptInToCosmosChainRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1384,7 +1384,7 @@ func (m *OptInToChainIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *OptInToChainIDResponse) Marshal() (dAtA []byte, err error) { +func (m *OptInToCosmosChainResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1394,12 +1394,12 @@ func (m *OptInToChainIDResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *OptInToChainIDResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *OptInToCosmosChainResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *OptInToChainIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *OptInToCosmosChainResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1407,7 +1407,7 @@ func (m *OptInToChainIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *InitiateOptOutFromChainIDRequest) Marshal() (dAtA []byte, err error) { +func (m *InitiateOptOutFromCosmosChainRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1417,12 +1417,12 @@ func (m *InitiateOptOutFromChainIDRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *InitiateOptOutFromChainIDRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *InitiateOptOutFromCosmosChainRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *InitiateOptOutFromChainIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *InitiateOptOutFromCosmosChainRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1444,7 +1444,7 @@ func (m *InitiateOptOutFromChainIDRequest) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } -func (m *InitiateOptOutFromChainIDResponse) Marshal() (dAtA []byte, err error) { +func (m *InitiateOptOutFromCosmosChainResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1454,12 +1454,12 @@ func (m *InitiateOptOutFromChainIDResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *InitiateOptOutFromChainIDResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *InitiateOptOutFromCosmosChainResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *InitiateOptOutFromChainIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *InitiateOptOutFromCosmosChainResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1630,7 +1630,7 @@ func (m *RegisterOperatorResponse) Size() (n int) { return n } -func (m *OptInToChainIDRequest) Size() (n int) { +func (m *OptInToCosmosChainRequest) Size() (n int) { if m == nil { return 0 } @@ -1651,7 +1651,7 @@ func (m *OptInToChainIDRequest) Size() (n int) { return n } -func (m *OptInToChainIDResponse) Size() (n int) { +func (m *OptInToCosmosChainResponse) Size() (n int) { if m == nil { return 0 } @@ -1660,7 +1660,7 @@ func (m *OptInToChainIDResponse) Size() (n int) { return n } -func (m *InitiateOptOutFromChainIDRequest) Size() (n int) { +func (m *InitiateOptOutFromCosmosChainRequest) Size() (n int) { if m == nil { return 0 } @@ -1677,7 +1677,7 @@ func (m *InitiateOptOutFromChainIDRequest) Size() (n int) { return n } -func (m *InitiateOptOutFromChainIDResponse) Size() (n int) { +func (m *InitiateOptOutFromCosmosChainResponse) Size() (n int) { if m == nil { return 0 } @@ -2742,7 +2742,7 @@ func (m *RegisterOperatorResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *OptInToChainIDRequest) Unmarshal(dAtA []byte) error { +func (m *OptInToCosmosChainRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2765,10 +2765,10 @@ func (m *OptInToChainIDRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: OptInToChainIDRequest: wiretype end group for non-group") + return fmt.Errorf("proto: OptInToCosmosChainRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: OptInToChainIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OptInToCosmosChainRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2888,7 +2888,7 @@ func (m *OptInToChainIDRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *OptInToChainIDResponse) Unmarshal(dAtA []byte) error { +func (m *OptInToCosmosChainResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2911,10 +2911,10 @@ func (m *OptInToChainIDResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: OptInToChainIDResponse: wiretype end group for non-group") + return fmt.Errorf("proto: OptInToCosmosChainResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: OptInToChainIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OptInToCosmosChainResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2938,7 +2938,7 @@ func (m *OptInToChainIDResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *InitiateOptOutFromChainIDRequest) Unmarshal(dAtA []byte) error { +func (m *InitiateOptOutFromCosmosChainRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2961,10 +2961,10 @@ func (m *InitiateOptOutFromChainIDRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: InitiateOptOutFromChainIDRequest: wiretype end group for non-group") + return fmt.Errorf("proto: InitiateOptOutFromCosmosChainRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: InitiateOptOutFromChainIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: InitiateOptOutFromCosmosChainRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3052,7 +3052,7 @@ func (m *InitiateOptOutFromChainIDRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *InitiateOptOutFromChainIDResponse) Unmarshal(dAtA []byte) error { +func (m *InitiateOptOutFromCosmosChainResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3075,10 +3075,10 @@ func (m *InitiateOptOutFromChainIDResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: InitiateOptOutFromChainIDResponse: wiretype end group for non-group") + return fmt.Errorf("proto: InitiateOptOutFromCosmosChainResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: InitiateOptOutFromChainIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: InitiateOptOutFromCosmosChainResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/x/reward/types/tx.pb.go b/x/reward/types/tx.pb.go index 19052baa8..f94910aab 100644 --- a/x/reward/types/tx.pb.go +++ b/x/reward/types/tx.pb.go @@ -31,7 +31,6 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgUpdateParams is the Msg/UpdateParams request type for Erc20 parameters. -// Since: cosmos-sdk 0.47 type MsgUpdateParams struct { // authority is the address of the governance account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` @@ -89,7 +88,6 @@ func (m *MsgUpdateParams) GetParams() Params { // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. -// Since: cosmos-sdk 0.47 type MsgUpdateParamsResponse struct { } diff --git a/x/slash/types/tx.pb.go b/x/slash/types/tx.pb.go index 78a818b45..d22b7b022 100644 --- a/x/slash/types/tx.pb.go +++ b/x/slash/types/tx.pb.go @@ -31,7 +31,6 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgUpdateParams is the Msg/UpdateParams request type for Erc20 parameters. -// Since: cosmos-sdk 0.47 type MsgUpdateParams struct { // authority is the address of the governance account. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` @@ -89,7 +88,6 @@ func (m *MsgUpdateParams) GetParams() Params { // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. -// Since: cosmos-sdk 0.47 type MsgUpdateParamsResponse struct { }