From ed36c88f80e2904dbf6309121cd4d61f1249c3ad Mon Sep 17 00:00:00 2001 From: Sorin Stanculeanu Date: Mon, 27 Nov 2023 11:00:12 +0200 Subject: [PATCH 1/3] added ValidatorStatus structure --- data/validator/validatorStatus.go | 2 + data/validator/validatorStatus.pb.go | 938 +++++++++++++++++++++++++++ data/validator/validatorStatus.proto | 27 + 3 files changed, 967 insertions(+) create mode 100644 data/validator/validatorStatus.go create mode 100644 data/validator/validatorStatus.pb.go create mode 100644 data/validator/validatorStatus.proto diff --git a/data/validator/validatorStatus.go b/data/validator/validatorStatus.go new file mode 100644 index 00000000..474bc239 --- /dev/null +++ b/data/validator/validatorStatus.go @@ -0,0 +1,2 @@ +//go:generate protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/multiversx/protobuf/protobuf --gogoslick_out=. validatorStatus.proto +package validator diff --git a/data/validator/validatorStatus.pb.go b/data/validator/validatorStatus.pb.go new file mode 100644 index 00000000..302e7bb6 --- /dev/null +++ b/data/validator/validatorStatus.pb.go @@ -0,0 +1,938 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: validatorStatus.proto + +package validator + +import ( + encoding_binary "encoding/binary" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// ValidatorStatus holds information about a validator +type ValidatorStatus struct { + TempRating float32 `protobuf:"fixed32,1,opt,name=TempRating,proto3" json:"tempRating"` + NumLeaderSuccess uint32 `protobuf:"varint,2,opt,name=NumLeaderSuccess,proto3" json:"numLeaderSuccess"` + NumLeaderFailure uint32 `protobuf:"varint,3,opt,name=NumLeaderFailure,proto3" json:"numLeaderFailure"` + NumValidatorSuccess uint32 `protobuf:"varint,4,opt,name=NumValidatorSuccess,proto3" json:"numValidatorSuccess"` + NumValidatorFailure uint32 `protobuf:"varint,5,opt,name=NumValidatorFailure,proto3" json:"numValidatorFailure"` + NumValidatorIgnoredSignatures uint32 `protobuf:"varint,6,opt,name=NumValidatorIgnoredSignatures,proto3" json:"numValidatorIgnoredSignatures"` + Rating float32 `protobuf:"fixed32,7,opt,name=Rating,proto3" json:"rating"` + RatingModifier float32 `protobuf:"fixed32,8,opt,name=RatingModifier,proto3" json:"ratingModifier"` + TotalNumLeaderSuccess uint32 `protobuf:"varint,9,opt,name=TotalNumLeaderSuccess,proto3" json:"totalNumLeaderSuccess"` + TotalNumLeaderFailure uint32 `protobuf:"varint,10,opt,name=TotalNumLeaderFailure,proto3" json:"totalNumLeaderFailure"` + TotalNumValidatorSuccess uint32 `protobuf:"varint,11,opt,name=TotalNumValidatorSuccess,proto3" json:"totalNumValidatorSuccess"` + TotalNumValidatorFailure uint32 `protobuf:"varint,12,opt,name=TotalNumValidatorFailure,proto3" json:"totalNumValidatorFailure"` + TotalNumValidatorIgnoredSignatures uint32 `protobuf:"varint,13,opt,name=TotalNumValidatorIgnoredSignatures,proto3" json:"totalNumValidatorIgnoredSignatures"` + ShardId uint32 `protobuf:"varint,14,opt,name=ShardId,proto3" json:"shardId"` + ValidatorStatus string `protobuf:"bytes,15,opt,name=ValidatorStatus,proto3" json:"validatorStatus,omitempty"` +} + +func (m *ValidatorStatus) Reset() { *m = ValidatorStatus{} } +func (*ValidatorStatus) ProtoMessage() {} +func (*ValidatorStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_42eb597ab5bfcbec, []int{0} +} +func (m *ValidatorStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ValidatorStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorStatus.Merge(m, src) +} +func (m *ValidatorStatus) XXX_Size() int { + return m.Size() +} +func (m *ValidatorStatus) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorStatus proto.InternalMessageInfo + +func (m *ValidatorStatus) GetTempRating() float32 { + if m != nil { + return m.TempRating + } + return 0 +} + +func (m *ValidatorStatus) GetNumLeaderSuccess() uint32 { + if m != nil { + return m.NumLeaderSuccess + } + return 0 +} + +func (m *ValidatorStatus) GetNumLeaderFailure() uint32 { + if m != nil { + return m.NumLeaderFailure + } + return 0 +} + +func (m *ValidatorStatus) GetNumValidatorSuccess() uint32 { + if m != nil { + return m.NumValidatorSuccess + } + return 0 +} + +func (m *ValidatorStatus) GetNumValidatorFailure() uint32 { + if m != nil { + return m.NumValidatorFailure + } + return 0 +} + +func (m *ValidatorStatus) GetNumValidatorIgnoredSignatures() uint32 { + if m != nil { + return m.NumValidatorIgnoredSignatures + } + return 0 +} + +func (m *ValidatorStatus) GetRating() float32 { + if m != nil { + return m.Rating + } + return 0 +} + +func (m *ValidatorStatus) GetRatingModifier() float32 { + if m != nil { + return m.RatingModifier + } + return 0 +} + +func (m *ValidatorStatus) GetTotalNumLeaderSuccess() uint32 { + if m != nil { + return m.TotalNumLeaderSuccess + } + return 0 +} + +func (m *ValidatorStatus) GetTotalNumLeaderFailure() uint32 { + if m != nil { + return m.TotalNumLeaderFailure + } + return 0 +} + +func (m *ValidatorStatus) GetTotalNumValidatorSuccess() uint32 { + if m != nil { + return m.TotalNumValidatorSuccess + } + return 0 +} + +func (m *ValidatorStatus) GetTotalNumValidatorFailure() uint32 { + if m != nil { + return m.TotalNumValidatorFailure + } + return 0 +} + +func (m *ValidatorStatus) GetTotalNumValidatorIgnoredSignatures() uint32 { + if m != nil { + return m.TotalNumValidatorIgnoredSignatures + } + return 0 +} + +func (m *ValidatorStatus) GetShardId() uint32 { + if m != nil { + return m.ShardId + } + return 0 +} + +func (m *ValidatorStatus) GetValidatorStatus() string { + if m != nil { + return m.ValidatorStatus + } + return "" +} + +func init() { + proto.RegisterType((*ValidatorStatus)(nil), "proto.ValidatorStatus") +} + +func init() { proto.RegisterFile("validatorStatus.proto", fileDescriptor_42eb597ab5bfcbec) } + +var fileDescriptor_42eb597ab5bfcbec = []byte{ + // 509 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xc1, 0x6e, 0xd3, 0x30, + 0x18, 0xc7, 0xe3, 0xc1, 0xda, 0xd5, 0x63, 0xdd, 0xe4, 0x51, 0x91, 0x21, 0x6a, 0x97, 0x4a, 0xa0, + 0x1e, 0xa0, 0x3b, 0x70, 0xe3, 0x84, 0x8a, 0x04, 0xaa, 0x04, 0x43, 0x72, 0x27, 0x84, 0xb8, 0xa5, + 0x4d, 0x96, 0x45, 0x6a, 0xe2, 0xc9, 0x71, 0x26, 0x71, 0xe3, 0x11, 0x78, 0x0c, 0x1e, 0x85, 0x63, + 0x8f, 0x3d, 0x59, 0xd4, 0xbd, 0x20, 0x9f, 0xf6, 0x08, 0x08, 0xb7, 0x19, 0x6d, 0x9c, 0x16, 0x4e, + 0x49, 0xbe, 0xff, 0xff, 0xff, 0xcb, 0x97, 0x7c, 0xd6, 0x07, 0x1b, 0xd7, 0xde, 0x38, 0xf2, 0x3d, + 0xc1, 0xf8, 0x40, 0x78, 0x22, 0x4b, 0xbb, 0x57, 0x9c, 0x09, 0x86, 0x76, 0xcd, 0xe5, 0xe1, 0xf3, + 0x30, 0x12, 0x97, 0xd9, 0xb0, 0x3b, 0x62, 0xf1, 0x69, 0xc8, 0x42, 0x76, 0x6a, 0xca, 0xc3, 0xec, + 0xc2, 0x3c, 0x99, 0x07, 0x73, 0xb7, 0x48, 0xb5, 0xd5, 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0x00, 0x00, 0xff, 0xff, 0x1e, 0x3e, 0x4e, 0xe7, 0xff, 0x04, 0x00, 0x00, +} + +func (this *ValidatorStatus) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ValidatorStatus) + if !ok { + that2, ok := that.(ValidatorStatus) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.TempRating != that1.TempRating { + return false + } + if this.NumLeaderSuccess != that1.NumLeaderSuccess { + return false + } + if this.NumLeaderFailure != that1.NumLeaderFailure { + return false + } + if this.NumValidatorSuccess != that1.NumValidatorSuccess { + return false + } + if this.NumValidatorFailure != that1.NumValidatorFailure { + return false + } + if this.NumValidatorIgnoredSignatures != that1.NumValidatorIgnoredSignatures { + return false + } + if this.Rating != that1.Rating { + return false + } + if this.RatingModifier != that1.RatingModifier { + return false + } + if this.TotalNumLeaderSuccess != that1.TotalNumLeaderSuccess { + return false + } + if this.TotalNumLeaderFailure != that1.TotalNumLeaderFailure { + return false + } + if this.TotalNumValidatorSuccess != that1.TotalNumValidatorSuccess { + return false + } + if this.TotalNumValidatorFailure != that1.TotalNumValidatorFailure { + return false + } + if this.TotalNumValidatorIgnoredSignatures != that1.TotalNumValidatorIgnoredSignatures { + return false + } + if this.ShardId != that1.ShardId { + return false + } + if this.ValidatorStatus != that1.ValidatorStatus { + return false + } + return true +} +func (this *ValidatorStatus) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 19) + s = append(s, "&validator.ValidatorStatus{") + s = append(s, "TempRating: "+fmt.Sprintf("%#v", this.TempRating)+",\n") + s = append(s, "NumLeaderSuccess: "+fmt.Sprintf("%#v", this.NumLeaderSuccess)+",\n") + s = append(s, "NumLeaderFailure: "+fmt.Sprintf("%#v", this.NumLeaderFailure)+",\n") + s = append(s, "NumValidatorSuccess: "+fmt.Sprintf("%#v", this.NumValidatorSuccess)+",\n") + s = append(s, "NumValidatorFailure: "+fmt.Sprintf("%#v", this.NumValidatorFailure)+",\n") + s = append(s, "NumValidatorIgnoredSignatures: "+fmt.Sprintf("%#v", this.NumValidatorIgnoredSignatures)+",\n") + s = append(s, "Rating: "+fmt.Sprintf("%#v", this.Rating)+",\n") + s = append(s, "RatingModifier: "+fmt.Sprintf("%#v", this.RatingModifier)+",\n") + s = append(s, "TotalNumLeaderSuccess: "+fmt.Sprintf("%#v", this.TotalNumLeaderSuccess)+",\n") + s = append(s, "TotalNumLeaderFailure: "+fmt.Sprintf("%#v", this.TotalNumLeaderFailure)+",\n") + s = append(s, "TotalNumValidatorSuccess: "+fmt.Sprintf("%#v", this.TotalNumValidatorSuccess)+",\n") + s = append(s, "TotalNumValidatorFailure: "+fmt.Sprintf("%#v", this.TotalNumValidatorFailure)+",\n") + s = append(s, "TotalNumValidatorIgnoredSignatures: "+fmt.Sprintf("%#v", this.TotalNumValidatorIgnoredSignatures)+",\n") + s = append(s, "ShardId: "+fmt.Sprintf("%#v", this.ShardId)+",\n") + s = append(s, "ValidatorStatus: "+fmt.Sprintf("%#v", this.ValidatorStatus)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringValidatorStatus(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *ValidatorStatus) 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 *ValidatorStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorStatus) > 0 { + i -= len(m.ValidatorStatus) + copy(dAtA[i:], m.ValidatorStatus) + i = encodeVarintValidatorStatus(dAtA, i, uint64(len(m.ValidatorStatus))) + i-- + dAtA[i] = 0x7a + } + if m.ShardId != 0 { + i = encodeVarintValidatorStatus(dAtA, i, uint64(m.ShardId)) + i-- + dAtA[i] = 0x70 + } + if m.TotalNumValidatorIgnoredSignatures != 0 { + i = encodeVarintValidatorStatus(dAtA, i, uint64(m.TotalNumValidatorIgnoredSignatures)) + i-- + dAtA[i] = 0x68 + } + if m.TotalNumValidatorFailure != 0 { + i = encodeVarintValidatorStatus(dAtA, i, uint64(m.TotalNumValidatorFailure)) + i-- + dAtA[i] = 0x60 + } + if m.TotalNumValidatorSuccess != 0 { + i = encodeVarintValidatorStatus(dAtA, i, uint64(m.TotalNumValidatorSuccess)) + i-- + dAtA[i] = 0x58 + } + if m.TotalNumLeaderFailure != 0 { + i = encodeVarintValidatorStatus(dAtA, i, uint64(m.TotalNumLeaderFailure)) + i-- + dAtA[i] = 0x50 + } + if m.TotalNumLeaderSuccess != 0 { + i = encodeVarintValidatorStatus(dAtA, i, uint64(m.TotalNumLeaderSuccess)) + i-- + dAtA[i] = 0x48 + } + if m.RatingModifier != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.RatingModifier)))) + i-- + dAtA[i] = 0x45 + } + if m.Rating != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Rating)))) + i-- + dAtA[i] = 0x3d + } + if m.NumValidatorIgnoredSignatures != 0 { + i = encodeVarintValidatorStatus(dAtA, i, uint64(m.NumValidatorIgnoredSignatures)) + i-- + dAtA[i] = 0x30 + } + if m.NumValidatorFailure != 0 { + i = encodeVarintValidatorStatus(dAtA, i, uint64(m.NumValidatorFailure)) + i-- + dAtA[i] = 0x28 + } + if m.NumValidatorSuccess != 0 { + i = encodeVarintValidatorStatus(dAtA, i, uint64(m.NumValidatorSuccess)) + i-- + dAtA[i] = 0x20 + } + if m.NumLeaderFailure != 0 { + i = encodeVarintValidatorStatus(dAtA, i, uint64(m.NumLeaderFailure)) + i-- + dAtA[i] = 0x18 + } + if m.NumLeaderSuccess != 0 { + i = encodeVarintValidatorStatus(dAtA, i, uint64(m.NumLeaderSuccess)) + i-- + dAtA[i] = 0x10 + } + if m.TempRating != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.TempRating)))) + i-- + dAtA[i] = 0xd + } + return len(dAtA) - i, nil +} + +func encodeVarintValidatorStatus(dAtA []byte, offset int, v uint64) int { + offset -= sovValidatorStatus(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ValidatorStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TempRating != 0 { + n += 5 + } + if m.NumLeaderSuccess != 0 { + n += 1 + sovValidatorStatus(uint64(m.NumLeaderSuccess)) + } + if m.NumLeaderFailure != 0 { + n += 1 + sovValidatorStatus(uint64(m.NumLeaderFailure)) + } + if m.NumValidatorSuccess != 0 { + n += 1 + sovValidatorStatus(uint64(m.NumValidatorSuccess)) + } + if m.NumValidatorFailure != 0 { + n += 1 + sovValidatorStatus(uint64(m.NumValidatorFailure)) + } + if m.NumValidatorIgnoredSignatures != 0 { + n += 1 + sovValidatorStatus(uint64(m.NumValidatorIgnoredSignatures)) + } + if m.Rating != 0 { + n += 5 + } + if m.RatingModifier != 0 { + n += 5 + } + if m.TotalNumLeaderSuccess != 0 { + n += 1 + sovValidatorStatus(uint64(m.TotalNumLeaderSuccess)) + } + if m.TotalNumLeaderFailure != 0 { + n += 1 + sovValidatorStatus(uint64(m.TotalNumLeaderFailure)) + } + if m.TotalNumValidatorSuccess != 0 { + n += 1 + sovValidatorStatus(uint64(m.TotalNumValidatorSuccess)) + } + if m.TotalNumValidatorFailure != 0 { + n += 1 + sovValidatorStatus(uint64(m.TotalNumValidatorFailure)) + } + if m.TotalNumValidatorIgnoredSignatures != 0 { + n += 1 + sovValidatorStatus(uint64(m.TotalNumValidatorIgnoredSignatures)) + } + if m.ShardId != 0 { + n += 1 + sovValidatorStatus(uint64(m.ShardId)) + } + l = len(m.ValidatorStatus) + if l > 0 { + n += 1 + l + sovValidatorStatus(uint64(l)) + } + return n +} + +func sovValidatorStatus(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozValidatorStatus(x uint64) (n int) { + return sovValidatorStatus(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *ValidatorStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ValidatorStatus{`, + `TempRating:` + fmt.Sprintf("%v", this.TempRating) + `,`, + `NumLeaderSuccess:` + fmt.Sprintf("%v", this.NumLeaderSuccess) + `,`, + `NumLeaderFailure:` + fmt.Sprintf("%v", this.NumLeaderFailure) + `,`, + `NumValidatorSuccess:` + fmt.Sprintf("%v", this.NumValidatorSuccess) + `,`, + `NumValidatorFailure:` + fmt.Sprintf("%v", this.NumValidatorFailure) + `,`, + `NumValidatorIgnoredSignatures:` + fmt.Sprintf("%v", this.NumValidatorIgnoredSignatures) + `,`, + `Rating:` + fmt.Sprintf("%v", this.Rating) + `,`, + `RatingModifier:` + fmt.Sprintf("%v", this.RatingModifier) + `,`, + `TotalNumLeaderSuccess:` + fmt.Sprintf("%v", this.TotalNumLeaderSuccess) + `,`, + `TotalNumLeaderFailure:` + fmt.Sprintf("%v", this.TotalNumLeaderFailure) + `,`, + `TotalNumValidatorSuccess:` + fmt.Sprintf("%v", this.TotalNumValidatorSuccess) + `,`, + `TotalNumValidatorFailure:` + fmt.Sprintf("%v", this.TotalNumValidatorFailure) + `,`, + `TotalNumValidatorIgnoredSignatures:` + fmt.Sprintf("%v", this.TotalNumValidatorIgnoredSignatures) + `,`, + `ShardId:` + fmt.Sprintf("%v", this.ShardId) + `,`, + `ValidatorStatus:` + fmt.Sprintf("%v", this.ValidatorStatus) + `,`, + `}`, + }, "") + return s +} +func valueToStringValidatorStatus(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *ValidatorStatus) 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 ErrIntOverflowValidatorStatus + } + 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: ValidatorStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field TempRating", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.TempRating = float32(math.Float32frombits(v)) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumLeaderSuccess", wireType) + } + m.NumLeaderSuccess = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumLeaderSuccess |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumLeaderFailure", wireType) + } + m.NumLeaderFailure = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumLeaderFailure |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumValidatorSuccess", wireType) + } + m.NumValidatorSuccess = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumValidatorSuccess |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumValidatorFailure", wireType) + } + m.NumValidatorFailure = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumValidatorFailure |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumValidatorIgnoredSignatures", wireType) + } + m.NumValidatorIgnoredSignatures = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumValidatorIgnoredSignatures |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field Rating", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.Rating = float32(math.Float32frombits(v)) + case 8: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field RatingModifier", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.RatingModifier = float32(math.Float32frombits(v)) + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalNumLeaderSuccess", wireType) + } + m.TotalNumLeaderSuccess = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalNumLeaderSuccess |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalNumLeaderFailure", wireType) + } + m.TotalNumLeaderFailure = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalNumLeaderFailure |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalNumValidatorSuccess", wireType) + } + m.TotalNumValidatorSuccess = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalNumValidatorSuccess |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalNumValidatorFailure", wireType) + } + m.TotalNumValidatorFailure = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalNumValidatorFailure |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalNumValidatorIgnoredSignatures", wireType) + } + m.TotalNumValidatorIgnoredSignatures = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalNumValidatorIgnoredSignatures |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardId", wireType) + } + m.ShardId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ShardId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorStatus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowValidatorStatus + } + 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 ErrInvalidLengthValidatorStatus + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthValidatorStatus + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorStatus = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipValidatorStatus(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthValidatorStatus + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthValidatorStatus + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipValidatorStatus(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidatorStatus + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidatorStatus + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowValidatorStatus + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthValidatorStatus + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupValidatorStatus + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthValidatorStatus + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthValidatorStatus = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowValidatorStatus = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupValidatorStatus = fmt.Errorf("proto: unexpected end of group") +) diff --git a/data/validator/validatorStatus.proto b/data/validator/validatorStatus.proto new file mode 100644 index 00000000..9561e5bf --- /dev/null +++ b/data/validator/validatorStatus.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package proto; + +option go_package = "validator"; +option (gogoproto.stable_marshaler_all) = true; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +// ValidatorStatus holds information about a validator +message ValidatorStatus { + float TempRating = 1 [(gogoproto.jsontag) = "tempRating"]; + uint32 NumLeaderSuccess = 2 [(gogoproto.jsontag) = "numLeaderSuccess"]; + uint32 NumLeaderFailure = 3 [(gogoproto.jsontag) = "numLeaderFailure"]; + uint32 NumValidatorSuccess = 4 [(gogoproto.jsontag) = "numValidatorSuccess"]; + uint32 NumValidatorFailure = 5 [(gogoproto.jsontag) = "numValidatorFailure"]; + uint32 NumValidatorIgnoredSignatures = 6 [(gogoproto.jsontag) = "numValidatorIgnoredSignatures"]; + float Rating = 7 [(gogoproto.jsontag) = "rating"]; + float RatingModifier = 8 [(gogoproto.jsontag) = "ratingModifier"]; + uint32 TotalNumLeaderSuccess = 9 [(gogoproto.jsontag) = "totalNumLeaderSuccess"]; + uint32 TotalNumLeaderFailure = 10 [(gogoproto.jsontag) = "totalNumLeaderFailure"]; + uint32 TotalNumValidatorSuccess = 11 [(gogoproto.jsontag) = "totalNumValidatorSuccess"]; + uint32 TotalNumValidatorFailure = 12 [(gogoproto.jsontag) = "totalNumValidatorFailure"]; + uint32 TotalNumValidatorIgnoredSignatures = 13 [(gogoproto.jsontag) = "totalNumValidatorIgnoredSignatures"]; + uint32 ShardId = 14 [(gogoproto.jsontag) = "shardId"]; + string ValidatorStatus = 15 [(gogoproto.jsontag) = "validatorStatus,omitempty"]; +} From 47f800118253da5614c8c51a653162de7a2f14db Mon Sep 17 00:00:00 2001 From: Sorin Stanculeanu Date: Mon, 27 Nov 2023 11:06:15 +0200 Subject: [PATCH 2/3] renamed --- ...idatorStatus.go => validatorStatistics.go} | 2 +- ...Status.pb.go => validatorStatistics.pb.go} | 279 +++++++++--------- ...Status.proto => validatorStatistics.proto} | 4 +- 3 files changed, 143 insertions(+), 142 deletions(-) rename data/validator/{validatorStatus.go => validatorStatistics.go} (91%) rename data/validator/{validatorStatus.pb.go => validatorStatistics.pb.go} (66%) rename data/validator/{validatorStatus.proto => validatorStatistics.proto} (94%) diff --git a/data/validator/validatorStatus.go b/data/validator/validatorStatistics.go similarity index 91% rename from data/validator/validatorStatus.go rename to data/validator/validatorStatistics.go index 474bc239..f905b5df 100644 --- a/data/validator/validatorStatus.go +++ b/data/validator/validatorStatistics.go @@ -1,2 +1,2 @@ -//go:generate protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/multiversx/protobuf/protobuf --gogoslick_out=. validatorStatus.proto +//go:generate protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/multiversx/protobuf/protobuf --gogoslick_out=. validatorStatistics.proto package validator diff --git a/data/validator/validatorStatus.pb.go b/data/validator/validatorStatistics.pb.go similarity index 66% rename from data/validator/validatorStatus.pb.go rename to data/validator/validatorStatistics.pb.go index 302e7bb6..7091fa59 100644 --- a/data/validator/validatorStatus.pb.go +++ b/data/validator/validatorStatistics.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: validatorStatus.proto +// source: validatorStatistics.proto package validator @@ -26,8 +26,8 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// ValidatorStatus holds information about a validator -type ValidatorStatus struct { +// ValidatorStatistics holds information about a validator +type ValidatorStatistics struct { TempRating float32 `protobuf:"fixed32,1,opt,name=TempRating,proto3" json:"tempRating"` NumLeaderSuccess uint32 `protobuf:"varint,2,opt,name=NumLeaderSuccess,proto3" json:"numLeaderSuccess"` NumLeaderFailure uint32 `protobuf:"varint,3,opt,name=NumLeaderFailure,proto3" json:"numLeaderFailure"` @@ -45,15 +45,15 @@ type ValidatorStatus struct { ValidatorStatus string `protobuf:"bytes,15,opt,name=ValidatorStatus,proto3" json:"validatorStatus,omitempty"` } -func (m *ValidatorStatus) Reset() { *m = ValidatorStatus{} } -func (*ValidatorStatus) ProtoMessage() {} -func (*ValidatorStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_42eb597ab5bfcbec, []int{0} +func (m *ValidatorStatistics) Reset() { *m = ValidatorStatistics{} } +func (*ValidatorStatistics) ProtoMessage() {} +func (*ValidatorStatistics) Descriptor() ([]byte, []int) { + return fileDescriptor_5fa43c48ee2425ed, []int{0} } -func (m *ValidatorStatus) XXX_Unmarshal(b []byte) error { +func (m *ValidatorStatistics) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ValidatorStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ValidatorStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -61,117 +61,117 @@ func (m *ValidatorStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, err } return b[:n], nil } -func (m *ValidatorStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorStatus.Merge(m, src) +func (m *ValidatorStatistics) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorStatistics.Merge(m, src) } -func (m *ValidatorStatus) XXX_Size() int { +func (m *ValidatorStatistics) XXX_Size() int { return m.Size() } -func (m *ValidatorStatus) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorStatus.DiscardUnknown(m) +func (m *ValidatorStatistics) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorStatistics.DiscardUnknown(m) } -var xxx_messageInfo_ValidatorStatus proto.InternalMessageInfo +var xxx_messageInfo_ValidatorStatistics proto.InternalMessageInfo -func (m *ValidatorStatus) GetTempRating() float32 { +func (m *ValidatorStatistics) GetTempRating() float32 { if m != nil { return m.TempRating } return 0 } -func (m *ValidatorStatus) GetNumLeaderSuccess() uint32 { +func (m *ValidatorStatistics) GetNumLeaderSuccess() uint32 { if m != nil { return m.NumLeaderSuccess } return 0 } -func (m *ValidatorStatus) GetNumLeaderFailure() uint32 { +func (m *ValidatorStatistics) GetNumLeaderFailure() uint32 { if m != nil { return m.NumLeaderFailure } return 0 } -func (m *ValidatorStatus) GetNumValidatorSuccess() uint32 { +func (m *ValidatorStatistics) GetNumValidatorSuccess() uint32 { if m != nil { return m.NumValidatorSuccess } return 0 } -func (m *ValidatorStatus) GetNumValidatorFailure() uint32 { +func (m *ValidatorStatistics) GetNumValidatorFailure() uint32 { if m != nil { return m.NumValidatorFailure } return 0 } -func (m *ValidatorStatus) GetNumValidatorIgnoredSignatures() uint32 { +func (m *ValidatorStatistics) GetNumValidatorIgnoredSignatures() uint32 { if m != nil { return m.NumValidatorIgnoredSignatures } return 0 } -func (m *ValidatorStatus) GetRating() float32 { +func (m *ValidatorStatistics) GetRating() float32 { if m != nil { return m.Rating } return 0 } -func (m *ValidatorStatus) GetRatingModifier() float32 { +func (m *ValidatorStatistics) GetRatingModifier() float32 { if m != nil { return m.RatingModifier } return 0 } -func (m *ValidatorStatus) GetTotalNumLeaderSuccess() uint32 { +func (m *ValidatorStatistics) GetTotalNumLeaderSuccess() uint32 { if m != nil { return m.TotalNumLeaderSuccess } return 0 } -func (m *ValidatorStatus) GetTotalNumLeaderFailure() uint32 { +func (m *ValidatorStatistics) GetTotalNumLeaderFailure() uint32 { if m != nil { return m.TotalNumLeaderFailure } return 0 } -func (m *ValidatorStatus) GetTotalNumValidatorSuccess() uint32 { +func (m *ValidatorStatistics) GetTotalNumValidatorSuccess() uint32 { if m != nil { return m.TotalNumValidatorSuccess } return 0 } -func (m *ValidatorStatus) GetTotalNumValidatorFailure() uint32 { +func (m *ValidatorStatistics) GetTotalNumValidatorFailure() uint32 { if m != nil { return m.TotalNumValidatorFailure } return 0 } -func (m *ValidatorStatus) GetTotalNumValidatorIgnoredSignatures() uint32 { +func (m *ValidatorStatistics) GetTotalNumValidatorIgnoredSignatures() uint32 { if m != nil { return m.TotalNumValidatorIgnoredSignatures } return 0 } -func (m *ValidatorStatus) GetShardId() uint32 { +func (m *ValidatorStatistics) GetShardId() uint32 { if m != nil { return m.ShardId } return 0 } -func (m *ValidatorStatus) GetValidatorStatus() string { +func (m *ValidatorStatistics) GetValidatorStatus() string { if m != nil { return m.ValidatorStatus } @@ -179,55 +179,56 @@ func (m *ValidatorStatus) GetValidatorStatus() string { } func init() { - proto.RegisterType((*ValidatorStatus)(nil), "proto.ValidatorStatus") + proto.RegisterType((*ValidatorStatistics)(nil), "proto.ValidatorStatistics") } -func init() { proto.RegisterFile("validatorStatus.proto", fileDescriptor_42eb597ab5bfcbec) } +func init() { proto.RegisterFile("validatorStatistics.proto", fileDescriptor_5fa43c48ee2425ed) } -var fileDescriptor_42eb597ab5bfcbec = []byte{ - // 509 bytes of a gzipped FileDescriptorProto +var fileDescriptor_5fa43c48ee2425ed = []byte{ + // 517 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xc1, 0x6e, 0xd3, 0x30, - 0x18, 0xc7, 0xe3, 0xc1, 0xda, 0xd5, 0x63, 0xdd, 0xe4, 0x51, 0x91, 0x21, 0x6a, 0x97, 0x4a, 0xa0, + 0x18, 0xc7, 0xe3, 0xc1, 0xda, 0xd5, 0x63, 0xdd, 0xe4, 0x32, 0x91, 0x21, 0x6a, 0x97, 0x4a, 0xa0, 0x1e, 0xa0, 0x3b, 0x70, 0xe3, 0x84, 0x8a, 0x04, 0xaa, 0x04, 0x43, 0x72, 0x27, 0x84, 0xb8, 0xa5, - 0x4d, 0x96, 0x45, 0x6a, 0xe2, 0xc9, 0x71, 0x26, 0x71, 0xe3, 0x11, 0x78, 0x0c, 0x1e, 0x85, 0x63, - 0x8f, 0x3d, 0x59, 0xd4, 0xbd, 0x20, 0x9f, 0xf6, 0x08, 0x08, 0xb7, 0x19, 0x6d, 0x9c, 0x16, 0x4e, - 0x49, 0xbe, 0xff, 0xff, 0xff, 0xcb, 0x97, 0x7c, 0xd6, 0x07, 0x1b, 0xd7, 0xde, 0x38, 0xf2, 0x3d, - 0xc1, 0xf8, 0x40, 0x78, 0x22, 0x4b, 0xbb, 0x57, 0x9c, 0x09, 0x86, 0x76, 0xcd, 0xe5, 0xe1, 0xf3, - 0x30, 0x12, 0x97, 0xd9, 0xb0, 0x3b, 0x62, 0xf1, 0x69, 0xc8, 0x42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9, 0x1c, 0x3b, 0x9f, 0x6b, 0xb7, 0x6f, 0x19, 0x56, 0xcc, 0xc2, 0x7a, 0xf1, - 0x3b, 0x00, 0x00, 0xff, 0xff, 0x1e, 0x3e, 0x4e, 0xe7, 0xff, 0x04, 0x00, 0x00, -} - -func (this *ValidatorStatus) Equal(that interface{}) bool { + 0x4d, 0x96, 0x59, 0x6a, 0xe3, 0xc9, 0xb1, 0x27, 0x71, 0xe3, 0x11, 0x78, 0x0c, 0x1e, 0x85, 0x63, + 0x8f, 0x3d, 0x59, 0x34, 0x95, 0x10, 0xf2, 0x69, 0x8f, 0x80, 0x70, 0x9b, 0xb1, 0xd6, 0x69, 0xd9, + 0x29, 0xc9, 0xf7, 0xff, 0xff, 0x7f, 0xf9, 0x92, 0xcf, 0xfa, 0xe0, 0xd1, 0x65, 0x30, 0x64, 0x61, + 0x20, 0xb9, 0xe8, 0xc9, 0x40, 0xb2, 0x54, 0xb2, 0x41, 0xda, 0xbe, 0x10, 0x5c, 0x72, 0xb4, 0x6d, + 0x2f, 0x0f, 0x9f, 0xc7, 0x4c, 0x9e, 0xab, 0x7e, 0x7b, 0xc0, 0x47, 0xc7, 0x31, 0x8f, 0xf9, 0xb1, + 0x2d, 0xf7, 0xd5, 0x99, 0x7d, 0xb2, 0x0f, 0xf6, 0x6e, 0x9e, 0x6a, 0xfe, 0xda, 0x81, 0xb5, 0x8f, + 0x2e, 0x13, 0xb5, 0x21, 0x3c, 0x8d, 0x46, 0x17, 0x34, 0x90, 0x2c, 0x89, 0x7d, 0xd0, 0x00, 0xad, + 0xad, 0x4e, 0xd5, 0x68, 0x02, 0xe5, 0x75, 0x95, 0xde, 0x70, 0xa0, 0x57, 0xf0, 0xe0, 0x44, 0x8d, + 0xde, 0x45, 0x41, 0x18, 0x89, 0x9e, 0x1a, 0x0c, 0xa2, 0x34, 0xf5, 0xb7, 0x1a, 0xa0, 0xb5, 0xd7, + 0xb9, 0x6f, 0x34, 0x39, 0x48, 0x56, 0x34, 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 0xcd, 0x3d, + 0x23, 0x7b, 0xf6, 0x1d, 0x4f, 0x8d, 0x26, 0x4d, 0xf9, 0x5f, 0x37, 0xbd, 0x05, 0x11, 0x3d, 0x81, + 0xe5, 0xde, 0x79, 0x20, 0xc2, 0x6e, 0xe8, 0x57, 0x2d, 0x7c, 0xd7, 0x68, 0x52, 0x4e, 0xe7, 0x25, + 0x9a, 0x6b, 0xe8, 0x2d, 0xdc, 0x5f, 0x5a, 0x0f, 0x2a, 0xf5, 0xf7, 0x1b, 0xa0, 0x55, 0xe9, 0xd4, + 0x8d, 0x26, 0xcb, 0xdb, 0x48, 0xa5, 0xcf, 0xf8, 0x88, 0xfd, 0xdd, 0x0f, 0xf2, 0x0b, 0x5d, 0x4d, + 0x75, 0x5e, 0x8f, 0xa7, 0xd8, 0x9b, 0x4c, 0xb1, 0x77, 0x35, 0xc5, 0xe0, 0x6b, 0x86, 0xc1, 0xf7, + 0x0c, 0x83, 0x1f, 0x19, 0x06, 0xe3, 0x0c, 0x83, 0x49, 0x86, 0xc1, 0xcf, 0x0c, 0x83, 0xdf, 0x19, + 0xf6, 0xae, 0x32, 0x0c, 0xbe, 0xcd, 0xb0, 0x37, 0x9e, 0x61, 0x6f, 0x32, 0xc3, 0xde, 0xe7, 0xca, + 0xf5, 0x5b, 0xfa, 0x25, 0xbb, 0xb4, 0x5e, 0xfc, 0x09, 0x00, 0x00, 0xff, 0xff, 0x9a, 0xff, 0x09, + 0x3b, 0x07, 0x05, 0x00, 0x00, +} + +func (this *ValidatorStatistics) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*ValidatorStatus) + that1, ok := that.(*ValidatorStatistics) if !ok { - that2, ok := that.(ValidatorStatus) + that2, ok := that.(ValidatorStatistics) if ok { that1 = &that2 } else { @@ -286,12 +287,12 @@ func (this *ValidatorStatus) Equal(that interface{}) bool { } return true } -func (this *ValidatorStatus) GoString() string { +func (this *ValidatorStatistics) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 19) - s = append(s, "&validator.ValidatorStatus{") + s = append(s, "&validator.ValidatorStatistics{") s = append(s, "TempRating: "+fmt.Sprintf("%#v", this.TempRating)+",\n") s = append(s, "NumLeaderSuccess: "+fmt.Sprintf("%#v", this.NumLeaderSuccess)+",\n") s = append(s, "NumLeaderFailure: "+fmt.Sprintf("%#v", this.NumLeaderFailure)+",\n") @@ -310,7 +311,7 @@ func (this *ValidatorStatus) GoString() string { s = append(s, "}") return strings.Join(s, "") } -func valueToGoStringValidatorStatus(v interface{}, typ string) string { +func valueToGoStringValidatorStatistics(v interface{}, typ string) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" @@ -318,7 +319,7 @@ func valueToGoStringValidatorStatus(v interface{}, typ string) string { pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } -func (m *ValidatorStatus) Marshal() (dAtA []byte, err error) { +func (m *ValidatorStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -328,12 +329,12 @@ func (m *ValidatorStatus) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ValidatorStatus) MarshalTo(dAtA []byte) (int, error) { +func (m *ValidatorStatistics) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ValidatorStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ValidatorStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -341,37 +342,37 @@ func (m *ValidatorStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.ValidatorStatus) > 0 { i -= len(m.ValidatorStatus) copy(dAtA[i:], m.ValidatorStatus) - i = encodeVarintValidatorStatus(dAtA, i, uint64(len(m.ValidatorStatus))) + i = encodeVarintValidatorStatistics(dAtA, i, uint64(len(m.ValidatorStatus))) i-- dAtA[i] = 0x7a } if m.ShardId != 0 { - i = encodeVarintValidatorStatus(dAtA, i, uint64(m.ShardId)) + i = encodeVarintValidatorStatistics(dAtA, i, uint64(m.ShardId)) i-- dAtA[i] = 0x70 } if m.TotalNumValidatorIgnoredSignatures != 0 { - i = encodeVarintValidatorStatus(dAtA, i, uint64(m.TotalNumValidatorIgnoredSignatures)) + i = encodeVarintValidatorStatistics(dAtA, i, uint64(m.TotalNumValidatorIgnoredSignatures)) i-- dAtA[i] = 0x68 } if m.TotalNumValidatorFailure != 0 { - i = encodeVarintValidatorStatus(dAtA, i, uint64(m.TotalNumValidatorFailure)) + i = encodeVarintValidatorStatistics(dAtA, i, uint64(m.TotalNumValidatorFailure)) i-- dAtA[i] = 0x60 } if m.TotalNumValidatorSuccess != 0 { - i = encodeVarintValidatorStatus(dAtA, i, uint64(m.TotalNumValidatorSuccess)) + i = encodeVarintValidatorStatistics(dAtA, i, uint64(m.TotalNumValidatorSuccess)) i-- dAtA[i] = 0x58 } if m.TotalNumLeaderFailure != 0 { - i = encodeVarintValidatorStatus(dAtA, i, uint64(m.TotalNumLeaderFailure)) + i = encodeVarintValidatorStatistics(dAtA, i, uint64(m.TotalNumLeaderFailure)) i-- dAtA[i] = 0x50 } if m.TotalNumLeaderSuccess != 0 { - i = encodeVarintValidatorStatus(dAtA, i, uint64(m.TotalNumLeaderSuccess)) + i = encodeVarintValidatorStatistics(dAtA, i, uint64(m.TotalNumLeaderSuccess)) i-- dAtA[i] = 0x48 } @@ -388,27 +389,27 @@ func (m *ValidatorStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x3d } if m.NumValidatorIgnoredSignatures != 0 { - i = encodeVarintValidatorStatus(dAtA, i, uint64(m.NumValidatorIgnoredSignatures)) + i = encodeVarintValidatorStatistics(dAtA, i, uint64(m.NumValidatorIgnoredSignatures)) i-- dAtA[i] = 0x30 } if m.NumValidatorFailure != 0 { - i = encodeVarintValidatorStatus(dAtA, i, uint64(m.NumValidatorFailure)) + i = encodeVarintValidatorStatistics(dAtA, i, uint64(m.NumValidatorFailure)) i-- dAtA[i] = 0x28 } if m.NumValidatorSuccess != 0 { - i = encodeVarintValidatorStatus(dAtA, i, uint64(m.NumValidatorSuccess)) + i = encodeVarintValidatorStatistics(dAtA, i, uint64(m.NumValidatorSuccess)) i-- dAtA[i] = 0x20 } if m.NumLeaderFailure != 0 { - i = encodeVarintValidatorStatus(dAtA, i, uint64(m.NumLeaderFailure)) + i = encodeVarintValidatorStatistics(dAtA, i, uint64(m.NumLeaderFailure)) i-- dAtA[i] = 0x18 } if m.NumLeaderSuccess != 0 { - i = encodeVarintValidatorStatus(dAtA, i, uint64(m.NumLeaderSuccess)) + i = encodeVarintValidatorStatistics(dAtA, i, uint64(m.NumLeaderSuccess)) i-- dAtA[i] = 0x10 } @@ -421,8 +422,8 @@ func (m *ValidatorStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarintValidatorStatus(dAtA []byte, offset int, v uint64) int { - offset -= sovValidatorStatus(v) +func encodeVarintValidatorStatistics(dAtA []byte, offset int, v uint64) int { + offset -= sovValidatorStatistics(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -432,7 +433,7 @@ func encodeVarintValidatorStatus(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *ValidatorStatus) Size() (n int) { +func (m *ValidatorStatistics) Size() (n int) { if m == nil { return 0 } @@ -442,19 +443,19 @@ func (m *ValidatorStatus) Size() (n int) { n += 5 } if m.NumLeaderSuccess != 0 { - n += 1 + sovValidatorStatus(uint64(m.NumLeaderSuccess)) + n += 1 + sovValidatorStatistics(uint64(m.NumLeaderSuccess)) } if m.NumLeaderFailure != 0 { - n += 1 + sovValidatorStatus(uint64(m.NumLeaderFailure)) + n += 1 + sovValidatorStatistics(uint64(m.NumLeaderFailure)) } if m.NumValidatorSuccess != 0 { - n += 1 + sovValidatorStatus(uint64(m.NumValidatorSuccess)) + n += 1 + sovValidatorStatistics(uint64(m.NumValidatorSuccess)) } if m.NumValidatorFailure != 0 { - n += 1 + sovValidatorStatus(uint64(m.NumValidatorFailure)) + n += 1 + sovValidatorStatistics(uint64(m.NumValidatorFailure)) } if m.NumValidatorIgnoredSignatures != 0 { - n += 1 + sovValidatorStatus(uint64(m.NumValidatorIgnoredSignatures)) + n += 1 + sovValidatorStatistics(uint64(m.NumValidatorIgnoredSignatures)) } if m.Rating != 0 { n += 5 @@ -463,41 +464,41 @@ func (m *ValidatorStatus) Size() (n int) { n += 5 } if m.TotalNumLeaderSuccess != 0 { - n += 1 + sovValidatorStatus(uint64(m.TotalNumLeaderSuccess)) + n += 1 + sovValidatorStatistics(uint64(m.TotalNumLeaderSuccess)) } if m.TotalNumLeaderFailure != 0 { - n += 1 + sovValidatorStatus(uint64(m.TotalNumLeaderFailure)) + n += 1 + sovValidatorStatistics(uint64(m.TotalNumLeaderFailure)) } if m.TotalNumValidatorSuccess != 0 { - n += 1 + sovValidatorStatus(uint64(m.TotalNumValidatorSuccess)) + n += 1 + sovValidatorStatistics(uint64(m.TotalNumValidatorSuccess)) } if m.TotalNumValidatorFailure != 0 { - n += 1 + sovValidatorStatus(uint64(m.TotalNumValidatorFailure)) + n += 1 + sovValidatorStatistics(uint64(m.TotalNumValidatorFailure)) } if m.TotalNumValidatorIgnoredSignatures != 0 { - n += 1 + sovValidatorStatus(uint64(m.TotalNumValidatorIgnoredSignatures)) + n += 1 + sovValidatorStatistics(uint64(m.TotalNumValidatorIgnoredSignatures)) } if m.ShardId != 0 { - n += 1 + sovValidatorStatus(uint64(m.ShardId)) + n += 1 + sovValidatorStatistics(uint64(m.ShardId)) } l = len(m.ValidatorStatus) if l > 0 { - n += 1 + l + sovValidatorStatus(uint64(l)) + n += 1 + l + sovValidatorStatistics(uint64(l)) } return n } -func sovValidatorStatus(x uint64) (n int) { +func sovValidatorStatistics(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } -func sozValidatorStatus(x uint64) (n int) { - return sovValidatorStatus(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func sozValidatorStatistics(x uint64) (n int) { + return sovValidatorStatistics(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (this *ValidatorStatus) String() string { +func (this *ValidatorStatistics) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ValidatorStatus{`, + s := strings.Join([]string{`&ValidatorStatistics{`, `TempRating:` + fmt.Sprintf("%v", this.TempRating) + `,`, `NumLeaderSuccess:` + fmt.Sprintf("%v", this.NumLeaderSuccess) + `,`, `NumLeaderFailure:` + fmt.Sprintf("%v", this.NumLeaderFailure) + `,`, @@ -517,7 +518,7 @@ func (this *ValidatorStatus) String() string { }, "") return s } -func valueToStringValidatorStatus(v interface{}) string { +func valueToStringValidatorStatistics(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" @@ -525,7 +526,7 @@ func valueToStringValidatorStatus(v interface{}) string { pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } -func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { +func (m *ValidatorStatistics) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -533,7 +534,7 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowValidatorStatus + return ErrIntOverflowValidatorStatistics } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -548,10 +549,10 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ValidatorStatus: wiretype end group for non-group") + return fmt.Errorf("proto: ValidatorStatistics: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ValidatorStatistics: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -572,7 +573,7 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { m.NumLeaderSuccess = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowValidatorStatus + return ErrIntOverflowValidatorStatistics } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -591,7 +592,7 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { m.NumLeaderFailure = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowValidatorStatus + return ErrIntOverflowValidatorStatistics } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -610,7 +611,7 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { m.NumValidatorSuccess = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowValidatorStatus + return ErrIntOverflowValidatorStatistics } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -629,7 +630,7 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { m.NumValidatorFailure = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowValidatorStatus + return ErrIntOverflowValidatorStatistics } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -648,7 +649,7 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { m.NumValidatorIgnoredSignatures = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowValidatorStatus + return ErrIntOverflowValidatorStatistics } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -689,7 +690,7 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { m.TotalNumLeaderSuccess = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowValidatorStatus + return ErrIntOverflowValidatorStatistics } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -708,7 +709,7 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { m.TotalNumLeaderFailure = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowValidatorStatus + return ErrIntOverflowValidatorStatistics } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -727,7 +728,7 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { m.TotalNumValidatorSuccess = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowValidatorStatus + return ErrIntOverflowValidatorStatistics } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -746,7 +747,7 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { m.TotalNumValidatorFailure = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowValidatorStatus + return ErrIntOverflowValidatorStatistics } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -765,7 +766,7 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { m.TotalNumValidatorIgnoredSignatures = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowValidatorStatus + return ErrIntOverflowValidatorStatistics } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -784,7 +785,7 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { m.ShardId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowValidatorStatus + return ErrIntOverflowValidatorStatistics } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -803,7 +804,7 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowValidatorStatus + return ErrIntOverflowValidatorStatistics } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -817,11 +818,11 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthValidatorStatus + return ErrInvalidLengthValidatorStatistics } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthValidatorStatus + return ErrInvalidLengthValidatorStatistics } if postIndex > l { return io.ErrUnexpectedEOF @@ -830,15 +831,15 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipValidatorStatus(dAtA[iNdEx:]) + skippy, err := skipValidatorStatistics(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthValidatorStatus + return ErrInvalidLengthValidatorStatistics } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthValidatorStatus + return ErrInvalidLengthValidatorStatistics } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -852,7 +853,7 @@ func (m *ValidatorStatus) Unmarshal(dAtA []byte) error { } return nil } -func skipValidatorStatus(dAtA []byte) (n int, err error) { +func skipValidatorStatistics(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 @@ -860,7 +861,7 @@ func skipValidatorStatus(dAtA []byte) (n int, err error) { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowValidatorStatus + return 0, ErrIntOverflowValidatorStatistics } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -877,7 +878,7 @@ func skipValidatorStatus(dAtA []byte) (n int, err error) { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowValidatorStatus + return 0, ErrIntOverflowValidatorStatistics } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -893,7 +894,7 @@ func skipValidatorStatus(dAtA []byte) (n int, err error) { var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowValidatorStatus + return 0, ErrIntOverflowValidatorStatistics } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -906,14 +907,14 @@ func skipValidatorStatus(dAtA []byte) (n int, err error) { } } if length < 0 { - return 0, ErrInvalidLengthValidatorStatus + return 0, ErrInvalidLengthValidatorStatistics } iNdEx += length case 3: depth++ case 4: if depth == 0 { - return 0, ErrUnexpectedEndOfGroupValidatorStatus + return 0, ErrUnexpectedEndOfGroupValidatorStatistics } depth-- case 5: @@ -922,7 +923,7 @@ func skipValidatorStatus(dAtA []byte) (n int, err error) { return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { - return 0, ErrInvalidLengthValidatorStatus + return 0, ErrInvalidLengthValidatorStatistics } if depth == 0 { return iNdEx, nil @@ -932,7 +933,7 @@ func skipValidatorStatus(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthValidatorStatus = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowValidatorStatus = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupValidatorStatus = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthValidatorStatistics = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowValidatorStatistics = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupValidatorStatistics = fmt.Errorf("proto: unexpected end of group") ) diff --git a/data/validator/validatorStatus.proto b/data/validator/validatorStatistics.proto similarity index 94% rename from data/validator/validatorStatus.proto rename to data/validator/validatorStatistics.proto index 9561e5bf..1a6333c7 100644 --- a/data/validator/validatorStatus.proto +++ b/data/validator/validatorStatistics.proto @@ -7,8 +7,8 @@ option (gogoproto.stable_marshaler_all) = true; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; -// ValidatorStatus holds information about a validator -message ValidatorStatus { +// ValidatorStatistics holds information about a validator +message ValidatorStatistics { float TempRating = 1 [(gogoproto.jsontag) = "tempRating"]; uint32 NumLeaderSuccess = 2 [(gogoproto.jsontag) = "numLeaderSuccess"]; uint32 NumLeaderFailure = 3 [(gogoproto.jsontag) = "numLeaderFailure"]; From be7692cb1c0b58fe8b036242985d0ea9ed3605e0 Mon Sep 17 00:00:00 2001 From: Sorin Stanculeanu Date: Mon, 4 Dec 2023 12:17:23 +0200 Subject: [PATCH 3/3] removed omitempty field from ValidatorStatus as on mx-chain-proxy-go --- data/validator/validatorStatistics.pb.go | 69 ++++++++++++------------ data/validator/validatorStatistics.proto | 2 +- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/data/validator/validatorStatistics.pb.go b/data/validator/validatorStatistics.pb.go index 7091fa59..fe84a073 100644 --- a/data/validator/validatorStatistics.pb.go +++ b/data/validator/validatorStatistics.pb.go @@ -42,7 +42,7 @@ type ValidatorStatistics struct { TotalNumValidatorFailure uint32 `protobuf:"varint,12,opt,name=TotalNumValidatorFailure,proto3" json:"totalNumValidatorFailure"` TotalNumValidatorIgnoredSignatures uint32 `protobuf:"varint,13,opt,name=TotalNumValidatorIgnoredSignatures,proto3" json:"totalNumValidatorIgnoredSignatures"` ShardId uint32 `protobuf:"varint,14,opt,name=ShardId,proto3" json:"shardId"` - ValidatorStatus string `protobuf:"bytes,15,opt,name=ValidatorStatus,proto3" json:"validatorStatus,omitempty"` + ValidatorStatus string `protobuf:"bytes,15,opt,name=ValidatorStatus,proto3" json:"validatorStatus"` } func (m *ValidatorStatistics) Reset() { *m = ValidatorStatistics{} } @@ -185,40 +185,39 @@ func init() { func init() { proto.RegisterFile("validatorStatistics.proto", fileDescriptor_5fa43c48ee2425ed) } var fileDescriptor_5fa43c48ee2425ed = []byte{ - // 517 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xc1, 0x6e, 0xd3, 0x30, - 0x18, 0xc7, 0xe3, 0xc1, 0xda, 0xd5, 0x63, 0xdd, 0xe4, 0x32, 0x91, 0x21, 0x6a, 0x97, 0x4a, 0xa0, - 0x1e, 0xa0, 0x3b, 0x70, 0xe3, 0x84, 0x8a, 0x04, 0xaa, 0x04, 0x43, 0x72, 0x27, 0x84, 0xb8, 0xa5, - 0x4d, 0x96, 0x59, 0x6a, 0xe3, 0xc9, 0xb1, 0x27, 0x71, 0xe3, 0x11, 0x78, 0x0c, 0x1e, 0x85, 0x63, - 0x8f, 0x3d, 0x59, 0x34, 0x95, 0x10, 0xf2, 0x69, 0x8f, 0x80, 0x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xa5, 0xcf, 0xf8, 0x88, 0xfd, 0xdd, 0x0f, 0xf2, 0x0b, 0x5d, 0x4d, - 0x75, 0x5e, 0x8f, 0xa7, 0xd8, 0x9b, 0x4c, 0xb1, 0x77, 0x35, 0xc5, 0xe0, 0x6b, 0x86, 0xc1, 0xf7, - 0x0c, 0x83, 0x1f, 0x19, 0x06, 0xe3, 0x0c, 0x83, 0x49, 0x86, 0xc1, 0xcf, 0x0c, 0x83, 0xdf, 0x19, - 0xf6, 0xae, 0x32, 0x0c, 0xbe, 0xcd, 0xb0, 0x37, 0x9e, 0x61, 0x6f, 0x32, 0xc3, 0xde, 0xe7, 0xca, - 0xf5, 0x5b, 0xfa, 0x25, 0xbb, 0xb4, 0x5e, 0xfc, 0x09, 0x00, 0x00, 0xff, 0xff, 0x9a, 0xff, 0x09, - 0x3b, 0x07, 0x05, 0x00, 0x00, + // 507 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xc1, 0x8e, 0x12, 0x31, + 0x18, 0xc7, 0xa7, 0xab, 0x0b, 0x4b, 0xd7, 0x85, 0x4d, 0x71, 0xe3, 0xac, 0x71, 0x5b, 0x24, 0xd1, + 0x70, 0x91, 0x3d, 0x78, 0x33, 0x31, 0x31, 0x98, 0x98, 0x90, 0xe8, 0x9a, 0x94, 0x8d, 0x31, 0xde, + 0x0a, 0x33, 0x3b, 0xdb, 0x04, 0xa6, 0x9b, 0x4e, 0x87, 0xb3, 0x8f, 0xe0, 0x63, 0xf8, 0x28, 0x1e, + 0x39, 0x72, 0x30, 0x8d, 0x0c, 0x17, 0xd3, 0xd3, 0x3e, 0x82, 0x49, 0x61, 0x56, 0xa0, 0x03, 0x7a, + 0x62, 0xfa, 0xfd, 0xff, 0xff, 0x1f, 0x5f, 0xfb, 0x35, 0x85, 0xa7, 0x63, 0x36, 0xe4, 0x01, 0x53, + 0x42, 0xf6, 0x14, 0x53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0x0c, + 0x83, 0x5f, 0x19, 0x06, 0xbf, 0x33, 0xec, 0xdd, 0x66, 0x18, 0x7c, 0x9b, 0x63, 0x6f, 0x32, 0xc7, + 0xde, 0x74, 0x8e, 0xbd, 0x2f, 0x95, 0x3b, 0x76, 0xbf, 0x64, 0x9f, 0xaa, 0x97, 0x7f, 0x02, 0x00, + 0x00, 0xff, 0xff, 0xb2, 0xd8, 0xe5, 0xbc, 0xfd, 0x04, 0x00, 0x00, } func (this *ValidatorStatistics) Equal(that interface{}) bool { diff --git a/data/validator/validatorStatistics.proto b/data/validator/validatorStatistics.proto index 1a6333c7..aeb23299 100644 --- a/data/validator/validatorStatistics.proto +++ b/data/validator/validatorStatistics.proto @@ -23,5 +23,5 @@ message ValidatorStatistics { uint32 TotalNumValidatorFailure = 12 [(gogoproto.jsontag) = "totalNumValidatorFailure"]; uint32 TotalNumValidatorIgnoredSignatures = 13 [(gogoproto.jsontag) = "totalNumValidatorIgnoredSignatures"]; uint32 ShardId = 14 [(gogoproto.jsontag) = "shardId"]; - string ValidatorStatus = 15 [(gogoproto.jsontag) = "validatorStatus,omitempty"]; + string ValidatorStatus = 15 [(gogoproto.jsontag) = "validatorStatus"]; }