diff --git a/proto/interchain_security/ccv/consumer/v1/consumer.proto b/proto/interchain_security/ccv/consumer/v1/consumer.proto index 8f095cfcfc..b190b02f34 100644 --- a/proto/interchain_security/ccv/consumer/v1/consumer.proto +++ b/proto/interchain_security/ccv/consumer/v1/consumer.proto @@ -50,3 +50,8 @@ message SlashRequest { interchain_security.ccv.v1.SlashPacketData packet = 1; cosmos.staking.v1beta1.InfractionType infraction = 2; } + +// SlashRequests is a list of slash requests for CCV consumer module +message SlashRequests { + repeated SlashRequest requests = 1; +} diff --git a/proto/interchain_security/ccv/provider/v1/provider.proto b/proto/interchain_security/ccv/provider/v1/provider.proto index b1cc640fd0..01ded5d390 100644 --- a/proto/interchain_security/ccv/provider/v1/provider.proto +++ b/proto/interchain_security/ccv/provider/v1/provider.proto @@ -64,3 +64,9 @@ message HandshakeMetadata { string provider_fee_pool_addr = 1; string version = 2; } + +// SlashAcks contains addesses of consumer chain validators +// successfully slashed on the provider chain +message SlashAcks { + repeated string addresses = 1; +} \ No newline at end of file diff --git a/proto/interchain_security/ccv/v1/ccv.proto b/proto/interchain_security/ccv/v1/ccv.proto index fd7c64f96d..1e5499d81d 100644 --- a/proto/interchain_security/ccv/v1/ccv.proto +++ b/proto/interchain_security/ccv/v1/ccv.proto @@ -46,3 +46,13 @@ message SlashPacketData { // tell if the slashing is for a downtime or a double-signing infraction cosmos.staking.v1beta1.InfractionType infraction = 3; } + +// UnbondingOpsIndex defines a list of unbonding operation ids. +message UnbondingOpsIndex { + repeated uint64 ids = 1; +} + +// MaturedUnbondingOps defines a list of ids corresponding to ids of matured unbonding operations. +message MaturedUnbondingOps { + repeated uint64 ids = 1; +} diff --git a/x/ccv/consumer/keeper/keeper.go b/x/ccv/consumer/keeper/keeper.go index f0dfb9edd5..6fbe2e74d5 100644 --- a/x/ccv/consumer/keeper/keeper.go +++ b/x/ccv/consumer/keeper/keeper.go @@ -1,9 +1,7 @@ package keeper import ( - "bytes" "encoding/binary" - "encoding/json" "fmt" "time" @@ -389,36 +387,40 @@ func (k Keeper) GetAllCCValidator(ctx sdk.Context) (validators []types.CrossChai } // SetPendingSlashRequests sets the pending slash requests in store -func (k Keeper) SetPendingSlashRequests(ctx sdk.Context, requests []types.SlashRequest) { +func (k Keeper) SetPendingSlashRequests(ctx sdk.Context, requests []*types.SlashRequest) { store := ctx.KVStore(k.storeKey) - buf := &bytes.Buffer{} - err := json.NewEncoder(buf).Encode(&requests) + + sr := types.SlashRequests{ + Requests: requests, + } + bz, err := sr.Marshal() if err != nil { panic(fmt.Errorf("failed to encode slash request json: %w", err)) } - store.Set([]byte{types.PendingSlashRequestsBytePrefix}, buf.Bytes()) + store.Set([]byte{types.PendingSlashRequestsBytePrefix}, bz) } // GetPendingSlashRequest returns the pending slash requests in store -func (k Keeper) GetPendingSlashRequests(ctx sdk.Context) (requests []types.SlashRequest) { +func (k Keeper) GetPendingSlashRequests(ctx sdk.Context) []*types.SlashRequest { store := ctx.KVStore(k.storeKey) bz := store.Get([]byte{types.PendingSlashRequestsBytePrefix}) if bz == nil { - return + return []*types.SlashRequest{} } - buf := bytes.NewBuffer(bz) - err := json.NewDecoder(buf).Decode(&requests) + + var sr types.SlashRequests + err := sr.Unmarshal(bz) if err != nil { panic(fmt.Errorf("failed to decode slash request json: %w", err)) } - return + return sr.GetRequests() } // AppendPendingSlashRequests appends the given slash request to the pending slash requests in store func (k Keeper) AppendPendingSlashRequests(ctx sdk.Context, req types.SlashRequest) { requests := k.GetPendingSlashRequests(ctx) - requests = append(requests, req) + requests = append(requests, &req) k.SetPendingSlashRequests(ctx, requests) } diff --git a/x/ccv/consumer/keeper/keeper_test.go b/x/ccv/consumer/keeper/keeper_test.go index cac65fed2b..d9f01c3aca 100644 --- a/x/ccv/consumer/keeper/keeper_test.go +++ b/x/ccv/consumer/keeper/keeper_test.go @@ -177,9 +177,9 @@ func TestPendingSlashRequests(t *testing.T) { defer ctrl.Finish() // prepare test setup by storing 10 pending slash requests - request := []types.SlashRequest{} + request := []*types.SlashRequest{} for i := 0; i < 10; i++ { - request = append(request, types.SlashRequest{}) + request = append(request, &types.SlashRequest{}) consumerKeeper.SetPendingSlashRequests(ctx, request) } diff --git a/x/ccv/consumer/types/consumer.pb.go b/x/ccv/consumer/types/consumer.pb.go index df4994c932..94741d0509 100644 --- a/x/ccv/consumer/types/consumer.pb.go +++ b/x/ccv/consumer/types/consumer.pb.go @@ -266,11 +266,57 @@ func (m *SlashRequest) GetInfraction() types2.InfractionType { return types2.InfractionEmpty } +// SlashRequests is a list of slash requests for CCV consumer module +type SlashRequests struct { + Requests []*SlashRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` +} + +func (m *SlashRequests) Reset() { *m = SlashRequests{} } +func (m *SlashRequests) String() string { return proto.CompactTextString(m) } +func (*SlashRequests) ProtoMessage() {} +func (*SlashRequests) Descriptor() ([]byte, []int) { + return fileDescriptor_5b27a82b276e7f93, []int{4} +} +func (m *SlashRequests) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlashRequests) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SlashRequests.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 *SlashRequests) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlashRequests.Merge(m, src) +} +func (m *SlashRequests) XXX_Size() int { + return m.Size() +} +func (m *SlashRequests) XXX_DiscardUnknown() { + xxx_messageInfo_SlashRequests.DiscardUnknown(m) +} + +var xxx_messageInfo_SlashRequests proto.InternalMessageInfo + +func (m *SlashRequests) GetRequests() []*SlashRequest { + if m != nil { + return m.Requests + } + return nil +} + func init() { proto.RegisterType((*Params)(nil), "interchain_security.ccv.consumer.v1.Params") proto.RegisterType((*LastTransmissionBlockHeight)(nil), "interchain_security.ccv.consumer.v1.LastTransmissionBlockHeight") proto.RegisterType((*CrossChainValidator)(nil), "interchain_security.ccv.consumer.v1.CrossChainValidator") proto.RegisterType((*SlashRequest)(nil), "interchain_security.ccv.consumer.v1.SlashRequest") + proto.RegisterType((*SlashRequests)(nil), "interchain_security.ccv.consumer.v1.SlashRequests") } func init() { @@ -278,44 +324,45 @@ func init() { } var fileDescriptor_5b27a82b276e7f93 = []byte{ - // 578 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0xad, 0xbf, 0x7e, 0x04, 0x98, 0x56, 0x2c, 0x4c, 0x54, 0x42, 0x91, 0xdc, 0xd6, 0x54, 0xa8, - 0x12, 0xea, 0x58, 0x49, 0xc5, 0x26, 0xbb, 0x26, 0x55, 0xc5, 0x9f, 0x44, 0xe4, 0x46, 0x2c, 0xd8, - 0x58, 0xe3, 0xf1, 0x8d, 0x3d, 0x8a, 0x3d, 0x63, 0x66, 0xc6, 0x06, 0xbf, 0x05, 0x7b, 0x5e, 0x80, - 0x07, 0xe0, 0x21, 0x10, 0xab, 0x2e, 0x59, 0x21, 0x94, 0xbc, 0x01, 0x5b, 0x36, 0xc8, 0x7f, 0x21, - 0x48, 0x64, 0x77, 0x8f, 0xee, 0x39, 0xc7, 0xd7, 0xf7, 0x9e, 0x41, 0x03, 0xc6, 0x35, 0x48, 0x1a, - 0x11, 0xc6, 0x3d, 0x05, 0x34, 0x93, 0x4c, 0x17, 0x0e, 0xa5, 0xb9, 0x43, 0x05, 0x57, 0x59, 0x02, - 0xd2, 0xc9, 0xfb, 0xab, 0x1a, 0xa7, 0x52, 0x68, 0x61, 0x3e, 0xfc, 0x87, 0x06, 0x53, 0x9a, 0xe3, - 0x15, 0x2f, 0xef, 0xef, 0x1f, 0x6f, 0x32, 0x2e, 0xfd, 0x68, 0x5e, 0x5b, 0xed, 0xdf, 0x0f, 0x85, - 0x08, 0x63, 0x70, 0x2a, 0xe4, 0x67, 0x33, 0x87, 0xf0, 0xa2, 0x69, 0x1d, 0x53, 0xa1, 0x12, 0xa1, - 0x1c, 0xa5, 0xc9, 0x9c, 0xf1, 0xd0, 0xc9, 0xfb, 0x3e, 0x68, 0xd2, 0x6f, 0x71, 0xc3, 0xea, 0x86, - 0x22, 0x14, 0x55, 0xe9, 0x94, 0x55, 0x6b, 0x5b, 0x6b, 0xbd, 0xba, 0x51, 0x83, 0xba, 0x65, 0xff, - 0x32, 0x50, 0x67, 0x42, 0x24, 0x49, 0x94, 0xd9, 0x43, 0x37, 0x81, 0x13, 0x3f, 0x86, 0xa0, 0x67, - 0x1c, 0x1a, 0x27, 0xb7, 0xdc, 0x16, 0x9a, 0xaf, 0xd0, 0xb1, 0x1f, 0x0b, 0x3a, 0x57, 0x5e, 0x0a, - 0xd2, 0x0b, 0x98, 0xd2, 0x92, 0xf9, 0x99, 0x66, 0x82, 0x7b, 0x5a, 0x12, 0xae, 0x12, 0xa6, 0x14, - 0x13, 0xbc, 0xf7, 0xdf, 0xa1, 0x71, 0xb2, 0xed, 0x1e, 0xd5, 0xdc, 0x09, 0xc8, 0x8b, 0x35, 0xe6, - 0x74, 0x8d, 0x68, 0x3e, 0x47, 0x47, 0x1b, 0x5d, 0x3c, 0x1a, 0x11, 0xce, 0x21, 0xee, 0x6d, 0x1f, - 0x1a, 0x27, 0xb7, 0xdd, 0x83, 0x60, 0x83, 0xc9, 0xb8, 0xa6, 0x99, 0x43, 0xb4, 0x9f, 0x4a, 0x91, - 0xb3, 0x00, 0xa4, 0x37, 0x03, 0xf0, 0x52, 0x21, 0x62, 0x8f, 0x04, 0x81, 0xf4, 0x94, 0x96, 0xbd, - 0xff, 0x2b, 0x93, 0xbd, 0x96, 0x71, 0x09, 0x30, 0x11, 0x22, 0x3e, 0x0f, 0x02, 0x79, 0xa5, 0xa5, - 0xfd, 0x04, 0x3d, 0x78, 0x49, 0x94, 0x5e, 0xb7, 0x1d, 0x95, 0xc3, 0x3f, 0x05, 0x16, 0x46, 0xda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x17, 0x96, 0xf1, 0x63, 0x61, 0x19, 0x1f, 0x96, 0xd6, 0xd6, 0xf5, - 0xd2, 0xda, 0xfa, 0xb6, 0xb4, 0xb6, 0xde, 0x0c, 0x43, 0xa6, 0xa3, 0xcc, 0xc7, 0x54, 0x24, 0x4d, - 0x60, 0x9d, 0x3f, 0x73, 0x9e, 0xae, 0x5e, 0xd0, 0xfb, 0xbf, 0x1f, 0xa7, 0x2e, 0x52, 0x50, 0x7e, - 0xa7, 0x5a, 0xdf, 0xd9, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x85, 0x02, 0x02, 0xcd, 0x03, - 0x00, 0x00, + // 606 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcb, 0x6e, 0xd3, 0x40, + 0x14, 0xad, 0x09, 0x84, 0x32, 0x2d, 0x2c, 0x4c, 0x54, 0x42, 0x91, 0xd2, 0xd4, 0x54, 0x28, 0x12, + 0xea, 0x58, 0x49, 0xc5, 0xa6, 0xbb, 0x36, 0x55, 0xc5, 0x53, 0x44, 0x6e, 0xc5, 0x82, 0x05, 0xd6, + 0x78, 0x7c, 0x6b, 0x8f, 0x62, 0xcf, 0x98, 0x99, 0xb1, 0xc1, 0x7f, 0xc1, 0x9e, 0x1f, 0xe0, 0x03, + 0xf8, 0x08, 0xc4, 0xaa, 0x4b, 0x56, 0x08, 0xb5, 0x7f, 0xc0, 0x96, 0x0d, 0xf2, 0x2b, 0x18, 0x89, + 0x48, 0xec, 0xee, 0xd1, 0x9c, 0x73, 0x66, 0xe6, 0x9e, 0x7b, 0xd1, 0x84, 0x71, 0x0d, 0x92, 0x86, + 0x84, 0x71, 0x57, 0x01, 0x4d, 0x25, 0xd3, 0xb9, 0x4d, 0x69, 0x66, 0x53, 0xc1, 0x55, 0x1a, 0x83, + 0xb4, 0xb3, 0xf1, 0xa2, 0xc6, 0x89, 0x14, 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, 0xe3, 0x67, 0x92, 0x50, 0xdd, 0xc4, 0x7e, 0x6b, 0xf2, 0x00, 0xd7, 0x0f, + 0x69, 0x26, 0xb2, 0x9e, 0x50, 0xfc, 0x64, 0xc1, 0x3c, 0xcd, 0x13, 0x70, 0x5a, 0x4a, 0xeb, 0x0d, + 0xba, 0xd9, 0x7e, 0x9c, 0x32, 0x5f, 0xa0, 0x55, 0x59, 0xd7, 0x7d, 0x63, 0xd8, 0x19, 0xad, 0x4d, + 0xc6, 0xf8, 0x3f, 0xd6, 0x0b, 0xb7, 0x5d, 0x9c, 0x85, 0xc5, 0xe1, 0xe9, 0x97, 0x8b, 0x81, 0x71, + 0x7e, 0x31, 0x30, 0x7e, 0x5c, 0x0c, 0x8c, 0x0f, 0x97, 0x83, 0x95, 0xf3, 0xcb, 0xc1, 0xca, 0xb7, + 0xcb, 0xc1, 0xca, 0xeb, 0xfd, 0x80, 0xe9, 0x30, 0xf5, 0x30, 0x15, 0x71, 0xbd, 0x10, 0xf6, 0x9f, + 0x7b, 0x76, 0x17, 0x1b, 0xfa, 0xfe, 0xef, 0xe5, 0xd7, 0x79, 0x02, 0xca, 0xeb, 0x96, 0xf1, 0xec, + 0xfd, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xb2, 0xda, 0xc4, 0x2d, 0x04, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -485,6 +532,43 @@ func (m *SlashRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *SlashRequests) 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 *SlashRequests) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlashRequests) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Requests) > 0 { + for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Requests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConsumer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintConsumer(dAtA []byte, offset int, v uint64) int { offset -= sovConsumer(v) base := offset @@ -567,6 +651,21 @@ func (m *SlashRequest) Size() (n int) { return n } +func (m *SlashRequests) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Requests) > 0 { + for _, e := range m.Requests { + l = e.Size() + n += 1 + l + sovConsumer(uint64(l)) + } + } + return n +} + func sovConsumer(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1039,6 +1138,90 @@ func (m *SlashRequest) Unmarshal(dAtA []byte) error { } return nil } +func (m *SlashRequests) 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 ErrIntOverflowConsumer + } + 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: SlashRequests: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SlashRequests: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowConsumer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConsumer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConsumer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Requests = append(m.Requests, &SlashRequest{}) + if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConsumer(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConsumer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipConsumer(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 52980b321e..495a75115f 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -316,9 +316,12 @@ func (k Keeper) DeleteUnbondingOp(ctx sdk.Context, id uint64) { func (k Keeper) SetUnbondingOpIndex(ctx sdk.Context, chainID string, valsetUpdateID uint64, IDs []uint64) { store := ctx.KVStore(k.storeKey) - bz, err := json.Marshal(IDs) + index := ccv.UnbondingOpsIndex{ + Ids: IDs, + } + bz, err := index.Marshal() if err != nil { - panic("Failed to JSON marshal") + panic("Failed to marshal UnbondingOpsIndex") } store.Set(types.UnbondingOpIndexKey(chainID, valsetUpdateID), bz) @@ -340,13 +343,12 @@ func (k Keeper) IterateOverUnbondingOpIndex(ctx sdk.Context, chainID string, cb } vscID = binary.BigEndian.Uint64(vscBytes) - var ids []uint64 - err = json.Unmarshal(iterator.Value(), &ids) - if err != nil { + var index ccv.UnbondingOpsIndex + if err = index.Unmarshal(iterator.Value()); err != nil { panic("Failed to unmarshal JSON") } - if !cb(vscID, ids) { + if !cb(vscID, index.GetIds()) { return } } @@ -361,13 +363,12 @@ func (k Keeper) GetUnbondingOpIndex(ctx sdk.Context, chainID string, valsetUpdat return []uint64{}, false } - var ids []uint64 - err := json.Unmarshal(bz, &ids) - if err != nil { - panic("Failed to JSON unmarshal") + var idx ccv.UnbondingOpsIndex + if err := idx.Unmarshal(bz); err != nil { + panic("Failed to unmarshal UnbondingOpsIndex") } - return ids, true + return idx.GetIds(), true } // This index allows retreiving UnbondingDelegationEntries by chainID and valsetUpdateID @@ -401,11 +402,12 @@ func (k Keeper) GetMaturedUnbondingOps(ctx sdk.Context) (ids []uint64, err error if bz == nil { return nil, nil } - err = json.Unmarshal(bz, &ids) - if err != nil { + + var ops ccv.MaturedUnbondingOps + if err := ops.Unmarshal(bz); err != nil { return nil, err } - return ids, nil + return ops.GetIds(), nil } // AppendMaturedUnbondingOps adds a list of ids to the list of matured unbonding operation ids @@ -417,11 +419,13 @@ func (k Keeper) AppendMaturedUnbondingOps(ctx sdk.Context, ids []uint64) error { if err != nil { return err } - // append works also on a nil list - existingIds = append(existingIds, ids...) + + maturedOps := ccv.MaturedUnbondingOps{ + Ids: append(existingIds, ids...), + } store := ctx.KVStore(k.storeKey) - bz, err := json.Marshal(existingIds) + bz, err := maturedOps.Marshal() if err != nil { return err } @@ -580,12 +584,15 @@ func (k Keeper) DeleteValsetUpdateBlockHeight(ctx sdk.Context, valsetUpdateId ui // SetSlashAcks sets the slash acks under the given chain ID func (k Keeper) SetSlashAcks(ctx sdk.Context, chainID string, acks []string) { store := ctx.KVStore(k.storeKey) - buf := &bytes.Buffer{} - err := json.NewEncoder(buf).Encode(acks) + + sa := types.SlashAcks{ + Addresses: acks, + } + bz, err := sa.Marshal() if err != nil { - panic("failed to encode json") + panic("failed to marshal SlashAcks") } - store.Set(types.SlashAcksKey(chainID), buf.Bytes()) + store.Set(types.SlashAcksKey(chainID), bz) } // GetSlashAcks returns the slash acks stored under the given chain ID @@ -595,15 +602,12 @@ func (k Keeper) GetSlashAcks(ctx sdk.Context, chainID string) []string { if bz == nil { return nil } - var acks []string - buf := bytes.NewBuffer(bz) - - err := json.NewDecoder(buf).Decode(&acks) - if err != nil { + var acks types.SlashAcks + if err := acks.Unmarshal(bz); err != nil { panic(fmt.Errorf("failed to decode json: %w", err)) } - return acks + return acks.GetAddresses() } // EmptySlashAcks empties and returns the slash acks for a given chain ID @@ -627,15 +631,13 @@ func (k Keeper) IterateSlashAcks(ctx sdk.Context, cb func(chainID string, acks [ chainID := string(iterator.Key()[1:]) - var data []string - buf := bytes.NewBuffer(iterator.Value()) - - err := json.NewDecoder(buf).Decode(&data) + var sa types.SlashAcks + err := sa.Unmarshal(iterator.Value()) if err != nil { - panic(fmt.Errorf("failed to decode json: %w", err)) + panic(fmt.Errorf("failed to unmarshal SlashAcks: %w", err)) } - if !cb(chainID, data) { + if !cb(chainID, sa.GetAddresses()) { return } } diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index a4ea3fd9e6..77eea3e616 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -260,11 +260,58 @@ func (m *HandshakeMetadata) GetVersion() string { return "" } +// SlashAcks contains addesses of consumer chain validators +// successfully slashed on the provider chain +type SlashAcks struct { + Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` +} + +func (m *SlashAcks) Reset() { *m = SlashAcks{} } +func (m *SlashAcks) String() string { return proto.CompactTextString(m) } +func (*SlashAcks) ProtoMessage() {} +func (*SlashAcks) Descriptor() ([]byte, []int) { + return fileDescriptor_f22ec409a72b7b72, []int{4} +} +func (m *SlashAcks) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlashAcks) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SlashAcks.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 *SlashAcks) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlashAcks.Merge(m, src) +} +func (m *SlashAcks) XXX_Size() int { + return m.Size() +} +func (m *SlashAcks) XXX_DiscardUnknown() { + xxx_messageInfo_SlashAcks.DiscardUnknown(m) +} + +var xxx_messageInfo_SlashAcks proto.InternalMessageInfo + +func (m *SlashAcks) GetAddresses() []string { + if m != nil { + return m.Addresses + } + return nil +} + func init() { proto.RegisterType((*ConsumerAdditionProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerAdditionProposal") proto.RegisterType((*ConsumerRemovalProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerRemovalProposal") proto.RegisterType((*Params)(nil), "interchain_security.ccv.provider.v1.Params") proto.RegisterType((*HandshakeMetadata)(nil), "interchain_security.ccv.provider.v1.HandshakeMetadata") + proto.RegisterType((*SlashAcks)(nil), "interchain_security.ccv.provider.v1.SlashAcks") } func init() { @@ -272,46 +319,47 @@ func init() { } var fileDescriptor_f22ec409a72b7b72 = []byte{ - // 610 bytes of a gzipped FileDescriptorProto + // 637 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xbd, 0x6e, 0xd4, 0x40, - 0x10, 0x3e, 0x93, 0xbf, 0xcb, 0x5e, 0x08, 0xc2, 0x44, 0x91, 0x13, 0xa4, 0xbb, 0xe3, 0x68, 0x4e, - 0x42, 0xd8, 0xba, 0xa4, 0x22, 0x5d, 0x72, 0x12, 0x84, 0x02, 0x11, 0x5d, 0x42, 0x43, 0x81, 0xb5, - 0x5e, 0x4f, 0xec, 0x55, 0xec, 0x1d, 0x6b, 0x77, 0x6d, 0xc8, 0x13, 0x40, 0x99, 0x92, 0x32, 0xaf, - 0xc0, 0x5b, 0xa4, 0x4c, 0x49, 0x05, 0x28, 0x79, 0x11, 0xe4, 0x5d, 0x3b, 0x09, 0x12, 0x0d, 0x0d, - 0xdd, 0xcc, 0x37, 0xdf, 0x67, 0xcf, 0xcc, 0x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 0x88, 0x9c, 0xd0, 0x50, 0x60, 0xad, + 0xd7, 0x13, 0x7b, 0x15, 0x7b, 0xd7, 0xda, 0x5d, 0x1b, 0xf2, 0x04, 0x50, 0xa6, 0xa4, 0xcc, 0x2b, + 0xf0, 0x16, 0x29, 0x53, 0x52, 0x01, 0x4a, 0x5e, 0x04, 0xed, 0xee, 0x39, 0x77, 0x48, 0x34, 0x34, + 0x74, 0x3b, 0xdf, 0x7c, 0xdf, 0x7a, 0x66, 0xbe, 0xf5, 0xa0, 0x6d, 0xca, 0x14, 0x08, 0x92, 0x61, + 0xca, 0x22, 0x09, 0xa4, 0x12, 0x54, 0x9d, 0x05, 0x84, 0xd4, 0x41, 0x29, 0x78, 0x4d, 0x13, 0x10, + 0x41, 0x3d, 0xbe, 0x3d, 0xfb, 0xa5, 0xe0, 0x8a, 0xbb, 0x4f, 0xfe, 0xa2, 0xf1, 0x09, 0xa9, 0xfd, + 0x5b, 0x5e, 0x3d, 0xde, 0x5a, 0x4f, 0x79, 0xca, 0x0d, 0x3f, 0xd0, 0x27, 0x2b, 0xdd, 0xea, 0xa7, + 0x9c, 0xa7, 0x39, 0x04, 0x26, 0x8a, 0xab, 0x93, 0x40, 0xd1, 0x02, 0xa4, 0xc2, 0x45, 0xd9, 0x10, + 0x68, 0x4c, 0x02, 0xc2, 0x05, 0x04, 0x24, 0xa7, 0xc0, 0x94, 0xfe, 0xbc, 0x3d, 0x4d, 0x09, 0x81, + 0x26, 0xe4, 0x34, 0xcd, 0x94, 0x85, 0x65, 0xa0, 0x80, 0x25, 0x20, 0x0a, 0x6a, 0xc9, 0xb3, 0xc8, + 0x0a, 0x86, 0x9f, 0x17, 0xd0, 0xc3, 0x89, 0x00, 0xac, 0x60, 0xc2, 0x99, 0xac, 0x0a, 0x10, 0x13, + 0x5d, 0xf9, 0xa1, 0xe0, 0x25, 0x97, 0x38, 0x77, 0xd7, 0xd1, 0x92, 0xa2, 0x2a, 0x07, 0xcf, 0x19, + 0x38, 0xa3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0xfb, 0xdd, + 0x94, 0xaa, 0xac, 0x8a, 0x7d, 0xc2, 0x8b, 0x80, 0x70, 0x59, 0x70, 0x19, 0xcc, 0xd6, 0xc0, 0xf3, + 0xdb, 0xd5, 0xf1, 0xe9, 0xcf, 0xe5, 0xa1, 0xce, 0x4a, 0x90, 0xf1, 0xb2, 0x19, 0xf6, 0xce, 0xef, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x20, 0xc6, 0xdc, 0x12, 0x6d, 0x04, 0x00, 0x00, } func (m *ConsumerAdditionProposal) Marshal() (dAtA []byte, err error) { @@ -524,6 +572,38 @@ func (m *HandshakeMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *SlashAcks) 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 *SlashAcks) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlashAcks) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Addresses) > 0 { + for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Addresses[iNdEx]) + copy(dAtA[i:], m.Addresses[iNdEx]) + i = encodeVarintProvider(dAtA, i, uint64(len(m.Addresses[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintProvider(dAtA []byte, offset int, v uint64) int { offset -= sovProvider(v) base := offset @@ -624,6 +704,21 @@ func (m *HandshakeMetadata) Size() (n int) { return n } +func (m *SlashAcks) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Addresses) > 0 { + for _, s := range m.Addresses { + l = len(s) + n += 1 + l + sovProvider(uint64(l)) + } + } + return n +} + func sovProvider(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1309,6 +1404,88 @@ func (m *HandshakeMetadata) Unmarshal(dAtA []byte) error { } return nil } +func (m *SlashAcks) 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 ErrIntOverflowProvider + } + 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: SlashAcks: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SlashAcks: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + 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 ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProvider(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProvider + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipProvider(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/ccv/types/ccv.pb.go b/x/ccv/types/ccv.pb.go index d6a17438a0..2d59fdd047 100644 --- a/x/ccv/types/ccv.pb.go +++ b/x/ccv/types/ccv.pb.go @@ -256,11 +256,103 @@ func (m *SlashPacketData) GetInfraction() types1.InfractionType { return types1.InfractionEmpty } +// UnbondingOpsIndex defines a list of unbonding operation ids. +type UnbondingOpsIndex struct { + Ids []uint64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` +} + +func (m *UnbondingOpsIndex) Reset() { *m = UnbondingOpsIndex{} } +func (m *UnbondingOpsIndex) String() string { return proto.CompactTextString(m) } +func (*UnbondingOpsIndex) ProtoMessage() {} +func (*UnbondingOpsIndex) Descriptor() ([]byte, []int) { + return fileDescriptor_68bd5f3242e6f29c, []int{4} +} +func (m *UnbondingOpsIndex) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UnbondingOpsIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UnbondingOpsIndex.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 *UnbondingOpsIndex) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnbondingOpsIndex.Merge(m, src) +} +func (m *UnbondingOpsIndex) XXX_Size() int { + return m.Size() +} +func (m *UnbondingOpsIndex) XXX_DiscardUnknown() { + xxx_messageInfo_UnbondingOpsIndex.DiscardUnknown(m) +} + +var xxx_messageInfo_UnbondingOpsIndex proto.InternalMessageInfo + +func (m *UnbondingOpsIndex) GetIds() []uint64 { + if m != nil { + return m.Ids + } + return nil +} + +// MaturedUnbondingOps defines a list of ids corresponding to ids of matured unbonding operations. +type MaturedUnbondingOps struct { + Ids []uint64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` +} + +func (m *MaturedUnbondingOps) Reset() { *m = MaturedUnbondingOps{} } +func (m *MaturedUnbondingOps) String() string { return proto.CompactTextString(m) } +func (*MaturedUnbondingOps) ProtoMessage() {} +func (*MaturedUnbondingOps) Descriptor() ([]byte, []int) { + return fileDescriptor_68bd5f3242e6f29c, []int{5} +} +func (m *MaturedUnbondingOps) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MaturedUnbondingOps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MaturedUnbondingOps.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 *MaturedUnbondingOps) XXX_Merge(src proto.Message) { + xxx_messageInfo_MaturedUnbondingOps.Merge(m, src) +} +func (m *MaturedUnbondingOps) XXX_Size() int { + return m.Size() +} +func (m *MaturedUnbondingOps) XXX_DiscardUnknown() { + xxx_messageInfo_MaturedUnbondingOps.DiscardUnknown(m) +} + +var xxx_messageInfo_MaturedUnbondingOps proto.InternalMessageInfo + +func (m *MaturedUnbondingOps) GetIds() []uint64 { + if m != nil { + return m.Ids + } + return nil +} + func init() { proto.RegisterType((*ValidatorSetChangePacketData)(nil), "interchain_security.ccv.v1.ValidatorSetChangePacketData") proto.RegisterType((*UnbondingOp)(nil), "interchain_security.ccv.v1.UnbondingOp") proto.RegisterType((*VSCMaturedPacketData)(nil), "interchain_security.ccv.v1.VSCMaturedPacketData") proto.RegisterType((*SlashPacketData)(nil), "interchain_security.ccv.v1.SlashPacketData") + proto.RegisterType((*UnbondingOpsIndex)(nil), "interchain_security.ccv.v1.UnbondingOpsIndex") + proto.RegisterType((*MaturedUnbondingOps)(nil), "interchain_security.ccv.v1.MaturedUnbondingOps") } func init() { @@ -268,37 +360,39 @@ func init() { } var fileDescriptor_68bd5f3242e6f29c = []byte{ - // 476 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xcf, 0x8a, 0xd3, 0x40, - 0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, 0x64, 0xfc, 0x6b, - 0x8e, 0xb0, 0x62, 0x82, 0x9b, 0x3d, 0x1b, 0xb8, 0xc3, 0xf1, 0x73, 0xaf, 0xee, 0x9d, 0xb7, 0xed, - 0x59, 0xd3, 0x3b, 0xef, 0xbc, 0x65, 0x7e, 0x5a, 0x65, 0x34, 0xdc, 0x53, 0x4e, 0xde, 0x5d, 0xad, - 0x2d, 0x70, 0xbd, 0xb6, 0xc0, 0xcf, 0xb5, 0x05, 0xbe, 0x6f, 0xac, 0xce, 0xf5, 0xc6, 0xea, 0xdc, - 0x6c, 0xac, 0xce, 0x97, 0x20, 0x61, 0x6a, 0x5e, 0xc4, 0x1e, 0x16, 0xa9, 0xdf, 0xf4, 0x79, 0x57, - 0xf9, 0x17, 0xed, 0x61, 0x7c, 0xd3, 0xa7, 0xa1, 0x4b, 0x1a, 0xdf, 0xd7, 0x2d, 0x7d, 0xf9, 0x3b, - 0x00, 0x00, 0xff, 0xff, 0x47, 0xac, 0x22, 0x45, 0x42, 0x03, 0x00, 0x00, + // 509 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x41, 0x8b, 0xd3, 0x40, + 0x14, 0xee, 0xb4, 0x8b, 0xb0, 0x53, 0xa8, 0xdd, 0xb8, 0x60, 0xac, 0x9a, 0x0d, 0x61, 0xd5, 0x5e, + 0x4c, 0x68, 0xbd, 0xed, 0x49, 0x5b, 0x11, 0x8a, 0x88, 0x92, 0xba, 0x0b, 0x7a, 0x09, 0xd3, 0x99, + 0x31, 0x1d, 0xda, 0xcc, 0x84, 0xcc, 0x24, 0x6c, 0xff, 0x85, 0x3f, 0x6b, 0x8f, 0x7b, 0x73, 0x4f, + 0x8b, 0xb4, 0xff, 0xc0, 0x5f, 0x20, 0x99, 0xa4, 0x69, 0x74, 0xeb, 0xc1, 0xd3, 0xbc, 0x79, 0xdf, + 0xf7, 0x3e, 0x1e, 0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 0xfb, 0xab, 0xb5, + 0x05, 0xae, 0xd7, 0x16, 0xf8, 0xb9, 0xb6, 0xc0, 0xf7, 0x8d, 0xd5, 0xb8, 0xde, 0x58, 0x8d, 0x9b, + 0x8d, 0xd5, 0xf8, 0x3a, 0x08, 0x99, 0x9a, 0xa7, 0x33, 0x17, 0x8b, 0xc8, 0x2b, 0xef, 0x63, 0x77, + 0x42, 0x2f, 0xab, 0x43, 0xbb, 0xd4, 0xa7, 0xa6, 0x43, 0x3f, 0xbb, 0xa7, 0x53, 0xff, 0xea, 0x77, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xf7, 0xaa, 0xb0, 0x21, 0x92, 0x03, 0x00, 0x00, } func (m *ValidatorSetChangePacketData) Marshal() (dAtA []byte, err error) { @@ -460,6 +554,88 @@ func (m *SlashPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *UnbondingOpsIndex) 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 *UnbondingOpsIndex) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnbondingOpsIndex) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Ids) > 0 { + dAtA3 := make([]byte, len(m.Ids)*10) + var j2 int + for _, num := range m.Ids { + for num >= 1<<7 { + dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j2++ + } + dAtA3[j2] = uint8(num) + j2++ + } + i -= j2 + copy(dAtA[i:], dAtA3[:j2]) + i = encodeVarintCcv(dAtA, i, uint64(j2)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MaturedUnbondingOps) 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 *MaturedUnbondingOps) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MaturedUnbondingOps) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Ids) > 0 { + dAtA5 := make([]byte, len(m.Ids)*10) + var j4 int + for _, num := range m.Ids { + 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 = encodeVarintCcv(dAtA, i, uint64(j4)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintCcv(dAtA []byte, offset int, v uint64) int { offset -= sovCcv(v) base := offset @@ -542,6 +718,38 @@ func (m *SlashPacketData) Size() (n int) { return n } +func (m *UnbondingOpsIndex) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Ids) > 0 { + l = 0 + for _, e := range m.Ids { + l += sovCcv(uint64(e)) + } + n += 1 + sovCcv(uint64(l)) + l + } + return n +} + +func (m *MaturedUnbondingOps) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Ids) > 0 { + l = 0 + for _, e := range m.Ids { + l += sovCcv(uint64(e)) + } + n += 1 + sovCcv(uint64(l)) + l + } + return n +} + func sovCcv(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -974,6 +1182,258 @@ func (m *SlashPacketData) Unmarshal(dAtA []byte) error { } return nil } +func (m *UnbondingOpsIndex) 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 ErrIntOverflowCcv + } + 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: UnbondingOpsIndex: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UnbondingOpsIndex: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCcv + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Ids = append(m.Ids, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCcv + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthCcv + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthCcv + } + 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.Ids) == 0 { + m.Ids = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCcv + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Ids = append(m.Ids, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipCcv(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCcv + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MaturedUnbondingOps) 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 ErrIntOverflowCcv + } + 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: MaturedUnbondingOps: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MaturedUnbondingOps: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCcv + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Ids = append(m.Ids, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCcv + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthCcv + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthCcv + } + 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.Ids) == 0 { + m.Ids = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCcv + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Ids = append(m.Ids, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipCcv(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCcv + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipCcv(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0