From cc5a1c28edc20670c50131b542ccd946bd2c86b1 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:06:03 -0500 Subject: [PATCH 01/26] undel host: rm protos, proto-gen --- proto/stride/stakeibc/callbacks.proto | 14 - proto/stride/stakeibc/tx.proto | 9 - x/stakeibc/types/callbacks.pb.go | 695 +++----------------------- x/stakeibc/types/tx.pb.go | 562 ++++----------------- 4 files changed, 156 insertions(+), 1124 deletions(-) diff --git a/proto/stride/stakeibc/callbacks.proto b/proto/stride/stakeibc/callbacks.proto index f752cf3700..8144592650 100644 --- a/proto/stride/stakeibc/callbacks.proto +++ b/proto/stride/stakeibc/callbacks.proto @@ -36,20 +36,6 @@ message ReinvestCallback { string host_zone_id = 3; } -message UndelegateCallback { - string host_zone_id = 1; - repeated SplitDelegation split_delegations = 2; - repeated uint64 epoch_unbonding_record_ids = 3; -} - -message UndelegateHostCallback { - string amt = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - repeated SplitDelegation split_delegations = 2; -} - message RedemptionCallback { string host_zone_id = 1; repeated uint64 epoch_unbonding_record_ids = 2; diff --git a/proto/stride/stakeibc/tx.proto b/proto/stride/stakeibc/tx.proto index f62c63825c..ce8acd3af5 100644 --- a/proto/stride/stakeibc/tx.proto +++ b/proto/stride/stakeibc/tx.proto @@ -30,7 +30,6 @@ service Msg { rpc CalibrateDelegation(MsgCalibrateDelegation) returns (MsgCalibrateDelegationResponse); rpc ClearBalance(MsgClearBalance) returns (MsgClearBalanceResponse); - rpc UndelegateHost(MsgUndelegateHost) returns (MsgUndelegateHostResponse); rpc UpdateInnerRedemptionRateBounds(MsgUpdateInnerRedemptionRateBounds) returns (MsgUpdateInnerRedemptionRateBoundsResponse); } @@ -173,14 +172,6 @@ message MsgUpdateValidatorSharesExchRate { string valoper = 3; } message MsgUpdateValidatorSharesExchRateResponse {} -message MsgUndelegateHost { - string creator = 1; - string amount = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; -} -message MsgUndelegateHostResponse {} message MsgCalibrateDelegation { string creator = 1; diff --git a/x/stakeibc/types/callbacks.pb.go b/x/stakeibc/types/callbacks.pb.go index 8675d2a086..22bb303e00 100644 --- a/x/stakeibc/types/callbacks.pb.go +++ b/x/stakeibc/types/callbacks.pb.go @@ -243,111 +243,6 @@ func (m *ReinvestCallback) GetHostZoneId() string { return "" } -type UndelegateCallback struct { - HostZoneId string `protobuf:"bytes,1,opt,name=host_zone_id,json=hostZoneId,proto3" json:"host_zone_id,omitempty"` - SplitDelegations []*SplitDelegation `protobuf:"bytes,2,rep,name=split_delegations,json=splitDelegations,proto3" json:"split_delegations,omitempty"` - EpochUnbondingRecordIds []uint64 `protobuf:"varint,3,rep,packed,name=epoch_unbonding_record_ids,json=epochUnbondingRecordIds,proto3" json:"epoch_unbonding_record_ids,omitempty"` -} - -func (m *UndelegateCallback) Reset() { *m = UndelegateCallback{} } -func (m *UndelegateCallback) String() string { return proto.CompactTextString(m) } -func (*UndelegateCallback) ProtoMessage() {} -func (*UndelegateCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{4} -} -func (m *UndelegateCallback) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UndelegateCallback) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UndelegateCallback.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UndelegateCallback) XXX_Merge(src proto.Message) { - xxx_messageInfo_UndelegateCallback.Merge(m, src) -} -func (m *UndelegateCallback) XXX_Size() int { - return m.Size() -} -func (m *UndelegateCallback) XXX_DiscardUnknown() { - xxx_messageInfo_UndelegateCallback.DiscardUnknown(m) -} - -var xxx_messageInfo_UndelegateCallback proto.InternalMessageInfo - -func (m *UndelegateCallback) GetHostZoneId() string { - if m != nil { - return m.HostZoneId - } - return "" -} - -func (m *UndelegateCallback) GetSplitDelegations() []*SplitDelegation { - if m != nil { - return m.SplitDelegations - } - return nil -} - -func (m *UndelegateCallback) GetEpochUnbondingRecordIds() []uint64 { - if m != nil { - return m.EpochUnbondingRecordIds - } - return nil -} - -type UndelegateHostCallback struct { - Amt github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=amt,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amt"` - SplitDelegations []*SplitDelegation `protobuf:"bytes,2,rep,name=split_delegations,json=splitDelegations,proto3" json:"split_delegations,omitempty"` -} - -func (m *UndelegateHostCallback) Reset() { *m = UndelegateHostCallback{} } -func (m *UndelegateHostCallback) String() string { return proto.CompactTextString(m) } -func (*UndelegateHostCallback) ProtoMessage() {} -func (*UndelegateHostCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{5} -} -func (m *UndelegateHostCallback) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UndelegateHostCallback) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UndelegateHostCallback.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UndelegateHostCallback) XXX_Merge(src proto.Message) { - xxx_messageInfo_UndelegateHostCallback.Merge(m, src) -} -func (m *UndelegateHostCallback) XXX_Size() int { - return m.Size() -} -func (m *UndelegateHostCallback) XXX_DiscardUnknown() { - xxx_messageInfo_UndelegateHostCallback.DiscardUnknown(m) -} - -var xxx_messageInfo_UndelegateHostCallback proto.InternalMessageInfo - -func (m *UndelegateHostCallback) GetSplitDelegations() []*SplitDelegation { - if m != nil { - return m.SplitDelegations - } - return nil -} - type RedemptionCallback struct { HostZoneId string `protobuf:"bytes,1,opt,name=host_zone_id,json=hostZoneId,proto3" json:"host_zone_id,omitempty"` EpochUnbondingRecordIds []uint64 `protobuf:"varint,2,rep,packed,name=epoch_unbonding_record_ids,json=epochUnbondingRecordIds,proto3" json:"epoch_unbonding_record_ids,omitempty"` @@ -357,7 +252,7 @@ func (m *RedemptionCallback) Reset() { *m = RedemptionCallback{} } func (m *RedemptionCallback) String() string { return proto.CompactTextString(m) } func (*RedemptionCallback) ProtoMessage() {} func (*RedemptionCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{6} + return fileDescriptor_f41c99b09b96a5ac, []int{4} } func (m *RedemptionCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -410,7 +305,7 @@ func (m *Rebalancing) Reset() { *m = Rebalancing{} } func (m *Rebalancing) String() string { return proto.CompactTextString(m) } func (*Rebalancing) ProtoMessage() {} func (*Rebalancing) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{7} + return fileDescriptor_f41c99b09b96a5ac, []int{5} } func (m *Rebalancing) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -462,7 +357,7 @@ func (m *RebalanceCallback) Reset() { *m = RebalanceCallback{} } func (m *RebalanceCallback) String() string { return proto.CompactTextString(m) } func (*RebalanceCallback) ProtoMessage() {} func (*RebalanceCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{8} + return fileDescriptor_f41c99b09b96a5ac, []int{6} } func (m *RebalanceCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -513,7 +408,7 @@ func (m *DetokenizeSharesCallback) Reset() { *m = DetokenizeSharesCallba func (m *DetokenizeSharesCallback) String() string { return proto.CompactTextString(m) } func (*DetokenizeSharesCallback) ProtoMessage() {} func (*DetokenizeSharesCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{9} + return fileDescriptor_f41c99b09b96a5ac, []int{7} } func (m *DetokenizeSharesCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -559,7 +454,7 @@ func (m *LSMLiquidStake) Reset() { *m = LSMLiquidStake{} } func (m *LSMLiquidStake) String() string { return proto.CompactTextString(m) } func (*LSMLiquidStake) ProtoMessage() {} func (*LSMLiquidStake) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{10} + return fileDescriptor_f41c99b09b96a5ac, []int{8} } func (m *LSMLiquidStake) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -617,7 +512,7 @@ func (m *ValidatorSharesToTokensQueryCallback) Reset() { *m = ValidatorS func (m *ValidatorSharesToTokensQueryCallback) String() string { return proto.CompactTextString(m) } func (*ValidatorSharesToTokensQueryCallback) ProtoMessage() {} func (*ValidatorSharesToTokensQueryCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{11} + return fileDescriptor_f41c99b09b96a5ac, []int{9} } func (m *ValidatorSharesToTokensQueryCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -662,7 +557,7 @@ func (m *DelegatorSharesQueryCallback) Reset() { *m = DelegatorSharesQue func (m *DelegatorSharesQueryCallback) String() string { return proto.CompactTextString(m) } func (*DelegatorSharesQueryCallback) ProtoMessage() {} func (*DelegatorSharesQueryCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{12} + return fileDescriptor_f41c99b09b96a5ac, []int{10} } func (m *DelegatorSharesQueryCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -696,8 +591,6 @@ func init() { proto.RegisterType((*DelegateCallback)(nil), "stride.stakeibc.DelegateCallback") proto.RegisterType((*ClaimCallback)(nil), "stride.stakeibc.ClaimCallback") proto.RegisterType((*ReinvestCallback)(nil), "stride.stakeibc.ReinvestCallback") - proto.RegisterType((*UndelegateCallback)(nil), "stride.stakeibc.UndelegateCallback") - proto.RegisterType((*UndelegateHostCallback)(nil), "stride.stakeibc.UndelegateHostCallback") proto.RegisterType((*RedemptionCallback)(nil), "stride.stakeibc.RedemptionCallback") proto.RegisterType((*Rebalancing)(nil), "stride.stakeibc.Rebalancing") proto.RegisterType((*RebalanceCallback)(nil), "stride.stakeibc.RebalanceCallback") @@ -710,60 +603,58 @@ func init() { func init() { proto.RegisterFile("stride/stakeibc/callbacks.proto", fileDescriptor_f41c99b09b96a5ac) } var fileDescriptor_f41c99b09b96a5ac = []byte{ - // 840 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6f, 0x23, 0x35, - 0x14, 0xcf, 0x34, 0xab, 0xdd, 0x8d, 0x93, 0x36, 0xe9, 0x08, 0x2d, 0x69, 0x14, 0x25, 0x61, 0x16, - 0xc1, 0x0a, 0x69, 0x67, 0xd4, 0x22, 0x10, 0x88, 0xcb, 0xd2, 0x56, 0x68, 0x23, 0xa5, 0x48, 0x4c, - 0x5a, 0x0e, 0xbd, 0x8c, 0x3c, 0x63, 0x2b, 0xb1, 0x32, 0x63, 0xa7, 0x63, 0x27, 0xa5, 0xfd, 0x04, - 0x1c, 0x7b, 0xe5, 0x23, 0xc0, 0x85, 0x4f, 0xc0, 0x85, 0x53, 0x8f, 0x3d, 0x22, 0x0e, 0x05, 0xb5, - 0x5f, 0x04, 0xd9, 0xe3, 0xf9, 0x93, 0x04, 0x2a, 0x52, 0x38, 0x25, 0xf3, 0xfc, 0xb3, 0xdf, 0xfb, - 0xfd, 0x7e, 0x7e, 0xcf, 0xa0, 0xcb, 0x45, 0x4c, 0x10, 0x76, 0xb8, 0x80, 0x13, 0x4c, 0xfc, 0xc0, - 0x09, 0x60, 0x18, 0xfa, 0x30, 0x98, 0x70, 0x7b, 0x1a, 0x33, 0xc1, 0xcc, 0x7a, 0x02, 0xb0, 0x53, - 0x40, 0xeb, 0x9d, 0x11, 0x1b, 0x31, 0xb5, 0xe6, 0xc8, 0x7f, 0x09, 0xac,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, 0x7e, - 0x56, 0x7c, 0x26, 0xca, 0x6a, 0x5f, 0x6b, 0x65, 0x5f, 0x66, 0x63, 0xe1, 0x09, 0xb1, 0xce, 0xc0, - 0xfb, 0x59, 0x3c, 0x51, 0xe5, 0x98, 0xa9, 0xda, 0xf8, 0x37, 0x33, 0x1c, 0x5f, 0x64, 0x12, 0xf5, - 0x41, 0x23, 0xe4, 0x91, 0x17, 0x2a, 0x9e, 0x9e, 0x3a, 0x73, 0x99, 0x5d, 0x96, 0x68, 0x51, 0x0f, - 0x77, 0x2b, 0xe4, 0x51, 0xe1, 0xdb, 0xba, 0x32, 0x40, 0x5b, 0xf7, 0x48, 0x9a, 0x73, 0x31, 0xd7, - 0x14, 0xb4, 0x09, 0x25, 0x82, 0xc0, 0x30, 0xbf, 0x8e, 0x85, 0x7e, 0x7c, 0x64, 0x7b, 0xb7, 0xf4, - 0x99, 0x19, 0xdd, 0xbc, 0x4f, 0xf7, 0x07, 0xd7, 0x77, 0x1d, 0xe3, 0xe6, 0xae, 0x63, 0xfc, 0x79, - 0xd7, 0x31, 0xae, 0xee, 0x3b, 0xa5, 0x9b, 0xfb, 0x4e, 0xe9, 0xb7, 0xfb, 0x4e, 0xe9, 0x74, 0xaf, - 0x70, 0xfa, 0x50, 0xf1, 0x7c, 0x3d, 0x80, 0x3e, 0x77, 0xf4, 0x5b, 0x3e, 0xdf, 0xfd, 0xc4, 0xf9, - 0x2e, 0x7f, 0xd1, 0x55, 0x36, 0xff, 0xa9, 0x7a, 0xce, 0x3f, 0xfe, 0x2b, 0x00, 0x00, 0xff, 0xff, - 0x70, 0x57, 0x4d, 0x1c, 0x98, 0x08, 0x00, 0x00, + // 805 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x4f, 0xe3, 0x46, + 0x14, 0x8f, 0x09, 0x02, 0x32, 0x09, 0x24, 0x58, 0x55, 0x1b, 0xa2, 0x28, 0x49, 0x4d, 0xd5, 0xa2, + 0x4a, 0xd8, 0x22, 0x55, 0xab, 0x56, 0xbd, 0x50, 0x40, 0x55, 0x23, 0x85, 0x4a, 0x75, 0xa0, 0x07, + 0x2e, 0xd6, 0xd8, 0x1e, 0x25, 0xa3, 0xd8, 0x33, 0xc1, 0x33, 0x09, 0x85, 0x4f, 0xd0, 0x23, 0xd7, + 0x7e, 0x84, 0xf6, 0xd2, 0x4f, 0xb0, 0x77, 0x8e, 0x1c, 0x57, 0x7b, 0x60, 0x57, 0xf0, 0x45, 0x56, + 0x33, 0x1e, 0xff, 0x49, 0xa2, 0x95, 0x36, 0xda, 0x53, 0xe2, 0x37, 0xbf, 0x37, 0xef, 0xfd, 0x7e, + 0xef, 0xe7, 0x67, 0xd0, 0x66, 0x3c, 0xc2, 0x3e, 0xb2, 0x18, 0x87, 0x63, 0x84, 0x5d, 0xcf, 0xf2, + 0x60, 0x10, 0xb8, 0xd0, 0x1b, 0x33, 0x73, 0x12, 0x51, 0x4e, 0xf5, 0x6a, 0x0c, 0x30, 0x13, 0x40, + 0xe3, 0xb3, 0x21, 0x1d, 0x52, 0x79, 0x66, 0x89, 0x7f, 0x31, 0xac, 0xd1, 0xf2, 0x28, 0x0b, 0x29, + 0xb3, 0x5c, 0xc8, 0x90, 0x35, 0x3b, 0x72, 0x11, 0x87, 0x47, 0x96, 0x47, 0x31, 0x51, 0xe7, 0x4d, + 0x55, 0x27, 0x42, 0x1e, 0x8d, 0x7c, 0x96, 0xfc, 0xaa, 0xd3, 0xa5, 0x2e, 0x46, 0x94, 0x71, 0xe7, + 0x8e, 0x12, 0xf4, 0x21, 0xc0, 0x0c, 0x06, 0xd8, 0x87, 0x9c, 0x46, 0x31, 0xc0, 0xb8, 0x01, 0xd5, + 0xc1, 0x24, 0xc0, 0xfc, 0x0c, 0x05, 0x68, 0x08, 0x39, 0xa6, 0x44, 0x6f, 0x82, 0x52, 0x8a, 0xaa, + 0x6b, 0x1d, 0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ab, 0xf0, 0xfa, 0xa5, 0x55, 0xb8, 0xea, 0xe6, 0x6e, 0x1f, 0x48, + 0x9e, 0x87, 0x7d, 0xe8, 0x32, 0x4b, 0x7d, 0x5a, 0x66, 0x47, 0xdf, 0x5b, 0x7f, 0x65, 0x1f, 0x18, + 0x59, 0xcd, 0xdd, 0x90, 0x5f, 0x97, 0xef, 0xde, 0x07, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x24, 0x25, + 0x84, 0x27, 0x07, 0x00, 0x00, } func (m *SplitDelegation) Marshal() (dAtA []byte, err error) { @@ -937,7 +828,7 @@ func (m *ReinvestCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *UndelegateCallback) Marshal() (dAtA []byte, err error) { +func (m *RedemptionCallback) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -947,12 +838,12 @@ func (m *UndelegateCallback) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *UndelegateCallback) MarshalTo(dAtA []byte) (int, error) { +func (m *RedemptionCallback) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UndelegateCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RedemptionCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -973,115 +864,6 @@ func (m *UndelegateCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], dAtA3[:j2]) i = encodeVarintCallbacks(dAtA, i, uint64(j2)) i-- - dAtA[i] = 0x1a - } - if len(m.SplitDelegations) > 0 { - for iNdEx := len(m.SplitDelegations) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SplitDelegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCallbacks(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.HostZoneId) > 0 { - i -= len(m.HostZoneId) - copy(dAtA[i:], m.HostZoneId) - i = encodeVarintCallbacks(dAtA, i, uint64(len(m.HostZoneId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UndelegateHostCallback) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UndelegateHostCallback) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UndelegateHostCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SplitDelegations) > 0 { - for iNdEx := len(m.SplitDelegations) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SplitDelegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCallbacks(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size := m.Amt.Size() - i -= size - if _, err := m.Amt.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintCallbacks(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *RedemptionCallback) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RedemptionCallback) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RedemptionCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.EpochUnbondingRecordIds) > 0 { - dAtA5 := make([]byte, len(m.EpochUnbondingRecordIds)*10) - var j4 int - for _, num := range m.EpochUnbondingRecordIds { - for num >= 1<<7 { - dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j4++ - } - dAtA5[j4] = uint8(num) - j4++ - } - i -= j4 - copy(dAtA[i:], dAtA5[:j4]) - i = encodeVarintCallbacks(dAtA, i, uint64(j4)) - i-- dAtA[i] = 0x12 } if len(m.HostZoneId) > 0 { @@ -1430,49 +1212,6 @@ func (m *ReinvestCallback) Size() (n int) { return n } -func (m *UndelegateCallback) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.HostZoneId) - if l > 0 { - n += 1 + l + sovCallbacks(uint64(l)) - } - if len(m.SplitDelegations) > 0 { - for _, e := range m.SplitDelegations { - l = e.Size() - n += 1 + l + sovCallbacks(uint64(l)) - } - } - if len(m.EpochUnbondingRecordIds) > 0 { - l = 0 - for _, e := range m.EpochUnbondingRecordIds { - l += sovCallbacks(uint64(e)) - } - n += 1 + sovCallbacks(uint64(l)) + l - } - return n -} - -func (m *UndelegateHostCallback) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Amt.Size() - n += 1 + l + sovCallbacks(uint64(l)) - if len(m.SplitDelegations) > 0 { - for _, e := range m.SplitDelegations { - l = e.Size() - n += 1 + l + sovCallbacks(uint64(l)) - } - } - return n -} - func (m *RedemptionCallback) Size() (n int) { if m == nil { return 0 @@ -2094,316 +1833,6 @@ func (m *ReinvestCallback) Unmarshal(dAtA []byte) error { } return nil } -func (m *UndelegateCallback) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UndelegateCallback: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UndelegateCallback: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostZoneId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCallbacks - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCallbacks - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HostZoneId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SplitDelegations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCallbacks - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCallbacks - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SplitDelegations = append(m.SplitDelegations, &SplitDelegation{}) - if err := m.SplitDelegations[len(m.SplitDelegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EpochUnbondingRecordIds = append(m.EpochUnbondingRecordIds, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthCallbacks - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthCallbacks - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.EpochUnbondingRecordIds) == 0 { - m.EpochUnbondingRecordIds = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EpochUnbondingRecordIds = append(m.EpochUnbondingRecordIds, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field EpochUnbondingRecordIds", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipCallbacks(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCallbacks - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UndelegateHostCallback) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UndelegateHostCallback: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UndelegateHostCallback: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amt", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCallbacks - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCallbacks - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Amt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SplitDelegations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCallbacks - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCallbacks - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SplitDelegations = append(m.SplitDelegations, &SplitDelegation{}) - if err := m.SplitDelegations[len(m.SplitDelegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCallbacks(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCallbacks - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *RedemptionCallback) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/stakeibc/types/tx.pb.go b/x/stakeibc/types/tx.pb.go index e58d0709fa..51e42a2447 100644 --- a/x/stakeibc/types/tx.pb.go +++ b/x/stakeibc/types/tx.pb.go @@ -1278,87 +1278,6 @@ func (m *MsgUpdateValidatorSharesExchRateResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateValidatorSharesExchRateResponse proto.InternalMessageInfo -type MsgUndelegateHost struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` -} - -func (m *MsgUndelegateHost) Reset() { *m = MsgUndelegateHost{} } -func (m *MsgUndelegateHost) String() string { return proto.CompactTextString(m) } -func (*MsgUndelegateHost) ProtoMessage() {} -func (*MsgUndelegateHost) Descriptor() ([]byte, []int) { - return fileDescriptor_9b7e09c9ad51cd54, []int{26} -} -func (m *MsgUndelegateHost) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUndelegateHost) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUndelegateHost.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUndelegateHost) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUndelegateHost.Merge(m, src) -} -func (m *MsgUndelegateHost) XXX_Size() int { - return m.Size() -} -func (m *MsgUndelegateHost) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUndelegateHost.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUndelegateHost proto.InternalMessageInfo - -func (m *MsgUndelegateHost) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -type MsgUndelegateHostResponse struct { -} - -func (m *MsgUndelegateHostResponse) Reset() { *m = MsgUndelegateHostResponse{} } -func (m *MsgUndelegateHostResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUndelegateHostResponse) ProtoMessage() {} -func (*MsgUndelegateHostResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9b7e09c9ad51cd54, []int{27} -} -func (m *MsgUndelegateHostResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUndelegateHostResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUndelegateHostResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUndelegateHostResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUndelegateHostResponse.Merge(m, src) -} -func (m *MsgUndelegateHostResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUndelegateHostResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUndelegateHostResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUndelegateHostResponse proto.InternalMessageInfo - type MsgCalibrateDelegation struct { Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` @@ -1369,7 +1288,7 @@ func (m *MsgCalibrateDelegation) Reset() { *m = MsgCalibrateDelegation{} func (m *MsgCalibrateDelegation) String() string { return proto.CompactTextString(m) } func (*MsgCalibrateDelegation) ProtoMessage() {} func (*MsgCalibrateDelegation) Descriptor() ([]byte, []int) { - return fileDescriptor_9b7e09c9ad51cd54, []int{28} + return fileDescriptor_9b7e09c9ad51cd54, []int{26} } func (m *MsgCalibrateDelegation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1426,7 +1345,7 @@ func (m *MsgCalibrateDelegationResponse) Reset() { *m = MsgCalibrateDele func (m *MsgCalibrateDelegationResponse) String() string { return proto.CompactTextString(m) } func (*MsgCalibrateDelegationResponse) ProtoMessage() {} func (*MsgCalibrateDelegationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9b7e09c9ad51cd54, []int{29} + return fileDescriptor_9b7e09c9ad51cd54, []int{27} } func (m *MsgCalibrateDelegationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1482,8 +1401,6 @@ func init() { proto.RegisterType((*MsgRestoreInterchainAccountResponse)(nil), "stride.stakeibc.MsgRestoreInterchainAccountResponse") proto.RegisterType((*MsgUpdateValidatorSharesExchRate)(nil), "stride.stakeibc.MsgUpdateValidatorSharesExchRate") proto.RegisterType((*MsgUpdateValidatorSharesExchRateResponse)(nil), "stride.stakeibc.MsgUpdateValidatorSharesExchRateResponse") - proto.RegisterType((*MsgUndelegateHost)(nil), "stride.stakeibc.MsgUndelegateHost") - proto.RegisterType((*MsgUndelegateHostResponse)(nil), "stride.stakeibc.MsgUndelegateHostResponse") proto.RegisterType((*MsgCalibrateDelegation)(nil), "stride.stakeibc.MsgCalibrateDelegation") proto.RegisterType((*MsgCalibrateDelegationResponse)(nil), "stride.stakeibc.MsgCalibrateDelegationResponse") } @@ -1491,100 +1408,98 @@ func init() { func init() { proto.RegisterFile("stride/stakeibc/tx.proto", fileDescriptor_9b7e09c9ad51cd54) } var fileDescriptor_9b7e09c9ad51cd54 = []byte{ - // 1482 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcf, 0x6f, 0xdc, 0xc4, - 0x17, 0x8f, 0x9b, 0x34, 0x4d, 0x5f, 0x36, 0xbf, 0x9c, 0x34, 0x75, 0x9c, 0x6f, 0x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d, 0xa6, 0xf3, 0x94, 0x04, 0xdb, - 0x9f, 0x14, 0x98, 0x60, 0xa6, 0xed, 0xad, 0xd7, 0x4b, 0x78, 0x11, 0x26, 0x7d, 0x1a, 0x58, 0x71, - 0x78, 0x0f, 0x13, 0xcb, 0xab, 0xdb, 0x39, 0xe6, 0xe3, 0x3e, 0x0d, 0x6e, 0x32, 0x4b, 0xad, 0x6e, - 0x27, 0x07, 0xb8, 0x01, 0x33, 0xfb, 0x58, 0x76, 0xce, 0xa0, 0xae, 0xc0, 0x54, 0x1c, 0x21, 0x42, - 0x91, 0xcd, 0xf3, 0xc1, 0x0e, 0x83, 0xa6, 0x8f, 0x63, 0xcc, 0xa9, 0x0f, 0x99, 0x93, 0x19, 0xdb, - 0x46, 0x6a, 0x32, 0x7e, 0x56, 0x60, 0x6c, 0x8b, 0xba, 0x1b, 0x3e, 0x46, 0x51, 0x15, 0xf9, 0x88, - 0xd8, 0xf8, 0x78, 0xaf, 0xa1, 0x1b, 0x8f, 0xfe, 0x57, 0x8a, 0x07, 0x73, 0xde, 0x40, 0x84, 0x60, - 0x3f, 0x49, 0x65, 0xb3, 0x33, 0x34, 0x66, 0xe0, 0x7c, 0x81, 0xa9, 0xb8, 0xbc, 0x5f, 0x92, 0x54, - 0x63, 0xe9, 0x88, 0x83, 0xd7, 0x75, 0x73, 0xb3, 0xc0, 0x13, 0xcb, 0xfa, 0x3c, 0x24, 0xe9, 0x7b, - 0x37, 0x87, 0xd8, 0xc4, 0x9d, 0x90, 0x60, 0x55, 0x87, 0xa1, 0x08, 0xdb, 0xd8, 0xdb, 0xc1, 0x51, - 0x7a, 0x0e, 0x31, 0x4e, 0x93, 0x30, 0x43, 0x56, 0x9c, 0xe3, 0xd7, 0xd3, 0x30, 0xc9, 0x4d, 0xae, - 0x47, 0x63, 0x1c, 0x7d, 0xd4, 0xd9, 0xed, 0x03, 0x18, 0xb1, 0x43, 0x42, 0x70, 0x72, 0xaf, 0x9d, - 0xe0, 0x57, 0xb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x62, 0x7d, 0x99, 0x97, 0xed, 0x52, 0x00, 0xe9, 0x6f, 0x1d, - 0x01, 0x24, 0x9c, 0x7c, 0x01, 0x5a, 0xcf, 0x1a, 0xd1, 0x23, 0xdf, 0xe4, 0x68, 0xfd, 0xca, 0xcb, - 0xa0, 0x85, 0xff, 0x6f, 0x14, 0xb8, 0x70, 0xb0, 0xca, 0x4b, 0x23, 0x77, 0xe0, 0x12, 0xfd, 0xdd, - 0x97, 0x5e, 0x92, 0xcd, 0x5d, 0x99, 0x82, 0x4a, 0x73, 0x57, 0x02, 0x94, 0xe7, 0xee, 0x01, 0x52, - 0xa9, 0xde, 0x81, 0x52, 0xee, 0xbf, 0xea, 0x39, 0xf9, 0x83, 0xeb, 0x22, 0xf4, 0x85, 0xc3, 0x10, - 0x59, 0x95, 0x2c, 0x94, 0x28, 0xa9, 0x4a, 0xe6, 0x31, 0x72, 0x95, 0x94, 0xd7, 0x1c, 0xf5, 0x7b, - 0x05, 0x2a, 0x87, 0x7d, 0x35, 0x5b, 0xeb, 0x7d, 0x1b, 0x3d, 0x17, 0xe9, 0xef, 0x1d, 0x63, 0x51, - 0x87, 0x55, 0xf5, 0xfa, 0x93, 0xe7, 0x65, 0xe5, 0xe9, 0xf3, 0xb2, 0xf2, 0xe7, 0xf3, 0xb2, 0xf2, - 0xed, 0x8b, 0x72, 0xdf, 0xd3, 0x17, 0xe5, 0xbe, 0xdf, 0x5f, 0x94, 0xfb, 0xee, 0xac, 0x66, 0x0a, - 0xee, 0x36, 0x77, 0xb0, 0x78, 0x1d, 0xd5, 0xe9, 0x72, 0xfa, 0x45, 0x71, 0x67, 0xe5, 0xed, 0xe5, - 0x76, 0xe6, 0x2b, 0x25, 0x2b, 0xc0, 0xf5, 0x41, 0xfe, 0x8d, 0x70, 0xed, 0x9f, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xc4, 0x68, 0xae, 0x73, 0xc5, 0x14, 0x00, 0x00, + // 1451 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4d, 0x6f, 0xdb, 0x46, + 0x13, 0x36, 0x63, 0xc7, 0x51, 0xc6, 0xf2, 0x17, 0xed, 0x38, 0x34, 0xf3, 0x46, 0x52, 0xe8, 0xf7, + 0xc3, 0x6f, 0x1a, 0x4b, 0xb0, 0x9d, 0xa2, 0x68, 0xda, 0x1e, 0x2c, 0x3b, 0x45, 0x05, 0x44, 0x41, + 0x41, 0x27, 0x0d, 0x10, 0xa0, 0x60, 0x57, 0xe4, 0x86, 0x22, 0x42, 0x2e, 0x15, 0x2e, 0xe5, 0x28, + 0x3d, 0x14, 0xbd, 0x14, 0xe8, 0xa5, 0x40, 0x8b, 0x02, 0x3d, 0xf4, 0x50, 0xe4, 0xd0, 0x43, 0x81, + 0xde, 0x8a, 0xfc, 0x88, 0x00, 0xbd, 0x04, 0x39, 0x15, 0x3d, 0x08, 0x45, 0x72, 0xe9, 0xd9, 0xbf, + 0xa0, 0xd8, 0x25, 0xb5, 0x92, 0x28, 0x4a, 0x72, 0x1c, 0x23, 0x27, 0x7b, 0x77, 0x9e, 0xdd, 0x79, + 0x76, 0x76, 0xe6, 0xd9, 0x11, 0x41, 0xa1, 0x61, 0xe0, 0x58, 0xb8, 0x44, 0x43, 0x74, 0x1f, 0x3b, + 0x35, 0xb3, 0x14, 0xb6, 0x8a, 0x8d, 0xc0, 0x0f, 0x7d, 0x79, 0x3e, 0xb2, 0x14, 0x3b, 0x16, 0xf5, + 0x52, 0x12, 0xea, 0x98, 0xc8, 0x40, 0xa6, 0xe9, 0x37, 0x49, 0x18, 0xad, 0x51, 0xf3, 0x49, 0xc8, + 0x01, 0x72, 0x1d, 0x0b, 0x85, 0x7e, 0x10, 0x03, 0x96, 0x6d, 0xdf, 0xf6, 0xf9, 0xbf, 0x25, 0xf6, + 0x5f, 0x3c, 0xbb, 0x6a, 0xfa, 0xd4, 0xf3, 0xa9, 0x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, 0x30, 0xbd, 0xde, 0x32, 0xeb, 0x5c, 0x94, 0x8e, + 0x75, 0x06, 0x05, 0x58, 0x04, 0xfd, 0x06, 0x8e, 0x43, 0xad, 0x77, 0x86, 0xda, 0x65, 0x58, 0x1f, + 0xe7, 0x52, 0xd0, 0xb3, 0xb9, 0x00, 0xec, 0x22, 0xd7, 0xa9, 0x31, 0xd9, 0xdd, 0x8b, 0x74, 0xc2, + 0xf1, 0xc9, 0x49, 0x93, 0x8a, 0x6a, 0x3e, 0xc5, 0x51, 0x87, 0xca, 0xd6, 0x8f, 0x59, 0x98, 0xac, + 0x52, 0x5b, 0xbe, 0x03, 0x33, 0xbd, 0x2d, 0xe9, 0xe0, 0xad, 0xf4, 0x77, 0xb4, 0xea, 0xff, 0xc6, + 0x00, 0x44, 0xbb, 0xf8, 0x19, 0xcc, 0x25, 0xda, 0x5d, 0x2d, 0x75, 0x69, 0x1f, 0x46, 0xbd, 0x3c, + 0x1e, 0x23, 0x3c, 0xdc, 0x81, 0x99, 0xde, 0x9e, 0x2c, 0x95, 0x7a, 0x0f, 0x20, 0x9d, 0x7a, 0x4a, + 0xa3, 0x24, 0xdf, 0x83, 0x85, 0x81, 0x26, 0xe9, 0xdf, 0xe9, 0x8b, 0xfb, 0x51, 0xea, 0x95, 0xa3, + 0xa0, 0x84, 0x9f, 0x16, 0xac, 0x0c, 0x79, 0xb8, 0x52, 0xc3, 0x90, 0x8e, 0x55, 0xb7, 0x8e, 0x8e, + 0x15, 0x9e, 0x7d, 0x58, 0x4a, 0x7b, 0x86, 0x86, 0x44, 0x68, 0x00, 0xa8, 0x96, 0x8e, 0x08, 0x14, + 0x0e, 0x3f, 0x85, 0xd9, 0xfe, 0xe7, 0xe5, 0x52, 0xda, 0x0e, 0x7d, 0x10, 0xf5, 0xff, 0x63, 0x21, + 0x62, 0xfb, 0x26, 0x9c, 0x4b, 0x7f, 0x19, 0x52, 0xf7, 0x48, 0x85, 0xaa, 0x9b, 0x47, 0x86, 0x0a, + 0xb7, 0x26, 0xcc, 0x27, 0xb5, 0x7c, 0x2d, 0x6d, 0x97, 0x04, 0x48, 0x7d, 0xeb, 0x08, 0x20, 0xe1, + 0xe4, 0x0b, 0x50, 0x86, 0xea, 0xf1, 0x90, 0x7c, 0x4b, 0x47, 0xab, 0x57, 0x5f, 0x05, 0x2d, 0xfc, + 0x7f, 0x23, 0xc1, 0xc5, 0xd1, 0x8a, 0x9a, 0x1a, 0xb9, 0x91, 0x4b, 0xd4, 0x77, 0x5f, 0x79, 0x49, + 0x6f, 0xee, 0xa6, 0x29, 0x68, 0x6a, 0xee, 0xa6, 0x00, 0xd3, 0x73, 0x77, 0x84, 0x54, 0xca, 0x77, + 0x21, 0xdb, 0xf7, 0x0b, 0xb6, 0x90, 0x5e, 0x70, 0x5d, 0x84, 0xba, 0x3e, 0x0e, 0x21, 0xf6, 0xfe, + 0x5e, 0x82, 0xfc, 0xb8, 0xef, 0x47, 0xdb, 0xc3, 0x63, 0x35, 0x74, 0x91, 0xfa, 0xde, 0x31, 0x16, + 0x75, 0x58, 0x95, 0x6f, 0x3c, 0x7d, 0x91, 0x93, 0x9e, 0xbd, 0xc8, 0x49, 0x7f, 0xbd, 0xc8, 0x49, + 0xdf, 0xbe, 0xcc, 0x4d, 0x3c, 0x7b, 0x99, 0x9b, 0xf8, 0xe3, 0x65, 0x6e, 0xe2, 0xee, 0x56, 0xcf, + 0x4f, 0x83, 0x7d, 0xee, 0x60, 0xe3, 0x06, 0xaa, 0xd1, 0x52, 0xfc, 0x6d, 0xed, 0x60, 0xf3, 0xed, + 0x52, 0xab, 0xe7, 0x7b, 0x1d, 0xfb, 0xa9, 0x50, 0x9b, 0xe6, 0x5f, 0xcb, 0xb6, 0xff, 0x09, 0x00, + 0x00, 0xff, 0xff, 0x87, 0x28, 0x7d, 0x8b, 0xcf, 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1612,7 +1527,6 @@ type MsgClient interface { UpdateValidatorSharesExchRate(ctx context.Context, in *MsgUpdateValidatorSharesExchRate, opts ...grpc.CallOption) (*MsgUpdateValidatorSharesExchRateResponse, error) CalibrateDelegation(ctx context.Context, in *MsgCalibrateDelegation, opts ...grpc.CallOption) (*MsgCalibrateDelegationResponse, error) ClearBalance(ctx context.Context, in *MsgClearBalance, opts ...grpc.CallOption) (*MsgClearBalanceResponse, error) - UndelegateHost(ctx context.Context, in *MsgUndelegateHost, opts ...grpc.CallOption) (*MsgUndelegateHostResponse, error) UpdateInnerRedemptionRateBounds(ctx context.Context, in *MsgUpdateInnerRedemptionRateBounds, opts ...grpc.CallOption) (*MsgUpdateInnerRedemptionRateBoundsResponse, error) } @@ -1741,15 +1655,6 @@ func (c *msgClient) ClearBalance(ctx context.Context, in *MsgClearBalance, opts return out, nil } -func (c *msgClient) UndelegateHost(ctx context.Context, in *MsgUndelegateHost, opts ...grpc.CallOption) (*MsgUndelegateHostResponse, error) { - out := new(MsgUndelegateHostResponse) - err := c.cc.Invoke(ctx, "/stride.stakeibc.Msg/UndelegateHost", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) UpdateInnerRedemptionRateBounds(ctx context.Context, in *MsgUpdateInnerRedemptionRateBounds, opts ...grpc.CallOption) (*MsgUpdateInnerRedemptionRateBoundsResponse, error) { out := new(MsgUpdateInnerRedemptionRateBoundsResponse) err := c.cc.Invoke(ctx, "/stride.stakeibc.Msg/UpdateInnerRedemptionRateBounds", in, out, opts...) @@ -1774,7 +1679,6 @@ type MsgServer interface { UpdateValidatorSharesExchRate(context.Context, *MsgUpdateValidatorSharesExchRate) (*MsgUpdateValidatorSharesExchRateResponse, error) CalibrateDelegation(context.Context, *MsgCalibrateDelegation) (*MsgCalibrateDelegationResponse, error) ClearBalance(context.Context, *MsgClearBalance) (*MsgClearBalanceResponse, error) - UndelegateHost(context.Context, *MsgUndelegateHost) (*MsgUndelegateHostResponse, error) UpdateInnerRedemptionRateBounds(context.Context, *MsgUpdateInnerRedemptionRateBounds) (*MsgUpdateInnerRedemptionRateBoundsResponse, error) } @@ -1821,9 +1725,6 @@ func (*UnimplementedMsgServer) CalibrateDelegation(ctx context.Context, req *Msg func (*UnimplementedMsgServer) ClearBalance(ctx context.Context, req *MsgClearBalance) (*MsgClearBalanceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ClearBalance not implemented") } -func (*UnimplementedMsgServer) UndelegateHost(ctx context.Context, req *MsgUndelegateHost) (*MsgUndelegateHostResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UndelegateHost not implemented") -} func (*UnimplementedMsgServer) UpdateInnerRedemptionRateBounds(ctx context.Context, req *MsgUpdateInnerRedemptionRateBounds) (*MsgUpdateInnerRedemptionRateBoundsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateInnerRedemptionRateBounds not implemented") } @@ -2066,24 +1967,6 @@ func _Msg_ClearBalance_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _Msg_UndelegateHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUndelegateHost) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UndelegateHost(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/stride.stakeibc.Msg/UndelegateHost", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UndelegateHost(ctx, req.(*MsgUndelegateHost)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_UpdateInnerRedemptionRateBounds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgUpdateInnerRedemptionRateBounds) if err := dec(in); err != nil { @@ -2158,10 +2041,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "ClearBalance", Handler: _Msg_ClearBalance_Handler, }, - { - MethodName: "UndelegateHost", - Handler: _Msg_UndelegateHost_Handler, - }, { MethodName: "UpdateInnerRedemptionRateBounds", Handler: _Msg_UpdateInnerRedemptionRateBounds_Handler, @@ -3160,69 +3039,6 @@ func (m *MsgUpdateValidatorSharesExchRateResponse) MarshalToSizedBuffer(dAtA []b return len(dAtA) - i, nil } -func (m *MsgUndelegateHost) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUndelegateHost) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUndelegateHost) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Amount.Size() - i -= size - if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUndelegateHostResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUndelegateHostResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUndelegateHostResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - func (m *MsgCalibrateDelegation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3722,30 +3538,6 @@ func (m *MsgUpdateValidatorSharesExchRateResponse) Size() (n int) { return n } -func (m *MsgUndelegateHost) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Amount.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUndelegateHostResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *MsgCalibrateDelegation) Size() (n int) { if m == nil { return 0 @@ -6675,172 +6467,6 @@ func (m *MsgUpdateValidatorSharesExchRateResponse) Unmarshal(dAtA []byte) error } return nil } -func (m *MsgUndelegateHost) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUndelegateHost: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUndelegateHost: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUndelegateHostResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUndelegateHostResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUndelegateHostResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *MsgCalibrateDelegation) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From 7cbafdd82d6d9103009c8e54acdcc5a502245492 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:16:40 -0500 Subject: [PATCH 02/26] undel host: revert all logic --- x/stakeibc/client/cli/tx.go | 1 - x/stakeibc/client/cli/tx_undelegate_host.go | 49 --- x/stakeibc/client/cli/tx_update_delegation.go | 45 --- x/stakeibc/handler.go | 3 - x/stakeibc/keeper/icacallbacks.go | 16 +- x/stakeibc/keeper/icacallbacks_undelegate.go | 83 ---- .../keeper/icacallbacks_undelegate_test.go | 228 ----------- x/stakeibc/keeper/msg_undelegate_host.go | 53 --- x/stakeibc/keeper/msg_undelegate_host_test.go | 21 - x/stakeibc/keeper/undelegate_host.go | 137 ------- x/stakeibc/keeper/undelegate_host_test.go | 362 ------------------ x/stakeibc/types/codec.go | 2 - x/stakeibc/types/errors.go | 3 +- x/stakeibc/types/message_undelegate_host.go | 56 --- 14 files changed, 8 insertions(+), 1051 deletions(-) delete mode 100644 x/stakeibc/client/cli/tx_undelegate_host.go delete mode 100644 x/stakeibc/client/cli/tx_update_delegation.go delete mode 100644 x/stakeibc/keeper/msg_undelegate_host.go delete mode 100644 x/stakeibc/keeper/msg_undelegate_host_test.go delete mode 100644 x/stakeibc/keeper/undelegate_host.go delete mode 100644 x/stakeibc/keeper/undelegate_host_test.go delete mode 100644 x/stakeibc/types/message_undelegate_host.go diff --git a/x/stakeibc/client/cli/tx.go b/x/stakeibc/client/cli/tx.go index c58b818b89..25649a5aa7 100644 --- a/x/stakeibc/client/cli/tx.go +++ b/x/stakeibc/client/cli/tx.go @@ -37,7 +37,6 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdUpdateValidatorSharesExchRate()) cmd.AddCommand(CmdCalibrateDelegation()) cmd.AddCommand(CmdClearBalance()) - cmd.AddCommand(CmdUndelegateHost()) cmd.AddCommand(CmdUpdateInnerRedemptionRateBounds()) return cmd diff --git a/x/stakeibc/client/cli/tx_undelegate_host.go b/x/stakeibc/client/cli/tx_undelegate_host.go deleted file mode 100644 index eaf516d10b..0000000000 --- a/x/stakeibc/client/cli/tx_undelegate_host.go +++ /dev/null @@ -1,49 +0,0 @@ -package cli - -import ( - "strconv" - - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/spf13/cobra" - - "github.com/Stride-Labs/stride/v15/x/stakeibc/types" -) - -var _ = strconv.Itoa(0) - -func CmdUndelegateHost() *cobra.Command { - cmd := &cobra.Command{ - Use: "undelegate-host [amount]", - Short: "Broadcast message undelegate-host", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - argAmount, found := sdk.NewIntFromString(args[0]) - if !found { - return errorsmod.Wrap(sdkerrors.ErrInvalidType, "can not convert string to int") - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgUndelegateHost( - clientCtx.GetFromAddress().String(), - argAmount, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/stakeibc/client/cli/tx_update_delegation.go b/x/stakeibc/client/cli/tx_update_delegation.go deleted file mode 100644 index 0c52fdf1d6..0000000000 --- a/x/stakeibc/client/cli/tx_update_delegation.go +++ /dev/null @@ -1,45 +0,0 @@ -package cli - -import ( - "strconv" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/spf13/cobra" - - "github.com/Stride-Labs/stride/v15/x/stakeibc/types" -) - -var _ = strconv.Itoa(0) - -func CmdUpdateValidatorSharesExchRate() *cobra.Command { - cmd := &cobra.Command{ - Use: "update-delegation [chainid] [valoper]", - Short: "Broadcast message update-delegation", - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) (err error) { - argHostdenom := args[0] - argValoper := args[1] - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgUpdateValidatorSharesExchRate( - clientCtx.GetFromAddress().String(), - argHostdenom, - argValoper, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/stakeibc/handler.go b/x/stakeibc/handler.go index ba216c46bd..14245e6cb4 100644 --- a/x/stakeibc/handler.go +++ b/x/stakeibc/handler.go @@ -58,9 +58,6 @@ func NewMessageHandler(k keeper.Keeper) sdk.Handler { case *types.MsgUpdateValidatorSharesExchRate: res, err := msgServer.UpdateValidatorSharesExchRate(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUndelegateHost: - res, err := msgServer.UndelegateHost(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) case *types.MsgCalibrateDelegation: res, err := msgServer.CalibrateDelegation(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) diff --git a/x/stakeibc/keeper/icacallbacks.go b/x/stakeibc/keeper/icacallbacks.go index 48000aba89..bd2ed0b423 100644 --- a/x/stakeibc/keeper/icacallbacks.go +++ b/x/stakeibc/keeper/icacallbacks.go @@ -5,14 +5,13 @@ import ( ) const ( - ICACallbackID_Delegate = "delegate" - ICACallbackID_Claim = "claim" - ICACallbackID_Undelegate = "undelegate" - ICACallbackID_UndelegateHost = "undelegatehost" - ICACallbackID_Reinvest = "reinvest" - ICACallbackID_Redemption = "redemption" - ICACallbackID_Rebalance = "rebalance" - ICACallbackID_Detokenize = "detokenize" + ICACallbackID_Delegate = "delegate" + ICACallbackID_Claim = "claim" + ICACallbackID_Undelegate = "undelegate" + ICACallbackID_Reinvest = "reinvest" + ICACallbackID_Redemption = "redemption" + ICACallbackID_Rebalance = "rebalance" + ICACallbackID_Detokenize = "detokenize" ) func (k Keeper) Callbacks() icacallbackstypes.ModuleCallbacks { @@ -20,7 +19,6 @@ func (k Keeper) Callbacks() icacallbackstypes.ModuleCallbacks { {CallbackId: ICACallbackID_Delegate, CallbackFunc: icacallbackstypes.ICACallbackFunction(k.DelegateCallback)}, {CallbackId: ICACallbackID_Claim, CallbackFunc: icacallbackstypes.ICACallbackFunction(k.ClaimCallback)}, {CallbackId: ICACallbackID_Undelegate, CallbackFunc: icacallbackstypes.ICACallbackFunction(k.UndelegateCallback)}, - {CallbackId: ICACallbackID_UndelegateHost, CallbackFunc: icacallbackstypes.ICACallbackFunction(k.UndelegateHostCallback)}, {CallbackId: ICACallbackID_Reinvest, CallbackFunc: icacallbackstypes.ICACallbackFunction(k.ReinvestCallback)}, {CallbackId: ICACallbackID_Redemption, CallbackFunc: icacallbackstypes.ICACallbackFunction(k.RedemptionCallback)}, {CallbackId: ICACallbackID_Rebalance, CallbackFunc: icacallbackstypes.ICACallbackFunction(k.RebalanceCallback)}, diff --git a/x/stakeibc/keeper/icacallbacks_undelegate.go b/x/stakeibc/keeper/icacallbacks_undelegate.go index cd44fa4516..c92f5712d9 100644 --- a/x/stakeibc/keeper/icacallbacks_undelegate.go +++ b/x/stakeibc/keeper/icacallbacks_undelegate.go @@ -233,86 +233,3 @@ func (k Keeper) BurnTokens(ctx sdk.Context, hostZone types.HostZone, stTokenBurn k.Logger(ctx).Info(fmt.Sprintf("Total supply %s", k.bankKeeper.GetSupply(ctx, stCoinDenom))) return nil } - -// ICA Callback after undelegating host -// -// If successful: -// * sets SetUndelegateHostPrevented -// If timeout: -// * Does nothing -// If failure: -// * Does nothing -func (k Keeper) UndelegateHostCallback(ctx sdk.Context, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error { - // Fetch callback args - var undelegateHostCallback types.UndelegateHostCallback - if err := proto.Unmarshal(args, &undelegateHostCallback); err != nil { - return errorsmod.Wrapf(types.ErrUnmarshalFailure, fmt.Sprintf("Unable to unmarshal undelegate host callback args: %s", err.Error())) - } - k.Logger(ctx).Info("Starting undelegate host callback for amount %v%s", undelegateHostCallback.Amt) - - // Regardless of failure/success/timeout, indicate that this ICA has completed - hostZone, found := k.GetHostZone(ctx, EvmosHostZoneChainId) - if !found { - return errorsmod.Wrapf(sdkerrors.ErrKeyNotFound, "Host zone not found: %s", EvmosHostZoneChainId) - } - for _, splitDelegation := range undelegateHostCallback.SplitDelegations { - if err := k.DecrementValidatorDelegationChangesInProgress(&hostZone, splitDelegation.Validator); err != nil { - // TODO: Revert after v14 upgrade - if errors.Is(err, types.ErrInvalidValidatorDelegationUpdates) { - k.Logger(ctx).Error(utils.LogICACallbackWithHostZone(EvmosHostZoneChainId, ICACallbackID_Undelegate, - "Invariant failed - delegation changes in progress fell below 0 for %s", splitDelegation.Validator)) - continue - } - return err - } - } - k.SetHostZone(ctx, hostZone) - - // Check for timeout (ack nil) - if ackResponse.Status == icacallbackstypes.AckResponseStatus_TIMEOUT { - k.Logger(ctx).Error("UndelegateHostCallback Timeout:", icacallbackstypes.AckResponseStatus_TIMEOUT, packet) - return nil - } - - // Check for a failed transaction (ack error) - if ackResponse.Status == icacallbackstypes.AckResponseStatus_FAILURE { - k.Logger(ctx).Error("UndelegateHostCallback failure (ack error):", icacallbackstypes.AckResponseStatus_FAILURE, packet) - return nil - } - - // Get the host zone - evmosHost, found := k.GetHostZone(ctx, EvmosHostZoneChainId) - if !found { - return errorsmod.Wrapf(types.ErrHostZoneNotFound, "host zone %s not found", EvmosHostZoneChainId) - } - - k.Logger(ctx).Info("UndelegateHostCallback success:", icacallbackstypes.AckResponseStatus_SUCCESS, packet) - - // Update delegation balances - err := k.UpdateDelegationBalancesHost(ctx, evmosHost, undelegateHostCallback) - if err != nil { - k.Logger(ctx).Error(fmt.Sprintf("UndelegateCallback | %s", err.Error())) - return err - } - - k.Logger(ctx).Info("UndelegateHostCallback: SetUndelegateHostPrevented") - if err := k.SetUndelegateHostPrevented(ctx); err != nil { - k.Logger(ctx).Error(fmt.Sprintf("UndelegateHostCallback failed due to SetUndelegateHostPrevented | %s", err.Error())) - return err - } - - return nil -} - -// Decrement the delegation field on host and each validator's delegations after a successful unbonding ICA -func (k Keeper) UpdateDelegationBalancesHost(ctx sdk.Context, hostZone types.HostZone, undelegateHostCallback types.UndelegateHostCallback) error { - // Undelegate from each validator and update Evmos staked balance, if successful - for _, undelegation := range undelegateHostCallback.SplitDelegations { - err := k.AddDelegationToValidator(ctx, &hostZone, undelegation.Validator, undelegation.Amount.Neg(), ICACallbackID_UndelegateHost) - if err != nil { - return err - } - } - k.SetHostZone(ctx, hostZone) - return nil -} diff --git a/x/stakeibc/keeper/icacallbacks_undelegate_test.go b/x/stakeibc/keeper/icacallbacks_undelegate_test.go index 1343366e64..a7922a5ba0 100644 --- a/x/stakeibc/keeper/icacallbacks_undelegate_test.go +++ b/x/stakeibc/keeper/icacallbacks_undelegate_test.go @@ -12,7 +12,6 @@ import ( icacallbacktypes "github.com/Stride-Labs/stride/v15/x/icacallbacks/types" recordtypes "github.com/Stride-Labs/stride/v15/x/records/types" - stakeibckeeper "github.com/Stride-Labs/stride/v15/x/stakeibc/keeper" "github.com/Stride-Labs/stride/v15/x/stakeibc/types" ) @@ -26,16 +25,6 @@ type UndelegateCallbackState struct { zoneAccountBalance sdkmath.Int } -type UndelegateCallbackHostState struct { - totalDelegations sdkmath.Int - val1Bal sdkmath.Int - val2Bal sdkmath.Int - epochNumber uint64 - completionTime time.Time - callbackArgs types.UndelegateHostCallback - zoneAccountBalance sdkmath.Int -} - type UndelegateCallbackArgs struct { packet channeltypes.Packet ackResponse *icacallbacktypes.AcknowledgementResponse @@ -50,14 +39,6 @@ type UndelegateCallbackTestCase struct { balanceToUnstake sdkmath.Int } -type UndelegateCallbackHostTestCase struct { - initialState UndelegateCallbackHostState - validArgs UndelegateCallbackArgs - val1UndelegationAmount sdkmath.Int - val2UndelegationAmount sdkmath.Int - balanceToUnstake sdkmath.Int -} - func (s *KeeperTestSuite) SetupUndelegateCallback() UndelegateCallbackTestCase { // Set up host zone and validator state totalDelegations := sdkmath.NewInt(1_000_000) @@ -161,108 +142,6 @@ func (s *KeeperTestSuite) SetupUndelegateCallback() UndelegateCallbackTestCase { } } -func (s *KeeperTestSuite) SetupUndelegateHostCallback() UndelegateCallbackHostTestCase { - // Set up host zone and validator state - totalDelegations := sdkmath.NewInt(1_000_000) - val1Bal := sdkmath.NewInt(400_000) - val2Bal := totalDelegations.Sub(val1Bal) - balanceToUnstake := sdkmath.NewInt(300_000) - val1UndelegationAmount := sdkmath.NewInt(120_000) - val2UndelegationAmount := balanceToUnstake.Sub(val1UndelegationAmount) - epochNumber := uint64(1) - val1 := types.Validator{ - Name: "val1", - Address: "val1_address", - Delegation: val1Bal, - DelegationChangesInProgress: 1, - } - val2 := types.Validator{ - Name: "val2", - Address: "val2_address", - Delegation: val2Bal, - DelegationChangesInProgress: 1, - } - depositAddress := types.NewHostZoneDepositAddress(stakeibckeeper.EvmosHostZoneChainId) - zoneAccountBalance := balanceToUnstake.Add(sdkmath.NewInt(10)) - zoneAccount := Account{ - acc: depositAddress, - stAtomBalance: sdk.NewCoin(StAtom, zoneAccountBalance), // Add a few extra tokens to make the test more robust - } - hostZone := types.HostZone{ - ChainId: stakeibckeeper.EvmosHostZoneChainId, - HostDenom: Atom, - IbcDenom: IbcAtom, - RedemptionRate: sdk.NewDec(1.0), - Validators: []*types.Validator{&val1, &val2}, - TotalDelegations: totalDelegations, - DepositAddress: depositAddress.String(), - } - s.App.StakeibcKeeper.SetHostZone(s.Ctx, hostZone) - - // Set up EpochUnbondingRecord, HostZoneUnbonding and token state - hostZoneUnbonding := recordtypes.HostZoneUnbonding{ - HostZoneId: stakeibckeeper.EvmosHostZoneChainId, - Status: recordtypes.HostZoneUnbonding_UNBONDING_QUEUE, - StTokenAmount: balanceToUnstake, - } - epochUnbondingRecord := recordtypes.EpochUnbondingRecord{ - EpochNumber: epochNumber, - HostZoneUnbondings: []*recordtypes.HostZoneUnbonding{&hostZoneUnbonding}, - } - s.App.RecordsKeeper.SetEpochUnbondingRecord(s.Ctx, epochUnbondingRecord) - - // mint stTokens to the zone account, to be burned - s.FundAccount(zoneAccount.acc, zoneAccount.stAtomBalance) - - // Mock ack response - packet := channeltypes.Packet{} - completionTime := time.Now() - msgsUndelegateResponse := &stakingtypes.MsgUndelegateResponse{CompletionTime: completionTime} - msgsUndelegateResponseBz, err := proto.Marshal(msgsUndelegateResponse) - s.Require().NoError(err, "no error expected when marshalling undelegate response") - - ackResponse := icacallbacktypes.AcknowledgementResponse{ - Status: icacallbacktypes.AckResponseStatus_SUCCESS, - MsgResponses: [][]byte{msgsUndelegateResponseBz}, - } - - // Mock callback args - val1SplitDelegation := types.SplitDelegation{ - Validator: val1.Address, - Amount: val1UndelegationAmount, - } - val2SplitDelegation := types.SplitDelegation{ - Validator: val2.Address, - Amount: val2UndelegationAmount, - } - callbackArgs := types.UndelegateHostCallback{ - Amt: balanceToUnstake, - SplitDelegations: []*types.SplitDelegation{&val1SplitDelegation, &val2SplitDelegation}, - } - callbackArgsBz, err := proto.Marshal(&callbackArgs) - s.Require().NoError(err, "callback args unmarshalled") - - return UndelegateCallbackHostTestCase{ - val1UndelegationAmount: val1UndelegationAmount, - val2UndelegationAmount: val2UndelegationAmount, - balanceToUnstake: balanceToUnstake, - initialState: UndelegateCallbackHostState{ - callbackArgs: callbackArgs, - totalDelegations: totalDelegations, - val1Bal: val1Bal, - val2Bal: val2Bal, - epochNumber: epochNumber, - completionTime: completionTime, - zoneAccountBalance: zoneAccountBalance, - }, - validArgs: UndelegateCallbackArgs{ - packet: packet, - ackResponse: &ackResponse, - args: callbackArgsBz, - }, - } -} - func (s *KeeperTestSuite) TestUndelegateCallback_Successful() { tc := s.SetupUndelegateCallback() initialState := tc.initialState @@ -578,110 +457,3 @@ func (s *KeeperTestSuite) TestBurnTokens_CouldNotSendCoinsFromAccountToModule() err := s.App.StakeibcKeeper.BurnTokens(s.Ctx, hostZone, sdkmath.NewInt(123456)) s.Require().EqualError(err, "could not send coins from account stride1755g4dkhpw73gz9h9nwhlcefc6sdf8kcmvcwrk4rxfrz8xpxxjms7savm8 to module stakeibc. err: spendable balance is smaller than 123456stcoinDNE: insufficient funds") } - -func (s *KeeperTestSuite) TestUndelegateCallbackHost_Successful() { - tc := s.SetupUndelegateHostCallback() - initialState := tc.initialState - validArgs := tc.validArgs - - // Ensure IsUndelegateHostPrevented(ctx) is not yet flipped - s.Require().False(s.App.StakeibcKeeper.IsUndelegateHostPrevented(s.Ctx)) - - // Callback - err := s.App.StakeibcKeeper.UndelegateHostCallback(s.Ctx, validArgs.packet, validArgs.ackResponse, validArgs.args) - s.Require().NoError(err, "undelegate host callback succeeds") - - // Check that total delegation has decreased on the host zone - hostZone, found := s.App.StakeibcKeeper.GetHostZone(s.Ctx, stakeibckeeper.EvmosHostZoneChainId) - s.Require().True(found) - s.Require().Equal(hostZone.TotalDelegations, initialState.totalDelegations.Sub(tc.balanceToUnstake), "total delegation has decreased on the host zone") - - // Check that Delegations on validators have decreased - s.Require().True(len(hostZone.Validators) == 2, "Expected 2 validators") - val1 := hostZone.Validators[0] - val2 := hostZone.Validators[1] - s.Require().Equal(initialState.val1Bal.Sub(tc.val1UndelegationAmount), val1.Delegation, "val1 delegation has decreased") - s.Require().Equal(initialState.val2Bal.Sub(tc.val2UndelegationAmount), val2.Delegation, "val2 delegation has decreased") - - // Check that the number of delegation changes in progress was reset to 0 - s.Require().Equal(0, int(val1.DelegationChangesInProgress), "val1 delegation changes in progress") - s.Require().Equal(0, int(val2.DelegationChangesInProgress), "val2 delegation changes in progress") - - // ensure UndelegateHostPrevented has been flipped to true - s.Require().True(s.App.StakeibcKeeper.IsUndelegateHostPrevented(s.Ctx)) -} - -func (s *KeeperTestSuite) checkStateIfUndelegateCallbackHostFailed(tc UndelegateCallbackHostTestCase) { - initialState := tc.initialState - - // Check that total delegation has NOT decreased on the host zone - hostZone, found := s.App.StakeibcKeeper.GetHostZone(s.Ctx, stakeibckeeper.EvmosHostZoneChainId) - s.Require().True(found, "host zone found") - s.Require().Equal(initialState.totalDelegations, hostZone.TotalDelegations, "total delegation has NOT decreased on the host zone") - - // Check that Delegations on validators have NOT decreased - s.Require().True(len(hostZone.Validators) == 2, "Expected 2 validators") - val1 := hostZone.Validators[0] - val2 := hostZone.Validators[1] - s.Require().Equal(initialState.val1Bal, val1.Delegation, "val1 delegation has NOT decreased") - s.Require().Equal(initialState.val2Bal, val2.Delegation, "val2 delegation has NOT decreased") - - // Check that the number of delegation changes in progress was reset - s.Require().Equal(0, int(val1.DelegationChangesInProgress), "val1 delegation changes in progress") - s.Require().Equal(0, int(val2.DelegationChangesInProgress), "val2 delegation changes in progress") - - // Check that the host zone unbonding records have not been updated - epochUnbondingRecord, found := s.App.RecordsKeeper.GetEpochUnbondingRecord(s.Ctx, initialState.epochNumber) - s.Require().True(found, "epoch unbonding record found") - s.Require().Equal(len(epochUnbondingRecord.HostZoneUnbondings), 1, "1 host zone unbonding found") - hzu := epochUnbondingRecord.HostZoneUnbondings[0] - s.Require().Equal(int64(hzu.UnbondingTime), int64(0), "completion time is NOT set on the hzu") - s.Require().Equal(hzu.Status, recordtypes.HostZoneUnbonding_UNBONDING_QUEUE, "hzu status is set to UNBONDING_QUEUE") - zoneAccount, err := sdk.AccAddressFromBech32(hostZone.DepositAddress) - s.Require().NoError(err, "zone account address is valid") - s.Require().Equal(initialState.zoneAccountBalance, s.App.BankKeeper.GetBalance(s.Ctx, zoneAccount, StAtom).Amount, "tokens are NOT burned") -} - -func (s *KeeperTestSuite) TestUndelegateCallbackHost_UndelegateCallbackTimeout() { - tc := s.SetupUndelegateHostCallback() - - // Update the ack response to indicate a timeout - invalidArgs := tc.validArgs - invalidArgs.ackResponse.Status = icacallbacktypes.AckResponseStatus_TIMEOUT - - err := s.App.StakeibcKeeper.UndelegateHostCallback(s.Ctx, invalidArgs.packet, invalidArgs.ackResponse, invalidArgs.args) - s.Require().NoError(err, "undelegate callback succeeds on timeout") - s.checkStateIfUndelegateCallbackHostFailed(tc) -} - -func (s *KeeperTestSuite) TestUndelegateCallbackHost_UndelegateCallbackErrorOnHost() { - tc := s.SetupUndelegateHostCallback() - - // an error ack means the tx failed on the host - invalidArgs := tc.validArgs - invalidArgs.ackResponse.Status = icacallbacktypes.AckResponseStatus_FAILURE - - err := s.App.StakeibcKeeper.UndelegateHostCallback(s.Ctx, invalidArgs.packet, invalidArgs.ackResponse, invalidArgs.args) - s.Require().NoError(err, "undelegate callback succeeds with error on host") - s.checkStateIfUndelegateCallbackHostFailed(tc) -} - -func (s *KeeperTestSuite) TestUndelegateCallbackHost_WrongCallbackArgs() { - tc := s.SetupUndelegateHostCallback() - - // random args should cause the callback to fail - invalidCallbackArgs := []byte("random bytes") - - err := s.App.StakeibcKeeper.UndelegateHostCallback(s.Ctx, tc.validArgs.packet, tc.validArgs.ackResponse, invalidCallbackArgs) - s.Require().EqualError(err, "Unable to unmarshal undelegate host callback args: unexpected EOF: unable to unmarshal data structure") -} - -func (s *KeeperTestSuite) TestUndelegateCallbackHost_HostNotFound() { - tc := s.SetupUndelegateHostCallback() - - // remove the host zone from the store to trigger a host not found error - s.App.StakeibcKeeper.RemoveHostZone(s.Ctx, stakeibckeeper.EvmosHostZoneChainId) - - err := s.App.StakeibcKeeper.UndelegateHostCallback(s.Ctx, tc.validArgs.packet, tc.validArgs.ackResponse, tc.validArgs.args) - s.Require().EqualError(err, "Host zone not found: evmos_9001-2: key not found") -} diff --git a/x/stakeibc/keeper/msg_undelegate_host.go b/x/stakeibc/keeper/msg_undelegate_host.go deleted file mode 100644 index 9bd14eb2ee..0000000000 --- a/x/stakeibc/keeper/msg_undelegate_host.go +++ /dev/null @@ -1,53 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/Stride-Labs/stride/v15/x/stakeibc/types" -) - -const isUndelegateHostPreventedKey = "is-undelegate-host-prevented" - -func (k msgServer) UndelegateHost(goCtx context.Context, msg *types.MsgUndelegateHost) (*types.MsgUndelegateHostResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - // undelegateHost is callable only if it has not yet been called and succeeded - if k.IsUndelegateHostPrevented(ctx) { - return nil, errorsmod.Wrapf(types.ErrUndelegateHostNotCallable, "") - } - - // Get host zone unbonding message by summing up the unbonding records - if err := k.UndelegateHostEvmos(ctx, msg.Amount); err != nil { - return nil, fmt.Errorf("Error initiating host zone unbondings for UndelegateHostEvmos %s", err.Error()) - } - - // log: issuing an undelegation to Evmos - k.Logger(ctx).Info("Issuing an undelegation to Evmos") - - return &types.MsgUndelegateHostResponse{}, nil -} - -func (k Keeper) SetUndelegateHostPrevented(ctx sdk.Context) error { - - store := ctx.KVStore(k.storeKey) - - // set the key to 1 if it's not set - if !k.IsUndelegateHostPrevented(ctx) { - store.Set([]byte(isUndelegateHostPreventedKey), []byte{1}) - } - return nil -} - -func (k Keeper) IsUndelegateHostPrevented(ctx sdk.Context) bool { - store := ctx.KVStore(k.storeKey) - if !store.Has([]byte(isUndelegateHostPreventedKey)) { - return false - } - - value := store.Get([]byte(isUndelegateHostPreventedKey)) - return len(value) == 1 && value[0] == 1 -} diff --git a/x/stakeibc/keeper/msg_undelegate_host_test.go b/x/stakeibc/keeper/msg_undelegate_host_test.go deleted file mode 100644 index 3642c96f64..0000000000 --- a/x/stakeibc/keeper/msg_undelegate_host_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package keeper_test - -import ( - _ "github.com/stretchr/testify/suite" -) - -func (s *KeeperTestSuite) TestEnableStrictUnbondingCap_CapNotSet() { - - // make sure StrictUnbondingCap is not set - s.Require().False(s.App.StakeibcKeeper.IsUndelegateHostPrevented(s.Ctx), "undelegate host prevented") -} - -func (s *KeeperTestSuite) TestEnableStrictUnbondingCap_CapSet() { - - // set undelegate Prevented - err := s.App.StakeibcKeeper.SetUndelegateHostPrevented(s.Ctx) - s.Require().NoError(err, "set undelegate host prevented") - - // make sure StrictUnbondingCap is set - s.Require().True(s.App.StakeibcKeeper.IsUndelegateHostPrevented(s.Ctx), "strict unbonding cap set to true") -} diff --git a/x/stakeibc/keeper/undelegate_host.go b/x/stakeibc/keeper/undelegate_host.go deleted file mode 100644 index ce51c52630..0000000000 --- a/x/stakeibc/keeper/undelegate_host.go +++ /dev/null @@ -1,137 +0,0 @@ -package keeper - -import ( - "fmt" - - errorsmod "cosmossdk.io/errors" - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/gogoproto/proto" - - "github.com/Stride-Labs/stride/v15/utils" - "github.com/Stride-Labs/stride/v15/x/stakeibc/types" -) - -const ( - MaxNumTokensUnbondableStr = "2500000000000000000000000" // 2,500,000e18 - EvmosHostZoneChainId = "evmos_9001-2" -) - -// Submits undelegation ICA message for Evmos -// The total unbond amount is input, capped at MaxNumTokensUnbondable. -func (k Keeper) UndelegateHostEvmos(ctx sdk.Context, totalUnbondAmount math.Int) error { - - // if the total unbond amount is greater than the max, exit - maxNumTokensUnbondable, ok := math.NewIntFromString(MaxNumTokensUnbondableStr) - if !ok { - return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "unable to parse maxNumTokensUnbondable %s", maxNumTokensUnbondable) - } - if totalUnbondAmount.GT(maxNumTokensUnbondable) { - return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "total unbond amount %v is greater than maxNumTokensUnbondable %v", - totalUnbondAmount, maxNumTokensUnbondable) - } - - // Get the host zone - evmosHost, found := k.GetHostZone(ctx, EvmosHostZoneChainId) - if !found { - return errorsmod.Wrapf(types.ErrHostZoneNotFound, "host zone %s not found", EvmosHostZoneChainId) - } - - k.Logger(ctx).Info(utils.LogWithHostZone(evmosHost.ChainId, - "Total unbonded amount: %v%s", totalUnbondAmount, evmosHost.HostDenom)) - - // If there's nothing to unbond, return and move on to the next host zone - if totalUnbondAmount.IsZero() { - return nil - } - - k.Logger(ctx).Info("Preparing MsgUndelegates from the delegation account to each validator on Evmos") - - // Confirm the delegation account was registered - if evmosHost.DelegationIcaAddress == "" { - return errorsmod.Wrapf(types.ErrICAAccountNotFound, "no delegation account found for %s", evmosHost.ChainId) - } - - // Determine the ideal balanced delegation for each validator after the unbonding - // (as if we were to unbond and then rebalance) - // This will serve as the starting point for determining how much to unbond each validator - delegationAfterUnbonding := evmosHost.TotalDelegations.Sub(totalUnbondAmount) - balancedDelegationsAfterUnbonding, err := k.GetTargetValAmtsForHostZone(ctx, evmosHost, delegationAfterUnbonding) - if err != nil { - return errorsmod.Wrapf(err, "unable to get target val amounts for host zone %s", evmosHost.ChainId) - } - - // Determine the unbond capacity for each validator - // Each validator can only unbond up to the difference between their current delegation and their balanced delegation - // The validator's current delegation will be above their balanced delegation if they've received LSM Liquid Stakes - // (which is only rebalanced once per unbonding period) - validatorUnbondCapacity := k.GetValidatorUnbondCapacity(ctx, evmosHost.Validators, balancedDelegationsAfterUnbonding) - if len(validatorUnbondCapacity) == 0 { - return fmt.Errorf("there are no validators on %s with sufficient unbond capacity", evmosHost.ChainId) - } - - // Sort the unbonding capacity by priority - // Priority is determined by checking the how proportionally unbalanced each validator is - // Zero weight validators will come first in the list - prioritizedUnbondCapacity, err := SortUnbondingCapacityByPriority(validatorUnbondCapacity) - if err != nil { - return err - } - - // Get the undelegation ICA messages and split delegations for the callback - msgs, unbondings, err := k.GetUnbondingICAMessages(evmosHost, totalUnbondAmount, prioritizedUnbondCapacity) - if err != nil { - return err - } - - // Shouldn't be possible, but if all the validator's had a target unbonding of zero, do not send an ICA - if len(msgs) == 0 { - return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Target unbonded amount was 0 for each validator") - } - - // Send the messages in batches so the gas limit isn't exceedeed - for start := 0; start < len(msgs); start += UndelegateICABatchSize { - end := start + UndelegateICABatchSize - if end > len(msgs) { - end = len(msgs) - } - - msgsBatch := msgs[start:end] - unbondingsBatch := unbondings[start:end] - - // Store the callback data - undelegateHostCallback := types.UndelegateHostCallback{ - Amt: totalUnbondAmount, - SplitDelegations: unbondingsBatch, - } - callbackArgsBz, err := proto.Marshal(&undelegateHostCallback) - if err != nil { - return errorsmod.Wrap(err, "unable to marshal undelegate callback args") - } - - // Submit the undelegation ICA - if _, err := k.SubmitTxsDayEpoch( - ctx, - evmosHost.ConnectionId, - msgsBatch, - types.ICAAccountType_DELEGATION, - ICACallbackID_UndelegateHost, - callbackArgsBz, - ); err != nil { - return errorsmod.Wrapf(err, "unable to submit unbonding ICA for %s", evmosHost.ChainId) - } - - // flag the delegation change in progress on each validator - for _, unbonding := range unbondingsBatch { - if err := k.IncrementValidatorDelegationChangesInProgress(&evmosHost, unbonding.Validator); err != nil { - return err - } - } - k.SetHostZone(ctx, evmosHost) - } - - EmitUndelegationEvent(ctx, evmosHost, totalUnbondAmount) - - return nil -} diff --git a/x/stakeibc/keeper/undelegate_host_test.go b/x/stakeibc/keeper/undelegate_host_test.go deleted file mode 100644 index e0ed72c4cd..0000000000 --- a/x/stakeibc/keeper/undelegate_host_test.go +++ /dev/null @@ -1,362 +0,0 @@ -package keeper_test - -import ( - "fmt" - - "cosmossdk.io/math" - sdkmath "cosmossdk.io/math" - "github.com/cosmos/gogoproto/proto" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - _ "github.com/stretchr/testify/suite" - - epochstypes "github.com/Stride-Labs/stride/v15/x/epochs/types" - recordtypes "github.com/Stride-Labs/stride/v15/x/records/types" - "github.com/Stride-Labs/stride/v15/x/stakeibc/types" -) - -const UndelegateHostZoneChainId = "evmos_9001-2" // the relevant zone for this test - -func (s *KeeperTestSuite) SetupTestUndelegateHost( - totalWeight int64, - totalStake sdkmath.Int, - unbondAmount sdkmath.Int, - validators []*types.Validator, -) UnbondingTestCase { - delegationAccountOwner := types.FormatICAAccountOwner(UndelegateHostZoneChainId, types.ICAAccountType_DELEGATION) - delegationChannelID, delegationPortID := s.CreateICAChannel(delegationAccountOwner) - - // Sanity checks: - // - total stake matches - // - total weights sum to 100 - actualTotalStake := sdkmath.ZeroInt() - actualTotalWeights := uint64(0) - for _, validator := range validators { - actualTotalStake = actualTotalStake.Add(validator.Delegation) - actualTotalWeights += validator.Weight - } - s.Require().Equal(totalStake.Int64(), actualTotalStake.Int64(), "test setup failed - total stake does not match") - s.Require().Equal(totalWeight, int64(actualTotalWeights), "test setup failed - total weight does not match") - - // Store the validators on the host zone - hostZone := types.HostZone{ - ChainId: UndelegateHostZoneChainId, - ConnectionId: ibctesting.FirstConnectionID, - HostDenom: Atom, - DelegationIcaAddress: "cosmos_DELEGATION", - Validators: validators, - TotalDelegations: totalStake, - } - s.App.StakeibcKeeper.SetHostZone(s.Ctx, hostZone) - - // Store the total unbond amount across two epoch unbonding records - halfUnbondAmount := unbondAmount.Quo(sdkmath.NewInt(2)) - for i := uint64(1); i <= 2; i++ { - s.App.RecordsKeeper.SetEpochUnbondingRecord(s.Ctx, recordtypes.EpochUnbondingRecord{ - EpochNumber: i, - HostZoneUnbondings: []*recordtypes.HostZoneUnbonding{ - { - HostZoneId: UndelegateHostZoneChainId, - Status: recordtypes.HostZoneUnbonding_UNBONDING_QUEUE, - NativeTokenAmount: halfUnbondAmount, - }, - }, - }) - } - - // Mock the epoch tracker to timeout 90% through the epoch - strideEpochTracker := types.EpochTracker{ - EpochIdentifier: epochstypes.DAY_EPOCH, - Duration: 10_000_000_000, // 10 second epochs - NextEpochStartTime: uint64(s.Coordinator.CurrentTime.UnixNano() + 30_000_000_000), // dictates timeout - } - s.App.StakeibcKeeper.SetEpochTracker(s.Ctx, strideEpochTracker) - - // Get tx seq number before the ICA was submitted to check whether an ICA was submitted - startSequence, found := s.App.IBCKeeper.ChannelKeeper.GetNextSequenceSend(s.Ctx, delegationPortID, delegationChannelID) - s.Require().True(found, "sequence number not found before ica") - - return UnbondingTestCase{ - hostZone: hostZone, - totalUnbondAmount: unbondAmount, - delegationChannelID: delegationChannelID, - delegationPortID: delegationPortID, - channelStartSequence: startSequence, - expectedUnbondingRecordIds: []uint64{1, 2}, - } -} - -// Helper function to check that an undelegation ICA was submitted and that the callback data -// holds the expected unbondings for each validator -func (s *KeeperTestSuite) CheckUndelegateHostMessages(tc UnbondingTestCase, expectedUnbondings []ValidatorUnbonding) { - - // Check that IsUndelegateHostPrevented(ctx) has not yet been flipped to true - s.Require().False(s.App.StakeibcKeeper.IsUndelegateHostPrevented(s.Ctx)) - - // Trigger unbonding - err := s.App.StakeibcKeeper.UndelegateHostEvmos(s.Ctx, tc.totalUnbondAmount) - s.Require().NoError(err, "no error expected when calling unbond from host") - - // Check that sequence number incremented from a sent ICA - endSequence, found := s.App.IBCKeeper.ChannelKeeper.GetNextSequenceSend(s.Ctx, tc.delegationPortID, tc.delegationChannelID) - s.Require().True(found, "sequence number not found after ica") - s.Require().Equal(tc.channelStartSequence+1, endSequence, "sequence number should have incremented") - - // Check that callback data was stored - callbackData := s.App.IcacallbacksKeeper.GetAllCallbackData(s.Ctx) - s.Require().Len(callbackData, 1, "there should only be one callback data stored") - - // Check host zone and epoch unbonding record id's - var actualCallback types.UndelegateHostCallback - err = proto.Unmarshal(callbackData[0].CallbackArgs, &actualCallback) - s.Require().NoError(err, "no error expected when unmarshalling callback args") - - s.Require().Equal(tc.totalUnbondAmount, actualCallback.Amt, "amount on callback") - - // Check splits from callback data align with expected unbondings - s.Require().Len(actualCallback.SplitDelegations, len(expectedUnbondings), "number of unbonding messages") - for i, expected := range expectedUnbondings { - actualSplit := actualCallback.SplitDelegations[i] - s.Require().Equal(expected.Validator, actualSplit.Validator, "callback message validator - index %d", i) - s.Require().Equal(expected.UnbondAmount.Int64(), actualSplit.Amount.Int64(), "callback message amount - index %d", i) - } - - // Check the delegation change in progress was incremented from each that had an unbonding - actualHostZone, found := s.App.StakeibcKeeper.GetHostZone(s.Ctx, UndelegateHostZoneChainId) - s.Require().True(found, "host zone should have been found") - - for _, actualValidator := range actualHostZone.Validators { - validatorUnbonded := false - for _, unbondedVal := range expectedUnbondings { - if actualValidator.Address == unbondedVal.Validator { - validatorUnbonded = true - } - } - - expectedDelegationChangesInProgress := 0 - if validatorUnbonded { - expectedDelegationChangesInProgress = 1 - } - s.Require().Equal(expectedDelegationChangesInProgress, int(actualValidator.DelegationChangesInProgress), - "validator %s delegation changes in progress", actualValidator.Address) - } - - // Check that the unbond event was emitted with the proper unbond amount - s.CheckEventValueEmitted(types.EventTypeUndelegation, types.AttributeKeyTotalUnbondAmount, tc.totalUnbondAmount.String()) -} - -func (s *KeeperTestSuite) TestUndelegateHost_Successful_UnbondOnlyZeroWeightVals() { - // Native Stake: 1000 - // LSM Stake: 250 - // Total Stake: 1250 - // - // Unbond Amount: 50 - // Stake After Unbond: 1200 - totalUnbondAmount := sdkmath.NewInt(50) - totalStake := sdkmath.NewInt(1250) - totalWeight := int64(100) - - validators := []*types.Validator{ - // Current: 100, Weight: 10%, Balanced: 10% * 1200 = 120, Capacity: 100-120 = -20 -> 0 - // No capacity -> unbondings - {Address: "valA", Weight: 10, Delegation: sdkmath.NewInt(100)}, - // Current: 420, Weight: 35%, Balanced: 35% * 1200 = 420, Capacity: 420-420 = 0 - // No capacity -> unbondings - {Address: "valB", Weight: 35, Delegation: sdkmath.NewInt(420)}, - // Weight: 0%, Balanced: 0, Capacity: 40 - // >>> Ratio: 0 -> Priority #1 <<< - {Address: "valC", Weight: 0, Delegation: sdkmath.NewInt(40)}, - // Current: 300, Weight: 30%, Balanced: 30% * 1200 = 360, Capacity: 300-360 = -60 -> 0 - // No capacity -> unbondings - {Address: "valD", Weight: 30, Delegation: sdkmath.NewInt(300)}, - // Weight: 0%, Balanced: 0, Capacity: 30 - // >>> Ratio: 0 -> Priority #2 <<< - {Address: "valE", Weight: 0, Delegation: sdkmath.NewInt(30)}, - // Current: 200, Weight: 10%, Balanced: 10% * 1200 = 120, Capacity: 200 - 120 = 80 - // >>> Ratio: 110/200 = 0.55 -> #3 Priority <<<< - {Address: "valF", Weight: 10, Delegation: sdkmath.NewInt(200)}, - // Current: 160, Weight: 15%, Balanced: 15% * 1200 = 180, Capacity: 160-180 = -20 -> 0 - // No capacity -> unbondings - {Address: "valG", Weight: 15, Delegation: sdkmath.NewInt(160)}, - } - - expectedUnbondings := []ValidatorUnbonding{ - // valC has #1 priority - unbond up to capacity at 40 - {Validator: "valC", UnbondAmount: sdkmath.NewInt(40)}, - // 50 - 40 = 10 unbond remaining - // valE has #2 priority - unbond up to remaining - {Validator: "valE", UnbondAmount: sdkmath.NewInt(10)}, - } - - tc := s.SetupTestUndelegateHost(totalWeight, totalStake, totalUnbondAmount, validators) - s.CheckUndelegateHostMessages(tc, expectedUnbondings) -} - -func (s *KeeperTestSuite) TestUndelegateHost_Successful_UnbondTotalLessThanTotalLSM() { - // Native Stake: 1000 - // LSM Stake: 250 - // Total Stake: 1250 - // - // Unbond Amount: 150 - // Stake After Unbond: 1100 - totalUnbondAmount := sdkmath.NewInt(150) - totalStake := sdkmath.NewInt(1250) - totalWeight := int64(100) - - validators := []*types.Validator{ - // Current: 100, Weight: 10%, Balanced: 10% * 1100 = 110, Capacity: 100-110 = -10 -> 0 - // No capacity -> unbondings - {Address: "valA", Weight: 10, Delegation: sdkmath.NewInt(100)}, - // Current: 420, Weight: 35%, Balanced: 35% * 1100 = 385, Capacity: 420-385 = 35 - // >>> Ratio: 385/420 = 0.91 -> Priority #4 <<< - {Address: "valB", Weight: 35, Delegation: sdkmath.NewInt(420)}, - // Weight: 0%, Balanced: 0, Capacity: 40 - // >>> Ratio: 0 -> Priority #1 <<< - {Address: "valC", Weight: 0, Delegation: sdkmath.NewInt(40)}, - // Current: 300, Weight: 30%, Balanced: 30% * 1100 = 330, Capacity: 300-330 = -30 -> 0 - // No capacity -> unbondings - {Address: "valD", Weight: 30, Delegation: sdkmath.NewInt(300)}, - // Weight: 0%, Balanced: 0, Capacity: 30 - // >>> Ratio: 0 -> Priority #2 <<< - {Address: "valE", Weight: 0, Delegation: sdkmath.NewInt(30)}, - // Current: 200, Weight: 10%, Balanced: 10% * 1100 = 110, Capacity: 200 - 110 = 90 - // >>> Ratio: 110/200 = 0.55 -> Priority #3 <<< - {Address: "valF", Weight: 10, Delegation: sdkmath.NewInt(200)}, - // Current: 160, Weight: 15%, Balanced: 15% * 1100 = 165, Capacity: 160-165 = -5 -> 0 - // No capacity -> unbondings - {Address: "valG", Weight: 15, Delegation: sdkmath.NewInt(160)}, - } - - expectedUnbondings := []ValidatorUnbonding{ - // valC has #1 priority - unbond up to capacity at 40 - {Validator: "valC", UnbondAmount: sdkmath.NewInt(40)}, - // 150 - 40 = 110 unbond remaining - // valE has #2 priority - unbond up to capacity at 30 - {Validator: "valE", UnbondAmount: sdkmath.NewInt(30)}, - // 150 - 40 - 30 = 80 unbond remaining - // valF has #3 priority - unbond up to remaining - {Validator: "valF", UnbondAmount: sdkmath.NewInt(80)}, - } - - tc := s.SetupTestUndelegateHost(totalWeight, totalStake, totalUnbondAmount, validators) - s.CheckUndelegateHostMessages(tc, expectedUnbondings) -} - -func (s *KeeperTestSuite) TestUndelegateHost_Successful_UnbondTotalGreaterThanTotalLSM() { - // Native Stake: 1000 - // LSM Stake: 250 - // Total Stake: 1250 - // - // Unbond Amount: 350 - // Stake After Unbond: 900 - totalUnbondAmount := sdkmath.NewInt(350) - totalStake := sdkmath.NewInt(1250) - totalWeight := int64(100) - - validators := []*types.Validator{ - // Current: 100, Weight: 10%, Balanced: 10% * 900 = 90, Capacity: 100-90 = 10 - // >>> Ratio: 90/100 = 0.9 -> Priority #7 <<< - {Address: "valA", Weight: 10, Delegation: sdkmath.NewInt(100)}, - // Current: 420, Weight: 35%, Balanced: 35% * 900 = 315, Capacity: 420-315 = 105 - // >>> Ratio: 315/420 = 0.75 -> Priority #4 <<< - {Address: "valB", Weight: 35, Delegation: sdkmath.NewInt(420)}, - // Weight: 0%, Balanced: 0, Capacity: 40 - // >>> Ratio: 0 -> Priority #1 <<< - {Address: "valC", Weight: 0, Delegation: sdkmath.NewInt(40)}, - // Current: 300, Weight: 30%, Balanced: 30% * 900 = 270, Capacity: 300-270 = 30 - // >>> Ratio: 270/300 = 0.9 -> Priority #6 <<< - {Address: "valD", Weight: 30, Delegation: sdkmath.NewInt(300)}, - // Weight: 0%, Balanced: 0, Capacity: 30 - // >>> Ratio: 0 -> Priority #2 <<< - {Address: "valE", Weight: 0, Delegation: sdkmath.NewInt(30)}, - // Current: 200, Weight: 10%, Balanced: 10% * 900 = 90, Capacity: 200 - 90 = 110 - // >>> Ratio: 90/200 = 0.45 -> Priority #3 <<< - {Address: "valF", Weight: 10, Delegation: sdkmath.NewInt(200)}, - // Current: 160, Weight: 15%, Balanced: 15% * 900 = 135, Capacity: 160-135 = 25 - // >>> Ratio: 135/160 = 0.85 -> Priority #5 <<< - {Address: "valG", Weight: 15, Delegation: sdkmath.NewInt(160)}, - } - - expectedUnbondings := []ValidatorUnbonding{ - // valC has #1 priority - unbond up to capacity at 40 - {Validator: "valC", UnbondAmount: sdkmath.NewInt(40)}, - // 350 - 40 = 310 unbond remaining - // valE has #2 priority - unbond up to capacity at 30 - {Validator: "valE", UnbondAmount: sdkmath.NewInt(30)}, - // 310 - 30 = 280 unbond remaining - // valF has #3 priority - unbond up to capacity at 110 - {Validator: "valF", UnbondAmount: sdkmath.NewInt(110)}, - // 280 - 110 = 170 unbond remaining - // valB has #4 priority - unbond up to capacity at 105 - {Validator: "valB", UnbondAmount: sdkmath.NewInt(105)}, - // 170 - 105 = 65 unbond remaining - // valG has #5 priority - unbond up to capacity at 25 - {Validator: "valG", UnbondAmount: sdkmath.NewInt(25)}, - // 65 - 25 = 40 unbond remaining - // valD has #6 priority - unbond up to capacity at 30 - {Validator: "valD", UnbondAmount: sdkmath.NewInt(30)}, - // 40 - 30 = 10 unbond remaining - // valA has #7 priority - unbond up to remaining - {Validator: "valA", UnbondAmount: sdkmath.NewInt(10)}, - } - - tc := s.SetupTestUndelegateHost(totalWeight, totalStake, totalUnbondAmount, validators) - s.CheckUndelegateHostMessages(tc, expectedUnbondings) -} - -func (s *KeeperTestSuite) TestUndelegateHost_AmountTooLarge() { - // Call undelegateHost with an amount that is greater than the max amount, it should fail - unbondAmount, ok := math.NewIntFromString("25000000000000000000000001") - s.Require().True(ok, "could not parse unbondAmount") - err := s.App.StakeibcKeeper.UndelegateHostEvmos(s.Ctx, unbondAmount) - s.Require().ErrorContains(err, fmt.Sprintf("total unbond amount %v is greater than", unbondAmount)) -} - -func (s *KeeperTestSuite) TestUndelegateHost_ZeroUnbondAmount() { - totalWeight := int64(0) - totalStake := sdkmath.ZeroInt() - totalUnbondAmount := sdkmath.ZeroInt() - tc := s.SetupTestUndelegateHost(totalWeight, totalStake, totalUnbondAmount, []*types.Validator{}) - - // Call unbond - it should NOT error since the unbond amount was 0 - but it should short circuit - err := s.App.StakeibcKeeper.UndelegateHostEvmos(s.Ctx, totalUnbondAmount) - s.Require().Nil(err, "unbond should not have thrown an error - it should have simply ignored the host zone") - - // Confirm no ICAs were sent - endSequence, found := s.App.IBCKeeper.ChannelKeeper.GetNextSequenceSend(s.Ctx, tc.delegationPortID, tc.delegationChannelID) - s.Require().True(found, "sequence number not found after ica") - s.Require().Equal(tc.channelStartSequence, endSequence, "sequence number should stay the same since no messages were sent") -} - -func (s *KeeperTestSuite) TestUndelegateHost_ZeroValidatorWeights() { - // Setup the test with all zero-weight validators - totalWeight := int64(0) - totalStake := sdkmath.NewInt(100) - totalUnbondAmount := sdkmath.NewInt(10) - validators := []*types.Validator{ - {Address: "valA", Weight: 0, Delegation: sdkmath.NewInt(25)}, - {Address: "valB", Weight: 0, Delegation: sdkmath.NewInt(50)}, - {Address: "valC", Weight: 0, Delegation: sdkmath.NewInt(25)}, - } - s.SetupTestUndelegateHost(totalWeight, totalStake, totalUnbondAmount, validators) - - // Call unbond - it should fail - err := s.App.StakeibcKeeper.UndelegateHostEvmos(s.Ctx, totalUnbondAmount) - s.Require().ErrorContains(err, "No non-zero validators found for host zone") -} - -func (s *KeeperTestSuite) TestUndelegateHost_InsufficientDelegations() { - // Setup the test where the total unbond amount is greater than the current delegations - totalWeight := int64(100) - totalStake := sdkmath.NewInt(100) - totalUnbondAmount := sdkmath.NewInt(200) - validators := []*types.Validator{ - {Address: "valA", Weight: 25, Delegation: sdkmath.NewInt(25)}, - {Address: "valB", Weight: 50, Delegation: sdkmath.NewInt(50)}, - {Address: "valC", Weight: 25, Delegation: sdkmath.NewInt(25)}, - } - s.SetupTestUndelegateHost(totalWeight, totalStake, totalUnbondAmount, validators) - - // Call unbond - it should fail - err := s.App.StakeibcKeeper.UndelegateHostEvmos(s.Ctx, totalUnbondAmount) - s.Require().ErrorContains(err, "Cannot calculate target delegation if final amount is less than or equal to zero") -} diff --git a/x/stakeibc/types/codec.go b/x/stakeibc/types/codec.go index 71a00545b6..c28fb0b674 100644 --- a/x/stakeibc/types/codec.go +++ b/x/stakeibc/types/codec.go @@ -23,7 +23,6 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&ToggleLSMProposal{}, "stakeibc/ToggleLSMProposal", nil) cdc.RegisterConcrete(&MsgRestoreInterchainAccount{}, "stakeibc/RestoreInterchainAccount", nil) cdc.RegisterConcrete(&MsgUpdateValidatorSharesExchRate{}, "stakeibc/UpdateValidatorSharesExchRate", nil) - cdc.RegisterConcrete(&MsgUndelegateHost{}, "stakeibc/UndelegateHost", nil) cdc.RegisterConcrete(&MsgCalibrateDelegation{}, "stakeibc/CalibrateDelegation", nil) cdc.RegisterConcrete(&MsgUpdateInnerRedemptionRateBounds{}, "stakeibc/UpdateInnerRedemptionRateBounds", nil) // this line is used by starport scaffolding # 2 @@ -42,7 +41,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgDeleteValidator{}, &MsgRestoreInterchainAccount{}, &MsgUpdateValidatorSharesExchRate{}, - &MsgUndelegateHost{}, &MsgCalibrateDelegation{}, &MsgUpdateInnerRedemptionRateBounds{}, ) diff --git a/x/stakeibc/types/errors.go b/x/stakeibc/types/errors.go index 1ab443f0a4..a0805b6f3f 100644 --- a/x/stakeibc/types/errors.go +++ b/x/stakeibc/types/errors.go @@ -56,6 +56,5 @@ var ( ErrInvalidValidatorDelegationUpdates = errorsmod.Register(ModuleName, 1548, "Invalid validator delegation updates") ErrLSMLiquidStakeDisabledForHostZone = errorsmod.Register(ModuleName, 1549, "LSM liquid stake is disabled for host zone") ErrUnableToRemoveValidator = errorsmod.Register(ModuleName, 1550, "Unable to remove validator") - ErrUndelegateHostNotCallable = errorsmod.Register(ModuleName, 1551, "Undelegate host is disabled") - ErrInvalidBounds = errorsmod.Register(ModuleName, 1552, "Invalid safety bounds - inner bounds must be within outer bounds") + ErrInvalidBounds = errorsmod.Register(ModuleName, 1551, "Invalid safety bounds - inner bounds must be within outer bounds") ) diff --git a/x/stakeibc/types/message_undelegate_host.go b/x/stakeibc/types/message_undelegate_host.go deleted file mode 100644 index e1e2c8c328..0000000000 --- a/x/stakeibc/types/message_undelegate_host.go +++ /dev/null @@ -1,56 +0,0 @@ -package types - -import ( - errorsmod "cosmossdk.io/errors" - sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/Stride-Labs/stride/v15/utils" -) - -const TypeMsgUndelegateHost = "undelegate_host" - -var _ sdk.Msg = &MsgUndelegateHost{} - -func NewMsgUndelegateHost(creator string, amount sdkmath.Int) *MsgUndelegateHost { - return &MsgUndelegateHost{ - Creator: creator, - Amount: amount, - } -} - -func (msg *MsgUndelegateHost) Route() string { - return RouterKey -} - -func (msg *MsgUndelegateHost) Type() string { - return TypeMsgUndelegateHost -} - -func (msg *MsgUndelegateHost) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgUndelegateHost) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgUndelegateHost) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - if err := utils.ValidateAdminAddress(msg.Creator); err != nil { - return err - } - if msg.Amount.IsZero() { - return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "amount must be positive") - } - return nil -} From c0b6b99a80e2eec7606c238539cc9acabab570de Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:16:40 -0500 Subject: [PATCH 03/26] undel host: revert all logic, add back undelcb proto + proto-gen --- x/stakeibc/client/cli/tx.go | 1 - x/stakeibc/client/cli/tx_undelegate_host.go | 49 --- x/stakeibc/handler.go | 3 - x/stakeibc/keeper/icacallbacks.go | 16 +- x/stakeibc/keeper/icacallbacks_undelegate.go | 83 ---- .../keeper/icacallbacks_undelegate_test.go | 228 ----------- x/stakeibc/keeper/msg_undelegate_host.go | 53 --- x/stakeibc/keeper/msg_undelegate_host_test.go | 21 - x/stakeibc/keeper/undelegate_host.go | 137 ------- x/stakeibc/keeper/undelegate_host_test.go | 362 ------------------ x/stakeibc/types/codec.go | 2 - x/stakeibc/types/errors.go | 3 +- x/stakeibc/types/message_undelegate_host.go | 56 --- 13 files changed, 8 insertions(+), 1006 deletions(-) delete mode 100644 x/stakeibc/client/cli/tx_undelegate_host.go delete mode 100644 x/stakeibc/keeper/msg_undelegate_host.go delete mode 100644 x/stakeibc/keeper/msg_undelegate_host_test.go delete mode 100644 x/stakeibc/keeper/undelegate_host.go delete mode 100644 x/stakeibc/keeper/undelegate_host_test.go delete mode 100644 x/stakeibc/types/message_undelegate_host.go diff --git a/x/stakeibc/client/cli/tx.go b/x/stakeibc/client/cli/tx.go index c58b818b89..25649a5aa7 100644 --- a/x/stakeibc/client/cli/tx.go +++ b/x/stakeibc/client/cli/tx.go @@ -37,7 +37,6 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdUpdateValidatorSharesExchRate()) cmd.AddCommand(CmdCalibrateDelegation()) cmd.AddCommand(CmdClearBalance()) - cmd.AddCommand(CmdUndelegateHost()) cmd.AddCommand(CmdUpdateInnerRedemptionRateBounds()) return cmd diff --git a/x/stakeibc/client/cli/tx_undelegate_host.go b/x/stakeibc/client/cli/tx_undelegate_host.go deleted file mode 100644 index eaf516d10b..0000000000 --- a/x/stakeibc/client/cli/tx_undelegate_host.go +++ /dev/null @@ -1,49 +0,0 @@ -package cli - -import ( - "strconv" - - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/spf13/cobra" - - "github.com/Stride-Labs/stride/v15/x/stakeibc/types" -) - -var _ = strconv.Itoa(0) - -func CmdUndelegateHost() *cobra.Command { - cmd := &cobra.Command{ - Use: "undelegate-host [amount]", - Short: "Broadcast message undelegate-host", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - argAmount, found := sdk.NewIntFromString(args[0]) - if !found { - return errorsmod.Wrap(sdkerrors.ErrInvalidType, "can not convert string to int") - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgUndelegateHost( - clientCtx.GetFromAddress().String(), - argAmount, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/stakeibc/handler.go b/x/stakeibc/handler.go index ba216c46bd..14245e6cb4 100644 --- a/x/stakeibc/handler.go +++ b/x/stakeibc/handler.go @@ -58,9 +58,6 @@ func NewMessageHandler(k keeper.Keeper) sdk.Handler { case *types.MsgUpdateValidatorSharesExchRate: res, err := msgServer.UpdateValidatorSharesExchRate(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgUndelegateHost: - res, err := msgServer.UndelegateHost(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) case *types.MsgCalibrateDelegation: res, err := msgServer.CalibrateDelegation(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) diff --git a/x/stakeibc/keeper/icacallbacks.go b/x/stakeibc/keeper/icacallbacks.go index 48000aba89..bd2ed0b423 100644 --- a/x/stakeibc/keeper/icacallbacks.go +++ b/x/stakeibc/keeper/icacallbacks.go @@ -5,14 +5,13 @@ import ( ) const ( - ICACallbackID_Delegate = "delegate" - ICACallbackID_Claim = "claim" - ICACallbackID_Undelegate = "undelegate" - ICACallbackID_UndelegateHost = "undelegatehost" - ICACallbackID_Reinvest = "reinvest" - ICACallbackID_Redemption = "redemption" - ICACallbackID_Rebalance = "rebalance" - ICACallbackID_Detokenize = "detokenize" + ICACallbackID_Delegate = "delegate" + ICACallbackID_Claim = "claim" + ICACallbackID_Undelegate = "undelegate" + ICACallbackID_Reinvest = "reinvest" + ICACallbackID_Redemption = "redemption" + ICACallbackID_Rebalance = "rebalance" + ICACallbackID_Detokenize = "detokenize" ) func (k Keeper) Callbacks() icacallbackstypes.ModuleCallbacks { @@ -20,7 +19,6 @@ func (k Keeper) Callbacks() icacallbackstypes.ModuleCallbacks { {CallbackId: ICACallbackID_Delegate, CallbackFunc: icacallbackstypes.ICACallbackFunction(k.DelegateCallback)}, {CallbackId: ICACallbackID_Claim, CallbackFunc: icacallbackstypes.ICACallbackFunction(k.ClaimCallback)}, {CallbackId: ICACallbackID_Undelegate, CallbackFunc: icacallbackstypes.ICACallbackFunction(k.UndelegateCallback)}, - {CallbackId: ICACallbackID_UndelegateHost, CallbackFunc: icacallbackstypes.ICACallbackFunction(k.UndelegateHostCallback)}, {CallbackId: ICACallbackID_Reinvest, CallbackFunc: icacallbackstypes.ICACallbackFunction(k.ReinvestCallback)}, {CallbackId: ICACallbackID_Redemption, CallbackFunc: icacallbackstypes.ICACallbackFunction(k.RedemptionCallback)}, {CallbackId: ICACallbackID_Rebalance, CallbackFunc: icacallbackstypes.ICACallbackFunction(k.RebalanceCallback)}, diff --git a/x/stakeibc/keeper/icacallbacks_undelegate.go b/x/stakeibc/keeper/icacallbacks_undelegate.go index cd44fa4516..c92f5712d9 100644 --- a/x/stakeibc/keeper/icacallbacks_undelegate.go +++ b/x/stakeibc/keeper/icacallbacks_undelegate.go @@ -233,86 +233,3 @@ func (k Keeper) BurnTokens(ctx sdk.Context, hostZone types.HostZone, stTokenBurn k.Logger(ctx).Info(fmt.Sprintf("Total supply %s", k.bankKeeper.GetSupply(ctx, stCoinDenom))) return nil } - -// ICA Callback after undelegating host -// -// If successful: -// * sets SetUndelegateHostPrevented -// If timeout: -// * Does nothing -// If failure: -// * Does nothing -func (k Keeper) UndelegateHostCallback(ctx sdk.Context, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error { - // Fetch callback args - var undelegateHostCallback types.UndelegateHostCallback - if err := proto.Unmarshal(args, &undelegateHostCallback); err != nil { - return errorsmod.Wrapf(types.ErrUnmarshalFailure, fmt.Sprintf("Unable to unmarshal undelegate host callback args: %s", err.Error())) - } - k.Logger(ctx).Info("Starting undelegate host callback for amount %v%s", undelegateHostCallback.Amt) - - // Regardless of failure/success/timeout, indicate that this ICA has completed - hostZone, found := k.GetHostZone(ctx, EvmosHostZoneChainId) - if !found { - return errorsmod.Wrapf(sdkerrors.ErrKeyNotFound, "Host zone not found: %s", EvmosHostZoneChainId) - } - for _, splitDelegation := range undelegateHostCallback.SplitDelegations { - if err := k.DecrementValidatorDelegationChangesInProgress(&hostZone, splitDelegation.Validator); err != nil { - // TODO: Revert after v14 upgrade - if errors.Is(err, types.ErrInvalidValidatorDelegationUpdates) { - k.Logger(ctx).Error(utils.LogICACallbackWithHostZone(EvmosHostZoneChainId, ICACallbackID_Undelegate, - "Invariant failed - delegation changes in progress fell below 0 for %s", splitDelegation.Validator)) - continue - } - return err - } - } - k.SetHostZone(ctx, hostZone) - - // Check for timeout (ack nil) - if ackResponse.Status == icacallbackstypes.AckResponseStatus_TIMEOUT { - k.Logger(ctx).Error("UndelegateHostCallback Timeout:", icacallbackstypes.AckResponseStatus_TIMEOUT, packet) - return nil - } - - // Check for a failed transaction (ack error) - if ackResponse.Status == icacallbackstypes.AckResponseStatus_FAILURE { - k.Logger(ctx).Error("UndelegateHostCallback failure (ack error):", icacallbackstypes.AckResponseStatus_FAILURE, packet) - return nil - } - - // Get the host zone - evmosHost, found := k.GetHostZone(ctx, EvmosHostZoneChainId) - if !found { - return errorsmod.Wrapf(types.ErrHostZoneNotFound, "host zone %s not found", EvmosHostZoneChainId) - } - - k.Logger(ctx).Info("UndelegateHostCallback success:", icacallbackstypes.AckResponseStatus_SUCCESS, packet) - - // Update delegation balances - err := k.UpdateDelegationBalancesHost(ctx, evmosHost, undelegateHostCallback) - if err != nil { - k.Logger(ctx).Error(fmt.Sprintf("UndelegateCallback | %s", err.Error())) - return err - } - - k.Logger(ctx).Info("UndelegateHostCallback: SetUndelegateHostPrevented") - if err := k.SetUndelegateHostPrevented(ctx); err != nil { - k.Logger(ctx).Error(fmt.Sprintf("UndelegateHostCallback failed due to SetUndelegateHostPrevented | %s", err.Error())) - return err - } - - return nil -} - -// Decrement the delegation field on host and each validator's delegations after a successful unbonding ICA -func (k Keeper) UpdateDelegationBalancesHost(ctx sdk.Context, hostZone types.HostZone, undelegateHostCallback types.UndelegateHostCallback) error { - // Undelegate from each validator and update Evmos staked balance, if successful - for _, undelegation := range undelegateHostCallback.SplitDelegations { - err := k.AddDelegationToValidator(ctx, &hostZone, undelegation.Validator, undelegation.Amount.Neg(), ICACallbackID_UndelegateHost) - if err != nil { - return err - } - } - k.SetHostZone(ctx, hostZone) - return nil -} diff --git a/x/stakeibc/keeper/icacallbacks_undelegate_test.go b/x/stakeibc/keeper/icacallbacks_undelegate_test.go index 1343366e64..a7922a5ba0 100644 --- a/x/stakeibc/keeper/icacallbacks_undelegate_test.go +++ b/x/stakeibc/keeper/icacallbacks_undelegate_test.go @@ -12,7 +12,6 @@ import ( icacallbacktypes "github.com/Stride-Labs/stride/v15/x/icacallbacks/types" recordtypes "github.com/Stride-Labs/stride/v15/x/records/types" - stakeibckeeper "github.com/Stride-Labs/stride/v15/x/stakeibc/keeper" "github.com/Stride-Labs/stride/v15/x/stakeibc/types" ) @@ -26,16 +25,6 @@ type UndelegateCallbackState struct { zoneAccountBalance sdkmath.Int } -type UndelegateCallbackHostState struct { - totalDelegations sdkmath.Int - val1Bal sdkmath.Int - val2Bal sdkmath.Int - epochNumber uint64 - completionTime time.Time - callbackArgs types.UndelegateHostCallback - zoneAccountBalance sdkmath.Int -} - type UndelegateCallbackArgs struct { packet channeltypes.Packet ackResponse *icacallbacktypes.AcknowledgementResponse @@ -50,14 +39,6 @@ type UndelegateCallbackTestCase struct { balanceToUnstake sdkmath.Int } -type UndelegateCallbackHostTestCase struct { - initialState UndelegateCallbackHostState - validArgs UndelegateCallbackArgs - val1UndelegationAmount sdkmath.Int - val2UndelegationAmount sdkmath.Int - balanceToUnstake sdkmath.Int -} - func (s *KeeperTestSuite) SetupUndelegateCallback() UndelegateCallbackTestCase { // Set up host zone and validator state totalDelegations := sdkmath.NewInt(1_000_000) @@ -161,108 +142,6 @@ func (s *KeeperTestSuite) SetupUndelegateCallback() UndelegateCallbackTestCase { } } -func (s *KeeperTestSuite) SetupUndelegateHostCallback() UndelegateCallbackHostTestCase { - // Set up host zone and validator state - totalDelegations := sdkmath.NewInt(1_000_000) - val1Bal := sdkmath.NewInt(400_000) - val2Bal := totalDelegations.Sub(val1Bal) - balanceToUnstake := sdkmath.NewInt(300_000) - val1UndelegationAmount := sdkmath.NewInt(120_000) - val2UndelegationAmount := balanceToUnstake.Sub(val1UndelegationAmount) - epochNumber := uint64(1) - val1 := types.Validator{ - Name: "val1", - Address: "val1_address", - Delegation: val1Bal, - DelegationChangesInProgress: 1, - } - val2 := types.Validator{ - Name: "val2", - Address: "val2_address", - Delegation: val2Bal, - DelegationChangesInProgress: 1, - } - depositAddress := types.NewHostZoneDepositAddress(stakeibckeeper.EvmosHostZoneChainId) - zoneAccountBalance := balanceToUnstake.Add(sdkmath.NewInt(10)) - zoneAccount := Account{ - acc: depositAddress, - stAtomBalance: sdk.NewCoin(StAtom, zoneAccountBalance), // Add a few extra tokens to make the test more robust - } - hostZone := types.HostZone{ - ChainId: stakeibckeeper.EvmosHostZoneChainId, - HostDenom: Atom, - IbcDenom: IbcAtom, - RedemptionRate: sdk.NewDec(1.0), - Validators: []*types.Validator{&val1, &val2}, - TotalDelegations: totalDelegations, - DepositAddress: depositAddress.String(), - } - s.App.StakeibcKeeper.SetHostZone(s.Ctx, hostZone) - - // Set up EpochUnbondingRecord, HostZoneUnbonding and token state - hostZoneUnbonding := recordtypes.HostZoneUnbonding{ - HostZoneId: stakeibckeeper.EvmosHostZoneChainId, - Status: recordtypes.HostZoneUnbonding_UNBONDING_QUEUE, - StTokenAmount: balanceToUnstake, - } - epochUnbondingRecord := recordtypes.EpochUnbondingRecord{ - EpochNumber: epochNumber, - HostZoneUnbondings: []*recordtypes.HostZoneUnbonding{&hostZoneUnbonding}, - } - s.App.RecordsKeeper.SetEpochUnbondingRecord(s.Ctx, epochUnbondingRecord) - - // mint stTokens to the zone account, to be burned - s.FundAccount(zoneAccount.acc, zoneAccount.stAtomBalance) - - // Mock ack response - packet := channeltypes.Packet{} - completionTime := time.Now() - msgsUndelegateResponse := &stakingtypes.MsgUndelegateResponse{CompletionTime: completionTime} - msgsUndelegateResponseBz, err := proto.Marshal(msgsUndelegateResponse) - s.Require().NoError(err, "no error expected when marshalling undelegate response") - - ackResponse := icacallbacktypes.AcknowledgementResponse{ - Status: icacallbacktypes.AckResponseStatus_SUCCESS, - MsgResponses: [][]byte{msgsUndelegateResponseBz}, - } - - // Mock callback args - val1SplitDelegation := types.SplitDelegation{ - Validator: val1.Address, - Amount: val1UndelegationAmount, - } - val2SplitDelegation := types.SplitDelegation{ - Validator: val2.Address, - Amount: val2UndelegationAmount, - } - callbackArgs := types.UndelegateHostCallback{ - Amt: balanceToUnstake, - SplitDelegations: []*types.SplitDelegation{&val1SplitDelegation, &val2SplitDelegation}, - } - callbackArgsBz, err := proto.Marshal(&callbackArgs) - s.Require().NoError(err, "callback args unmarshalled") - - return UndelegateCallbackHostTestCase{ - val1UndelegationAmount: val1UndelegationAmount, - val2UndelegationAmount: val2UndelegationAmount, - balanceToUnstake: balanceToUnstake, - initialState: UndelegateCallbackHostState{ - callbackArgs: callbackArgs, - totalDelegations: totalDelegations, - val1Bal: val1Bal, - val2Bal: val2Bal, - epochNumber: epochNumber, - completionTime: completionTime, - zoneAccountBalance: zoneAccountBalance, - }, - validArgs: UndelegateCallbackArgs{ - packet: packet, - ackResponse: &ackResponse, - args: callbackArgsBz, - }, - } -} - func (s *KeeperTestSuite) TestUndelegateCallback_Successful() { tc := s.SetupUndelegateCallback() initialState := tc.initialState @@ -578,110 +457,3 @@ func (s *KeeperTestSuite) TestBurnTokens_CouldNotSendCoinsFromAccountToModule() err := s.App.StakeibcKeeper.BurnTokens(s.Ctx, hostZone, sdkmath.NewInt(123456)) s.Require().EqualError(err, "could not send coins from account stride1755g4dkhpw73gz9h9nwhlcefc6sdf8kcmvcwrk4rxfrz8xpxxjms7savm8 to module stakeibc. err: spendable balance is smaller than 123456stcoinDNE: insufficient funds") } - -func (s *KeeperTestSuite) TestUndelegateCallbackHost_Successful() { - tc := s.SetupUndelegateHostCallback() - initialState := tc.initialState - validArgs := tc.validArgs - - // Ensure IsUndelegateHostPrevented(ctx) is not yet flipped - s.Require().False(s.App.StakeibcKeeper.IsUndelegateHostPrevented(s.Ctx)) - - // Callback - err := s.App.StakeibcKeeper.UndelegateHostCallback(s.Ctx, validArgs.packet, validArgs.ackResponse, validArgs.args) - s.Require().NoError(err, "undelegate host callback succeeds") - - // Check that total delegation has decreased on the host zone - hostZone, found := s.App.StakeibcKeeper.GetHostZone(s.Ctx, stakeibckeeper.EvmosHostZoneChainId) - s.Require().True(found) - s.Require().Equal(hostZone.TotalDelegations, initialState.totalDelegations.Sub(tc.balanceToUnstake), "total delegation has decreased on the host zone") - - // Check that Delegations on validators have decreased - s.Require().True(len(hostZone.Validators) == 2, "Expected 2 validators") - val1 := hostZone.Validators[0] - val2 := hostZone.Validators[1] - s.Require().Equal(initialState.val1Bal.Sub(tc.val1UndelegationAmount), val1.Delegation, "val1 delegation has decreased") - s.Require().Equal(initialState.val2Bal.Sub(tc.val2UndelegationAmount), val2.Delegation, "val2 delegation has decreased") - - // Check that the number of delegation changes in progress was reset to 0 - s.Require().Equal(0, int(val1.DelegationChangesInProgress), "val1 delegation changes in progress") - s.Require().Equal(0, int(val2.DelegationChangesInProgress), "val2 delegation changes in progress") - - // ensure UndelegateHostPrevented has been flipped to true - s.Require().True(s.App.StakeibcKeeper.IsUndelegateHostPrevented(s.Ctx)) -} - -func (s *KeeperTestSuite) checkStateIfUndelegateCallbackHostFailed(tc UndelegateCallbackHostTestCase) { - initialState := tc.initialState - - // Check that total delegation has NOT decreased on the host zone - hostZone, found := s.App.StakeibcKeeper.GetHostZone(s.Ctx, stakeibckeeper.EvmosHostZoneChainId) - s.Require().True(found, "host zone found") - s.Require().Equal(initialState.totalDelegations, hostZone.TotalDelegations, "total delegation has NOT decreased on the host zone") - - // Check that Delegations on validators have NOT decreased - s.Require().True(len(hostZone.Validators) == 2, "Expected 2 validators") - val1 := hostZone.Validators[0] - val2 := hostZone.Validators[1] - s.Require().Equal(initialState.val1Bal, val1.Delegation, "val1 delegation has NOT decreased") - s.Require().Equal(initialState.val2Bal, val2.Delegation, "val2 delegation has NOT decreased") - - // Check that the number of delegation changes in progress was reset - s.Require().Equal(0, int(val1.DelegationChangesInProgress), "val1 delegation changes in progress") - s.Require().Equal(0, int(val2.DelegationChangesInProgress), "val2 delegation changes in progress") - - // Check that the host zone unbonding records have not been updated - epochUnbondingRecord, found := s.App.RecordsKeeper.GetEpochUnbondingRecord(s.Ctx, initialState.epochNumber) - s.Require().True(found, "epoch unbonding record found") - s.Require().Equal(len(epochUnbondingRecord.HostZoneUnbondings), 1, "1 host zone unbonding found") - hzu := epochUnbondingRecord.HostZoneUnbondings[0] - s.Require().Equal(int64(hzu.UnbondingTime), int64(0), "completion time is NOT set on the hzu") - s.Require().Equal(hzu.Status, recordtypes.HostZoneUnbonding_UNBONDING_QUEUE, "hzu status is set to UNBONDING_QUEUE") - zoneAccount, err := sdk.AccAddressFromBech32(hostZone.DepositAddress) - s.Require().NoError(err, "zone account address is valid") - s.Require().Equal(initialState.zoneAccountBalance, s.App.BankKeeper.GetBalance(s.Ctx, zoneAccount, StAtom).Amount, "tokens are NOT burned") -} - -func (s *KeeperTestSuite) TestUndelegateCallbackHost_UndelegateCallbackTimeout() { - tc := s.SetupUndelegateHostCallback() - - // Update the ack response to indicate a timeout - invalidArgs := tc.validArgs - invalidArgs.ackResponse.Status = icacallbacktypes.AckResponseStatus_TIMEOUT - - err := s.App.StakeibcKeeper.UndelegateHostCallback(s.Ctx, invalidArgs.packet, invalidArgs.ackResponse, invalidArgs.args) - s.Require().NoError(err, "undelegate callback succeeds on timeout") - s.checkStateIfUndelegateCallbackHostFailed(tc) -} - -func (s *KeeperTestSuite) TestUndelegateCallbackHost_UndelegateCallbackErrorOnHost() { - tc := s.SetupUndelegateHostCallback() - - // an error ack means the tx failed on the host - invalidArgs := tc.validArgs - invalidArgs.ackResponse.Status = icacallbacktypes.AckResponseStatus_FAILURE - - err := s.App.StakeibcKeeper.UndelegateHostCallback(s.Ctx, invalidArgs.packet, invalidArgs.ackResponse, invalidArgs.args) - s.Require().NoError(err, "undelegate callback succeeds with error on host") - s.checkStateIfUndelegateCallbackHostFailed(tc) -} - -func (s *KeeperTestSuite) TestUndelegateCallbackHost_WrongCallbackArgs() { - tc := s.SetupUndelegateHostCallback() - - // random args should cause the callback to fail - invalidCallbackArgs := []byte("random bytes") - - err := s.App.StakeibcKeeper.UndelegateHostCallback(s.Ctx, tc.validArgs.packet, tc.validArgs.ackResponse, invalidCallbackArgs) - s.Require().EqualError(err, "Unable to unmarshal undelegate host callback args: unexpected EOF: unable to unmarshal data structure") -} - -func (s *KeeperTestSuite) TestUndelegateCallbackHost_HostNotFound() { - tc := s.SetupUndelegateHostCallback() - - // remove the host zone from the store to trigger a host not found error - s.App.StakeibcKeeper.RemoveHostZone(s.Ctx, stakeibckeeper.EvmosHostZoneChainId) - - err := s.App.StakeibcKeeper.UndelegateHostCallback(s.Ctx, tc.validArgs.packet, tc.validArgs.ackResponse, tc.validArgs.args) - s.Require().EqualError(err, "Host zone not found: evmos_9001-2: key not found") -} diff --git a/x/stakeibc/keeper/msg_undelegate_host.go b/x/stakeibc/keeper/msg_undelegate_host.go deleted file mode 100644 index 9bd14eb2ee..0000000000 --- a/x/stakeibc/keeper/msg_undelegate_host.go +++ /dev/null @@ -1,53 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/Stride-Labs/stride/v15/x/stakeibc/types" -) - -const isUndelegateHostPreventedKey = "is-undelegate-host-prevented" - -func (k msgServer) UndelegateHost(goCtx context.Context, msg *types.MsgUndelegateHost) (*types.MsgUndelegateHostResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - // undelegateHost is callable only if it has not yet been called and succeeded - if k.IsUndelegateHostPrevented(ctx) { - return nil, errorsmod.Wrapf(types.ErrUndelegateHostNotCallable, "") - } - - // Get host zone unbonding message by summing up the unbonding records - if err := k.UndelegateHostEvmos(ctx, msg.Amount); err != nil { - return nil, fmt.Errorf("Error initiating host zone unbondings for UndelegateHostEvmos %s", err.Error()) - } - - // log: issuing an undelegation to Evmos - k.Logger(ctx).Info("Issuing an undelegation to Evmos") - - return &types.MsgUndelegateHostResponse{}, nil -} - -func (k Keeper) SetUndelegateHostPrevented(ctx sdk.Context) error { - - store := ctx.KVStore(k.storeKey) - - // set the key to 1 if it's not set - if !k.IsUndelegateHostPrevented(ctx) { - store.Set([]byte(isUndelegateHostPreventedKey), []byte{1}) - } - return nil -} - -func (k Keeper) IsUndelegateHostPrevented(ctx sdk.Context) bool { - store := ctx.KVStore(k.storeKey) - if !store.Has([]byte(isUndelegateHostPreventedKey)) { - return false - } - - value := store.Get([]byte(isUndelegateHostPreventedKey)) - return len(value) == 1 && value[0] == 1 -} diff --git a/x/stakeibc/keeper/msg_undelegate_host_test.go b/x/stakeibc/keeper/msg_undelegate_host_test.go deleted file mode 100644 index 3642c96f64..0000000000 --- a/x/stakeibc/keeper/msg_undelegate_host_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package keeper_test - -import ( - _ "github.com/stretchr/testify/suite" -) - -func (s *KeeperTestSuite) TestEnableStrictUnbondingCap_CapNotSet() { - - // make sure StrictUnbondingCap is not set - s.Require().False(s.App.StakeibcKeeper.IsUndelegateHostPrevented(s.Ctx), "undelegate host prevented") -} - -func (s *KeeperTestSuite) TestEnableStrictUnbondingCap_CapSet() { - - // set undelegate Prevented - err := s.App.StakeibcKeeper.SetUndelegateHostPrevented(s.Ctx) - s.Require().NoError(err, "set undelegate host prevented") - - // make sure StrictUnbondingCap is set - s.Require().True(s.App.StakeibcKeeper.IsUndelegateHostPrevented(s.Ctx), "strict unbonding cap set to true") -} diff --git a/x/stakeibc/keeper/undelegate_host.go b/x/stakeibc/keeper/undelegate_host.go deleted file mode 100644 index ce51c52630..0000000000 --- a/x/stakeibc/keeper/undelegate_host.go +++ /dev/null @@ -1,137 +0,0 @@ -package keeper - -import ( - "fmt" - - errorsmod "cosmossdk.io/errors" - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/gogoproto/proto" - - "github.com/Stride-Labs/stride/v15/utils" - "github.com/Stride-Labs/stride/v15/x/stakeibc/types" -) - -const ( - MaxNumTokensUnbondableStr = "2500000000000000000000000" // 2,500,000e18 - EvmosHostZoneChainId = "evmos_9001-2" -) - -// Submits undelegation ICA message for Evmos -// The total unbond amount is input, capped at MaxNumTokensUnbondable. -func (k Keeper) UndelegateHostEvmos(ctx sdk.Context, totalUnbondAmount math.Int) error { - - // if the total unbond amount is greater than the max, exit - maxNumTokensUnbondable, ok := math.NewIntFromString(MaxNumTokensUnbondableStr) - if !ok { - return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "unable to parse maxNumTokensUnbondable %s", maxNumTokensUnbondable) - } - if totalUnbondAmount.GT(maxNumTokensUnbondable) { - return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "total unbond amount %v is greater than maxNumTokensUnbondable %v", - totalUnbondAmount, maxNumTokensUnbondable) - } - - // Get the host zone - evmosHost, found := k.GetHostZone(ctx, EvmosHostZoneChainId) - if !found { - return errorsmod.Wrapf(types.ErrHostZoneNotFound, "host zone %s not found", EvmosHostZoneChainId) - } - - k.Logger(ctx).Info(utils.LogWithHostZone(evmosHost.ChainId, - "Total unbonded amount: %v%s", totalUnbondAmount, evmosHost.HostDenom)) - - // If there's nothing to unbond, return and move on to the next host zone - if totalUnbondAmount.IsZero() { - return nil - } - - k.Logger(ctx).Info("Preparing MsgUndelegates from the delegation account to each validator on Evmos") - - // Confirm the delegation account was registered - if evmosHost.DelegationIcaAddress == "" { - return errorsmod.Wrapf(types.ErrICAAccountNotFound, "no delegation account found for %s", evmosHost.ChainId) - } - - // Determine the ideal balanced delegation for each validator after the unbonding - // (as if we were to unbond and then rebalance) - // This will serve as the starting point for determining how much to unbond each validator - delegationAfterUnbonding := evmosHost.TotalDelegations.Sub(totalUnbondAmount) - balancedDelegationsAfterUnbonding, err := k.GetTargetValAmtsForHostZone(ctx, evmosHost, delegationAfterUnbonding) - if err != nil { - return errorsmod.Wrapf(err, "unable to get target val amounts for host zone %s", evmosHost.ChainId) - } - - // Determine the unbond capacity for each validator - // Each validator can only unbond up to the difference between their current delegation and their balanced delegation - // The validator's current delegation will be above their balanced delegation if they've received LSM Liquid Stakes - // (which is only rebalanced once per unbonding period) - validatorUnbondCapacity := k.GetValidatorUnbondCapacity(ctx, evmosHost.Validators, balancedDelegationsAfterUnbonding) - if len(validatorUnbondCapacity) == 0 { - return fmt.Errorf("there are no validators on %s with sufficient unbond capacity", evmosHost.ChainId) - } - - // Sort the unbonding capacity by priority - // Priority is determined by checking the how proportionally unbalanced each validator is - // Zero weight validators will come first in the list - prioritizedUnbondCapacity, err := SortUnbondingCapacityByPriority(validatorUnbondCapacity) - if err != nil { - return err - } - - // Get the undelegation ICA messages and split delegations for the callback - msgs, unbondings, err := k.GetUnbondingICAMessages(evmosHost, totalUnbondAmount, prioritizedUnbondCapacity) - if err != nil { - return err - } - - // Shouldn't be possible, but if all the validator's had a target unbonding of zero, do not send an ICA - if len(msgs) == 0 { - return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Target unbonded amount was 0 for each validator") - } - - // Send the messages in batches so the gas limit isn't exceedeed - for start := 0; start < len(msgs); start += UndelegateICABatchSize { - end := start + UndelegateICABatchSize - if end > len(msgs) { - end = len(msgs) - } - - msgsBatch := msgs[start:end] - unbondingsBatch := unbondings[start:end] - - // Store the callback data - undelegateHostCallback := types.UndelegateHostCallback{ - Amt: totalUnbondAmount, - SplitDelegations: unbondingsBatch, - } - callbackArgsBz, err := proto.Marshal(&undelegateHostCallback) - if err != nil { - return errorsmod.Wrap(err, "unable to marshal undelegate callback args") - } - - // Submit the undelegation ICA - if _, err := k.SubmitTxsDayEpoch( - ctx, - evmosHost.ConnectionId, - msgsBatch, - types.ICAAccountType_DELEGATION, - ICACallbackID_UndelegateHost, - callbackArgsBz, - ); err != nil { - return errorsmod.Wrapf(err, "unable to submit unbonding ICA for %s", evmosHost.ChainId) - } - - // flag the delegation change in progress on each validator - for _, unbonding := range unbondingsBatch { - if err := k.IncrementValidatorDelegationChangesInProgress(&evmosHost, unbonding.Validator); err != nil { - return err - } - } - k.SetHostZone(ctx, evmosHost) - } - - EmitUndelegationEvent(ctx, evmosHost, totalUnbondAmount) - - return nil -} diff --git a/x/stakeibc/keeper/undelegate_host_test.go b/x/stakeibc/keeper/undelegate_host_test.go deleted file mode 100644 index e0ed72c4cd..0000000000 --- a/x/stakeibc/keeper/undelegate_host_test.go +++ /dev/null @@ -1,362 +0,0 @@ -package keeper_test - -import ( - "fmt" - - "cosmossdk.io/math" - sdkmath "cosmossdk.io/math" - "github.com/cosmos/gogoproto/proto" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - _ "github.com/stretchr/testify/suite" - - epochstypes "github.com/Stride-Labs/stride/v15/x/epochs/types" - recordtypes "github.com/Stride-Labs/stride/v15/x/records/types" - "github.com/Stride-Labs/stride/v15/x/stakeibc/types" -) - -const UndelegateHostZoneChainId = "evmos_9001-2" // the relevant zone for this test - -func (s *KeeperTestSuite) SetupTestUndelegateHost( - totalWeight int64, - totalStake sdkmath.Int, - unbondAmount sdkmath.Int, - validators []*types.Validator, -) UnbondingTestCase { - delegationAccountOwner := types.FormatICAAccountOwner(UndelegateHostZoneChainId, types.ICAAccountType_DELEGATION) - delegationChannelID, delegationPortID := s.CreateICAChannel(delegationAccountOwner) - - // Sanity checks: - // - total stake matches - // - total weights sum to 100 - actualTotalStake := sdkmath.ZeroInt() - actualTotalWeights := uint64(0) - for _, validator := range validators { - actualTotalStake = actualTotalStake.Add(validator.Delegation) - actualTotalWeights += validator.Weight - } - s.Require().Equal(totalStake.Int64(), actualTotalStake.Int64(), "test setup failed - total stake does not match") - s.Require().Equal(totalWeight, int64(actualTotalWeights), "test setup failed - total weight does not match") - - // Store the validators on the host zone - hostZone := types.HostZone{ - ChainId: UndelegateHostZoneChainId, - ConnectionId: ibctesting.FirstConnectionID, - HostDenom: Atom, - DelegationIcaAddress: "cosmos_DELEGATION", - Validators: validators, - TotalDelegations: totalStake, - } - s.App.StakeibcKeeper.SetHostZone(s.Ctx, hostZone) - - // Store the total unbond amount across two epoch unbonding records - halfUnbondAmount := unbondAmount.Quo(sdkmath.NewInt(2)) - for i := uint64(1); i <= 2; i++ { - s.App.RecordsKeeper.SetEpochUnbondingRecord(s.Ctx, recordtypes.EpochUnbondingRecord{ - EpochNumber: i, - HostZoneUnbondings: []*recordtypes.HostZoneUnbonding{ - { - HostZoneId: UndelegateHostZoneChainId, - Status: recordtypes.HostZoneUnbonding_UNBONDING_QUEUE, - NativeTokenAmount: halfUnbondAmount, - }, - }, - }) - } - - // Mock the epoch tracker to timeout 90% through the epoch - strideEpochTracker := types.EpochTracker{ - EpochIdentifier: epochstypes.DAY_EPOCH, - Duration: 10_000_000_000, // 10 second epochs - NextEpochStartTime: uint64(s.Coordinator.CurrentTime.UnixNano() + 30_000_000_000), // dictates timeout - } - s.App.StakeibcKeeper.SetEpochTracker(s.Ctx, strideEpochTracker) - - // Get tx seq number before the ICA was submitted to check whether an ICA was submitted - startSequence, found := s.App.IBCKeeper.ChannelKeeper.GetNextSequenceSend(s.Ctx, delegationPortID, delegationChannelID) - s.Require().True(found, "sequence number not found before ica") - - return UnbondingTestCase{ - hostZone: hostZone, - totalUnbondAmount: unbondAmount, - delegationChannelID: delegationChannelID, - delegationPortID: delegationPortID, - channelStartSequence: startSequence, - expectedUnbondingRecordIds: []uint64{1, 2}, - } -} - -// Helper function to check that an undelegation ICA was submitted and that the callback data -// holds the expected unbondings for each validator -func (s *KeeperTestSuite) CheckUndelegateHostMessages(tc UnbondingTestCase, expectedUnbondings []ValidatorUnbonding) { - - // Check that IsUndelegateHostPrevented(ctx) has not yet been flipped to true - s.Require().False(s.App.StakeibcKeeper.IsUndelegateHostPrevented(s.Ctx)) - - // Trigger unbonding - err := s.App.StakeibcKeeper.UndelegateHostEvmos(s.Ctx, tc.totalUnbondAmount) - s.Require().NoError(err, "no error expected when calling unbond from host") - - // Check that sequence number incremented from a sent ICA - endSequence, found := s.App.IBCKeeper.ChannelKeeper.GetNextSequenceSend(s.Ctx, tc.delegationPortID, tc.delegationChannelID) - s.Require().True(found, "sequence number not found after ica") - s.Require().Equal(tc.channelStartSequence+1, endSequence, "sequence number should have incremented") - - // Check that callback data was stored - callbackData := s.App.IcacallbacksKeeper.GetAllCallbackData(s.Ctx) - s.Require().Len(callbackData, 1, "there should only be one callback data stored") - - // Check host zone and epoch unbonding record id's - var actualCallback types.UndelegateHostCallback - err = proto.Unmarshal(callbackData[0].CallbackArgs, &actualCallback) - s.Require().NoError(err, "no error expected when unmarshalling callback args") - - s.Require().Equal(tc.totalUnbondAmount, actualCallback.Amt, "amount on callback") - - // Check splits from callback data align with expected unbondings - s.Require().Len(actualCallback.SplitDelegations, len(expectedUnbondings), "number of unbonding messages") - for i, expected := range expectedUnbondings { - actualSplit := actualCallback.SplitDelegations[i] - s.Require().Equal(expected.Validator, actualSplit.Validator, "callback message validator - index %d", i) - s.Require().Equal(expected.UnbondAmount.Int64(), actualSplit.Amount.Int64(), "callback message amount - index %d", i) - } - - // Check the delegation change in progress was incremented from each that had an unbonding - actualHostZone, found := s.App.StakeibcKeeper.GetHostZone(s.Ctx, UndelegateHostZoneChainId) - s.Require().True(found, "host zone should have been found") - - for _, actualValidator := range actualHostZone.Validators { - validatorUnbonded := false - for _, unbondedVal := range expectedUnbondings { - if actualValidator.Address == unbondedVal.Validator { - validatorUnbonded = true - } - } - - expectedDelegationChangesInProgress := 0 - if validatorUnbonded { - expectedDelegationChangesInProgress = 1 - } - s.Require().Equal(expectedDelegationChangesInProgress, int(actualValidator.DelegationChangesInProgress), - "validator %s delegation changes in progress", actualValidator.Address) - } - - // Check that the unbond event was emitted with the proper unbond amount - s.CheckEventValueEmitted(types.EventTypeUndelegation, types.AttributeKeyTotalUnbondAmount, tc.totalUnbondAmount.String()) -} - -func (s *KeeperTestSuite) TestUndelegateHost_Successful_UnbondOnlyZeroWeightVals() { - // Native Stake: 1000 - // LSM Stake: 250 - // Total Stake: 1250 - // - // Unbond Amount: 50 - // Stake After Unbond: 1200 - totalUnbondAmount := sdkmath.NewInt(50) - totalStake := sdkmath.NewInt(1250) - totalWeight := int64(100) - - validators := []*types.Validator{ - // Current: 100, Weight: 10%, Balanced: 10% * 1200 = 120, Capacity: 100-120 = -20 -> 0 - // No capacity -> unbondings - {Address: "valA", Weight: 10, Delegation: sdkmath.NewInt(100)}, - // Current: 420, Weight: 35%, Balanced: 35% * 1200 = 420, Capacity: 420-420 = 0 - // No capacity -> unbondings - {Address: "valB", Weight: 35, Delegation: sdkmath.NewInt(420)}, - // Weight: 0%, Balanced: 0, Capacity: 40 - // >>> Ratio: 0 -> Priority #1 <<< - {Address: "valC", Weight: 0, Delegation: sdkmath.NewInt(40)}, - // Current: 300, Weight: 30%, Balanced: 30% * 1200 = 360, Capacity: 300-360 = -60 -> 0 - // No capacity -> unbondings - {Address: "valD", Weight: 30, Delegation: sdkmath.NewInt(300)}, - // Weight: 0%, Balanced: 0, Capacity: 30 - // >>> Ratio: 0 -> Priority #2 <<< - {Address: "valE", Weight: 0, Delegation: sdkmath.NewInt(30)}, - // Current: 200, Weight: 10%, Balanced: 10% * 1200 = 120, Capacity: 200 - 120 = 80 - // >>> Ratio: 110/200 = 0.55 -> #3 Priority <<<< - {Address: "valF", Weight: 10, Delegation: sdkmath.NewInt(200)}, - // Current: 160, Weight: 15%, Balanced: 15% * 1200 = 180, Capacity: 160-180 = -20 -> 0 - // No capacity -> unbondings - {Address: "valG", Weight: 15, Delegation: sdkmath.NewInt(160)}, - } - - expectedUnbondings := []ValidatorUnbonding{ - // valC has #1 priority - unbond up to capacity at 40 - {Validator: "valC", UnbondAmount: sdkmath.NewInt(40)}, - // 50 - 40 = 10 unbond remaining - // valE has #2 priority - unbond up to remaining - {Validator: "valE", UnbondAmount: sdkmath.NewInt(10)}, - } - - tc := s.SetupTestUndelegateHost(totalWeight, totalStake, totalUnbondAmount, validators) - s.CheckUndelegateHostMessages(tc, expectedUnbondings) -} - -func (s *KeeperTestSuite) TestUndelegateHost_Successful_UnbondTotalLessThanTotalLSM() { - // Native Stake: 1000 - // LSM Stake: 250 - // Total Stake: 1250 - // - // Unbond Amount: 150 - // Stake After Unbond: 1100 - totalUnbondAmount := sdkmath.NewInt(150) - totalStake := sdkmath.NewInt(1250) - totalWeight := int64(100) - - validators := []*types.Validator{ - // Current: 100, Weight: 10%, Balanced: 10% * 1100 = 110, Capacity: 100-110 = -10 -> 0 - // No capacity -> unbondings - {Address: "valA", Weight: 10, Delegation: sdkmath.NewInt(100)}, - // Current: 420, Weight: 35%, Balanced: 35% * 1100 = 385, Capacity: 420-385 = 35 - // >>> Ratio: 385/420 = 0.91 -> Priority #4 <<< - {Address: "valB", Weight: 35, Delegation: sdkmath.NewInt(420)}, - // Weight: 0%, Balanced: 0, Capacity: 40 - // >>> Ratio: 0 -> Priority #1 <<< - {Address: "valC", Weight: 0, Delegation: sdkmath.NewInt(40)}, - // Current: 300, Weight: 30%, Balanced: 30% * 1100 = 330, Capacity: 300-330 = -30 -> 0 - // No capacity -> unbondings - {Address: "valD", Weight: 30, Delegation: sdkmath.NewInt(300)}, - // Weight: 0%, Balanced: 0, Capacity: 30 - // >>> Ratio: 0 -> Priority #2 <<< - {Address: "valE", Weight: 0, Delegation: sdkmath.NewInt(30)}, - // Current: 200, Weight: 10%, Balanced: 10% * 1100 = 110, Capacity: 200 - 110 = 90 - // >>> Ratio: 110/200 = 0.55 -> Priority #3 <<< - {Address: "valF", Weight: 10, Delegation: sdkmath.NewInt(200)}, - // Current: 160, Weight: 15%, Balanced: 15% * 1100 = 165, Capacity: 160-165 = -5 -> 0 - // No capacity -> unbondings - {Address: "valG", Weight: 15, Delegation: sdkmath.NewInt(160)}, - } - - expectedUnbondings := []ValidatorUnbonding{ - // valC has #1 priority - unbond up to capacity at 40 - {Validator: "valC", UnbondAmount: sdkmath.NewInt(40)}, - // 150 - 40 = 110 unbond remaining - // valE has #2 priority - unbond up to capacity at 30 - {Validator: "valE", UnbondAmount: sdkmath.NewInt(30)}, - // 150 - 40 - 30 = 80 unbond remaining - // valF has #3 priority - unbond up to remaining - {Validator: "valF", UnbondAmount: sdkmath.NewInt(80)}, - } - - tc := s.SetupTestUndelegateHost(totalWeight, totalStake, totalUnbondAmount, validators) - s.CheckUndelegateHostMessages(tc, expectedUnbondings) -} - -func (s *KeeperTestSuite) TestUndelegateHost_Successful_UnbondTotalGreaterThanTotalLSM() { - // Native Stake: 1000 - // LSM Stake: 250 - // Total Stake: 1250 - // - // Unbond Amount: 350 - // Stake After Unbond: 900 - totalUnbondAmount := sdkmath.NewInt(350) - totalStake := sdkmath.NewInt(1250) - totalWeight := int64(100) - - validators := []*types.Validator{ - // Current: 100, Weight: 10%, Balanced: 10% * 900 = 90, Capacity: 100-90 = 10 - // >>> Ratio: 90/100 = 0.9 -> Priority #7 <<< - {Address: "valA", Weight: 10, Delegation: sdkmath.NewInt(100)}, - // Current: 420, Weight: 35%, Balanced: 35% * 900 = 315, Capacity: 420-315 = 105 - // >>> Ratio: 315/420 = 0.75 -> Priority #4 <<< - {Address: "valB", Weight: 35, Delegation: sdkmath.NewInt(420)}, - // Weight: 0%, Balanced: 0, Capacity: 40 - // >>> Ratio: 0 -> Priority #1 <<< - {Address: "valC", Weight: 0, Delegation: sdkmath.NewInt(40)}, - // Current: 300, Weight: 30%, Balanced: 30% * 900 = 270, Capacity: 300-270 = 30 - // >>> Ratio: 270/300 = 0.9 -> Priority #6 <<< - {Address: "valD", Weight: 30, Delegation: sdkmath.NewInt(300)}, - // Weight: 0%, Balanced: 0, Capacity: 30 - // >>> Ratio: 0 -> Priority #2 <<< - {Address: "valE", Weight: 0, Delegation: sdkmath.NewInt(30)}, - // Current: 200, Weight: 10%, Balanced: 10% * 900 = 90, Capacity: 200 - 90 = 110 - // >>> Ratio: 90/200 = 0.45 -> Priority #3 <<< - {Address: "valF", Weight: 10, Delegation: sdkmath.NewInt(200)}, - // Current: 160, Weight: 15%, Balanced: 15% * 900 = 135, Capacity: 160-135 = 25 - // >>> Ratio: 135/160 = 0.85 -> Priority #5 <<< - {Address: "valG", Weight: 15, Delegation: sdkmath.NewInt(160)}, - } - - expectedUnbondings := []ValidatorUnbonding{ - // valC has #1 priority - unbond up to capacity at 40 - {Validator: "valC", UnbondAmount: sdkmath.NewInt(40)}, - // 350 - 40 = 310 unbond remaining - // valE has #2 priority - unbond up to capacity at 30 - {Validator: "valE", UnbondAmount: sdkmath.NewInt(30)}, - // 310 - 30 = 280 unbond remaining - // valF has #3 priority - unbond up to capacity at 110 - {Validator: "valF", UnbondAmount: sdkmath.NewInt(110)}, - // 280 - 110 = 170 unbond remaining - // valB has #4 priority - unbond up to capacity at 105 - {Validator: "valB", UnbondAmount: sdkmath.NewInt(105)}, - // 170 - 105 = 65 unbond remaining - // valG has #5 priority - unbond up to capacity at 25 - {Validator: "valG", UnbondAmount: sdkmath.NewInt(25)}, - // 65 - 25 = 40 unbond remaining - // valD has #6 priority - unbond up to capacity at 30 - {Validator: "valD", UnbondAmount: sdkmath.NewInt(30)}, - // 40 - 30 = 10 unbond remaining - // valA has #7 priority - unbond up to remaining - {Validator: "valA", UnbondAmount: sdkmath.NewInt(10)}, - } - - tc := s.SetupTestUndelegateHost(totalWeight, totalStake, totalUnbondAmount, validators) - s.CheckUndelegateHostMessages(tc, expectedUnbondings) -} - -func (s *KeeperTestSuite) TestUndelegateHost_AmountTooLarge() { - // Call undelegateHost with an amount that is greater than the max amount, it should fail - unbondAmount, ok := math.NewIntFromString("25000000000000000000000001") - s.Require().True(ok, "could not parse unbondAmount") - err := s.App.StakeibcKeeper.UndelegateHostEvmos(s.Ctx, unbondAmount) - s.Require().ErrorContains(err, fmt.Sprintf("total unbond amount %v is greater than", unbondAmount)) -} - -func (s *KeeperTestSuite) TestUndelegateHost_ZeroUnbondAmount() { - totalWeight := int64(0) - totalStake := sdkmath.ZeroInt() - totalUnbondAmount := sdkmath.ZeroInt() - tc := s.SetupTestUndelegateHost(totalWeight, totalStake, totalUnbondAmount, []*types.Validator{}) - - // Call unbond - it should NOT error since the unbond amount was 0 - but it should short circuit - err := s.App.StakeibcKeeper.UndelegateHostEvmos(s.Ctx, totalUnbondAmount) - s.Require().Nil(err, "unbond should not have thrown an error - it should have simply ignored the host zone") - - // Confirm no ICAs were sent - endSequence, found := s.App.IBCKeeper.ChannelKeeper.GetNextSequenceSend(s.Ctx, tc.delegationPortID, tc.delegationChannelID) - s.Require().True(found, "sequence number not found after ica") - s.Require().Equal(tc.channelStartSequence, endSequence, "sequence number should stay the same since no messages were sent") -} - -func (s *KeeperTestSuite) TestUndelegateHost_ZeroValidatorWeights() { - // Setup the test with all zero-weight validators - totalWeight := int64(0) - totalStake := sdkmath.NewInt(100) - totalUnbondAmount := sdkmath.NewInt(10) - validators := []*types.Validator{ - {Address: "valA", Weight: 0, Delegation: sdkmath.NewInt(25)}, - {Address: "valB", Weight: 0, Delegation: sdkmath.NewInt(50)}, - {Address: "valC", Weight: 0, Delegation: sdkmath.NewInt(25)}, - } - s.SetupTestUndelegateHost(totalWeight, totalStake, totalUnbondAmount, validators) - - // Call unbond - it should fail - err := s.App.StakeibcKeeper.UndelegateHostEvmos(s.Ctx, totalUnbondAmount) - s.Require().ErrorContains(err, "No non-zero validators found for host zone") -} - -func (s *KeeperTestSuite) TestUndelegateHost_InsufficientDelegations() { - // Setup the test where the total unbond amount is greater than the current delegations - totalWeight := int64(100) - totalStake := sdkmath.NewInt(100) - totalUnbondAmount := sdkmath.NewInt(200) - validators := []*types.Validator{ - {Address: "valA", Weight: 25, Delegation: sdkmath.NewInt(25)}, - {Address: "valB", Weight: 50, Delegation: sdkmath.NewInt(50)}, - {Address: "valC", Weight: 25, Delegation: sdkmath.NewInt(25)}, - } - s.SetupTestUndelegateHost(totalWeight, totalStake, totalUnbondAmount, validators) - - // Call unbond - it should fail - err := s.App.StakeibcKeeper.UndelegateHostEvmos(s.Ctx, totalUnbondAmount) - s.Require().ErrorContains(err, "Cannot calculate target delegation if final amount is less than or equal to zero") -} diff --git a/x/stakeibc/types/codec.go b/x/stakeibc/types/codec.go index 71a00545b6..c28fb0b674 100644 --- a/x/stakeibc/types/codec.go +++ b/x/stakeibc/types/codec.go @@ -23,7 +23,6 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&ToggleLSMProposal{}, "stakeibc/ToggleLSMProposal", nil) cdc.RegisterConcrete(&MsgRestoreInterchainAccount{}, "stakeibc/RestoreInterchainAccount", nil) cdc.RegisterConcrete(&MsgUpdateValidatorSharesExchRate{}, "stakeibc/UpdateValidatorSharesExchRate", nil) - cdc.RegisterConcrete(&MsgUndelegateHost{}, "stakeibc/UndelegateHost", nil) cdc.RegisterConcrete(&MsgCalibrateDelegation{}, "stakeibc/CalibrateDelegation", nil) cdc.RegisterConcrete(&MsgUpdateInnerRedemptionRateBounds{}, "stakeibc/UpdateInnerRedemptionRateBounds", nil) // this line is used by starport scaffolding # 2 @@ -42,7 +41,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgDeleteValidator{}, &MsgRestoreInterchainAccount{}, &MsgUpdateValidatorSharesExchRate{}, - &MsgUndelegateHost{}, &MsgCalibrateDelegation{}, &MsgUpdateInnerRedemptionRateBounds{}, ) diff --git a/x/stakeibc/types/errors.go b/x/stakeibc/types/errors.go index 1ab443f0a4..a0805b6f3f 100644 --- a/x/stakeibc/types/errors.go +++ b/x/stakeibc/types/errors.go @@ -56,6 +56,5 @@ var ( ErrInvalidValidatorDelegationUpdates = errorsmod.Register(ModuleName, 1548, "Invalid validator delegation updates") ErrLSMLiquidStakeDisabledForHostZone = errorsmod.Register(ModuleName, 1549, "LSM liquid stake is disabled for host zone") ErrUnableToRemoveValidator = errorsmod.Register(ModuleName, 1550, "Unable to remove validator") - ErrUndelegateHostNotCallable = errorsmod.Register(ModuleName, 1551, "Undelegate host is disabled") - ErrInvalidBounds = errorsmod.Register(ModuleName, 1552, "Invalid safety bounds - inner bounds must be within outer bounds") + ErrInvalidBounds = errorsmod.Register(ModuleName, 1551, "Invalid safety bounds - inner bounds must be within outer bounds") ) diff --git a/x/stakeibc/types/message_undelegate_host.go b/x/stakeibc/types/message_undelegate_host.go deleted file mode 100644 index e1e2c8c328..0000000000 --- a/x/stakeibc/types/message_undelegate_host.go +++ /dev/null @@ -1,56 +0,0 @@ -package types - -import ( - errorsmod "cosmossdk.io/errors" - sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/Stride-Labs/stride/v15/utils" -) - -const TypeMsgUndelegateHost = "undelegate_host" - -var _ sdk.Msg = &MsgUndelegateHost{} - -func NewMsgUndelegateHost(creator string, amount sdkmath.Int) *MsgUndelegateHost { - return &MsgUndelegateHost{ - Creator: creator, - Amount: amount, - } -} - -func (msg *MsgUndelegateHost) Route() string { - return RouterKey -} - -func (msg *MsgUndelegateHost) Type() string { - return TypeMsgUndelegateHost -} - -func (msg *MsgUndelegateHost) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgUndelegateHost) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgUndelegateHost) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - if err := utils.ValidateAdminAddress(msg.Creator); err != nil { - return err - } - if msg.Amount.IsZero() { - return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "amount must be positive") - } - return nil -} From 4c42dfe503c48c37d83d82cb5605984d32c73515 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:25:13 -0500 Subject: [PATCH 04/26] undel host: re-add tx update delegation --- x/stakeibc/client/cli/tx_update_delegation.go | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 x/stakeibc/client/cli/tx_update_delegation.go diff --git a/x/stakeibc/client/cli/tx_update_delegation.go b/x/stakeibc/client/cli/tx_update_delegation.go new file mode 100644 index 0000000000..0c52fdf1d6 --- /dev/null +++ b/x/stakeibc/client/cli/tx_update_delegation.go @@ -0,0 +1,45 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + + "github.com/Stride-Labs/stride/v15/x/stakeibc/types" +) + +var _ = strconv.Itoa(0) + +func CmdUpdateValidatorSharesExchRate() *cobra.Command { + cmd := &cobra.Command{ + Use: "update-delegation [chainid] [valoper]", + Short: "Broadcast message update-delegation", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argHostdenom := args[0] + argValoper := args[1] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgUpdateValidatorSharesExchRate( + clientCtx.GetFromAddress().String(), + argHostdenom, + argValoper, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} From e8bad998a9e2f51fb59f4bd38b6c02c04ae6a1c0 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:27:23 -0500 Subject: [PATCH 05/26] calibration: revert proto + protogen; re-add delegation protos from undel host --- proto/stride/stakeibc/callbacks.proto | 6 + proto/stride/stakeibc/tx.proto | 9 - .../client/cli/tx_calibrate_delegation.go | 41 -- x/stakeibc/types/callbacks.pb.go | 466 ++++++++++++-- x/stakeibc/types/tx.pb.go | 609 +++--------------- 5 files changed, 500 insertions(+), 631 deletions(-) delete mode 100644 x/stakeibc/client/cli/tx_calibrate_delegation.go diff --git a/proto/stride/stakeibc/callbacks.proto b/proto/stride/stakeibc/callbacks.proto index 8144592650..00f3d128bd 100644 --- a/proto/stride/stakeibc/callbacks.proto +++ b/proto/stride/stakeibc/callbacks.proto @@ -36,6 +36,12 @@ message ReinvestCallback { string host_zone_id = 3; } +message UndelegateCallback { + string host_zone_id = 1; + repeated SplitDelegation split_delegations = 2; + repeated uint64 epoch_unbonding_record_ids = 3; +} + message RedemptionCallback { string host_zone_id = 1; repeated uint64 epoch_unbonding_record_ids = 2; diff --git a/proto/stride/stakeibc/tx.proto b/proto/stride/stakeibc/tx.proto index ce8acd3af5..3f32ab3d0c 100644 --- a/proto/stride/stakeibc/tx.proto +++ b/proto/stride/stakeibc/tx.proto @@ -27,8 +27,6 @@ service Msg { returns (MsgRestoreInterchainAccountResponse); rpc UpdateValidatorSharesExchRate(MsgUpdateValidatorSharesExchRate) returns (MsgUpdateValidatorSharesExchRateResponse); - rpc CalibrateDelegation(MsgCalibrateDelegation) - returns (MsgCalibrateDelegationResponse); rpc ClearBalance(MsgClearBalance) returns (MsgClearBalanceResponse); rpc UpdateInnerRedemptionRateBounds(MsgUpdateInnerRedemptionRateBounds) returns (MsgUpdateInnerRedemptionRateBoundsResponse); @@ -172,10 +170,3 @@ message MsgUpdateValidatorSharesExchRate { string valoper = 3; } message MsgUpdateValidatorSharesExchRateResponse {} - -message MsgCalibrateDelegation { - string creator = 1; - string chain_id = 2; - string valoper = 3; -} -message MsgCalibrateDelegationResponse {} diff --git a/x/stakeibc/client/cli/tx_calibrate_delegation.go b/x/stakeibc/client/cli/tx_calibrate_delegation.go deleted file mode 100644 index 72d58a0d3a..0000000000 --- a/x/stakeibc/client/cli/tx_calibrate_delegation.go +++ /dev/null @@ -1,41 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/spf13/cobra" - - "github.com/Stride-Labs/stride/v15/x/stakeibc/types" -) - -func CmdCalibrateDelegation() *cobra.Command { - cmd := &cobra.Command{ - Use: "calibrate-delegation [chainid] [valoper]", - Short: "Broadcast message calibrate-delegation", - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) (err error) { - argChainId := args[0] - argValoper := args[1] - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgCalibrateDelegation( - clientCtx.GetFromAddress().String(), - argChainId, - argValoper, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/stakeibc/types/callbacks.pb.go b/x/stakeibc/types/callbacks.pb.go index 22bb303e00..903da2a28b 100644 --- a/x/stakeibc/types/callbacks.pb.go +++ b/x/stakeibc/types/callbacks.pb.go @@ -243,6 +243,66 @@ func (m *ReinvestCallback) GetHostZoneId() string { return "" } +type UndelegateCallback struct { + HostZoneId string `protobuf:"bytes,1,opt,name=host_zone_id,json=hostZoneId,proto3" json:"host_zone_id,omitempty"` + SplitDelegations []*SplitDelegation `protobuf:"bytes,2,rep,name=split_delegations,json=splitDelegations,proto3" json:"split_delegations,omitempty"` + EpochUnbondingRecordIds []uint64 `protobuf:"varint,3,rep,packed,name=epoch_unbonding_record_ids,json=epochUnbondingRecordIds,proto3" json:"epoch_unbonding_record_ids,omitempty"` +} + +func (m *UndelegateCallback) Reset() { *m = UndelegateCallback{} } +func (m *UndelegateCallback) String() string { return proto.CompactTextString(m) } +func (*UndelegateCallback) ProtoMessage() {} +func (*UndelegateCallback) Descriptor() ([]byte, []int) { + return fileDescriptor_f41c99b09b96a5ac, []int{4} +} +func (m *UndelegateCallback) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UndelegateCallback) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UndelegateCallback.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UndelegateCallback) XXX_Merge(src proto.Message) { + xxx_messageInfo_UndelegateCallback.Merge(m, src) +} +func (m *UndelegateCallback) XXX_Size() int { + return m.Size() +} +func (m *UndelegateCallback) XXX_DiscardUnknown() { + xxx_messageInfo_UndelegateCallback.DiscardUnknown(m) +} + +var xxx_messageInfo_UndelegateCallback proto.InternalMessageInfo + +func (m *UndelegateCallback) GetHostZoneId() string { + if m != nil { + return m.HostZoneId + } + return "" +} + +func (m *UndelegateCallback) GetSplitDelegations() []*SplitDelegation { + if m != nil { + return m.SplitDelegations + } + return nil +} + +func (m *UndelegateCallback) GetEpochUnbondingRecordIds() []uint64 { + if m != nil { + return m.EpochUnbondingRecordIds + } + return nil +} + type RedemptionCallback struct { HostZoneId string `protobuf:"bytes,1,opt,name=host_zone_id,json=hostZoneId,proto3" json:"host_zone_id,omitempty"` EpochUnbondingRecordIds []uint64 `protobuf:"varint,2,rep,packed,name=epoch_unbonding_record_ids,json=epochUnbondingRecordIds,proto3" json:"epoch_unbonding_record_ids,omitempty"` @@ -252,7 +312,7 @@ func (m *RedemptionCallback) Reset() { *m = RedemptionCallback{} } func (m *RedemptionCallback) String() string { return proto.CompactTextString(m) } func (*RedemptionCallback) ProtoMessage() {} func (*RedemptionCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{4} + return fileDescriptor_f41c99b09b96a5ac, []int{5} } func (m *RedemptionCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -305,7 +365,7 @@ func (m *Rebalancing) Reset() { *m = Rebalancing{} } func (m *Rebalancing) String() string { return proto.CompactTextString(m) } func (*Rebalancing) ProtoMessage() {} func (*Rebalancing) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{5} + return fileDescriptor_f41c99b09b96a5ac, []int{6} } func (m *Rebalancing) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -357,7 +417,7 @@ func (m *RebalanceCallback) Reset() { *m = RebalanceCallback{} } func (m *RebalanceCallback) String() string { return proto.CompactTextString(m) } func (*RebalanceCallback) ProtoMessage() {} func (*RebalanceCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{6} + return fileDescriptor_f41c99b09b96a5ac, []int{7} } func (m *RebalanceCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -408,7 +468,7 @@ func (m *DetokenizeSharesCallback) Reset() { *m = DetokenizeSharesCallba func (m *DetokenizeSharesCallback) String() string { return proto.CompactTextString(m) } func (*DetokenizeSharesCallback) ProtoMessage() {} func (*DetokenizeSharesCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{7} + return fileDescriptor_f41c99b09b96a5ac, []int{8} } func (m *DetokenizeSharesCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -454,7 +514,7 @@ func (m *LSMLiquidStake) Reset() { *m = LSMLiquidStake{} } func (m *LSMLiquidStake) String() string { return proto.CompactTextString(m) } func (*LSMLiquidStake) ProtoMessage() {} func (*LSMLiquidStake) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{8} + return fileDescriptor_f41c99b09b96a5ac, []int{9} } func (m *LSMLiquidStake) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -512,7 +572,7 @@ func (m *ValidatorSharesToTokensQueryCallback) Reset() { *m = ValidatorS func (m *ValidatorSharesToTokensQueryCallback) String() string { return proto.CompactTextString(m) } func (*ValidatorSharesToTokensQueryCallback) ProtoMessage() {} func (*ValidatorSharesToTokensQueryCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{9} + return fileDescriptor_f41c99b09b96a5ac, []int{10} } func (m *ValidatorSharesToTokensQueryCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -557,7 +617,7 @@ func (m *DelegatorSharesQueryCallback) Reset() { *m = DelegatorSharesQue func (m *DelegatorSharesQueryCallback) String() string { return proto.CompactTextString(m) } func (*DelegatorSharesQueryCallback) ProtoMessage() {} func (*DelegatorSharesQueryCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{10} + return fileDescriptor_f41c99b09b96a5ac, []int{11} } func (m *DelegatorSharesQueryCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -591,6 +651,7 @@ func init() { proto.RegisterType((*DelegateCallback)(nil), "stride.stakeibc.DelegateCallback") proto.RegisterType((*ClaimCallback)(nil), "stride.stakeibc.ClaimCallback") proto.RegisterType((*ReinvestCallback)(nil), "stride.stakeibc.ReinvestCallback") + proto.RegisterType((*UndelegateCallback)(nil), "stride.stakeibc.UndelegateCallback") proto.RegisterType((*RedemptionCallback)(nil), "stride.stakeibc.RedemptionCallback") proto.RegisterType((*Rebalancing)(nil), "stride.stakeibc.Rebalancing") proto.RegisterType((*RebalanceCallback)(nil), "stride.stakeibc.RebalanceCallback") @@ -603,58 +664,59 @@ func init() { func init() { proto.RegisterFile("stride/stakeibc/callbacks.proto", fileDescriptor_f41c99b09b96a5ac) } var fileDescriptor_f41c99b09b96a5ac = []byte{ - // 805 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x4f, 0xe3, 0x46, - 0x14, 0x8f, 0x09, 0x02, 0x32, 0x09, 0x24, 0x58, 0x55, 0x1b, 0xa2, 0x28, 0x49, 0x4d, 0xd5, 0xa2, - 0x4a, 0xd8, 0x22, 0x55, 0xab, 0x56, 0xbd, 0x50, 0x40, 0x55, 0x23, 0x85, 0x4a, 0x75, 0xa0, 0x07, - 0x2e, 0xd6, 0xd8, 0x1e, 0x25, 0xa3, 0xd8, 0x33, 0xc1, 0x33, 0x09, 0x85, 0x4f, 0xd0, 0x23, 0xd7, - 0x7e, 0x84, 0xf6, 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, 0x25, - 0x84, 0x27, 0x07, 0x00, 0x00, + // 822 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x6f, 0xeb, 0x44, + 0x10, 0x8f, 0x9b, 0xa7, 0xf7, 0x5e, 0x36, 0x69, 0x93, 0x5a, 0x08, 0xd2, 0x28, 0x4a, 0x82, 0x1f, + 0x82, 0x0a, 0xa9, 0xb6, 0x5a, 0x04, 0x02, 0x71, 0x29, 0x6d, 0x85, 0x88, 0x94, 0x22, 0xe1, 0xb4, + 0x1c, 0x7a, 0xb1, 0xd6, 0xde, 0x55, 0xb2, 0x8a, 0xbd, 0x9b, 0x7a, 0x37, 0x29, 0xed, 0x27, 0xe0, + 0xd8, 0x2b, 0x1f, 0x01, 0x2e, 0x7c, 0x02, 0x2e, 0x9c, 0x7a, 0xec, 0x11, 0x71, 0x28, 0xa8, 0xfd, + 0x22, 0x68, 0xd7, 0xeb, 0x3f, 0x49, 0xa0, 0x22, 0x70, 0x4a, 0x3c, 0xf3, 0x9b, 0x9d, 0xf9, 0xcd, + 0x6f, 0x66, 0x17, 0x74, 0xb9, 0x88, 0x09, 0xc2, 0x0e, 0x17, 0x70, 0x82, 0x89, 0x1f, 0x38, 0x01, + 0x0c, 0x43, 0x1f, 0x06, 0x13, 0x6e, 0x4f, 0x63, 0x26, 0x98, 0x59, 0x4f, 0x00, 0x76, 0x0a, 0x68, + 0xbd, 0x35, 0x62, 0x23, 0xa6, 0x7c, 0x8e, 0xfc, 0x97, 0xc0, 0x5a, 0x9d, 0x80, 0xf1, 0x88, 0x71, + 0xc7, 0x87, 0x1c, 0x3b, 0xf3, 0x7d, 0x1f, 0x0b, 0xb8, 0xef, 0x04, 0x8c, 0x50, 0xed, 0x6f, 0xeb, + 0x3c, 0x31, 0x0e, 0x58, 0x8c, 0x78, 0xfa, 0xab, 0xbd, 0x2b, 0x55, 0x8c, 0x19, 0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+ 0xc2, 0xb7, 0x75, 0x6b, 0x80, 0xb6, 0x5e, 0xb0, 0x34, 0xe7, 0x62, 0xae, 0x29, 0x68, 0x13, 0x4a, + 0x04, 0x81, 0x61, 0x3e, 0x8e, 0x85, 0x65, 0x4e, 0xc6, 0x63, 0xed, 0xf1, 0x6b, 0xe9, 0x33, 0x33, + 0xba, 0xf9, 0x92, 0x1f, 0x0d, 0xee, 0x1e, 0x3b, 0xc6, 0xfd, 0x63, 0xc7, 0xf8, 0xf3, 0xb1, 0x63, + 0xdc, 0x3e, 0x75, 0x4a, 0xf7, 0x4f, 0x9d, 0xd2, 0x6f, 0x4f, 0x9d, 0xd2, 0xc5, 0x41, 0xe1, 0xf4, + 0xa1, 0xe2, 0xb9, 0x37, 0x80, 0x3e, 0x77, 0xf4, 0xfb, 0x38, 0xdf, 0xff, 0xd8, 0xf9, 0x2e, 0x7f, + 0x25, 0x55, 0x36, 0xff, 0xa5, 0x7a, 0x22, 0x3f, 0xfa, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x45, + 0xda, 0x3f, 0xec, 0x07, 0x00, 0x00, } func (m *SplitDelegation) Marshal() (dAtA []byte, err error) { @@ -828,7 +890,7 @@ func (m *ReinvestCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *RedemptionCallback) Marshal() (dAtA []byte, err error) { +func (m *UndelegateCallback) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -838,12 +900,12 @@ func (m *RedemptionCallback) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RedemptionCallback) MarshalTo(dAtA []byte) (int, error) { +func (m *UndelegateCallback) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RedemptionCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *UndelegateCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -864,6 +926,68 @@ func (m *RedemptionCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], dAtA3[:j2]) i = encodeVarintCallbacks(dAtA, i, uint64(j2)) i-- + dAtA[i] = 0x1a + } + if len(m.SplitDelegations) > 0 { + for iNdEx := len(m.SplitDelegations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SplitDelegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCallbacks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.HostZoneId) > 0 { + i -= len(m.HostZoneId) + copy(dAtA[i:], m.HostZoneId) + i = encodeVarintCallbacks(dAtA, i, uint64(len(m.HostZoneId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RedemptionCallback) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RedemptionCallback) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RedemptionCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.EpochUnbondingRecordIds) > 0 { + dAtA5 := make([]byte, len(m.EpochUnbondingRecordIds)*10) + var j4 int + for _, num := range m.EpochUnbondingRecordIds { + for num >= 1<<7 { + dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j4++ + } + dAtA5[j4] = uint8(num) + j4++ + } + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintCallbacks(dAtA, i, uint64(j4)) + i-- dAtA[i] = 0x12 } if len(m.HostZoneId) > 0 { @@ -1212,6 +1336,32 @@ func (m *ReinvestCallback) Size() (n int) { return n } +func (m *UndelegateCallback) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.HostZoneId) + if l > 0 { + n += 1 + l + sovCallbacks(uint64(l)) + } + if len(m.SplitDelegations) > 0 { + for _, e := range m.SplitDelegations { + l = e.Size() + n += 1 + l + sovCallbacks(uint64(l)) + } + } + if len(m.EpochUnbondingRecordIds) > 0 { + l = 0 + for _, e := range m.EpochUnbondingRecordIds { + l += sovCallbacks(uint64(e)) + } + n += 1 + sovCallbacks(uint64(l)) + l + } + return n +} + func (m *RedemptionCallback) Size() (n int) { if m == nil { return 0 @@ -1833,6 +1983,198 @@ func (m *ReinvestCallback) Unmarshal(dAtA []byte) error { } return nil } +func (m *UndelegateCallback) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallbacks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UndelegateCallback: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UndelegateCallback: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostZoneId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallbacks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCallbacks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCallbacks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostZoneId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SplitDelegations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallbacks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCallbacks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCallbacks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SplitDelegations = append(m.SplitDelegations, &SplitDelegation{}) + if err := m.SplitDelegations[len(m.SplitDelegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallbacks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EpochUnbondingRecordIds = append(m.EpochUnbondingRecordIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallbacks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthCallbacks + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthCallbacks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.EpochUnbondingRecordIds) == 0 { + m.EpochUnbondingRecordIds = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallbacks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EpochUnbondingRecordIds = append(m.EpochUnbondingRecordIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field EpochUnbondingRecordIds", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipCallbacks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCallbacks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *RedemptionCallback) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/stakeibc/types/tx.pb.go b/x/stakeibc/types/tx.pb.go index 51e42a2447..8f156b6bea 100644 --- a/x/stakeibc/types/tx.pb.go +++ b/x/stakeibc/types/tx.pb.go @@ -1278,102 +1278,6 @@ func (m *MsgUpdateValidatorSharesExchRateResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateValidatorSharesExchRateResponse proto.InternalMessageInfo -type MsgCalibrateDelegation struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Valoper string `protobuf:"bytes,3,opt,name=valoper,proto3" json:"valoper,omitempty"` -} - -func (m *MsgCalibrateDelegation) Reset() { *m = MsgCalibrateDelegation{} } -func (m *MsgCalibrateDelegation) String() string { return proto.CompactTextString(m) } -func (*MsgCalibrateDelegation) ProtoMessage() {} -func (*MsgCalibrateDelegation) Descriptor() ([]byte, []int) { - return fileDescriptor_9b7e09c9ad51cd54, []int{26} -} -func (m *MsgCalibrateDelegation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCalibrateDelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCalibrateDelegation.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgCalibrateDelegation) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCalibrateDelegation.Merge(m, src) -} -func (m *MsgCalibrateDelegation) XXX_Size() int { - return m.Size() -} -func (m *MsgCalibrateDelegation) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCalibrateDelegation.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCalibrateDelegation proto.InternalMessageInfo - -func (m *MsgCalibrateDelegation) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgCalibrateDelegation) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -func (m *MsgCalibrateDelegation) GetValoper() string { - if m != nil { - return m.Valoper - } - return "" -} - -type MsgCalibrateDelegationResponse struct { -} - -func (m *MsgCalibrateDelegationResponse) Reset() { *m = MsgCalibrateDelegationResponse{} } -func (m *MsgCalibrateDelegationResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCalibrateDelegationResponse) ProtoMessage() {} -func (*MsgCalibrateDelegationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9b7e09c9ad51cd54, []int{27} -} -func (m *MsgCalibrateDelegationResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCalibrateDelegationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCalibrateDelegationResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgCalibrateDelegationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCalibrateDelegationResponse.Merge(m, src) -} -func (m *MsgCalibrateDelegationResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgCalibrateDelegationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCalibrateDelegationResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCalibrateDelegationResponse proto.InternalMessageInfo - func init() { proto.RegisterType((*MsgUpdateInnerRedemptionRateBounds)(nil), "stride.stakeibc.MsgUpdateInnerRedemptionRateBounds") proto.RegisterType((*MsgUpdateInnerRedemptionRateBoundsResponse)(nil), "stride.stakeibc.MsgUpdateInnerRedemptionRateBoundsResponse") @@ -1401,105 +1305,101 @@ func init() { proto.RegisterType((*MsgRestoreInterchainAccountResponse)(nil), "stride.stakeibc.MsgRestoreInterchainAccountResponse") proto.RegisterType((*MsgUpdateValidatorSharesExchRate)(nil), "stride.stakeibc.MsgUpdateValidatorSharesExchRate") proto.RegisterType((*MsgUpdateValidatorSharesExchRateResponse)(nil), "stride.stakeibc.MsgUpdateValidatorSharesExchRateResponse") - proto.RegisterType((*MsgCalibrateDelegation)(nil), "stride.stakeibc.MsgCalibrateDelegation") - proto.RegisterType((*MsgCalibrateDelegationResponse)(nil), "stride.stakeibc.MsgCalibrateDelegationResponse") } func init() { proto.RegisterFile("stride/stakeibc/tx.proto", fileDescriptor_9b7e09c9ad51cd54) } var fileDescriptor_9b7e09c9ad51cd54 = []byte{ - // 1451 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4d, 0x6f, 0xdb, 0x46, - 0x13, 0x36, 0x63, 0xc7, 0x51, 0xc6, 0xf2, 0x17, 0xed, 0x38, 0x34, 0xf3, 0x46, 0x52, 0xe8, 0xf7, - 0xc3, 0x6f, 0x1a, 0x4b, 0xb0, 0x9d, 0xa2, 0x68, 0xda, 0x1e, 0x2c, 0x3b, 0x45, 0x05, 0x44, 0x41, - 0x41, 0x27, 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7, 0x23, 0x36, 0xd7, 0x23, 0xe3, - 0xb5, 0xcc, 0xd7, 0x8f, 0xf3, 0x13, 0x7f, 0x3f, 0xce, 0x4f, 0x68, 0x17, 0xe1, 0x42, 0x4a, 0xce, - 0x8a, 0x9c, 0xfe, 0x4a, 0xe2, 0x92, 0xb5, 0xeb, 0x22, 0xc7, 0xbb, 0x4d, 0x2c, 0xec, 0x62, 0x1b, - 0x85, 0xd8, 0xe2, 0xb2, 0x36, 0xea, 0xe5, 0x2d, 0x40, 0x56, 0x94, 0x57, 0x57, 0x6f, 0xa0, 0x53, - 0x61, 0x15, 0x4b, 0x5e, 0x86, 0xd3, 0xb8, 0xe1, 0x9b, 0x75, 0x5e, 0x7c, 0x53, 0x7a, 0x34, 0x90, - 0x57, 0x60, 0x9a, 0x62, 0x62, 0x89, 0xba, 0x8b, 0x47, 0xda, 0x1a, 0x5c, 0x1a, 0x4a, 0x43, 0x90, - 0x0d, 0xe3, 0xd2, 0xac, 0x45, 0x02, 0xf3, 0x49, 0xa7, 0xff, 0x18, 0x45, 0xb4, 0x4f, 0x07, 0x4e, - 0x25, 0x74, 0x60, 0x0d, 0x66, 0x49, 0xd3, 0x33, 0x82, 0xce, 0x8e, 0x31, 0xd7, 0x2c, 0x69, 0x7a, - 0xc2, 0x8b, 0x56, 0x80, 0x5c, 0xba, 0xd7, 0xde, 0x20, 0x2e, 0x54, 0xa9, 0xbd, 0x63, 0x59, 0xaf, - 0x4f, 0xe9, 0x1a, 0x80, 0xe8, 0xab, 0xa8, 0x32, 0x59, 0x98, 0x5c, 0x9f, 0xd9, 0x52, 0x8b, 0x89, - 0x76, 0xad, 0x28, 0xfc, 0xe8, 0x3d, 0x68, 0x4d, 0x05, 0x25, 0x49, 0x43, 0x70, 0xfc, 0x49, 0xe2, - 0x46, 0x56, 0x7f, 0x76, 0xf7, 0x0c, 0x77, 0xb0, 0x63, 0xd7, 0xc3, 0xe3, 0x72, 0xdd, 0x86, 0xcc, - 0x01, 0x72, 0x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x6f, 0xee, 0xa6, 0x29, 0x68, 0x6a, 0xee, 0xa6, 0x00, 0xd3, 0x73, 0x77, 0x84, 0x54, 0xca, 0x77, - 0x21, 0xdb, 0xf7, 0x0b, 0xb6, 0x90, 0x5e, 0x70, 0x5d, 0x84, 0xba, 0x3e, 0x0e, 0x21, 0xf6, 0xfe, - 0x5e, 0x82, 0xfc, 0xb8, 0xef, 0x47, 0xdb, 0xc3, 0x63, 0x35, 0x74, 0x91, 0xfa, 0xde, 0x31, 0x16, - 0x75, 0x58, 0x95, 0x6f, 0x3c, 0x7d, 0x91, 0x93, 0x9e, 0xbd, 0xc8, 0x49, 0x7f, 0xbd, 0xc8, 0x49, - 0xdf, 0xbe, 0xcc, 0x4d, 0x3c, 0x7b, 0x99, 0x9b, 0xf8, 0xe3, 0x65, 0x6e, 0xe2, 0xee, 0x56, 0xcf, - 0x4f, 0x83, 0x7d, 0xee, 0x60, 0xe3, 0x06, 0xaa, 0xd1, 0x52, 0xfc, 0x6d, 0xed, 0x60, 0xf3, 0xed, - 0x52, 0xab, 0xe7, 0x7b, 0x1d, 0xfb, 0xa9, 0x50, 0x9b, 0xe6, 0x5f, 0xcb, 0xb6, 0xff, 0x09, 0x00, - 0x00, 0xff, 0xff, 0x87, 0x28, 0x7d, 0x8b, 0xcf, 0x13, 0x00, 0x00, + // 1410 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xcf, 0x36, 0x69, 0x9a, 0xbe, 0x38, 0xbf, 0x36, 0x69, 0xba, 0xd9, 0x7e, 0x6b, 0xbb, 0x9b, + 0x2f, 0x10, 0x4a, 0x63, 0x2b, 0x49, 0x11, 0xa2, 0xc0, 0x21, 0x4e, 0x8a, 0xb0, 0x54, 0x57, 0x68, + 0xd3, 0x52, 0xa9, 0x12, 0x5a, 0xc6, 0xbb, 0xd3, 0x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 0xf5, 0x83, 0x63, 0x2c, 0xea, 0xaa, 0xaa, 0x5c, 0x7b, 0xfc, 0x2c, 0x2f, + 0x3d, 0x79, 0x96, 0x97, 0xfe, 0x79, 0x96, 0x97, 0xbe, 0x7f, 0x9e, 0x1f, 0x7b, 0xf2, 0x3c, 0x3f, + 0xf6, 0xd7, 0xf3, 0xfc, 0xd8, 0xed, 0xcd, 0xbe, 0xf6, 0x78, 0x8f, 0x13, 0xac, 0x5f, 0x43, 0x75, + 0x5a, 0x8e, 0xbf, 0x2f, 0xed, 0x6f, 0xbc, 0x5b, 0x6e, 0xf7, 0x7d, 0xb3, 0x62, 0xed, 0x72, 0x7d, + 0x92, 0x7f, 0x31, 0xda, 0xfa, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x92, 0xfd, 0x84, 0xf9, 0xd3, 0x12, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1525,7 +1425,6 @@ type MsgClient interface { DeleteValidator(ctx context.Context, in *MsgDeleteValidator, opts ...grpc.CallOption) (*MsgDeleteValidatorResponse, error) RestoreInterchainAccount(ctx context.Context, in *MsgRestoreInterchainAccount, opts ...grpc.CallOption) (*MsgRestoreInterchainAccountResponse, error) UpdateValidatorSharesExchRate(ctx context.Context, in *MsgUpdateValidatorSharesExchRate, opts ...grpc.CallOption) (*MsgUpdateValidatorSharesExchRateResponse, error) - CalibrateDelegation(ctx context.Context, in *MsgCalibrateDelegation, opts ...grpc.CallOption) (*MsgCalibrateDelegationResponse, error) ClearBalance(ctx context.Context, in *MsgClearBalance, opts ...grpc.CallOption) (*MsgClearBalanceResponse, error) UpdateInnerRedemptionRateBounds(ctx context.Context, in *MsgUpdateInnerRedemptionRateBounds, opts ...grpc.CallOption) (*MsgUpdateInnerRedemptionRateBoundsResponse, error) } @@ -1637,15 +1536,6 @@ func (c *msgClient) UpdateValidatorSharesExchRate(ctx context.Context, in *MsgUp return out, nil } -func (c *msgClient) CalibrateDelegation(ctx context.Context, in *MsgCalibrateDelegation, opts ...grpc.CallOption) (*MsgCalibrateDelegationResponse, error) { - out := new(MsgCalibrateDelegationResponse) - err := c.cc.Invoke(ctx, "/stride.stakeibc.Msg/CalibrateDelegation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) ClearBalance(ctx context.Context, in *MsgClearBalance, opts ...grpc.CallOption) (*MsgClearBalanceResponse, error) { out := new(MsgClearBalanceResponse) err := c.cc.Invoke(ctx, "/stride.stakeibc.Msg/ClearBalance", in, out, opts...) @@ -1677,7 +1567,6 @@ type MsgServer interface { DeleteValidator(context.Context, *MsgDeleteValidator) (*MsgDeleteValidatorResponse, error) RestoreInterchainAccount(context.Context, *MsgRestoreInterchainAccount) (*MsgRestoreInterchainAccountResponse, error) UpdateValidatorSharesExchRate(context.Context, *MsgUpdateValidatorSharesExchRate) (*MsgUpdateValidatorSharesExchRateResponse, error) - CalibrateDelegation(context.Context, *MsgCalibrateDelegation) (*MsgCalibrateDelegationResponse, error) ClearBalance(context.Context, *MsgClearBalance) (*MsgClearBalanceResponse, error) UpdateInnerRedemptionRateBounds(context.Context, *MsgUpdateInnerRedemptionRateBounds) (*MsgUpdateInnerRedemptionRateBoundsResponse, error) } @@ -1719,9 +1608,6 @@ func (*UnimplementedMsgServer) RestoreInterchainAccount(ctx context.Context, req func (*UnimplementedMsgServer) UpdateValidatorSharesExchRate(ctx context.Context, req *MsgUpdateValidatorSharesExchRate) (*MsgUpdateValidatorSharesExchRateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateValidatorSharesExchRate not implemented") } -func (*UnimplementedMsgServer) CalibrateDelegation(ctx context.Context, req *MsgCalibrateDelegation) (*MsgCalibrateDelegationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CalibrateDelegation not implemented") -} func (*UnimplementedMsgServer) ClearBalance(ctx context.Context, req *MsgClearBalance) (*MsgClearBalanceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ClearBalance not implemented") } @@ -1931,24 +1817,6 @@ func _Msg_UpdateValidatorSharesExchRate_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } -func _Msg_CalibrateDelegation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCalibrateDelegation) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CalibrateDelegation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/stride.stakeibc.Msg/CalibrateDelegation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CalibrateDelegation(ctx, req.(*MsgCalibrateDelegation)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_ClearBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgClearBalance) if err := dec(in); err != nil { @@ -2033,10 +1901,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateValidatorSharesExchRate", Handler: _Msg_UpdateValidatorSharesExchRate_Handler, }, - { - MethodName: "CalibrateDelegation", - Handler: _Msg_CalibrateDelegation_Handler, - }, { MethodName: "ClearBalance", Handler: _Msg_ClearBalance_Handler, @@ -3039,73 +2903,6 @@ func (m *MsgUpdateValidatorSharesExchRateResponse) MarshalToSizedBuffer(dAtA []b return len(dAtA) - i, nil } -func (m *MsgCalibrateDelegation) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgCalibrateDelegation) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCalibrateDelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Valoper) > 0 { - i -= len(m.Valoper) - copy(dAtA[i:], m.Valoper) - i = encodeVarintTx(dAtA, i, uint64(len(m.Valoper))) - i-- - dAtA[i] = 0x1a - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgCalibrateDelegationResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgCalibrateDelegationResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCalibrateDelegationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -3538,36 +3335,6 @@ func (m *MsgUpdateValidatorSharesExchRateResponse) Size() (n int) { return n } -func (m *MsgCalibrateDelegation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Valoper) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgCalibrateDelegationResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -6467,202 +6234,6 @@ func (m *MsgUpdateValidatorSharesExchRateResponse) Unmarshal(dAtA []byte) error } return nil } -func (m *MsgCalibrateDelegation) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgCalibrateDelegation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCalibrateDelegation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Valoper", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Valoper = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCalibrateDelegationResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgCalibrateDelegationResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCalibrateDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 876b1e0c5d62be5bd140fe01d945255910a3cef1 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:31:23 -0500 Subject: [PATCH 06/26] calibration: logic cleanup --- x/stakeibc/client/cli/tx.go | 1 - x/stakeibc/handler.go | 3 - x/stakeibc/keeper/icqcallbacks.go | 2 - .../icqcallbacks_callibrate_delegation.go | 110 ------------------ .../keeper/msg_server_calibrate_delegation.go | 25 ---- x/stakeibc/keeper/msg_server_submit_tx.go | 58 --------- x/stakeibc/types/codec.go | 2 - .../types/message_calibrate_delegation.go | 66 ----------- 8 files changed, 267 deletions(-) delete mode 100644 x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go delete mode 100644 x/stakeibc/keeper/msg_server_calibrate_delegation.go delete mode 100644 x/stakeibc/types/message_calibrate_delegation.go diff --git a/x/stakeibc/client/cli/tx.go b/x/stakeibc/client/cli/tx.go index 25649a5aa7..b7a47e2124 100644 --- a/x/stakeibc/client/cli/tx.go +++ b/x/stakeibc/client/cli/tx.go @@ -35,7 +35,6 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdDeleteValidator()) cmd.AddCommand(CmdRestoreInterchainAccount()) cmd.AddCommand(CmdUpdateValidatorSharesExchRate()) - cmd.AddCommand(CmdCalibrateDelegation()) cmd.AddCommand(CmdClearBalance()) cmd.AddCommand(CmdUpdateInnerRedemptionRateBounds()) diff --git a/x/stakeibc/handler.go b/x/stakeibc/handler.go index 14245e6cb4..ca7d14835e 100644 --- a/x/stakeibc/handler.go +++ b/x/stakeibc/handler.go @@ -58,9 +58,6 @@ func NewMessageHandler(k keeper.Keeper) sdk.Handler { case *types.MsgUpdateValidatorSharesExchRate: res, err := msgServer.UpdateValidatorSharesExchRate(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgCalibrateDelegation: - res, err := msgServer.CalibrateDelegation(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) case *types.MsgUpdateInnerRedemptionRateBounds: res, err := msgServer.UpdateInnerRedemptionRateBounds(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) diff --git a/x/stakeibc/keeper/icqcallbacks.go b/x/stakeibc/keeper/icqcallbacks.go index 3c4518d08d..deea1957b2 100644 --- a/x/stakeibc/keeper/icqcallbacks.go +++ b/x/stakeibc/keeper/icqcallbacks.go @@ -11,7 +11,6 @@ const ( ICQCallbackID_FeeBalance = "feebalance" ICQCallbackID_Delegation = "delegation" ICQCallbackID_Validator = "validator" - ICQCallbackID_Calibrate = "calibrate" ) // ICQCallbacks wrapper struct for stakeibc keeper @@ -48,5 +47,4 @@ func (c ICQCallbacks) RegisterICQCallbacks() icqtypes.QueryCallbacks { AddICQCallback(ICQCallbackID_FeeBalance, ICQCallback(FeeBalanceCallback)). AddICQCallback(ICQCallbackID_Delegation, ICQCallback(DelegatorSharesCallback)). AddICQCallback(ICQCallbackID_Validator, ICQCallback(ValidatorSharesToTokensRateCallback)). - AddICQCallback(ICQCallbackID_Calibrate, ICQCallback(CalibrateDelegationCallback)) } diff --git a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go deleted file mode 100644 index f258a16a29..0000000000 --- a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go +++ /dev/null @@ -1,110 +0,0 @@ -package keeper - -import ( - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/gogoproto/proto" - - "github.com/Stride-Labs/stride/v15/utils" - icqtypes "github.com/Stride-Labs/stride/v15/x/interchainquery/types" - "github.com/Stride-Labs/stride/v15/x/stakeibc/types" -) - -// DelegatorSharesCallback is a callback handler for UpdateValidatorSharesExchRate queries. -// -// In an attempt to get the ICA's delegation amount on a given validator, we have to query: -// 1. the validator's internal shares to tokens rate -// 2. the Delegation ICA's delegated shares -// And apply the following equation: -// numTokens = numShares * sharesToTokensRate -// -// This is the callback from query #2 -// -// Note: for now, to get proofs in your ICQs, you need to query the entire store on the host zone! e.g. "store/bank/key" -func CalibrateDelegationCallback(k Keeper, ctx sdk.Context, args []byte, query icqtypes.Query) error { - k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(query.ChainId, ICQCallbackID_Calibrate, - "Starting delegator shares callback, QueryId: %vs, QueryType: %s, Connection: %s", query.Id, query.QueryType, query.ConnectionId)) - - // Confirm host exists - chainId := query.ChainId - hostZone, found := k.GetHostZone(ctx, chainId) - if !found { - return errorsmod.Wrapf(types.ErrHostZoneNotFound, "no registered zone for queried chain ID (%s)", chainId) - } - - // Unmarshal the query response which returns a delegation object for the delegator/validator pair - queriedDelegation := stakingtypes.Delegation{} - err := k.cdc.Unmarshal(args, &queriedDelegation) - if err != nil { - return errorsmod.Wrapf(err, "unable to unmarshal delegator shares query response into Delegation type") - } - k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, "Query response - Delegator: %s, Validator: %s, Shares: %v", - queriedDelegation.DelegatorAddress, queriedDelegation.ValidatorAddress, queriedDelegation.Shares)) - - // Unmarshal the callback data containing the previous delegation to the validator (from the time the query was submitted) - var callbackData types.DelegatorSharesQueryCallback - if err := proto.Unmarshal(query.CallbackData, &callbackData); err != nil { - return errorsmod.Wrapf(err, "unable to unmarshal delegator shares callback data") - } - - // Grab the validator object from the hostZone using the address returned from the query - validator, valIndex, found := GetValidatorFromAddress(hostZone.Validators, queriedDelegation.ValidatorAddress) - if !found { - return errorsmod.Wrapf(types.ErrValidatorNotFound, "no registered validator for address (%s)", queriedDelegation.ValidatorAddress) - } - - // Check if the ICQ overlapped a delegation, undelegation, or detokenization ICA - // that would have modfied the number of delegated tokens - prevInternalDelegation := callbackData.InitialValidatorDelegation - currInternalDelegation := validator.Delegation - icaOverlappedIcq, err := k.CheckDelegationChangedDuringQuery(ctx, validator, prevInternalDelegation, currInternalDelegation) - if err != nil { - return err - } - - // If the ICA/ICQ overlapped, submit a new query - if icaOverlappedIcq { - // Store the updated validator delegation amount - callbackDataBz, err := proto.Marshal(&types.DelegatorSharesQueryCallback{ - InitialValidatorDelegation: currInternalDelegation, - }) - if err != nil { - return errorsmod.Wrapf(err, "unable to marshal delegator shares callback data") - } - query.CallbackData = callbackDataBz - - if err := k.InterchainQueryKeeper.RetryICQRequest(ctx, query); err != nil { - return errorsmod.Wrapf(err, "unable to resubmit delegator shares query") - } - return nil - } - - // If there was no ICA/ICQ overlap, update the validator to indicate that the query - // is no longer in progress (which will unblock LSM liquid stakes to that validator) - validator.SlashQueryInProgress = false - - // Calculate the number of tokens delegated (using the internal sharesToTokensRate) - // note: truncateInt per https://github.com/cosmos/cosmos-sdk/blob/cb31043d35bad90c4daa923bb109f38fd092feda/x/staking/types/validator.go#L431 - delegatedTokens := queriedDelegation.Shares.Mul(validator.SharesToTokensRate).TruncateInt() - k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, - "Previous Delegation: %v, Current Delegation: %v", validator.Delegation, delegatedTokens)) - - // Confirm the validator has actually been slashed - if delegatedTokens.Equal(validator.Delegation) { - k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, "Validator delegation is correct")) - return nil - } - - delegationChange := validator.Delegation.Sub(delegatedTokens) - validator.Delegation = validator.Delegation.Sub(delegationChange) - hostZone.TotalDelegations = hostZone.TotalDelegations.Sub(delegationChange) - - k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, - "Delegation updated to: %v", validator.Delegation)) - - hostZone.Validators[valIndex] = &validator - k.SetHostZone(ctx, hostZone) - - return nil -} diff --git a/x/stakeibc/keeper/msg_server_calibrate_delegation.go b/x/stakeibc/keeper/msg_server_calibrate_delegation.go deleted file mode 100644 index ab44eabe26..0000000000 --- a/x/stakeibc/keeper/msg_server_calibrate_delegation.go +++ /dev/null @@ -1,25 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/Stride-Labs/stride/v15/x/stakeibc/types" -) - -// Submits an ICQ to get the validator's delegated shares -func (k msgServer) CalibrateDelegation(goCtx context.Context, msg *types.MsgCalibrateDelegation) (*types.MsgCalibrateDelegationResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - hostZone, found := k.GetHostZone(ctx, msg.ChainId) - if !found { - return nil, types.ErrHostZoneNotFound - } - - if err := k.SubmitCalibrationICQ(ctx, hostZone, msg.Valoper); err != nil { - return nil, err - } - - return &types.MsgCalibrateDelegationResponse{}, nil -} diff --git a/x/stakeibc/keeper/msg_server_submit_tx.go b/x/stakeibc/keeper/msg_server_submit_tx.go index e9b2f5f12a..5bfaeedf03 100644 --- a/x/stakeibc/keeper/msg_server_submit_tx.go +++ b/x/stakeibc/keeper/msg_server_submit_tx.go @@ -492,61 +492,3 @@ func (k Keeper) SubmitDelegationICQ(ctx sdk.Context, hostZone types.HostZone, va return nil } - -// Submits an ICQ to get a validator's delegations -// This is called after the validator's sharesToTokens rate is determined -// The timeoutDuration parameter represents the length of the timeout (not to be confused with an actual timestamp) -func (k Keeper) SubmitCalibrationICQ(ctx sdk.Context, hostZone types.HostZone, validatorAddress string) error { - if hostZone.DelegationIcaAddress == "" { - return errorsmod.Wrapf(types.ErrICAAccountNotFound, "no delegation address found for %s", hostZone.ChainId) - } - validator, valIndex, found := GetValidatorFromAddress(hostZone.Validators, validatorAddress) - if !found { - return errorsmod.Wrapf(types.ErrValidatorNotFound, "no registered validator for address (%s)", validatorAddress) - } - - // Get the validator and delegator encoded addresses to form the query request - _, validatorAddressBz, err := bech32.DecodeAndConvert(validatorAddress) - if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "invalid validator address, could not decode (%s)", err.Error()) - } - _, delegatorAddressBz, err := bech32.DecodeAndConvert(hostZone.DelegationIcaAddress) - if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "invalid delegator address, could not decode (%s)", err.Error()) - } - queryData := stakingtypes.GetDelegationKey(delegatorAddressBz, validatorAddressBz) - - // Store the current validator's delegation in the callback data so we can determine if it changed - // while the query was in flight - callbackData := types.DelegatorSharesQueryCallback{ - InitialValidatorDelegation: validator.Delegation, - } - callbackDataBz, err := proto.Marshal(&callbackData) - if err != nil { - return errorsmod.Wrapf(err, "unable to marshal delegator shares callback data") - } - - // Update the validator to indicate that the slash query is in progress - validator.SlashQueryInProgress = true - hostZone.Validators[valIndex] = &validator - k.SetHostZone(ctx, hostZone) - - // Submit delegator shares ICQ - query := icqtypes.Query{ - ChainId: hostZone.ChainId, - ConnectionId: hostZone.ConnectionId, - QueryType: icqtypes.STAKING_STORE_QUERY_WITH_PROOF, - RequestData: queryData, - CallbackModule: types.ModuleName, - CallbackId: ICQCallbackID_Calibrate, - CallbackData: callbackDataBz, - TimeoutDuration: time.Hour, - TimeoutPolicy: icqtypes.TimeoutPolicy_RETRY_QUERY_REQUEST, - } - if err := k.InterchainQueryKeeper.SubmitICQRequest(ctx, query, false); err != nil { - k.Logger(ctx).Error(fmt.Sprintf("Error submitting ICQ for delegation, error : %s", err.Error())) - return err - } - - return nil -} diff --git a/x/stakeibc/types/codec.go b/x/stakeibc/types/codec.go index c28fb0b674..e0f63edc89 100644 --- a/x/stakeibc/types/codec.go +++ b/x/stakeibc/types/codec.go @@ -23,7 +23,6 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&ToggleLSMProposal{}, "stakeibc/ToggleLSMProposal", nil) cdc.RegisterConcrete(&MsgRestoreInterchainAccount{}, "stakeibc/RestoreInterchainAccount", nil) cdc.RegisterConcrete(&MsgUpdateValidatorSharesExchRate{}, "stakeibc/UpdateValidatorSharesExchRate", nil) - cdc.RegisterConcrete(&MsgCalibrateDelegation{}, "stakeibc/CalibrateDelegation", nil) cdc.RegisterConcrete(&MsgUpdateInnerRedemptionRateBounds{}, "stakeibc/UpdateInnerRedemptionRateBounds", nil) // this line is used by starport scaffolding # 2 } @@ -41,7 +40,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgDeleteValidator{}, &MsgRestoreInterchainAccount{}, &MsgUpdateValidatorSharesExchRate{}, - &MsgCalibrateDelegation{}, &MsgUpdateInnerRedemptionRateBounds{}, ) diff --git a/x/stakeibc/types/message_calibrate_delegation.go b/x/stakeibc/types/message_calibrate_delegation.go deleted file mode 100644 index a1c160c831..0000000000 --- a/x/stakeibc/types/message_calibrate_delegation.go +++ /dev/null @@ -1,66 +0,0 @@ -package types - -import ( - "strings" - - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/Stride-Labs/stride/v15/utils" -) - -const TypeMsgCalibrateDelegation = "calibrate_delegation" - -var _ sdk.Msg = &MsgCalibrateDelegation{} - -func NewMsgCalibrateDelegation(creator string, chainid string, valoper string) *MsgCalibrateDelegation { - return &MsgCalibrateDelegation{ - Creator: creator, - ChainId: chainid, - Valoper: valoper, - } -} - -func (msg *MsgCalibrateDelegation) Route() string { - return RouterKey -} - -func (msg *MsgCalibrateDelegation) Type() string { - return TypeMsgCalibrateDelegation -} - -func (msg *MsgCalibrateDelegation) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgCalibrateDelegation) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgCalibrateDelegation) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - if err := utils.ValidateAdminAddress(msg.Creator); err != nil { - return err - } - - if len(msg.ChainId) == 0 { - return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "chainid is required") - } - if len(msg.Valoper) == 0 { - return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "valoper is required") - } - if !strings.Contains(msg.Valoper, "valoper") { - return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "validator operator address must contrain 'valoper'") - } - - return nil -} From 00f5f27c8e066bb82943b2f6d9c3e7fe5844852c Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:33:59 -0500 Subject: [PATCH 07/26] calibration: fix typo --- x/stakeibc/keeper/icqcallbacks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/stakeibc/keeper/icqcallbacks.go b/x/stakeibc/keeper/icqcallbacks.go index deea1957b2..2e7b6df75e 100644 --- a/x/stakeibc/keeper/icqcallbacks.go +++ b/x/stakeibc/keeper/icqcallbacks.go @@ -46,5 +46,5 @@ func (c ICQCallbacks) RegisterICQCallbacks() icqtypes.QueryCallbacks { AddICQCallback(ICQCallbackID_WithdrawalBalance, ICQCallback(WithdrawalBalanceCallback)). AddICQCallback(ICQCallbackID_FeeBalance, ICQCallback(FeeBalanceCallback)). AddICQCallback(ICQCallbackID_Delegation, ICQCallback(DelegatorSharesCallback)). - AddICQCallback(ICQCallbackID_Validator, ICQCallback(ValidatorSharesToTokensRateCallback)). + AddICQCallback(ICQCallbackID_Validator, ICQCallback(ValidatorSharesToTokensRateCallback)) } From 2541d18bce2cf6b049edd930b9d9532c4c765867 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:36:03 -0500 Subject: [PATCH 08/26] Revert "calibration: fix typo" This reverts commit 00f5f27c8e066bb82943b2f6d9c3e7fe5844852c. --- x/stakeibc/keeper/icqcallbacks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/stakeibc/keeper/icqcallbacks.go b/x/stakeibc/keeper/icqcallbacks.go index 2e7b6df75e..deea1957b2 100644 --- a/x/stakeibc/keeper/icqcallbacks.go +++ b/x/stakeibc/keeper/icqcallbacks.go @@ -46,5 +46,5 @@ func (c ICQCallbacks) RegisterICQCallbacks() icqtypes.QueryCallbacks { AddICQCallback(ICQCallbackID_WithdrawalBalance, ICQCallback(WithdrawalBalanceCallback)). AddICQCallback(ICQCallbackID_FeeBalance, ICQCallback(FeeBalanceCallback)). AddICQCallback(ICQCallbackID_Delegation, ICQCallback(DelegatorSharesCallback)). - AddICQCallback(ICQCallbackID_Validator, ICQCallback(ValidatorSharesToTokensRateCallback)) + AddICQCallback(ICQCallbackID_Validator, ICQCallback(ValidatorSharesToTokensRateCallback)). } From 7f8e57e4d488ac91e8969f568e4da7303baa4cbf Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:36:09 -0500 Subject: [PATCH 09/26] Revert "calibration: logic cleanup" This reverts commit 876b1e0c5d62be5bd140fe01d945255910a3cef1. --- x/stakeibc/client/cli/tx.go | 1 + x/stakeibc/handler.go | 3 + x/stakeibc/keeper/icqcallbacks.go | 2 + .../icqcallbacks_callibrate_delegation.go | 110 ++++++++++++++++++ .../keeper/msg_server_calibrate_delegation.go | 25 ++++ x/stakeibc/keeper/msg_server_submit_tx.go | 58 +++++++++ x/stakeibc/types/codec.go | 2 + .../types/message_calibrate_delegation.go | 66 +++++++++++ 8 files changed, 267 insertions(+) create mode 100644 x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go create mode 100644 x/stakeibc/keeper/msg_server_calibrate_delegation.go create mode 100644 x/stakeibc/types/message_calibrate_delegation.go diff --git a/x/stakeibc/client/cli/tx.go b/x/stakeibc/client/cli/tx.go index b7a47e2124..25649a5aa7 100644 --- a/x/stakeibc/client/cli/tx.go +++ b/x/stakeibc/client/cli/tx.go @@ -35,6 +35,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdDeleteValidator()) cmd.AddCommand(CmdRestoreInterchainAccount()) cmd.AddCommand(CmdUpdateValidatorSharesExchRate()) + cmd.AddCommand(CmdCalibrateDelegation()) cmd.AddCommand(CmdClearBalance()) cmd.AddCommand(CmdUpdateInnerRedemptionRateBounds()) diff --git a/x/stakeibc/handler.go b/x/stakeibc/handler.go index ca7d14835e..14245e6cb4 100644 --- a/x/stakeibc/handler.go +++ b/x/stakeibc/handler.go @@ -58,6 +58,9 @@ func NewMessageHandler(k keeper.Keeper) sdk.Handler { case *types.MsgUpdateValidatorSharesExchRate: res, err := msgServer.UpdateValidatorSharesExchRate(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgCalibrateDelegation: + res, err := msgServer.CalibrateDelegation(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgUpdateInnerRedemptionRateBounds: res, err := msgServer.UpdateInnerRedemptionRateBounds(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) diff --git a/x/stakeibc/keeper/icqcallbacks.go b/x/stakeibc/keeper/icqcallbacks.go index deea1957b2..3c4518d08d 100644 --- a/x/stakeibc/keeper/icqcallbacks.go +++ b/x/stakeibc/keeper/icqcallbacks.go @@ -11,6 +11,7 @@ const ( ICQCallbackID_FeeBalance = "feebalance" ICQCallbackID_Delegation = "delegation" ICQCallbackID_Validator = "validator" + ICQCallbackID_Calibrate = "calibrate" ) // ICQCallbacks wrapper struct for stakeibc keeper @@ -47,4 +48,5 @@ func (c ICQCallbacks) RegisterICQCallbacks() icqtypes.QueryCallbacks { AddICQCallback(ICQCallbackID_FeeBalance, ICQCallback(FeeBalanceCallback)). AddICQCallback(ICQCallbackID_Delegation, ICQCallback(DelegatorSharesCallback)). AddICQCallback(ICQCallbackID_Validator, ICQCallback(ValidatorSharesToTokensRateCallback)). + AddICQCallback(ICQCallbackID_Calibrate, ICQCallback(CalibrateDelegationCallback)) } diff --git a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go new file mode 100644 index 0000000000..f258a16a29 --- /dev/null +++ b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go @@ -0,0 +1,110 @@ +package keeper + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/cosmos/gogoproto/proto" + + "github.com/Stride-Labs/stride/v15/utils" + icqtypes "github.com/Stride-Labs/stride/v15/x/interchainquery/types" + "github.com/Stride-Labs/stride/v15/x/stakeibc/types" +) + +// DelegatorSharesCallback is a callback handler for UpdateValidatorSharesExchRate queries. +// +// In an attempt to get the ICA's delegation amount on a given validator, we have to query: +// 1. the validator's internal shares to tokens rate +// 2. the Delegation ICA's delegated shares +// And apply the following equation: +// numTokens = numShares * sharesToTokensRate +// +// This is the callback from query #2 +// +// Note: for now, to get proofs in your ICQs, you need to query the entire store on the host zone! e.g. "store/bank/key" +func CalibrateDelegationCallback(k Keeper, ctx sdk.Context, args []byte, query icqtypes.Query) error { + k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(query.ChainId, ICQCallbackID_Calibrate, + "Starting delegator shares callback, QueryId: %vs, QueryType: %s, Connection: %s", query.Id, query.QueryType, query.ConnectionId)) + + // Confirm host exists + chainId := query.ChainId + hostZone, found := k.GetHostZone(ctx, chainId) + if !found { + return errorsmod.Wrapf(types.ErrHostZoneNotFound, "no registered zone for queried chain ID (%s)", chainId) + } + + // Unmarshal the query response which returns a delegation object for the delegator/validator pair + queriedDelegation := stakingtypes.Delegation{} + err := k.cdc.Unmarshal(args, &queriedDelegation) + if err != nil { + return errorsmod.Wrapf(err, "unable to unmarshal delegator shares query response into Delegation type") + } + k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, "Query response - Delegator: %s, Validator: %s, Shares: %v", + queriedDelegation.DelegatorAddress, queriedDelegation.ValidatorAddress, queriedDelegation.Shares)) + + // Unmarshal the callback data containing the previous delegation to the validator (from the time the query was submitted) + var callbackData types.DelegatorSharesQueryCallback + if err := proto.Unmarshal(query.CallbackData, &callbackData); err != nil { + return errorsmod.Wrapf(err, "unable to unmarshal delegator shares callback data") + } + + // Grab the validator object from the hostZone using the address returned from the query + validator, valIndex, found := GetValidatorFromAddress(hostZone.Validators, queriedDelegation.ValidatorAddress) + if !found { + return errorsmod.Wrapf(types.ErrValidatorNotFound, "no registered validator for address (%s)", queriedDelegation.ValidatorAddress) + } + + // Check if the ICQ overlapped a delegation, undelegation, or detokenization ICA + // that would have modfied the number of delegated tokens + prevInternalDelegation := callbackData.InitialValidatorDelegation + currInternalDelegation := validator.Delegation + icaOverlappedIcq, err := k.CheckDelegationChangedDuringQuery(ctx, validator, prevInternalDelegation, currInternalDelegation) + if err != nil { + return err + } + + // If the ICA/ICQ overlapped, submit a new query + if icaOverlappedIcq { + // Store the updated validator delegation amount + callbackDataBz, err := proto.Marshal(&types.DelegatorSharesQueryCallback{ + InitialValidatorDelegation: currInternalDelegation, + }) + if err != nil { + return errorsmod.Wrapf(err, "unable to marshal delegator shares callback data") + } + query.CallbackData = callbackDataBz + + if err := k.InterchainQueryKeeper.RetryICQRequest(ctx, query); err != nil { + return errorsmod.Wrapf(err, "unable to resubmit delegator shares query") + } + return nil + } + + // If there was no ICA/ICQ overlap, update the validator to indicate that the query + // is no longer in progress (which will unblock LSM liquid stakes to that validator) + validator.SlashQueryInProgress = false + + // Calculate the number of tokens delegated (using the internal sharesToTokensRate) + // note: truncateInt per https://github.com/cosmos/cosmos-sdk/blob/cb31043d35bad90c4daa923bb109f38fd092feda/x/staking/types/validator.go#L431 + delegatedTokens := queriedDelegation.Shares.Mul(validator.SharesToTokensRate).TruncateInt() + k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, + "Previous Delegation: %v, Current Delegation: %v", validator.Delegation, delegatedTokens)) + + // Confirm the validator has actually been slashed + if delegatedTokens.Equal(validator.Delegation) { + k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, "Validator delegation is correct")) + return nil + } + + delegationChange := validator.Delegation.Sub(delegatedTokens) + validator.Delegation = validator.Delegation.Sub(delegationChange) + hostZone.TotalDelegations = hostZone.TotalDelegations.Sub(delegationChange) + + k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, + "Delegation updated to: %v", validator.Delegation)) + + hostZone.Validators[valIndex] = &validator + k.SetHostZone(ctx, hostZone) + + return nil +} diff --git a/x/stakeibc/keeper/msg_server_calibrate_delegation.go b/x/stakeibc/keeper/msg_server_calibrate_delegation.go new file mode 100644 index 0000000000..ab44eabe26 --- /dev/null +++ b/x/stakeibc/keeper/msg_server_calibrate_delegation.go @@ -0,0 +1,25 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/Stride-Labs/stride/v15/x/stakeibc/types" +) + +// Submits an ICQ to get the validator's delegated shares +func (k msgServer) CalibrateDelegation(goCtx context.Context, msg *types.MsgCalibrateDelegation) (*types.MsgCalibrateDelegationResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + hostZone, found := k.GetHostZone(ctx, msg.ChainId) + if !found { + return nil, types.ErrHostZoneNotFound + } + + if err := k.SubmitCalibrationICQ(ctx, hostZone, msg.Valoper); err != nil { + return nil, err + } + + return &types.MsgCalibrateDelegationResponse{}, nil +} diff --git a/x/stakeibc/keeper/msg_server_submit_tx.go b/x/stakeibc/keeper/msg_server_submit_tx.go index 5bfaeedf03..e9b2f5f12a 100644 --- a/x/stakeibc/keeper/msg_server_submit_tx.go +++ b/x/stakeibc/keeper/msg_server_submit_tx.go @@ -492,3 +492,61 @@ func (k Keeper) SubmitDelegationICQ(ctx sdk.Context, hostZone types.HostZone, va return nil } + +// Submits an ICQ to get a validator's delegations +// This is called after the validator's sharesToTokens rate is determined +// The timeoutDuration parameter represents the length of the timeout (not to be confused with an actual timestamp) +func (k Keeper) SubmitCalibrationICQ(ctx sdk.Context, hostZone types.HostZone, validatorAddress string) error { + if hostZone.DelegationIcaAddress == "" { + return errorsmod.Wrapf(types.ErrICAAccountNotFound, "no delegation address found for %s", hostZone.ChainId) + } + validator, valIndex, found := GetValidatorFromAddress(hostZone.Validators, validatorAddress) + if !found { + return errorsmod.Wrapf(types.ErrValidatorNotFound, "no registered validator for address (%s)", validatorAddress) + } + + // Get the validator and delegator encoded addresses to form the query request + _, validatorAddressBz, err := bech32.DecodeAndConvert(validatorAddress) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "invalid validator address, could not decode (%s)", err.Error()) + } + _, delegatorAddressBz, err := bech32.DecodeAndConvert(hostZone.DelegationIcaAddress) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "invalid delegator address, could not decode (%s)", err.Error()) + } + queryData := stakingtypes.GetDelegationKey(delegatorAddressBz, validatorAddressBz) + + // Store the current validator's delegation in the callback data so we can determine if it changed + // while the query was in flight + callbackData := types.DelegatorSharesQueryCallback{ + InitialValidatorDelegation: validator.Delegation, + } + callbackDataBz, err := proto.Marshal(&callbackData) + if err != nil { + return errorsmod.Wrapf(err, "unable to marshal delegator shares callback data") + } + + // Update the validator to indicate that the slash query is in progress + validator.SlashQueryInProgress = true + hostZone.Validators[valIndex] = &validator + k.SetHostZone(ctx, hostZone) + + // Submit delegator shares ICQ + query := icqtypes.Query{ + ChainId: hostZone.ChainId, + ConnectionId: hostZone.ConnectionId, + QueryType: icqtypes.STAKING_STORE_QUERY_WITH_PROOF, + RequestData: queryData, + CallbackModule: types.ModuleName, + CallbackId: ICQCallbackID_Calibrate, + CallbackData: callbackDataBz, + TimeoutDuration: time.Hour, + TimeoutPolicy: icqtypes.TimeoutPolicy_RETRY_QUERY_REQUEST, + } + if err := k.InterchainQueryKeeper.SubmitICQRequest(ctx, query, false); err != nil { + k.Logger(ctx).Error(fmt.Sprintf("Error submitting ICQ for delegation, error : %s", err.Error())) + return err + } + + return nil +} diff --git a/x/stakeibc/types/codec.go b/x/stakeibc/types/codec.go index e0f63edc89..c28fb0b674 100644 --- a/x/stakeibc/types/codec.go +++ b/x/stakeibc/types/codec.go @@ -23,6 +23,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&ToggleLSMProposal{}, "stakeibc/ToggleLSMProposal", nil) cdc.RegisterConcrete(&MsgRestoreInterchainAccount{}, "stakeibc/RestoreInterchainAccount", nil) cdc.RegisterConcrete(&MsgUpdateValidatorSharesExchRate{}, "stakeibc/UpdateValidatorSharesExchRate", nil) + cdc.RegisterConcrete(&MsgCalibrateDelegation{}, "stakeibc/CalibrateDelegation", nil) cdc.RegisterConcrete(&MsgUpdateInnerRedemptionRateBounds{}, "stakeibc/UpdateInnerRedemptionRateBounds", nil) // this line is used by starport scaffolding # 2 } @@ -40,6 +41,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgDeleteValidator{}, &MsgRestoreInterchainAccount{}, &MsgUpdateValidatorSharesExchRate{}, + &MsgCalibrateDelegation{}, &MsgUpdateInnerRedemptionRateBounds{}, ) diff --git a/x/stakeibc/types/message_calibrate_delegation.go b/x/stakeibc/types/message_calibrate_delegation.go new file mode 100644 index 0000000000..a1c160c831 --- /dev/null +++ b/x/stakeibc/types/message_calibrate_delegation.go @@ -0,0 +1,66 @@ +package types + +import ( + "strings" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/Stride-Labs/stride/v15/utils" +) + +const TypeMsgCalibrateDelegation = "calibrate_delegation" + +var _ sdk.Msg = &MsgCalibrateDelegation{} + +func NewMsgCalibrateDelegation(creator string, chainid string, valoper string) *MsgCalibrateDelegation { + return &MsgCalibrateDelegation{ + Creator: creator, + ChainId: chainid, + Valoper: valoper, + } +} + +func (msg *MsgCalibrateDelegation) Route() string { + return RouterKey +} + +func (msg *MsgCalibrateDelegation) Type() string { + return TypeMsgCalibrateDelegation +} + +func (msg *MsgCalibrateDelegation) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgCalibrateDelegation) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgCalibrateDelegation) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if err := utils.ValidateAdminAddress(msg.Creator); err != nil { + return err + } + + if len(msg.ChainId) == 0 { + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "chainid is required") + } + if len(msg.Valoper) == 0 { + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "valoper is required") + } + if !strings.Contains(msg.Valoper, "valoper") { + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "validator operator address must contrain 'valoper'") + } + + return nil +} From d897ace9c69b30b487e5ba24be5679fe87b4546a Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:36:12 -0500 Subject: [PATCH 10/26] Revert "calibration: revert proto + protogen; re-add delegation protos from undel host" This reverts commit e8bad998a9e2f51fb59f4bd38b6c02c04ae6a1c0. --- proto/stride/stakeibc/callbacks.proto | 6 - proto/stride/stakeibc/tx.proto | 9 + .../client/cli/tx_calibrate_delegation.go | 41 ++ x/stakeibc/types/callbacks.pb.go | 466 ++------------ x/stakeibc/types/tx.pb.go | 609 +++++++++++++++--- 5 files changed, 631 insertions(+), 500 deletions(-) create mode 100644 x/stakeibc/client/cli/tx_calibrate_delegation.go diff --git a/proto/stride/stakeibc/callbacks.proto b/proto/stride/stakeibc/callbacks.proto index 00f3d128bd..8144592650 100644 --- a/proto/stride/stakeibc/callbacks.proto +++ b/proto/stride/stakeibc/callbacks.proto @@ -36,12 +36,6 @@ message ReinvestCallback { string host_zone_id = 3; } -message UndelegateCallback { - string host_zone_id = 1; - repeated SplitDelegation split_delegations = 2; - repeated uint64 epoch_unbonding_record_ids = 3; -} - message RedemptionCallback { string host_zone_id = 1; repeated uint64 epoch_unbonding_record_ids = 2; diff --git a/proto/stride/stakeibc/tx.proto b/proto/stride/stakeibc/tx.proto index 3f32ab3d0c..ce8acd3af5 100644 --- a/proto/stride/stakeibc/tx.proto +++ b/proto/stride/stakeibc/tx.proto @@ -27,6 +27,8 @@ service Msg { returns (MsgRestoreInterchainAccountResponse); rpc UpdateValidatorSharesExchRate(MsgUpdateValidatorSharesExchRate) returns (MsgUpdateValidatorSharesExchRateResponse); + rpc CalibrateDelegation(MsgCalibrateDelegation) + returns (MsgCalibrateDelegationResponse); rpc ClearBalance(MsgClearBalance) returns (MsgClearBalanceResponse); rpc UpdateInnerRedemptionRateBounds(MsgUpdateInnerRedemptionRateBounds) returns (MsgUpdateInnerRedemptionRateBoundsResponse); @@ -170,3 +172,10 @@ message MsgUpdateValidatorSharesExchRate { string valoper = 3; } message MsgUpdateValidatorSharesExchRateResponse {} + +message MsgCalibrateDelegation { + string creator = 1; + string chain_id = 2; + string valoper = 3; +} +message MsgCalibrateDelegationResponse {} diff --git a/x/stakeibc/client/cli/tx_calibrate_delegation.go b/x/stakeibc/client/cli/tx_calibrate_delegation.go new file mode 100644 index 0000000000..72d58a0d3a --- /dev/null +++ b/x/stakeibc/client/cli/tx_calibrate_delegation.go @@ -0,0 +1,41 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + + "github.com/Stride-Labs/stride/v15/x/stakeibc/types" +) + +func CmdCalibrateDelegation() *cobra.Command { + cmd := &cobra.Command{ + Use: "calibrate-delegation [chainid] [valoper]", + Short: "Broadcast message calibrate-delegation", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argChainId := args[0] + argValoper := args[1] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgCalibrateDelegation( + clientCtx.GetFromAddress().String(), + argChainId, + argValoper, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stakeibc/types/callbacks.pb.go b/x/stakeibc/types/callbacks.pb.go index 903da2a28b..22bb303e00 100644 --- a/x/stakeibc/types/callbacks.pb.go +++ b/x/stakeibc/types/callbacks.pb.go @@ -243,66 +243,6 @@ func (m *ReinvestCallback) GetHostZoneId() string { return "" } -type UndelegateCallback struct { - HostZoneId string `protobuf:"bytes,1,opt,name=host_zone_id,json=hostZoneId,proto3" json:"host_zone_id,omitempty"` - SplitDelegations []*SplitDelegation `protobuf:"bytes,2,rep,name=split_delegations,json=splitDelegations,proto3" json:"split_delegations,omitempty"` - EpochUnbondingRecordIds []uint64 `protobuf:"varint,3,rep,packed,name=epoch_unbonding_record_ids,json=epochUnbondingRecordIds,proto3" json:"epoch_unbonding_record_ids,omitempty"` -} - -func (m *UndelegateCallback) Reset() { *m = UndelegateCallback{} } -func (m *UndelegateCallback) String() string { return proto.CompactTextString(m) } -func (*UndelegateCallback) ProtoMessage() {} -func (*UndelegateCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{4} -} -func (m *UndelegateCallback) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UndelegateCallback) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UndelegateCallback.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UndelegateCallback) XXX_Merge(src proto.Message) { - xxx_messageInfo_UndelegateCallback.Merge(m, src) -} -func (m *UndelegateCallback) XXX_Size() int { - return m.Size() -} -func (m *UndelegateCallback) XXX_DiscardUnknown() { - xxx_messageInfo_UndelegateCallback.DiscardUnknown(m) -} - -var xxx_messageInfo_UndelegateCallback proto.InternalMessageInfo - -func (m *UndelegateCallback) GetHostZoneId() string { - if m != nil { - return m.HostZoneId - } - return "" -} - -func (m *UndelegateCallback) GetSplitDelegations() []*SplitDelegation { - if m != nil { - return m.SplitDelegations - } - return nil -} - -func (m *UndelegateCallback) GetEpochUnbondingRecordIds() []uint64 { - if m != nil { - return m.EpochUnbondingRecordIds - } - return nil -} - type RedemptionCallback struct { HostZoneId string `protobuf:"bytes,1,opt,name=host_zone_id,json=hostZoneId,proto3" json:"host_zone_id,omitempty"` EpochUnbondingRecordIds []uint64 `protobuf:"varint,2,rep,packed,name=epoch_unbonding_record_ids,json=epochUnbondingRecordIds,proto3" json:"epoch_unbonding_record_ids,omitempty"` @@ -312,7 +252,7 @@ func (m *RedemptionCallback) Reset() { *m = RedemptionCallback{} } func (m *RedemptionCallback) String() string { return proto.CompactTextString(m) } func (*RedemptionCallback) ProtoMessage() {} func (*RedemptionCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{5} + return fileDescriptor_f41c99b09b96a5ac, []int{4} } func (m *RedemptionCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -365,7 +305,7 @@ func (m *Rebalancing) Reset() { *m = Rebalancing{} } func (m *Rebalancing) String() string { return proto.CompactTextString(m) } func (*Rebalancing) ProtoMessage() {} func (*Rebalancing) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{6} + return fileDescriptor_f41c99b09b96a5ac, []int{5} } func (m *Rebalancing) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -417,7 +357,7 @@ func (m *RebalanceCallback) Reset() { *m = RebalanceCallback{} } func (m *RebalanceCallback) String() string { return proto.CompactTextString(m) } func (*RebalanceCallback) ProtoMessage() {} func (*RebalanceCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{7} + return fileDescriptor_f41c99b09b96a5ac, []int{6} } func (m *RebalanceCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -468,7 +408,7 @@ func (m *DetokenizeSharesCallback) Reset() { *m = DetokenizeSharesCallba func (m *DetokenizeSharesCallback) String() string { return proto.CompactTextString(m) } func (*DetokenizeSharesCallback) ProtoMessage() {} func (*DetokenizeSharesCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{8} + return fileDescriptor_f41c99b09b96a5ac, []int{7} } func (m *DetokenizeSharesCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -514,7 +454,7 @@ func (m *LSMLiquidStake) Reset() { *m = LSMLiquidStake{} } func (m *LSMLiquidStake) String() string { return proto.CompactTextString(m) } func (*LSMLiquidStake) ProtoMessage() {} func (*LSMLiquidStake) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{9} + return fileDescriptor_f41c99b09b96a5ac, []int{8} } func (m *LSMLiquidStake) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -572,7 +512,7 @@ func (m *ValidatorSharesToTokensQueryCallback) Reset() { *m = ValidatorS func (m *ValidatorSharesToTokensQueryCallback) String() string { return proto.CompactTextString(m) } func (*ValidatorSharesToTokensQueryCallback) ProtoMessage() {} func (*ValidatorSharesToTokensQueryCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{10} + return fileDescriptor_f41c99b09b96a5ac, []int{9} } func (m *ValidatorSharesToTokensQueryCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -617,7 +557,7 @@ func (m *DelegatorSharesQueryCallback) Reset() { *m = DelegatorSharesQue func (m *DelegatorSharesQueryCallback) String() string { return proto.CompactTextString(m) } func (*DelegatorSharesQueryCallback) ProtoMessage() {} func (*DelegatorSharesQueryCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{11} + return fileDescriptor_f41c99b09b96a5ac, []int{10} } func (m *DelegatorSharesQueryCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -651,7 +591,6 @@ func init() { proto.RegisterType((*DelegateCallback)(nil), "stride.stakeibc.DelegateCallback") proto.RegisterType((*ClaimCallback)(nil), "stride.stakeibc.ClaimCallback") proto.RegisterType((*ReinvestCallback)(nil), "stride.stakeibc.ReinvestCallback") - proto.RegisterType((*UndelegateCallback)(nil), "stride.stakeibc.UndelegateCallback") proto.RegisterType((*RedemptionCallback)(nil), "stride.stakeibc.RedemptionCallback") proto.RegisterType((*Rebalancing)(nil), "stride.stakeibc.Rebalancing") proto.RegisterType((*RebalanceCallback)(nil), "stride.stakeibc.RebalanceCallback") @@ -664,59 +603,58 @@ func init() { func init() { proto.RegisterFile("stride/stakeibc/callbacks.proto", fileDescriptor_f41c99b09b96a5ac) } var fileDescriptor_f41c99b09b96a5ac = []byte{ - // 822 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x6f, 0xeb, 0x44, - 0x10, 0x8f, 0x9b, 0xa7, 0xf7, 0x5e, 0x36, 0x69, 0x93, 0x5a, 0x08, 0xd2, 0x28, 0x4a, 0x82, 0x1f, - 0x82, 0x0a, 0xa9, 0xb6, 0x5a, 0x04, 0x02, 0x71, 0x29, 0x6d, 0x85, 0x88, 0x94, 0x22, 0xe1, 0xb4, - 0x1c, 0x7a, 0xb1, 0xd6, 0xde, 0x55, 0xb2, 0x8a, 0xbd, 0x9b, 0x7a, 0x37, 0x29, 0xed, 0x27, 0xe0, - 0xd8, 0x2b, 0x1f, 0x01, 0x2e, 0x7c, 0x02, 0x2e, 0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66, 0x1f, 0x33, 0x42, 0x8f, 0x1c, 0xa9, 0xde, 0x4f, 0x7f, 0x74, 0x3f, 0xf8, - 0x17, 0xea, 0xc9, 0x00, 0x77, 0x2b, 0x4d, 0xf1, 0x85, 0xca, 0xb0, 0xa2, 0x58, 0x79, 0x59, 0x31, - 0xeb, 0x57, 0x03, 0x98, 0xe7, 0x14, 0xad, 0x2f, 0xf5, 0xdf, 0xca, 0xb7, 0xf1, 0x5f, 0xe5, 0x33, - 0x3f, 0x07, 0xad, 0xa4, 0xad, 0x33, 0xea, 0x33, 0x8a, 0x08, 0x1d, 0xe5, 0x62, 0x25, 0x63, 0xf1, - 0xc2, 0x7d, 0x47, 0x21, 0xce, 0x53, 0x40, 0xaa, 0x16, 0xb7, 0x38, 0x30, 0x73, 0x11, 0xd7, 0xe0, - 0xf0, 0x7c, 0xd2, 0x8d, 0xe7, 0x93, 0xfe, 0x60, 0x80, 0xaa, 0x8b, 0x7d, 0x18, 0x42, 0x1a, 0x10, - 0x3a, 0x32, 0xdf, 0x80, 0x4d, 0x1e, 0x07, 0xde, 0xf2, 0x72, 0xd6, 0x78, 0x1c, 0x7c, 0x9b, 0xed, - 0xe7, 0x1b, 0xb0, 0x89, 0xb8, 0x28, 0x80, 0x92, 0xe9, 0xaa, 0x21, 0x2e, 0x72, 0xd0, 0x21, 0x28, - 0xc3, 0x48, 0x24, 0x62, 0xad, 0xbd, 0xc1, 0x32, 0xd4, 0xba, 0x02, 0xdb, 0x69, 0x69, 0xeb, 0x68, - 0x7a, 0x08, 0x6a, 0x71, 0xce, 0x28, 0x95, 0xb3, 0xbd, 0x22, 0x67, 0x81, 0xb6, 0xbb, 0x10, 0x61, - 0x9d, 0x83, 0xe6, 0x09, 0x16, 0x6c, 0x82, 0x29, 0xb9, 0xc1, 0xc3, 0x31, 0x8c, 0x31, 0x2f, 0xec, - 0xe3, 0x2b, 0x7d, 0x07, 0xe8, 0xc9, 0xef, 0xa6, 0x07, 0xa7, 0xd7, 0xe6,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25, 0x55, 0x36, 0xff, 0xa5, 0x7a, 0x22, 0x3f, 0xfa, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x45, - 0xda, 0x3f, 0xec, 0x07, 0x00, 0x00, + // 805 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x4f, 0xe3, 0x46, + 0x14, 0x8f, 0x09, 0x02, 0x32, 0x09, 0x24, 0x58, 0x55, 0x1b, 0xa2, 0x28, 0x49, 0x4d, 0xd5, 0xa2, + 0x4a, 0xd8, 0x22, 0x55, 0xab, 0x56, 0xbd, 0x50, 0x40, 0x55, 0x23, 0x85, 0x4a, 0x75, 0xa0, 0x07, + 0x2e, 0xd6, 0xd8, 0x1e, 0x25, 0xa3, 0xd8, 0x33, 0xc1, 0x33, 0x09, 0x85, 0x4f, 0xd0, 0x23, 0xd7, + 0x7e, 0x84, 0xf6, 0xd2, 0x4f, 0xb0, 0x77, 0x8e, 0x1c, 0x57, 0x7b, 0x60, 0x57, 0xf0, 0x45, 0x56, + 0x33, 0x1e, 0xff, 0x49, 0xa2, 0x95, 0x36, 0xda, 0x53, 0xe2, 0x37, 0xbf, 0x37, 0xef, 0xfd, 0x7e, + 0xef, 0xe7, 0x67, 0xd0, 0x66, 0x3c, 0xc2, 0x3e, 0xb2, 0x18, 0x87, 0x63, 0x84, 0x5d, 0xcf, 0xf2, + 0x60, 0x10, 0xb8, 0xd0, 0x1b, 0x33, 0x73, 0x12, 0x51, 0x4e, 0xf5, 0x6a, 0x0c, 0x30, 0x13, 0x40, + 0xe3, 0xb3, 0x21, 0x1d, 0x52, 0x79, 0x66, 0x89, 0x7f, 0x31, 0xac, 0xd1, 0xf2, 0x28, 0x0b, 0x29, + 0xb3, 0x5c, 0xc8, 0x90, 0x35, 0x3b, 0x72, 0x11, 0x87, 0x47, 0x96, 0x47, 0x31, 0x51, 0xe7, 0x4d, + 0x55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0x53, 0xad, 0x96, 0xa4, 0xe6, 0x7c, 0xad, 0x09, 0x68, 0x62, 0x82, 0x39, + 0x86, 0x41, 0x66, 0xc7, 0xdc, 0x1a, 0x8b, 0xed, 0xb1, 0xb2, 0xfd, 0x1a, 0xea, 0xce, 0x94, 0x6e, + 0xb6, 0xde, 0x4e, 0xfa, 0x0f, 0xcf, 0x2d, 0xed, 0xf1, 0xb9, 0xa5, 0xbd, 0x7b, 0x6e, 0x69, 0xf7, + 0x2f, 0xad, 0xc2, 0xe3, 0x4b, 0xab, 0xf0, 0xfa, 0xa5, 0x55, 0xb8, 0xea, 0xe6, 0x6e, 0x1f, 0x48, + 0x9e, 0x87, 0x7d, 0xe8, 0x32, 0x4b, 0x7d, 0x5a, 0x66, 0x47, 0xdf, 0x5b, 0x7f, 0x65, 0x1f, 0x18, + 0x59, 0xcd, 0xdd, 0x90, 0x5f, 0x97, 0xef, 0xde, 0x07, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x24, 0x25, + 0x84, 0x27, 0x07, 0x00, 0x00, } func (m *SplitDelegation) Marshal() (dAtA []byte, err error) { @@ -890,7 +828,7 @@ func (m *ReinvestCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *UndelegateCallback) Marshal() (dAtA []byte, err error) { +func (m *RedemptionCallback) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -900,12 +838,12 @@ func (m *UndelegateCallback) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *UndelegateCallback) MarshalTo(dAtA []byte) (int, error) { +func (m *RedemptionCallback) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UndelegateCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RedemptionCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -926,68 +864,6 @@ func (m *UndelegateCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], dAtA3[:j2]) i = encodeVarintCallbacks(dAtA, i, uint64(j2)) i-- - dAtA[i] = 0x1a - } - if len(m.SplitDelegations) > 0 { - for iNdEx := len(m.SplitDelegations) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SplitDelegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCallbacks(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.HostZoneId) > 0 { - i -= len(m.HostZoneId) - copy(dAtA[i:], m.HostZoneId) - i = encodeVarintCallbacks(dAtA, i, uint64(len(m.HostZoneId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RedemptionCallback) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RedemptionCallback) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RedemptionCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.EpochUnbondingRecordIds) > 0 { - dAtA5 := make([]byte, len(m.EpochUnbondingRecordIds)*10) - var j4 int - for _, num := range m.EpochUnbondingRecordIds { - for num >= 1<<7 { - dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j4++ - } - dAtA5[j4] = uint8(num) - j4++ - } - i -= j4 - copy(dAtA[i:], dAtA5[:j4]) - i = encodeVarintCallbacks(dAtA, i, uint64(j4)) - i-- dAtA[i] = 0x12 } if len(m.HostZoneId) > 0 { @@ -1336,32 +1212,6 @@ func (m *ReinvestCallback) Size() (n int) { return n } -func (m *UndelegateCallback) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.HostZoneId) - if l > 0 { - n += 1 + l + sovCallbacks(uint64(l)) - } - if len(m.SplitDelegations) > 0 { - for _, e := range m.SplitDelegations { - l = e.Size() - n += 1 + l + sovCallbacks(uint64(l)) - } - } - if len(m.EpochUnbondingRecordIds) > 0 { - l = 0 - for _, e := range m.EpochUnbondingRecordIds { - l += sovCallbacks(uint64(e)) - } - n += 1 + sovCallbacks(uint64(l)) + l - } - return n -} - func (m *RedemptionCallback) Size() (n int) { if m == nil { return 0 @@ -1983,198 +1833,6 @@ func (m *ReinvestCallback) Unmarshal(dAtA []byte) error { } return nil } -func (m *UndelegateCallback) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UndelegateCallback: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UndelegateCallback: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostZoneId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCallbacks - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCallbacks - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HostZoneId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SplitDelegations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCallbacks - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCallbacks - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SplitDelegations = append(m.SplitDelegations, &SplitDelegation{}) - if err := m.SplitDelegations[len(m.SplitDelegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EpochUnbondingRecordIds = append(m.EpochUnbondingRecordIds, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthCallbacks - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthCallbacks - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.EpochUnbondingRecordIds) == 0 { - m.EpochUnbondingRecordIds = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCallbacks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EpochUnbondingRecordIds = append(m.EpochUnbondingRecordIds, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field EpochUnbondingRecordIds", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipCallbacks(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCallbacks - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *RedemptionCallback) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/stakeibc/types/tx.pb.go b/x/stakeibc/types/tx.pb.go index 8f156b6bea..51e42a2447 100644 --- a/x/stakeibc/types/tx.pb.go +++ b/x/stakeibc/types/tx.pb.go @@ -1278,6 +1278,102 @@ func (m *MsgUpdateValidatorSharesExchRateResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateValidatorSharesExchRateResponse proto.InternalMessageInfo +type MsgCalibrateDelegation struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Valoper string `protobuf:"bytes,3,opt,name=valoper,proto3" json:"valoper,omitempty"` +} + +func (m *MsgCalibrateDelegation) Reset() { *m = MsgCalibrateDelegation{} } +func (m *MsgCalibrateDelegation) String() string { return proto.CompactTextString(m) } +func (*MsgCalibrateDelegation) ProtoMessage() {} +func (*MsgCalibrateDelegation) Descriptor() ([]byte, []int) { + return fileDescriptor_9b7e09c9ad51cd54, []int{26} +} +func (m *MsgCalibrateDelegation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCalibrateDelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCalibrateDelegation.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCalibrateDelegation) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCalibrateDelegation.Merge(m, src) +} +func (m *MsgCalibrateDelegation) XXX_Size() int { + return m.Size() +} +func (m *MsgCalibrateDelegation) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCalibrateDelegation.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCalibrateDelegation proto.InternalMessageInfo + +func (m *MsgCalibrateDelegation) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgCalibrateDelegation) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *MsgCalibrateDelegation) GetValoper() string { + if m != nil { + return m.Valoper + } + return "" +} + +type MsgCalibrateDelegationResponse struct { +} + +func (m *MsgCalibrateDelegationResponse) Reset() { *m = MsgCalibrateDelegationResponse{} } +func (m *MsgCalibrateDelegationResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCalibrateDelegationResponse) ProtoMessage() {} +func (*MsgCalibrateDelegationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9b7e09c9ad51cd54, []int{27} +} +func (m *MsgCalibrateDelegationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCalibrateDelegationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCalibrateDelegationResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCalibrateDelegationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCalibrateDelegationResponse.Merge(m, src) +} +func (m *MsgCalibrateDelegationResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCalibrateDelegationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCalibrateDelegationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCalibrateDelegationResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUpdateInnerRedemptionRateBounds)(nil), "stride.stakeibc.MsgUpdateInnerRedemptionRateBounds") proto.RegisterType((*MsgUpdateInnerRedemptionRateBoundsResponse)(nil), "stride.stakeibc.MsgUpdateInnerRedemptionRateBoundsResponse") @@ -1305,101 +1401,105 @@ func init() { proto.RegisterType((*MsgRestoreInterchainAccountResponse)(nil), "stride.stakeibc.MsgRestoreInterchainAccountResponse") proto.RegisterType((*MsgUpdateValidatorSharesExchRate)(nil), "stride.stakeibc.MsgUpdateValidatorSharesExchRate") proto.RegisterType((*MsgUpdateValidatorSharesExchRateResponse)(nil), "stride.stakeibc.MsgUpdateValidatorSharesExchRateResponse") + proto.RegisterType((*MsgCalibrateDelegation)(nil), "stride.stakeibc.MsgCalibrateDelegation") + proto.RegisterType((*MsgCalibrateDelegationResponse)(nil), "stride.stakeibc.MsgCalibrateDelegationResponse") } func init() { proto.RegisterFile("stride/stakeibc/tx.proto", fileDescriptor_9b7e09c9ad51cd54) } var fileDescriptor_9b7e09c9ad51cd54 = []byte{ - // 1410 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xcf, 0x36, 0x69, 0x9a, 0xbe, 0x38, 0xbf, 0x36, 0x69, 0xba, 0xd9, 0x7e, 0x6b, 0xbb, 0x9b, - 0x2f, 0x10, 0x4a, 0x63, 0x2b, 0x49, 0x11, 0xa2, 0xc0, 0x21, 0x4e, 0x8a, 0xb0, 0x54, 0x57, 0x68, - 0xd3, 0x52, 0xa9, 0x12, 0x5a, 0xc6, 0xbb, 0xd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 0x22, 0xf5, 0x83, 0x63, 0x2c, 0xea, 0xaa, 0xaa, 0x5c, 0x7b, 0xfc, 0x2c, 0x2f, - 0x3d, 0x79, 0x96, 0x97, 0xfe, 0x79, 0x96, 0x97, 0xbe, 0x7f, 0x9e, 0x1f, 0x7b, 0xf2, 0x3c, 0x3f, - 0xf6, 0xd7, 0xf3, 0xfc, 0xd8, 0xed, 0xcd, 0xbe, 0xf6, 0x78, 0x8f, 0x13, 0xac, 0x5f, 0x43, 0x75, - 0x5a, 0x8e, 0xbf, 0x2f, 0xed, 0x6f, 0xbc, 0x5b, 0x6e, 0xf7, 0x7d, 0xb3, 0x62, 0xed, 0x72, 0x7d, - 0x92, 0x7f, 0x31, 0xda, 0xfa, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x92, 0xfd, 0x84, 0xf9, 0xd3, 0x12, - 0x00, 0x00, + // 1451 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4d, 0x6f, 0xdb, 0x46, + 0x13, 0x36, 0x63, 0xc7, 0x51, 0xc6, 0xf2, 0x17, 0xed, 0x38, 0x34, 0xf3, 0x46, 0x52, 0xe8, 0xf7, + 0xc3, 0x6f, 0x1a, 0x4b, 0xb0, 0x9d, 0xa2, 0x68, 0xda, 0x1e, 0x2c, 0x3b, 0x45, 0x05, 0x44, 0x41, + 0x41, 0x27, 0x0d, 0x10, 0xa0, 0x60, 0x57, 0xe4, 0x86, 0x22, 0x42, 0x2e, 0x15, 0x2e, 0xe5, 0x28, + 0x3d, 0x14, 0xbd, 0x14, 0xe8, 0xa5, 0x40, 0x8b, 0x02, 0x3d, 0xf4, 0x50, 0xe4, 0xd0, 0x43, 0x81, + 0xde, 0x8a, 0xfc, 0x88, 0x00, 0xbd, 0x04, 0x39, 0x15, 0x3d, 0x08, 0x45, 0x72, 0xe9, 0xd9, 0xbf, + 0xa0, 0xd8, 0x25, 0xb5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x57, 0x57, 0x6f, 0xa0, 0x53, + 0x61, 0x15, 0x4b, 0x5e, 0x86, 0xd3, 0xb8, 0xe1, 0x9b, 0x75, 0x5e, 0x7c, 0x53, 0x7a, 0x34, 0x90, + 0x57, 0x60, 0x9a, 0x62, 0x62, 0x89, 0xba, 0x8b, 0x47, 0xda, 0x1a, 0x5c, 0x1a, 0x4a, 0x43, 0x90, + 0x0d, 0xe3, 0xd2, 0xac, 0x45, 0x02, 0xf3, 0x49, 0xa7, 0xff, 0x18, 0x45, 0xb4, 0x4f, 0x07, 0x4e, + 0x25, 0x74, 0x60, 0x0d, 0x66, 0x49, 0xd3, 0x33, 0x82, 0xce, 0x8e, 0x31, 0xd7, 0x2c, 0x69, 0x7a, + 0xc2, 0x8b, 0x56, 0x80, 0x5c, 0xba, 0xd7, 0xde, 0x20, 0x2e, 0x54, 0xa9, 0xbd, 0x63, 0x59, 0xaf, + 0x4f, 0xe9, 0x1a, 0x80, 0xe8, 0xab, 0xa8, 0x32, 0x59, 0x98, 0x5c, 0x9f, 0xd9, 0x52, 0x8b, 0x89, + 0x76, 0xad, 0x28, 0xfc, 0xe8, 0x3d, 0x68, 0x4d, 0x05, 0x25, 0x49, 0x43, 0x70, 0xfc, 0x49, 0xe2, + 0x46, 0x56, 0x7f, 0x76, 0xf7, 0x0c, 0x77, 0xb0, 0x63, 0xd7, 0xc3, 0xe3, 0x72, 0xdd, 0x86, 0xcc, + 0x01, 0x72, 0x0d, 0x64, 0x59, 0x41, 0xfc, 0xae, 0x28, 0xcf, 0x9f, 0x6c, 0x2c, 0xc7, 0x39, 0xbd, + 0x63, 0x59, 0x01, 0xa6, 0x74, 0x3f, 0x0c, 0x1c, 0x62, 0xeb, 0x67, 0x0e, 0x90, 0xcb, 0x66, 0x58, + 0x06, 0x3c, 0xe4, 0x5e, 0x79, 0x06, 0x4c, 0xe9, 0xf1, 0x48, 0xd3, 0xa0, 0x30, 0x8c, 0x9f, 0x38, + 0xc4, 0x97, 0x12, 0xc8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 0x0f, 0x20, 0x9d, 0x7a, 0x4a, + 0xa3, 0x24, 0xdf, 0x83, 0x85, 0x81, 0x26, 0xe9, 0xdf, 0xe9, 0x8b, 0xfb, 0x51, 0xea, 0x95, 0xa3, + 0xa0, 0x84, 0x9f, 0x16, 0xac, 0x0c, 0x79, 0xb8, 0x52, 0xc3, 0x90, 0x8e, 0x55, 0xb7, 0x8e, 0x8e, + 0x15, 0x9e, 0x7d, 0x58, 0x4a, 0x7b, 0x86, 0x86, 0x44, 0x68, 0x00, 0xa8, 0x96, 0x8e, 0x08, 0x14, + 0x0e, 0x3f, 0x85, 0xd9, 0xfe, 0xe7, 0xe5, 0x52, 0xda, 0x0e, 0x7d, 0x10, 0xf5, 0xff, 0x63, 0x21, + 0x62, 0xfb, 0x26, 0x9c, 0x4b, 0x7f, 0x19, 0x52, 0xf7, 0x48, 0x85, 0xaa, 0x9b, 0x47, 0x86, 0x0a, + 0xb7, 0x26, 0xcc, 0x27, 0xb5, 0x7c, 0x2d, 0x6d, 0x97, 0x04, 0x48, 0x7d, 0xeb, 0x08, 0x20, 0xe1, + 0xe4, 0x0b, 0x50, 0x86, 0xea, 0xf1, 0x90, 0x7c, 0x4b, 0x47, 0xab, 0x57, 0x5f, 0x05, 0x2d, 0xfc, + 0x7f, 0x23, 0xc1, 0xc5, 0xd1, 0x8a, 0x9a, 0x1a, 0xb9, 0x91, 0x4b, 0xd4, 0x77, 0x5f, 0x79, 0x49, + 0x6f, 0xee, 0xa6, 0x29, 0x68, 0x6a, 0xee, 0xa6, 0x00, 0xd3, 0x73, 0x77, 0x84, 0x54, 0xca, 0x77, + 0x21, 0xdb, 0xf7, 0x0b, 0xb6, 0x90, 0x5e, 0x70, 0x5d, 0x84, 0xba, 0x3e, 0x0e, 0x21, 0xf6, 0xfe, + 0x5e, 0x82, 0xfc, 0xb8, 0xef, 0x47, 0xdb, 0xc3, 0x63, 0x35, 0x74, 0x91, 0xfa, 0xde, 0x31, 0x16, + 0x75, 0x58, 0x95, 0x6f, 0x3c, 0x7d, 0x91, 0x93, 0x9e, 0xbd, 0xc8, 0x49, 0x7f, 0xbd, 0xc8, 0x49, + 0xdf, 0xbe, 0xcc, 0x4d, 0x3c, 0x7b, 0x99, 0x9b, 0xf8, 0xe3, 0x65, 0x6e, 0xe2, 0xee, 0x56, 0xcf, + 0x4f, 0x83, 0x7d, 0xee, 0x60, 0xe3, 0x06, 0xaa, 0xd1, 0x52, 0xfc, 0x6d, 0xed, 0x60, 0xf3, 0xed, + 0x52, 0xab, 0xe7, 0x7b, 0x1d, 0xfb, 0xa9, 0x50, 0x9b, 0xe6, 0x5f, 0xcb, 0xb6, 0xff, 0x09, 0x00, + 0x00, 0xff, 0xff, 0x87, 0x28, 0x7d, 0x8b, 0xcf, 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1425,6 +1525,7 @@ type MsgClient interface { DeleteValidator(ctx context.Context, in *MsgDeleteValidator, opts ...grpc.CallOption) (*MsgDeleteValidatorResponse, error) RestoreInterchainAccount(ctx context.Context, in *MsgRestoreInterchainAccount, opts ...grpc.CallOption) (*MsgRestoreInterchainAccountResponse, error) UpdateValidatorSharesExchRate(ctx context.Context, in *MsgUpdateValidatorSharesExchRate, opts ...grpc.CallOption) (*MsgUpdateValidatorSharesExchRateResponse, error) + CalibrateDelegation(ctx context.Context, in *MsgCalibrateDelegation, opts ...grpc.CallOption) (*MsgCalibrateDelegationResponse, error) ClearBalance(ctx context.Context, in *MsgClearBalance, opts ...grpc.CallOption) (*MsgClearBalanceResponse, error) UpdateInnerRedemptionRateBounds(ctx context.Context, in *MsgUpdateInnerRedemptionRateBounds, opts ...grpc.CallOption) (*MsgUpdateInnerRedemptionRateBoundsResponse, error) } @@ -1536,6 +1637,15 @@ func (c *msgClient) UpdateValidatorSharesExchRate(ctx context.Context, in *MsgUp return out, nil } +func (c *msgClient) CalibrateDelegation(ctx context.Context, in *MsgCalibrateDelegation, opts ...grpc.CallOption) (*MsgCalibrateDelegationResponse, error) { + out := new(MsgCalibrateDelegationResponse) + err := c.cc.Invoke(ctx, "/stride.stakeibc.Msg/CalibrateDelegation", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) ClearBalance(ctx context.Context, in *MsgClearBalance, opts ...grpc.CallOption) (*MsgClearBalanceResponse, error) { out := new(MsgClearBalanceResponse) err := c.cc.Invoke(ctx, "/stride.stakeibc.Msg/ClearBalance", in, out, opts...) @@ -1567,6 +1677,7 @@ type MsgServer interface { DeleteValidator(context.Context, *MsgDeleteValidator) (*MsgDeleteValidatorResponse, error) RestoreInterchainAccount(context.Context, *MsgRestoreInterchainAccount) (*MsgRestoreInterchainAccountResponse, error) UpdateValidatorSharesExchRate(context.Context, *MsgUpdateValidatorSharesExchRate) (*MsgUpdateValidatorSharesExchRateResponse, error) + CalibrateDelegation(context.Context, *MsgCalibrateDelegation) (*MsgCalibrateDelegationResponse, error) ClearBalance(context.Context, *MsgClearBalance) (*MsgClearBalanceResponse, error) UpdateInnerRedemptionRateBounds(context.Context, *MsgUpdateInnerRedemptionRateBounds) (*MsgUpdateInnerRedemptionRateBoundsResponse, error) } @@ -1608,6 +1719,9 @@ func (*UnimplementedMsgServer) RestoreInterchainAccount(ctx context.Context, req func (*UnimplementedMsgServer) UpdateValidatorSharesExchRate(ctx context.Context, req *MsgUpdateValidatorSharesExchRate) (*MsgUpdateValidatorSharesExchRateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateValidatorSharesExchRate not implemented") } +func (*UnimplementedMsgServer) CalibrateDelegation(ctx context.Context, req *MsgCalibrateDelegation) (*MsgCalibrateDelegationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CalibrateDelegation not implemented") +} func (*UnimplementedMsgServer) ClearBalance(ctx context.Context, req *MsgClearBalance) (*MsgClearBalanceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ClearBalance not implemented") } @@ -1817,6 +1931,24 @@ func _Msg_UpdateValidatorSharesExchRate_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } +func _Msg_CalibrateDelegation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCalibrateDelegation) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CalibrateDelegation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stride.stakeibc.Msg/CalibrateDelegation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CalibrateDelegation(ctx, req.(*MsgCalibrateDelegation)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_ClearBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgClearBalance) if err := dec(in); err != nil { @@ -1901,6 +2033,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateValidatorSharesExchRate", Handler: _Msg_UpdateValidatorSharesExchRate_Handler, }, + { + MethodName: "CalibrateDelegation", + Handler: _Msg_CalibrateDelegation_Handler, + }, { MethodName: "ClearBalance", Handler: _Msg_ClearBalance_Handler, @@ -2903,6 +3039,73 @@ func (m *MsgUpdateValidatorSharesExchRateResponse) MarshalToSizedBuffer(dAtA []b return len(dAtA) - i, nil } +func (m *MsgCalibrateDelegation) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCalibrateDelegation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCalibrateDelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Valoper) > 0 { + i -= len(m.Valoper) + copy(dAtA[i:], m.Valoper) + i = encodeVarintTx(dAtA, i, uint64(len(m.Valoper))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCalibrateDelegationResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCalibrateDelegationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCalibrateDelegationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -3335,6 +3538,36 @@ func (m *MsgUpdateValidatorSharesExchRateResponse) Size() (n int) { return n } +func (m *MsgCalibrateDelegation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Valoper) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCalibrateDelegationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -6234,6 +6467,202 @@ func (m *MsgUpdateValidatorSharesExchRateResponse) Unmarshal(dAtA []byte) error } return nil } +func (m *MsgCalibrateDelegation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCalibrateDelegation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCalibrateDelegation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Valoper", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Valoper = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCalibrateDelegationResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCalibrateDelegationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCalibrateDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 753bdce8e7ff2ff22146e28eb2216f38d8d6233b Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:38:20 -0500 Subject: [PATCH 11/26] undel host: add back undelegatecallback + proto-gen --- proto/stride/stakeibc/callbacks.proto | 6 + x/stakeibc/types/callbacks.pb.go | 466 ++++++++++++++++++++++---- 2 files changed, 410 insertions(+), 62 deletions(-) diff --git a/proto/stride/stakeibc/callbacks.proto b/proto/stride/stakeibc/callbacks.proto index 8144592650..00f3d128bd 100644 --- a/proto/stride/stakeibc/callbacks.proto +++ b/proto/stride/stakeibc/callbacks.proto @@ -36,6 +36,12 @@ message ReinvestCallback { string host_zone_id = 3; } +message UndelegateCallback { + string host_zone_id = 1; + repeated SplitDelegation split_delegations = 2; + repeated uint64 epoch_unbonding_record_ids = 3; +} + message RedemptionCallback { string host_zone_id = 1; repeated uint64 epoch_unbonding_record_ids = 2; diff --git a/x/stakeibc/types/callbacks.pb.go b/x/stakeibc/types/callbacks.pb.go index 22bb303e00..903da2a28b 100644 --- a/x/stakeibc/types/callbacks.pb.go +++ b/x/stakeibc/types/callbacks.pb.go @@ -243,6 +243,66 @@ func (m *ReinvestCallback) GetHostZoneId() string { return "" } +type UndelegateCallback struct { + HostZoneId string `protobuf:"bytes,1,opt,name=host_zone_id,json=hostZoneId,proto3" json:"host_zone_id,omitempty"` + SplitDelegations []*SplitDelegation `protobuf:"bytes,2,rep,name=split_delegations,json=splitDelegations,proto3" json:"split_delegations,omitempty"` + EpochUnbondingRecordIds []uint64 `protobuf:"varint,3,rep,packed,name=epoch_unbonding_record_ids,json=epochUnbondingRecordIds,proto3" json:"epoch_unbonding_record_ids,omitempty"` +} + +func (m *UndelegateCallback) Reset() { *m = UndelegateCallback{} } +func (m *UndelegateCallback) String() string { return proto.CompactTextString(m) } +func (*UndelegateCallback) ProtoMessage() {} +func (*UndelegateCallback) Descriptor() ([]byte, []int) { + return fileDescriptor_f41c99b09b96a5ac, []int{4} +} +func (m *UndelegateCallback) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UndelegateCallback) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UndelegateCallback.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UndelegateCallback) XXX_Merge(src proto.Message) { + xxx_messageInfo_UndelegateCallback.Merge(m, src) +} +func (m *UndelegateCallback) XXX_Size() int { + return m.Size() +} +func (m *UndelegateCallback) XXX_DiscardUnknown() { + xxx_messageInfo_UndelegateCallback.DiscardUnknown(m) +} + +var xxx_messageInfo_UndelegateCallback proto.InternalMessageInfo + +func (m *UndelegateCallback) GetHostZoneId() string { + if m != nil { + return m.HostZoneId + } + return "" +} + +func (m *UndelegateCallback) GetSplitDelegations() []*SplitDelegation { + if m != nil { + return m.SplitDelegations + } + return nil +} + +func (m *UndelegateCallback) GetEpochUnbondingRecordIds() []uint64 { + if m != nil { + return m.EpochUnbondingRecordIds + } + return nil +} + type RedemptionCallback struct { HostZoneId string `protobuf:"bytes,1,opt,name=host_zone_id,json=hostZoneId,proto3" json:"host_zone_id,omitempty"` EpochUnbondingRecordIds []uint64 `protobuf:"varint,2,rep,packed,name=epoch_unbonding_record_ids,json=epochUnbondingRecordIds,proto3" json:"epoch_unbonding_record_ids,omitempty"` @@ -252,7 +312,7 @@ func (m *RedemptionCallback) Reset() { *m = RedemptionCallback{} } func (m *RedemptionCallback) String() string { return proto.CompactTextString(m) } func (*RedemptionCallback) ProtoMessage() {} func (*RedemptionCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{4} + return fileDescriptor_f41c99b09b96a5ac, []int{5} } func (m *RedemptionCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -305,7 +365,7 @@ func (m *Rebalancing) Reset() { *m = Rebalancing{} } func (m *Rebalancing) String() string { return proto.CompactTextString(m) } func (*Rebalancing) ProtoMessage() {} func (*Rebalancing) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{5} + return fileDescriptor_f41c99b09b96a5ac, []int{6} } func (m *Rebalancing) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -357,7 +417,7 @@ func (m *RebalanceCallback) Reset() { *m = RebalanceCallback{} } func (m *RebalanceCallback) String() string { return proto.CompactTextString(m) } func (*RebalanceCallback) ProtoMessage() {} func (*RebalanceCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{6} + return fileDescriptor_f41c99b09b96a5ac, []int{7} } func (m *RebalanceCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -408,7 +468,7 @@ func (m *DetokenizeSharesCallback) Reset() { *m = DetokenizeSharesCallba func (m *DetokenizeSharesCallback) String() string { return proto.CompactTextString(m) } func (*DetokenizeSharesCallback) ProtoMessage() {} func (*DetokenizeSharesCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{7} + return fileDescriptor_f41c99b09b96a5ac, []int{8} } func (m *DetokenizeSharesCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -454,7 +514,7 @@ func (m *LSMLiquidStake) Reset() { *m = LSMLiquidStake{} } func (m *LSMLiquidStake) String() string { return proto.CompactTextString(m) } func (*LSMLiquidStake) ProtoMessage() {} func (*LSMLiquidStake) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{8} + return fileDescriptor_f41c99b09b96a5ac, []int{9} } func (m *LSMLiquidStake) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -512,7 +572,7 @@ func (m *ValidatorSharesToTokensQueryCallback) Reset() { *m = ValidatorS func (m *ValidatorSharesToTokensQueryCallback) String() string { return proto.CompactTextString(m) } func (*ValidatorSharesToTokensQueryCallback) ProtoMessage() {} func (*ValidatorSharesToTokensQueryCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{9} + return fileDescriptor_f41c99b09b96a5ac, []int{10} } func (m *ValidatorSharesToTokensQueryCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -557,7 +617,7 @@ func (m *DelegatorSharesQueryCallback) Reset() { *m = DelegatorSharesQue func (m *DelegatorSharesQueryCallback) String() string { return proto.CompactTextString(m) } func (*DelegatorSharesQueryCallback) ProtoMessage() {} func (*DelegatorSharesQueryCallback) Descriptor() ([]byte, []int) { - return fileDescriptor_f41c99b09b96a5ac, []int{10} + return fileDescriptor_f41c99b09b96a5ac, []int{11} } func (m *DelegatorSharesQueryCallback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -591,6 +651,7 @@ func init() { proto.RegisterType((*DelegateCallback)(nil), "stride.stakeibc.DelegateCallback") proto.RegisterType((*ClaimCallback)(nil), "stride.stakeibc.ClaimCallback") proto.RegisterType((*ReinvestCallback)(nil), "stride.stakeibc.ReinvestCallback") + proto.RegisterType((*UndelegateCallback)(nil), "stride.stakeibc.UndelegateCallback") proto.RegisterType((*RedemptionCallback)(nil), "stride.stakeibc.RedemptionCallback") proto.RegisterType((*Rebalancing)(nil), "stride.stakeibc.Rebalancing") proto.RegisterType((*RebalanceCallback)(nil), "stride.stakeibc.RebalanceCallback") @@ -603,58 +664,59 @@ func init() { func init() { proto.RegisterFile("stride/stakeibc/callbacks.proto", fileDescriptor_f41c99b09b96a5ac) } var fileDescriptor_f41c99b09b96a5ac = []byte{ - // 805 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x4f, 0xe3, 0x46, - 0x14, 0x8f, 0x09, 0x02, 0x32, 0x09, 0x24, 0x58, 0x55, 0x1b, 0xa2, 0x28, 0x49, 0x4d, 0xd5, 0xa2, - 0x4a, 0xd8, 0x22, 0x55, 0xab, 0x56, 0xbd, 0x50, 0x40, 0x55, 0x23, 0x85, 0x4a, 0x75, 0xa0, 0x07, - 0x2e, 0xd6, 0xd8, 0x1e, 0x25, 0xa3, 0xd8, 0x33, 0xc1, 0x33, 0x09, 0x85, 0x4f, 0xd0, 0x23, 0xd7, - 0x7e, 0x84, 0xf6, 0xd2, 0x4f, 0xb0, 0x77, 0x8e, 0x1c, 0x57, 0x7b, 0x60, 0x57, 0xf0, 0x45, 0x56, - 0x33, 0x1e, 0xff, 0x49, 0xa2, 0x95, 0x36, 0xda, 0x53, 0xe2, 0x37, 0xbf, 0x37, 0xef, 0xfd, 0x7e, - 0xef, 0xe7, 0x67, 0xd0, 0x66, 0x3c, 0xc2, 0x3e, 0xb2, 0x18, 0x87, 0x63, 0x84, 0x5d, 0xcf, 0xf2, - 0x60, 0x10, 0xb8, 0xd0, 0x1b, 0x33, 0x73, 0x12, 0x51, 0x4e, 0xf5, 0x6a, 0x0c, 0x30, 0x13, 0x40, - 0xe3, 0xb3, 0x21, 0x1d, 0x52, 0x79, 0x66, 0x89, 0x7f, 0x31, 0xac, 0xd1, 0xf2, 0x28, 0x0b, 0x29, - 0xb3, 0x5c, 0xc8, 0x90, 0x35, 0x3b, 0x72, 0x11, 0x87, 0x47, 0x96, 0x47, 0x31, 0x51, 0xe7, 0x4d, - 0x55, 0x27, 0x42, 0x1e, 0x8d, 0x7c, 0x96, 0xfc, 0xaa, 0xd3, 0xa5, 0x2e, 0x46, 0x94, 0x71, 0xe7, - 0x8e, 0x12, 0xf4, 0x21, 0xc0, 0x0c, 0x06, 0xd8, 0x87, 0x9c, 0x46, 0x31, 0xc0, 0xb8, 0x01, 0xd5, - 0xc1, 0x24, 0xc0, 0xfc, 0x0c, 0x05, 0x68, 0x08, 0x39, 0xa6, 0x44, 0x6f, 0x82, 0x52, 0x8a, 0xaa, - 0x6b, 0x1d, 0xed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 0xf0, 0xfa, 0xa5, 0x55, 0xb8, 0xea, 0xe6, 0x6e, 0x1f, 0x48, - 0x9e, 0x87, 0x7d, 0xe8, 0x32, 0x4b, 0x7d, 0x5a, 0x66, 0x47, 0xdf, 0x5b, 0x7f, 0x65, 0x1f, 0x18, - 0x59, 0xcd, 0xdd, 0x90, 0x5f, 0x97, 0xef, 0xde, 0x07, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x24, 0x25, - 0x84, 0x27, 0x07, 0x00, 0x00, + // 822 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x6f, 0xeb, 0x44, + 0x10, 0x8f, 0x9b, 0xa7, 0xf7, 0x5e, 0x36, 0x69, 0x93, 0x5a, 0x08, 0xd2, 0x28, 0x4a, 0x82, 0x1f, + 0x82, 0x0a, 0xa9, 0xb6, 0x5a, 0x04, 0x02, 0x71, 0x29, 0x6d, 0x85, 0x88, 0x94, 0x22, 0xe1, 0xb4, + 0x1c, 0x7a, 0xb1, 0xd6, 0xde, 0x55, 0xb2, 0x8a, 0xbd, 0x9b, 0x7a, 0x37, 0x29, 0xed, 0x27, 0xe0, + 0xd8, 0x2b, 0x1f, 0x01, 0x2e, 0x7c, 0x02, 0x2e, 0x9c, 0x7a, 0xec, 0x11, 0x71, 0x28, 0xa8, 0xfd, + 0x22, 0x68, 0xd7, 0xeb, 0x3f, 0x49, 0xa0, 0x22, 0x70, 0x4a, 0x3c, 0xf3, 0x9b, 0x9d, 0xf9, 0xcd, + 0x6f, 0x66, 0x17, 0x74, 0xb9, 0x88, 0x09, 0xc2, 0x0e, 0x17, 0x70, 0x82, 0x89, 0x1f, 0x38, 0x01, + 0x0c, 0x43, 0x1f, 0x06, 0x13, 0x6e, 0x4f, 0x63, 0x26, 0x98, 0x59, 0x4f, 0x00, 0x76, 0x0a, 0x68, + 0xbd, 0x35, 0x62, 0x23, 0xa6, 0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b8, 0x96, 0xad, 0x4b, 0xf0, 0x5e, 0x66, 0x4f, 0xba, + 0x72, 0xc6, 0x54, 0x6d, 0xfc, 0x9b, 0x19, 0x8e, 0xaf, 0xb3, 0x16, 0xf5, 0x41, 0x23, 0xe4, 0x91, + 0x17, 0x2a, 0x9e, 0x9e, 0x3a, 0x73, 0x99, 0x5d, 0x96, 0x68, 0xb1, 0x1f, 0xee, 0x56, 0xc8, 0xa3, + 0xc2, 0xb7, 0x75, 0x6b, 0x80, 0xb6, 0x5e, 0xb0, 0x34, 0xe7, 0x62, 0xae, 0x29, 0x68, 0x13, 0x4a, + 0x04, 0x81, 0x61, 0x3e, 0x8e, 0x85, 0x65, 0x4e, 0xc6, 0x63, 0xed, 0xf1, 0x6b, 0xe9, 0x33, 0x33, + 0xba, 0xf9, 0x92, 0x1f, 0x0d, 0xee, 0x1e, 0x3b, 0xc6, 0xfd, 0x63, 0xc7, 0xf8, 0xf3, 0xb1, 0x63, + 0xdc, 0x3e, 0x75, 0x4a, 0xf7, 0x4f, 0x9d, 0xd2, 0x6f, 0x4f, 0x9d, 0xd2, 0xc5, 0x41, 0xe1, 0xf4, + 0xa1, 0xe2, 0xb9, 0x37, 0x80, 0x3e, 0x77, 0xf4, 0xfb, 0x38, 0xdf, 0xff, 0xd8, 0xf9, 0x2e, 0x7f, + 0x25, 0x55, 0x36, 0xff, 0xa5, 0x7a, 0x22, 0x3f, 0xfa, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x45, + 0xda, 0x3f, 0xec, 0x07, 0x00, 0x00, } func (m *SplitDelegation) Marshal() (dAtA []byte, err error) { @@ -828,7 +890,7 @@ func (m *ReinvestCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *RedemptionCallback) Marshal() (dAtA []byte, err error) { +func (m *UndelegateCallback) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -838,12 +900,12 @@ func (m *RedemptionCallback) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RedemptionCallback) MarshalTo(dAtA []byte) (int, error) { +func (m *UndelegateCallback) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RedemptionCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *UndelegateCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -864,6 +926,68 @@ func (m *RedemptionCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], dAtA3[:j2]) i = encodeVarintCallbacks(dAtA, i, uint64(j2)) i-- + dAtA[i] = 0x1a + } + if len(m.SplitDelegations) > 0 { + for iNdEx := len(m.SplitDelegations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SplitDelegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCallbacks(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.HostZoneId) > 0 { + i -= len(m.HostZoneId) + copy(dAtA[i:], m.HostZoneId) + i = encodeVarintCallbacks(dAtA, i, uint64(len(m.HostZoneId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RedemptionCallback) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RedemptionCallback) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RedemptionCallback) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.EpochUnbondingRecordIds) > 0 { + dAtA5 := make([]byte, len(m.EpochUnbondingRecordIds)*10) + var j4 int + for _, num := range m.EpochUnbondingRecordIds { + for num >= 1<<7 { + dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j4++ + } + dAtA5[j4] = uint8(num) + j4++ + } + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintCallbacks(dAtA, i, uint64(j4)) + i-- dAtA[i] = 0x12 } if len(m.HostZoneId) > 0 { @@ -1212,6 +1336,32 @@ func (m *ReinvestCallback) Size() (n int) { return n } +func (m *UndelegateCallback) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.HostZoneId) + if l > 0 { + n += 1 + l + sovCallbacks(uint64(l)) + } + if len(m.SplitDelegations) > 0 { + for _, e := range m.SplitDelegations { + l = e.Size() + n += 1 + l + sovCallbacks(uint64(l)) + } + } + if len(m.EpochUnbondingRecordIds) > 0 { + l = 0 + for _, e := range m.EpochUnbondingRecordIds { + l += sovCallbacks(uint64(e)) + } + n += 1 + sovCallbacks(uint64(l)) + l + } + return n +} + func (m *RedemptionCallback) Size() (n int) { if m == nil { return 0 @@ -1833,6 +1983,198 @@ func (m *ReinvestCallback) Unmarshal(dAtA []byte) error { } return nil } +func (m *UndelegateCallback) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallbacks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UndelegateCallback: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UndelegateCallback: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostZoneId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallbacks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCallbacks + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCallbacks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostZoneId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SplitDelegations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallbacks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCallbacks + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCallbacks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SplitDelegations = append(m.SplitDelegations, &SplitDelegation{}) + if err := m.SplitDelegations[len(m.SplitDelegations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallbacks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EpochUnbondingRecordIds = append(m.EpochUnbondingRecordIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallbacks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthCallbacks + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthCallbacks + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.EpochUnbondingRecordIds) == 0 { + m.EpochUnbondingRecordIds = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallbacks + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EpochUnbondingRecordIds = append(m.EpochUnbondingRecordIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field EpochUnbondingRecordIds", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipCallbacks(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCallbacks + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *RedemptionCallback) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From 57d61c69725dddcf17d8c38a4de9b8dd9210a27d Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:39:13 -0500 Subject: [PATCH 12/26] calibrate: rm admin gate --- x/stakeibc/types/message_calibrate_delegation.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/x/stakeibc/types/message_calibrate_delegation.go b/x/stakeibc/types/message_calibrate_delegation.go index a1c160c831..5f1ca4d655 100644 --- a/x/stakeibc/types/message_calibrate_delegation.go +++ b/x/stakeibc/types/message_calibrate_delegation.go @@ -6,8 +6,6 @@ import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/Stride-Labs/stride/v15/utils" ) const TypeMsgCalibrateDelegation = "calibrate_delegation" @@ -48,9 +46,6 @@ func (msg *MsgCalibrateDelegation) ValidateBasic() error { if err != nil { return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } - if err := utils.ValidateAdminAddress(msg.Creator); err != nil { - return err - } if len(msg.ChainId) == 0 { return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "chainid is required") From 9463f14a52ae3c15a0ad00569ee228c0ffcefcd1 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:44:29 -0500 Subject: [PATCH 13/26] calibration: do not block ICAs --- .../icqcallbacks_callibrate_delegation.go | 30 ------------------- x/stakeibc/keeper/msg_server_submit_tx.go | 5 ---- 2 files changed, 35 deletions(-) diff --git a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go index f258a16a29..49abb32078 100644 --- a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go +++ b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go @@ -54,36 +54,6 @@ func CalibrateDelegationCallback(k Keeper, ctx sdk.Context, args []byte, query i return errorsmod.Wrapf(types.ErrValidatorNotFound, "no registered validator for address (%s)", queriedDelegation.ValidatorAddress) } - // Check if the ICQ overlapped a delegation, undelegation, or detokenization ICA - // that would have modfied the number of delegated tokens - prevInternalDelegation := callbackData.InitialValidatorDelegation - currInternalDelegation := validator.Delegation - icaOverlappedIcq, err := k.CheckDelegationChangedDuringQuery(ctx, validator, prevInternalDelegation, currInternalDelegation) - if err != nil { - return err - } - - // If the ICA/ICQ overlapped, submit a new query - if icaOverlappedIcq { - // Store the updated validator delegation amount - callbackDataBz, err := proto.Marshal(&types.DelegatorSharesQueryCallback{ - InitialValidatorDelegation: currInternalDelegation, - }) - if err != nil { - return errorsmod.Wrapf(err, "unable to marshal delegator shares callback data") - } - query.CallbackData = callbackDataBz - - if err := k.InterchainQueryKeeper.RetryICQRequest(ctx, query); err != nil { - return errorsmod.Wrapf(err, "unable to resubmit delegator shares query") - } - return nil - } - - // If there was no ICA/ICQ overlap, update the validator to indicate that the query - // is no longer in progress (which will unblock LSM liquid stakes to that validator) - validator.SlashQueryInProgress = false - // Calculate the number of tokens delegated (using the internal sharesToTokensRate) // note: truncateInt per https://github.com/cosmos/cosmos-sdk/blob/cb31043d35bad90c4daa923bb109f38fd092feda/x/staking/types/validator.go#L431 delegatedTokens := queriedDelegation.Shares.Mul(validator.SharesToTokensRate).TruncateInt() diff --git a/x/stakeibc/keeper/msg_server_submit_tx.go b/x/stakeibc/keeper/msg_server_submit_tx.go index e9b2f5f12a..9c0b881296 100644 --- a/x/stakeibc/keeper/msg_server_submit_tx.go +++ b/x/stakeibc/keeper/msg_server_submit_tx.go @@ -526,11 +526,6 @@ func (k Keeper) SubmitCalibrationICQ(ctx sdk.Context, hostZone types.HostZone, v return errorsmod.Wrapf(err, "unable to marshal delegator shares callback data") } - // Update the validator to indicate that the slash query is in progress - validator.SlashQueryInProgress = true - hostZone.Validators[valIndex] = &validator - k.SetHostZone(ctx, hostZone) - // Submit delegator shares ICQ query := icqtypes.Query{ ChainId: hostZone.ChainId, From 9e2c398705c5a60943b7727ae94b79c24e31cec9 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:52:07 -0500 Subject: [PATCH 14/26] calibration: limit calibration adjustment to record keeping to <1000microdenom --- x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go | 9 +++++++++ x/stakeibc/types/errors.go | 1 + 2 files changed, 10 insertions(+) diff --git a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go index 49abb32078..15235f02c8 100644 --- a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go +++ b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go @@ -11,6 +11,9 @@ import ( "github.com/Stride-Labs/stride/v15/x/stakeibc/types" ) +// CalibrationThreshold is the max amount of tokens by which a calibration can alter internal record keeping of delegations +var CalibrationThreshold = sdk.NewInt(1000) + // DelegatorSharesCallback is a callback handler for UpdateValidatorSharesExchRate queries. // // In an attempt to get the ICA's delegation amount on a given validator, we have to query: @@ -67,6 +70,12 @@ func CalibrateDelegationCallback(k Keeper, ctx sdk.Context, args []byte, query i } delegationChange := validator.Delegation.Sub(delegatedTokens) + // if the delegation change is more than the calibration threshold constant, log and throw an error + if delegationChange.Abs().GTE(CalibrationThreshold) { + k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, + "Delegation change is GT CalibrationThreshold, failing calibration callback")) + return errorsmod.Wrapf(types.ErrCalibrationThresholdExceeded, "calibration threshold %v exceeded, attempted to calibrate by %v ", CalibrationThreshold, delegationChange) + } validator.Delegation = validator.Delegation.Sub(delegationChange) hostZone.TotalDelegations = hostZone.TotalDelegations.Sub(delegationChange) diff --git a/x/stakeibc/types/errors.go b/x/stakeibc/types/errors.go index a0805b6f3f..939739b8e4 100644 --- a/x/stakeibc/types/errors.go +++ b/x/stakeibc/types/errors.go @@ -57,4 +57,5 @@ var ( ErrLSMLiquidStakeDisabledForHostZone = errorsmod.Register(ModuleName, 1549, "LSM liquid stake is disabled for host zone") ErrUnableToRemoveValidator = errorsmod.Register(ModuleName, 1550, "Unable to remove validator") ErrInvalidBounds = errorsmod.Register(ModuleName, 1551, "Invalid safety bounds - inner bounds must be within outer bounds") + ErrCalibrationThresholdExceeded = errorsmod.Register(ModuleName, 1552, "Calibration threshold exceeded") ) From dea43a748ef6c1c06089011c5a243eac2130e57c Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 04:52:07 -0500 Subject: [PATCH 15/26] calibration: limit calibration adjustment to record keeping to <1000microdenom --- x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go | 9 +++++++++ x/stakeibc/keeper/msg_server_submit_tx.go | 2 +- x/stakeibc/types/errors.go | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go index 49abb32078..15235f02c8 100644 --- a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go +++ b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go @@ -11,6 +11,9 @@ import ( "github.com/Stride-Labs/stride/v15/x/stakeibc/types" ) +// CalibrationThreshold is the max amount of tokens by which a calibration can alter internal record keeping of delegations +var CalibrationThreshold = sdk.NewInt(1000) + // DelegatorSharesCallback is a callback handler for UpdateValidatorSharesExchRate queries. // // In an attempt to get the ICA's delegation amount on a given validator, we have to query: @@ -67,6 +70,12 @@ func CalibrateDelegationCallback(k Keeper, ctx sdk.Context, args []byte, query i } delegationChange := validator.Delegation.Sub(delegatedTokens) + // if the delegation change is more than the calibration threshold constant, log and throw an error + if delegationChange.Abs().GTE(CalibrationThreshold) { + k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, + "Delegation change is GT CalibrationThreshold, failing calibration callback")) + return errorsmod.Wrapf(types.ErrCalibrationThresholdExceeded, "calibration threshold %v exceeded, attempted to calibrate by %v ", CalibrationThreshold, delegationChange) + } validator.Delegation = validator.Delegation.Sub(delegationChange) hostZone.TotalDelegations = hostZone.TotalDelegations.Sub(delegationChange) diff --git a/x/stakeibc/keeper/msg_server_submit_tx.go b/x/stakeibc/keeper/msg_server_submit_tx.go index 9c0b881296..2520c259b7 100644 --- a/x/stakeibc/keeper/msg_server_submit_tx.go +++ b/x/stakeibc/keeper/msg_server_submit_tx.go @@ -500,7 +500,7 @@ func (k Keeper) SubmitCalibrationICQ(ctx sdk.Context, hostZone types.HostZone, v if hostZone.DelegationIcaAddress == "" { return errorsmod.Wrapf(types.ErrICAAccountNotFound, "no delegation address found for %s", hostZone.ChainId) } - validator, valIndex, found := GetValidatorFromAddress(hostZone.Validators, validatorAddress) + validator, _, found := GetValidatorFromAddress(hostZone.Validators, validatorAddress) if !found { return errorsmod.Wrapf(types.ErrValidatorNotFound, "no registered validator for address (%s)", validatorAddress) } diff --git a/x/stakeibc/types/errors.go b/x/stakeibc/types/errors.go index a0805b6f3f..939739b8e4 100644 --- a/x/stakeibc/types/errors.go +++ b/x/stakeibc/types/errors.go @@ -57,4 +57,5 @@ var ( ErrLSMLiquidStakeDisabledForHostZone = errorsmod.Register(ModuleName, 1549, "LSM liquid stake is disabled for host zone") ErrUnableToRemoveValidator = errorsmod.Register(ModuleName, 1550, "Unable to remove validator") ErrInvalidBounds = errorsmod.Register(ModuleName, 1551, "Invalid safety bounds - inner bounds must be within outer bounds") + ErrCalibrationThresholdExceeded = errorsmod.Register(ModuleName, 1552, "Calibration threshold exceeded") ) From 856bf8c15cc4a4fa7b071df160faaa472f85e479 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 11 Oct 2023 13:57:18 -0500 Subject: [PATCH 16/26] add calibrate delegation test --- .../icqcallbacks_delegator_shares_test.go | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/x/stakeibc/keeper/icqcallbacks_delegator_shares_test.go b/x/stakeibc/keeper/icqcallbacks_delegator_shares_test.go index be94762956..74d8e93e56 100644 --- a/x/stakeibc/keeper/icqcallbacks_delegator_shares_test.go +++ b/x/stakeibc/keeper/icqcallbacks_delegator_shares_test.go @@ -375,3 +375,24 @@ func (s *KeeperTestSuite) TestDelegatorSharesCallback_PrecisionError() { expectedValDelegation := tc.hostZone.Validators[tc.valIndexQueried].Delegation.Add(precisionErrorTokens) s.Require().Equal(expectedValDelegation.Int64(), validator.Delegation.Int64(), "validator delegation amount") } + +func (s *KeeperTestSuite) TestCalibrateDelegationCallback_Successful() { + tc := s.SetupDelegatorSharesICQCallback() + + // Callback + err := keeper.CalibrateDelegationCallback(s.App.StakeibcKeeper, s.Ctx, tc.validArgs.callbackArgs, tc.validArgs.query) + s.Require().NoError(err, "calibrate delegation callback error") + + // Confirm the staked balance was decreased on the host + hostZone, found := s.App.StakeibcKeeper.GetHostZone(s.Ctx, HostChainId) + s.Require().True(found, "host zone found") + s.Require().Equal(tc.expectedSlashAmount.Int64(), tc.hostZone.TotalDelegations.Sub(hostZone.TotalDelegations).Int64(), "staked bal slash") + + // Confirm the validator's weight and delegation amount were not reduced + validator := hostZone.Validators[tc.valIndexQueried] + s.Require().NotEqual(tc.expectedWeight, validator.Weight, "validator weight") + s.Require().Equal(tc.expectedDelegationAmount.Int64(), validator.Delegation.Int64(), "validator delegation amount") + + // Confirm the validator query is still in progress (calibration callback does not set it false) + s.Require().True(validator.SlashQueryInProgress, "slash query in progress") +} From 6ca4fef79182579851a442169be5c1b9c8d36620 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Tue, 31 Oct 2023 19:50:57 -0400 Subject: [PATCH 17/26] raise calibration threshold --- x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go index 15235f02c8..d1f2e7b74a 100644 --- a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go +++ b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go @@ -12,7 +12,7 @@ import ( ) // CalibrationThreshold is the max amount of tokens by which a calibration can alter internal record keeping of delegations -var CalibrationThreshold = sdk.NewInt(1000) +var CalibrationThreshold = sdk.NewInt(100000) // DelegatorSharesCallback is a callback handler for UpdateValidatorSharesExchRate queries. // From 834898c035650b33f675e2bca55aa115b66db732 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Thu, 9 Nov 2023 11:52:05 -0500 Subject: [PATCH 18/26] small fixes per sam's pr comments --- x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go index d1f2e7b74a..19cb7ee5c2 100644 --- a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go +++ b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go @@ -72,9 +72,9 @@ func CalibrateDelegationCallback(k Keeper, ctx sdk.Context, args []byte, query i delegationChange := validator.Delegation.Sub(delegatedTokens) // if the delegation change is more than the calibration threshold constant, log and throw an error if delegationChange.Abs().GTE(CalibrationThreshold) { - k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, + k.Logger(ctx).Error(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, "Delegation change is GT CalibrationThreshold, failing calibration callback")) - return errorsmod.Wrapf(types.ErrCalibrationThresholdExceeded, "calibration threshold %v exceeded, attempted to calibrate by %v ", CalibrationThreshold, delegationChange) + return nil } validator.Delegation = validator.Delegation.Sub(delegationChange) hostZone.TotalDelegations = hostZone.TotalDelegations.Sub(delegationChange) From 86cbe4a894469c76e8e6400c8d0f187f740a21cf Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Thu, 30 Nov 2023 16:01:54 -0500 Subject: [PATCH 19/26] Set CalibrationThreshold to 3000 --- x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go index 19cb7ee5c2..d5828e927b 100644 --- a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go +++ b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go @@ -12,7 +12,7 @@ import ( ) // CalibrationThreshold is the max amount of tokens by which a calibration can alter internal record keeping of delegations -var CalibrationThreshold = sdk.NewInt(100000) +var CalibrationThreshold = sdk.NewInt(3000) // DelegatorSharesCallback is a callback handler for UpdateValidatorSharesExchRate queries. // From e4b05adb87e23e5b28ca59d62dc3fdb2b59cca20 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Mon, 4 Dec 2023 15:42:18 -0500 Subject: [PATCH 20/26] add test for slash beyond threshold --- .../icqcallbacks_delegator_shares_test.go | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/x/stakeibc/keeper/icqcallbacks_delegator_shares_test.go b/x/stakeibc/keeper/icqcallbacks_delegator_shares_test.go index 74d8e93e56..a3bf0ac3d8 100644 --- a/x/stakeibc/keeper/icqcallbacks_delegator_shares_test.go +++ b/x/stakeibc/keeper/icqcallbacks_delegator_shares_test.go @@ -396,3 +396,124 @@ func (s *KeeperTestSuite) TestCalibrateDelegationCallback_Successful() { // Confirm the validator query is still in progress (calibration callback does not set it false) s.Require().True(validator.SlashQueryInProgress, "slash query in progress") } + +func (s *KeeperTestSuite) SetupDelegatorSharesICQCallbackLargeSlash() DelegatorSharesICQCallbackTestCase { + // Setting this up to initialize the coordinator for the block time + s.CreateTransferChannel(HostChainId) + + valIndexQueried := 1 + tokensBeforeSlash := sdkmath.NewInt(10000) + sharesToTokensRate := sdk.NewDec(1).Quo(sdk.NewDec(2)) // 0.5 + numShares := sdk.NewDec(5000) + + // 5000 shares * 0.5 sharesToTokens rate = 2500 tokens + // 10000 tokens - 2500 token = 7500 tokens slashed + // 7500 slash tokens / 10000 initial tokens = 75% slash + expectedTokensAfterSlash := sdkmath.NewInt(2500) + expectedSlashAmount := tokensBeforeSlash.Sub(expectedTokensAfterSlash) + slashPercentage := sdk.MustNewDecFromStr("0.75") + weightBeforeSlash := uint64(20) + expectedWeightAfterSlash := uint64(5) + totalDelegation := sdkmath.NewInt(100000) + + s.Require().Equal(numShares, sdk.NewDecFromInt(expectedTokensAfterSlash.Mul(sdkmath.NewInt(2))), "tokens, shares, and sharesToTokens rate aligned") + s.Require().Equal(slashPercentage, sdk.NewDecFromInt(expectedSlashAmount).Quo(sdk.NewDecFromInt(tokensBeforeSlash)), "expected slash percentage") + s.Require().Equal(slashPercentage, sdk.NewDec(int64(weightBeforeSlash-expectedWeightAfterSlash)).Quo(sdk.NewDec(int64(weightBeforeSlash))), "weight reduction") + + hostZone := types.HostZone{ + ChainId: HostChainId, + TotalDelegations: totalDelegation, + Validators: []*types.Validator{ + // This validator isn't being queried + { + Name: "val1", + Address: "valoper1", + Weight: 1, + Delegation: sdkmath.ZeroInt(), + }, + // This is the validator in question + { + Name: "val2", + Address: ValAddress, + SharesToTokensRate: sharesToTokensRate, + Delegation: tokensBeforeSlash, + Weight: weightBeforeSlash, + SlashQueryInProgress: true, + DelegationChangesInProgress: 0, + }, + }, + } + s.App.StakeibcKeeper.SetHostZone(s.Ctx, hostZone) + + queryResponse := s.CreateDelegatorSharesQueryResponse(ValAddress, numShares) + + // Create callback data + callbackDataBz, err := proto.Marshal(&types.DelegatorSharesQueryCallback{ + InitialValidatorDelegation: tokensBeforeSlash, + }) + s.Require().NoError(err, "no error expected when marshalling callback data") + + // Set the timeout timestamp to be 1 minute after the block time, and + // the timeout duration to be 5 minutes + blockTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) + s.Ctx = s.Ctx.WithBlockTime(blockTime) + timeoutDuration := time.Minute + timeoutTimestamp := uint64(blockTime.Add(timeoutDuration).UnixNano()) + + // Create the query that represents the ICQ in flight + query := icqtypes.Query{ + Id: "query-1", + ChainId: HostChainId, + ConnectionId: ibctesting.FirstConnectionID, + QueryType: icqtypes.STAKING_STORE_QUERY_WITH_PROOF, + CallbackData: callbackDataBz, + CallbackId: keeper.ICQCallbackID_Delegation, + CallbackModule: types.ModuleName, + TimeoutDuration: timeoutDuration, + TimeoutTimestamp: timeoutTimestamp, + RequestSent: true, + TimeoutPolicy: icqtypes.TimeoutPolicy_RETRY_QUERY_REQUEST, + } + s.App.InterchainqueryKeeper.SetQuery(s.Ctx, query) + + return DelegatorSharesICQCallbackTestCase{ + valIndexQueried: valIndexQueried, + validArgs: DelegatorSharesICQCallbackArgs{ + query: query, + callbackArgs: queryResponse, + }, + hostZone: hostZone, + numShares: numShares, + slashPercentage: slashPercentage, + expectedDelegationAmount: expectedTokensAfterSlash, + expectedSlashAmount: expectedSlashAmount, + expectedWeight: expectedWeightAfterSlash, + sharesToTokensRate: sharesToTokensRate, + retryTimeoutDuration: timeoutDuration, + } +} + +func (s *KeeperTestSuite) TestCalibrateDelegationCallback_SlashBeyondThreshold() { + tc := s.SetupDelegatorSharesICQCallbackLargeSlash() + weightBeforeSlash := tc.hostZone.Validators[tc.valIndexQueried].Weight + delegationAmountBeforeSlash := tc.hostZone.Validators[tc.valIndexQueried].Delegation + // Callback + err := keeper.CalibrateDelegationCallback(s.App.StakeibcKeeper, s.Ctx, tc.validArgs.callbackArgs, tc.validArgs.query) + // nil return indicates that the callback was not successful + s.Require().Nil(err) + + // Confirm the staked balance was not decreased on the host + hostZone, found := s.App.StakeibcKeeper.GetHostZone(s.Ctx, HostChainId) + s.Require().True(found, "host zone found") + // println(tc.hostZone.TotalDelegations.Sub(hostZone.TotalDelegations).Int64()) + // println(tc.hostZone.TotalDelegations.Int64()) + s.Require().Equal(sdk.ZeroInt().Int64(), tc.hostZone.TotalDelegations.Sub(hostZone.TotalDelegations).Int64(), "staked bal not slashed") + + // Confirm the validator's weight and delegation amount were not reduced + validator := hostZone.Validators[tc.valIndexQueried] + s.Require().Equal(weightBeforeSlash, validator.Weight, "validator weight unchanged") + s.Require().Equal(delegationAmountBeforeSlash.Int64(), validator.Delegation.Int64(), "validator delegation amount") + + // Confirm the validator query is still in progress (calibration callback does not set it false) + s.Require().True(validator.SlashQueryInProgress, "slash query in progress") +} From bf47e1b931e4924db56535bd8d94437182b2321a Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Mon, 4 Dec 2023 16:48:44 -0500 Subject: [PATCH 21/26] fix errors.go --- x/stakeibc/types/errors.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/x/stakeibc/types/errors.go b/x/stakeibc/types/errors.go index 81cff54365..ecd3f8f3fd 100644 --- a/x/stakeibc/types/errors.go +++ b/x/stakeibc/types/errors.go @@ -57,8 +57,7 @@ var ( ErrUnableToRemoveValidator = errorsmod.Register(ModuleName, 1550, "Unable to remove validator") ErrInvalidBounds = errorsmod.Register(ModuleName, 1551, "Invalid safety bounds - inner bounds must be within outer bounds") ErrCalibrationThresholdExceeded = errorsmod.Register(ModuleName, 1552, "Calibration threshold exceeded") - ErrInvalidBounds = errorsmod.Register(ModuleName, 1553, "Invalid safety bounds - inner bounds must be within outer bounds") - ErrHostZoneNotHalted = errorsmod.Register(ModuleName, 1554, "host zone is not halted") - ErrFailedToLiquidStake = errorsmod.Register(ModuleName, 1555, "Failed to liquid stake") - ErrUnableToRedeemStake = errorsmod.Register(ModuleName, 1556, "Failed to redeem stake") + ErrHostZoneNotHalted = errorsmod.Register(ModuleName, 1553, "host zone is not halted") + ErrFailedToLiquidStake = errorsmod.Register(ModuleName, 1554, "Failed to liquid stake") + ErrUnableToRedeemStake = errorsmod.Register(ModuleName, 1555, "Failed to redeem stake") ) From 299631329f48e246358fc2dd45d07c4591ff65ed Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Mon, 4 Dec 2023 16:51:27 -0500 Subject: [PATCH 22/26] remove callback data for calibrationquery (sam's pr comment) --- x/stakeibc/keeper/msg_server_submit_tx.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/x/stakeibc/keeper/msg_server_submit_tx.go b/x/stakeibc/keeper/msg_server_submit_tx.go index 622a79df31..dadc16a7e7 100644 --- a/x/stakeibc/keeper/msg_server_submit_tx.go +++ b/x/stakeibc/keeper/msg_server_submit_tx.go @@ -516,16 +516,6 @@ func (k Keeper) SubmitCalibrationICQ(ctx sdk.Context, hostZone types.HostZone, v } queryData := stakingtypes.GetDelegationKey(delegatorAddressBz, validatorAddressBz) - // Store the current validator's delegation in the callback data so we can determine if it changed - // while the query was in flight - callbackData := types.DelegatorSharesQueryCallback{ - InitialValidatorDelegation: validator.Delegation, - } - callbackDataBz, err := proto.Marshal(&callbackData) - if err != nil { - return errorsmod.Wrapf(err, "unable to marshal delegator shares callback data") - } - // Submit delegator shares ICQ query := icqtypes.Query{ ChainId: hostZone.ChainId, @@ -534,7 +524,7 @@ func (k Keeper) SubmitCalibrationICQ(ctx sdk.Context, hostZone types.HostZone, v RequestData: queryData, CallbackModule: types.ModuleName, CallbackId: ICQCallbackID_Calibrate, - CallbackData: callbackDataBz, + CallbackData: []byte{}, TimeoutDuration: time.Hour, TimeoutPolicy: icqtypes.TimeoutPolicy_RETRY_QUERY_REQUEST, } From b953092ba2adbbd8adc32777ee9fcb09e9c5916e Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Mon, 4 Dec 2023 17:01:08 -0500 Subject: [PATCH 23/26] fix typo --- x/stakeibc/keeper/msg_server_submit_tx.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/x/stakeibc/keeper/msg_server_submit_tx.go b/x/stakeibc/keeper/msg_server_submit_tx.go index dadc16a7e7..53ee796801 100644 --- a/x/stakeibc/keeper/msg_server_submit_tx.go +++ b/x/stakeibc/keeper/msg_server_submit_tx.go @@ -500,10 +500,6 @@ func (k Keeper) SubmitCalibrationICQ(ctx sdk.Context, hostZone types.HostZone, v if hostZone.DelegationIcaAddress == "" { return errorsmod.Wrapf(types.ErrICAAccountNotFound, "no delegation address found for %s", hostZone.ChainId) } - validator, _, found := GetValidatorFromAddress(hostZone.Validators, validatorAddress) - if !found { - return errorsmod.Wrapf(types.ErrValidatorNotFound, "no registered validator for address (%s)", validatorAddress) - } // Get the validator and delegator encoded addresses to form the query request _, validatorAddressBz, err := bech32.DecodeAndConvert(validatorAddress) From 6542233d7ce1ff5a8025f9115f636a544bfd0d4e Mon Sep 17 00:00:00 2001 From: sampocs Date: Tue, 5 Dec 2023 14:36:36 -0600 Subject: [PATCH 24/26] Unit tests for calibration ICQ callback (#1013) --- .../keeper/grpc_query_host_zone_test.go | 3 - .../icqcallbacks_callibrate_delegation.go | 21 +-- ...icqcallbacks_callibrate_delegation_test.go | 153 ++++++++++++++++++ .../icqcallbacks_delegator_shares_test.go | 121 -------------- .../keeper/msg_server_calibrate_delegation.go | 2 + x/stakeibc/keeper/msg_server_submit_tx.go | 1 - 6 files changed, 163 insertions(+), 138 deletions(-) create mode 100644 x/stakeibc/keeper/icqcallbacks_callibrate_delegation_test.go diff --git a/x/stakeibc/keeper/grpc_query_host_zone_test.go b/x/stakeibc/keeper/grpc_query_host_zone_test.go index 7e24d0c2bc..17381c1aad 100644 --- a/x/stakeibc/keeper/grpc_query_host_zone_test.go +++ b/x/stakeibc/keeper/grpc_query_host_zone_test.go @@ -20,9 +20,6 @@ func TestHostZoneQuerySingle(t *testing.T) { keeper, ctx := keepertest.StakeibcKeeper(t) wctx := sdk.WrapSDKContext(ctx) msgs := createNHostZone(keeper, ctx, 2) - for _, msg := range msgs { - t.Log(msg.ChainId) - } for _, tc := range []struct { desc string request *types.QueryGetHostZoneRequest diff --git a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go index cc9990c9b4..660a8249b8 100644 --- a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go +++ b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation.go @@ -4,7 +4,6 @@ import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/gogoproto/proto" "github.com/Stride-Labs/stride/v16/utils" icqtypes "github.com/Stride-Labs/stride/v16/x/interchainquery/types" @@ -12,7 +11,7 @@ import ( ) // CalibrationThreshold is the max amount of tokens by which a calibration can alter internal record keeping of delegations -var CalibrationThreshold = sdk.NewInt(3000) +var CalibrationThreshold = sdk.NewInt(5000) // DelegatorSharesCallback is a callback handler for UpdateValidatorSharesExchRate queries. // @@ -45,12 +44,6 @@ func CalibrateDelegationCallback(k Keeper, ctx sdk.Context, args []byte, query i k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, "Query response - Delegator: %s, Validator: %s, Shares: %v", queriedDelegation.DelegatorAddress, queriedDelegation.ValidatorAddress, queriedDelegation.Shares)) - // Unmarshal the callback data containing the previous delegation to the validator (from the time the query was submitted) - var callbackData types.DelegatorSharesQueryCallback - if err := proto.Unmarshal(query.CallbackData, &callbackData); err != nil { - return errorsmod.Wrapf(err, "unable to unmarshal delegator shares callback data") - } - // Grab the validator object from the hostZone using the address returned from the query validator, valIndex, found := GetValidatorFromAddress(hostZone.Validators, queriedDelegation.ValidatorAddress) if !found { @@ -69,9 +62,11 @@ func CalibrateDelegationCallback(k Keeper, ctx sdk.Context, args []byte, query i return nil } + // if the delegation change is more than the calibration threshold constant, + // return nil so the query submission succeeds + // Note: There should be no stateful changes above this line delegationChange := validator.Delegation.Sub(delegatedTokens) - // if the delegation change is more than the calibration threshold constant, log and throw an error - if delegationChange.Abs().GTE(CalibrationThreshold) { + if delegationChange.Abs().GT(CalibrationThreshold) { k.Logger(ctx).Error(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, "Delegation change is GT CalibrationThreshold, failing calibration callback")) return nil @@ -79,11 +74,11 @@ func CalibrateDelegationCallback(k Keeper, ctx sdk.Context, args []byte, query i validator.Delegation = validator.Delegation.Sub(delegationChange) hostZone.TotalDelegations = hostZone.TotalDelegations.Sub(delegationChange) - k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, - "Delegation updated to: %v", validator.Delegation)) - hostZone.Validators[valIndex] = &validator k.SetHostZone(ctx, hostZone) + k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(chainId, ICQCallbackID_Calibrate, + "Delegation updated to: %v", validator.Delegation)) + return nil } diff --git a/x/stakeibc/keeper/icqcallbacks_callibrate_delegation_test.go b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation_test.go new file mode 100644 index 0000000000..18ae8a44f1 --- /dev/null +++ b/x/stakeibc/keeper/icqcallbacks_callibrate_delegation_test.go @@ -0,0 +1,153 @@ +package keeper_test + +import ( + sdkmath "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" + + icqtypes "github.com/Stride-Labs/stride/v16/x/interchainquery/types" + "github.com/Stride-Labs/stride/v16/x/stakeibc/keeper" + "github.com/Stride-Labs/stride/v16/x/stakeibc/types" +) + +func (s *KeeperTestSuite) TestCalibrateDelegation_Success() { + queriedValIndex := 1 + initialTotalDelegations := sdkmath.NewInt(1_000_000) + + baseHostZone := types.HostZone{ + ChainId: HostChainId, + TotalDelegations: initialTotalDelegations, + Validators: []*types.Validator{ + {Address: "valoper1"}, // not queried + {Address: ValAddress}, // queried validator - will get overridden in each test case + }, + } + + testCases := []struct { + name string + currentDelegation sdkmath.Int + sharesInQueryResponse sdk.Dec + sharesToTokensRate sdk.Dec + expectedEndDelegation sdkmath.Int + }{ + { + // Current delegation: 10,000 tokens + // Query response: 13,334 shares * 0.75 sharesToTokens = 10,000 tokens (+0) + name: "delegation change of 0", + currentDelegation: sdkmath.NewInt(10_000), + sharesInQueryResponse: sdk.MustNewDecFromStr("13334"), + sharesToTokensRate: sdk.MustNewDecFromStr("0.75"), + expectedEndDelegation: sdkmath.NewInt(10_000), + }, + { + // Current delegation: 10,000 tokens + // Query response: 10,000 shares * 0.75 sharesToTokens = 7,500 tokens (-2,500) + name: "negative delegation change", + currentDelegation: sdkmath.NewInt(10_000), + sharesInQueryResponse: sdk.MustNewDecFromStr("10000"), + sharesToTokensRate: sdk.MustNewDecFromStr("0.75"), + expectedEndDelegation: sdkmath.NewInt(7_500), + }, + { + // Current delegation: 12,500 tokens + // Query response: 20,000 shares * 0.75 sharesToTokens = 15,000 tokens (+2,500) + name: "positive delegation change", + currentDelegation: sdkmath.NewInt(12_500), + sharesInQueryResponse: sdk.MustNewDecFromStr("20000"), + sharesToTokensRate: sdk.MustNewDecFromStr("0.75"), + expectedEndDelegation: sdkmath.NewInt(15_000), + }, + { + // Current delegation: 12,500 tokens + // Query response: 10,000 shares * 0.75 sharesToTokens = 7,500 tokens (-5,000) + name: "negative delegation change at threshold boundary", + currentDelegation: sdkmath.NewInt(12_500), + sharesInQueryResponse: sdk.MustNewDecFromStr("10000"), + sharesToTokensRate: sdk.MustNewDecFromStr("0.75"), + expectedEndDelegation: sdkmath.NewInt(7_500), + }, + { + // Current delegation: 10,000 tokens + // Query response: 20,000 shares * 0.75 sharesToTokens = 15,000 tokens (+5,000) + name: "positive delegation change at threshold boundary", + currentDelegation: sdkmath.NewInt(10_000), + sharesInQueryResponse: sdk.MustNewDecFromStr("20000"), + sharesToTokensRate: sdk.MustNewDecFromStr("0.75"), + expectedEndDelegation: sdkmath.NewInt(15_000), + }, + { + // Current delegation: 12,501 tokens + // Query response: 10,000 shares * 0.75 sharesToTokens = 7,500 tokens (-5,001) + name: "negative delegation change exceeds threshold", + currentDelegation: sdkmath.NewInt(12_501), + sharesInQueryResponse: sdk.MustNewDecFromStr("10000"), + sharesToTokensRate: sdk.MustNewDecFromStr("0.75"), + expectedEndDelegation: sdkmath.NewInt(12_501), // no change + }, + { + // Current delegation: 9,999 tokens + // Query response: 20,000 shares * 0.75 sharesToTokens = 15,000 tokens (+5,001) + name: "positive delegation change exceeds threshold", + currentDelegation: sdkmath.NewInt(9_999), + sharesInQueryResponse: sdk.MustNewDecFromStr("20000"), + sharesToTokensRate: sdk.MustNewDecFromStr("0.75"), + expectedEndDelegation: sdkmath.NewInt(9_999), // no change + }, + } + + for _, tc := range testCases { + // Define a host zone with the current parameters + hostZone := baseHostZone + hostZone.Validators[queriedValIndex] = &types.Validator{ + Address: ValAddress, + Delegation: tc.currentDelegation, + SharesToTokensRate: tc.sharesToTokensRate, + } + s.App.StakeibcKeeper.SetHostZone(s.Ctx, hostZone) + + // Mock out the query response and confirm the callback succeede + query := icqtypes.Query{ChainId: HostChainId} + queryResponse := s.CreateDelegatorSharesQueryResponse(ValAddress, tc.sharesInQueryResponse) + + err := keeper.CalibrateDelegationCallback(s.App.StakeibcKeeper, s.Ctx, queryResponse, query) + s.Require().NoError(err, "%s - no error expected during delegation callback", tc.name) + + // Fetch the updated host zone and validator + updatedHostZone, found := s.App.StakeibcKeeper.GetHostZone(s.Ctx, HostChainId) + s.Require().True(found, "%s - host zone should have been found", tc.name) + updatedValidator := updatedHostZone.Validators[queriedValIndex] + + // Confirm the delegation changes match expectations + expectedDelegationChange := tc.expectedEndDelegation.Sub(tc.currentDelegation) + expectedTotalDelegation := initialTotalDelegations.Add(expectedDelegationChange) + s.Require().Equal(tc.expectedEndDelegation.Int64(), updatedValidator.Delegation.Int64(), + "%s - validator delegation", tc.name) + s.Require().Equal(expectedTotalDelegation.Int64(), updatedHostZone.TotalDelegations.Int64(), + "%s - host zone total delegation", tc.name) + } +} + +func (s *KeeperTestSuite) TestCalibrateDelegation_Failure() { + s.App.StakeibcKeeper.SetHostZone(s.Ctx, types.HostZone{ + ChainId: HostChainId, + Validators: []*types.Validator{{Address: ValAddress}}, + }) + validQuery := icqtypes.Query{ChainId: HostChainId} + validQueryResponse := s.CreateDelegatorSharesQueryResponse(ValAddress, sdk.NewDec(1000)) + + // Atempt the callback with a missing host zone - it should fail + invalidQuery := validQuery + invalidQuery.ChainId = "" + err := keeper.CalibrateDelegationCallback(s.App.StakeibcKeeper, s.Ctx, validQueryResponse, invalidQuery) + s.Require().ErrorContains(err, "host zone not found") + + // Attempt the callback with an invalid query response - it should fail + invalidQueryResponse := []byte{1, 2, 3} + err = keeper.CalibrateDelegationCallback(s.App.StakeibcKeeper, s.Ctx, invalidQueryResponse, validQuery) + s.Require().ErrorContains(err, "unable to unmarshal delegator shares query response") + + // Attempt the callback with a non-existent validator address - it should fail + invalidQueryResponse = s.CreateDelegatorSharesQueryResponse("non-existent validator", sdk.NewDec(1000)) + err = keeper.CalibrateDelegationCallback(s.App.StakeibcKeeper, s.Ctx, invalidQueryResponse, validQuery) + s.Require().ErrorContains(err, "validator not found") +} diff --git a/x/stakeibc/keeper/icqcallbacks_delegator_shares_test.go b/x/stakeibc/keeper/icqcallbacks_delegator_shares_test.go index 183f94e48a..02e96b2f93 100644 --- a/x/stakeibc/keeper/icqcallbacks_delegator_shares_test.go +++ b/x/stakeibc/keeper/icqcallbacks_delegator_shares_test.go @@ -396,124 +396,3 @@ func (s *KeeperTestSuite) TestCalibrateDelegationCallback_Successful() { // Confirm the validator query is still in progress (calibration callback does not set it false) s.Require().True(validator.SlashQueryInProgress, "slash query in progress") } - -func (s *KeeperTestSuite) SetupDelegatorSharesICQCallbackLargeSlash() DelegatorSharesICQCallbackTestCase { - // Setting this up to initialize the coordinator for the block time - s.CreateTransferChannel(HostChainId) - - valIndexQueried := 1 - tokensBeforeSlash := sdkmath.NewInt(10000) - sharesToTokensRate := sdk.NewDec(1).Quo(sdk.NewDec(2)) // 0.5 - numShares := sdk.NewDec(5000) - - // 5000 shares * 0.5 sharesToTokens rate = 2500 tokens - // 10000 tokens - 2500 token = 7500 tokens slashed - // 7500 slash tokens / 10000 initial tokens = 75% slash - expectedTokensAfterSlash := sdkmath.NewInt(2500) - expectedSlashAmount := tokensBeforeSlash.Sub(expectedTokensAfterSlash) - slashPercentage := sdk.MustNewDecFromStr("0.75") - weightBeforeSlash := uint64(20) - expectedWeightAfterSlash := uint64(5) - totalDelegation := sdkmath.NewInt(100000) - - s.Require().Equal(numShares, sdk.NewDecFromInt(expectedTokensAfterSlash.Mul(sdkmath.NewInt(2))), "tokens, shares, and sharesToTokens rate aligned") - s.Require().Equal(slashPercentage, sdk.NewDecFromInt(expectedSlashAmount).Quo(sdk.NewDecFromInt(tokensBeforeSlash)), "expected slash percentage") - s.Require().Equal(slashPercentage, sdk.NewDec(int64(weightBeforeSlash-expectedWeightAfterSlash)).Quo(sdk.NewDec(int64(weightBeforeSlash))), "weight reduction") - - hostZone := types.HostZone{ - ChainId: HostChainId, - TotalDelegations: totalDelegation, - Validators: []*types.Validator{ - // This validator isn't being queried - { - Name: "val1", - Address: "valoper1", - Weight: 1, - Delegation: sdkmath.ZeroInt(), - }, - // This is the validator in question - { - Name: "val2", - Address: ValAddress, - SharesToTokensRate: sharesToTokensRate, - Delegation: tokensBeforeSlash, - Weight: weightBeforeSlash, - SlashQueryInProgress: true, - DelegationChangesInProgress: 0, - }, - }, - } - s.App.StakeibcKeeper.SetHostZone(s.Ctx, hostZone) - - queryResponse := s.CreateDelegatorSharesQueryResponse(ValAddress, numShares) - - // Create callback data - callbackDataBz, err := proto.Marshal(&types.DelegatorSharesQueryCallback{ - InitialValidatorDelegation: tokensBeforeSlash, - }) - s.Require().NoError(err, "no error expected when marshalling callback data") - - // Set the timeout timestamp to be 1 minute after the block time, and - // the timeout duration to be 5 minutes - blockTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) - s.Ctx = s.Ctx.WithBlockTime(blockTime) - timeoutDuration := time.Minute - timeoutTimestamp := uint64(blockTime.Add(timeoutDuration).UnixNano()) - - // Create the query that represents the ICQ in flight - query := icqtypes.Query{ - Id: "query-1", - ChainId: HostChainId, - ConnectionId: ibctesting.FirstConnectionID, - QueryType: icqtypes.STAKING_STORE_QUERY_WITH_PROOF, - CallbackData: callbackDataBz, - CallbackId: keeper.ICQCallbackID_Delegation, - CallbackModule: types.ModuleName, - TimeoutDuration: timeoutDuration, - TimeoutTimestamp: timeoutTimestamp, - RequestSent: true, - TimeoutPolicy: icqtypes.TimeoutPolicy_RETRY_QUERY_REQUEST, - } - s.App.InterchainqueryKeeper.SetQuery(s.Ctx, query) - - return DelegatorSharesICQCallbackTestCase{ - valIndexQueried: valIndexQueried, - validArgs: DelegatorSharesICQCallbackArgs{ - query: query, - callbackArgs: queryResponse, - }, - hostZone: hostZone, - numShares: numShares, - slashPercentage: slashPercentage, - expectedDelegationAmount: expectedTokensAfterSlash, - expectedSlashAmount: expectedSlashAmount, - expectedWeight: expectedWeightAfterSlash, - sharesToTokensRate: sharesToTokensRate, - retryTimeoutDuration: timeoutDuration, - } -} - -func (s *KeeperTestSuite) TestCalibrateDelegationCallback_SlashBeyondThreshold() { - tc := s.SetupDelegatorSharesICQCallbackLargeSlash() - weightBeforeSlash := tc.hostZone.Validators[tc.valIndexQueried].Weight - delegationAmountBeforeSlash := tc.hostZone.Validators[tc.valIndexQueried].Delegation - // Callback - err := keeper.CalibrateDelegationCallback(s.App.StakeibcKeeper, s.Ctx, tc.validArgs.callbackArgs, tc.validArgs.query) - // nil return indicates that the callback was not successful - s.Require().Nil(err) - - // Confirm the staked balance was not decreased on the host - hostZone, found := s.App.StakeibcKeeper.GetHostZone(s.Ctx, HostChainId) - s.Require().True(found, "host zone found") - // println(tc.hostZone.TotalDelegations.Sub(hostZone.TotalDelegations).Int64()) - // println(tc.hostZone.TotalDelegations.Int64()) - s.Require().Equal(sdk.ZeroInt().Int64(), tc.hostZone.TotalDelegations.Sub(hostZone.TotalDelegations).Int64(), "staked bal not slashed") - - // Confirm the validator's weight and delegation amount were not reduced - validator := hostZone.Validators[tc.valIndexQueried] - s.Require().Equal(weightBeforeSlash, validator.Weight, "validator weight unchanged") - s.Require().Equal(delegationAmountBeforeSlash.Int64(), validator.Delegation.Int64(), "validator delegation amount") - - // Confirm the validator query is still in progress (calibration callback does not set it false) - s.Require().True(validator.SlashQueryInProgress, "slash query in progress") -} diff --git a/x/stakeibc/keeper/msg_server_calibrate_delegation.go b/x/stakeibc/keeper/msg_server_calibrate_delegation.go index c4c965a7a7..013e49179c 100644 --- a/x/stakeibc/keeper/msg_server_calibrate_delegation.go +++ b/x/stakeibc/keeper/msg_server_calibrate_delegation.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" @@ -18,6 +19,7 @@ func (k msgServer) CalibrateDelegation(goCtx context.Context, msg *types.MsgCali } if err := k.SubmitCalibrationICQ(ctx, hostZone, msg.Valoper); err != nil { + k.Logger(ctx).Error(fmt.Sprintf("Error submitting ICQ for delegation, error : %s", err.Error())) return nil, err } diff --git a/x/stakeibc/keeper/msg_server_submit_tx.go b/x/stakeibc/keeper/msg_server_submit_tx.go index 53ee796801..73c8a80d1a 100644 --- a/x/stakeibc/keeper/msg_server_submit_tx.go +++ b/x/stakeibc/keeper/msg_server_submit_tx.go @@ -525,7 +525,6 @@ func (k Keeper) SubmitCalibrationICQ(ctx sdk.Context, hostZone types.HostZone, v TimeoutPolicy: icqtypes.TimeoutPolicy_RETRY_QUERY_REQUEST, } if err := k.InterchainQueryKeeper.SubmitICQRequest(ctx, query, false); err != nil { - k.Logger(ctx).Error(fmt.Sprintf("Error submitting ICQ for delegation, error : %s", err.Error())) return err } From 06144f37cf93f7317781c37a82952089bba21d08 Mon Sep 17 00:00:00 2001 From: Riley Edmunds Date: Wed, 6 Dec 2023 14:21:56 -0500 Subject: [PATCH 25/26] added back GetValidatorFromAddress check --- x/stakeibc/keeper/msg_server_submit_tx.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x/stakeibc/keeper/msg_server_submit_tx.go b/x/stakeibc/keeper/msg_server_submit_tx.go index 73c8a80d1a..911032a0e7 100644 --- a/x/stakeibc/keeper/msg_server_submit_tx.go +++ b/x/stakeibc/keeper/msg_server_submit_tx.go @@ -501,6 +501,12 @@ func (k Keeper) SubmitCalibrationICQ(ctx sdk.Context, hostZone types.HostZone, v return errorsmod.Wrapf(types.ErrICAAccountNotFound, "no delegation address found for %s", hostZone.ChainId) } + // ensure the validator is in the set for this host + _, _, found := GetValidatorFromAddress(hostZone.Validators, validatorAddress) + if !found { + return errorsmod.Wrapf(types.ErrValidatorNotFound, "no registered validator for address (%s)", validatorAddress) + } + // Get the validator and delegator encoded addresses to form the query request _, validatorAddressBz, err := bech32.DecodeAndConvert(validatorAddress) if err != nil { From b16fd21e799d251dd9e16900d5a3f0943484e05c Mon Sep 17 00:00:00 2001 From: sampocs Date: Wed, 13 Dec 2023 11:46:05 -0600 Subject: [PATCH 26/26] lint --- x/stakeibc/keeper/icacallbacks_undelegate.go | 1 - 1 file changed, 1 deletion(-) diff --git a/x/stakeibc/keeper/icacallbacks_undelegate.go b/x/stakeibc/keeper/icacallbacks_undelegate.go index fbe54ae397..a03da4c86c 100644 --- a/x/stakeibc/keeper/icacallbacks_undelegate.go +++ b/x/stakeibc/keeper/icacallbacks_undelegate.go @@ -1,7 +1,6 @@ package keeper import ( - "errors" "fmt" "time"