From 9105e636441609e51a29791414300903dd7f09f6 Mon Sep 17 00:00:00 2001 From: Kacper Sawicki Date: Mon, 22 Jul 2024 15:57:06 +0200 Subject: [PATCH 1/4] Add v2alpha1 malfeasance service --- .../go/spacemesh/v2alpha1/malfeasance.pb.go | 524 ++++++++++++++++++ .../spacemesh/v2alpha1/malfeasance.pb.gw.go | 271 +++++++++ .../spacemesh/v2alpha1/malfeasance_grpc.pb.go | 222 ++++++++ release/openapi/swagger/src/api.swagger.json | 109 ++++ spacemesh/v2alpha1/malfeasance.proto | 49 ++ 5 files changed, 1175 insertions(+) create mode 100644 release/go/spacemesh/v2alpha1/malfeasance.pb.go create mode 100644 release/go/spacemesh/v2alpha1/malfeasance.pb.gw.go create mode 100644 release/go/spacemesh/v2alpha1/malfeasance_grpc.pb.go create mode 100644 spacemesh/v2alpha1/malfeasance.proto diff --git a/release/go/spacemesh/v2alpha1/malfeasance.pb.go b/release/go/spacemesh/v2alpha1/malfeasance.pb.go new file mode 100644 index 00000000..06468319 --- /dev/null +++ b/release/go/spacemesh/v2alpha1/malfeasance.pb.go @@ -0,0 +1,524 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc (unknown) +// source: spacemesh/v2alpha1/malfeasance.proto + +package spacemeshv2alpha1 + +import ( + _ "google.golang.org/genproto/googleapis/api/visibility" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MalfeasanceProof_MalfeasanceType int32 + +const ( + MalfeasanceProof_MALFEASANCE_UNSPECIFIED MalfeasanceProof_MalfeasanceType = 0 + MalfeasanceProof_MALFEASANCE_ATX MalfeasanceProof_MalfeasanceType = 1 + MalfeasanceProof_MALFEASANCE_BALLOT MalfeasanceProof_MalfeasanceType = 2 + MalfeasanceProof_MALFEASANCE_HARE MalfeasanceProof_MalfeasanceType = 3 + MalfeasanceProof_MALFEASANCE_POST_INDEX MalfeasanceProof_MalfeasanceType = 4 + MalfeasanceProof_MALFEASANCE_INCORRECT_PREV_ATX MalfeasanceProof_MalfeasanceType = 5 + MalfeasanceProof_MALFEASANCE_DOUBLE_MARRY MalfeasanceProof_MalfeasanceType = 6 +) + +// Enum value maps for MalfeasanceProof_MalfeasanceType. +var ( + MalfeasanceProof_MalfeasanceType_name = map[int32]string{ + 0: "MALFEASANCE_UNSPECIFIED", + 1: "MALFEASANCE_ATX", + 2: "MALFEASANCE_BALLOT", + 3: "MALFEASANCE_HARE", + 4: "MALFEASANCE_POST_INDEX", + 5: "MALFEASANCE_INCORRECT_PREV_ATX", + 6: "MALFEASANCE_DOUBLE_MARRY", + } + MalfeasanceProof_MalfeasanceType_value = map[string]int32{ + "MALFEASANCE_UNSPECIFIED": 0, + "MALFEASANCE_ATX": 1, + "MALFEASANCE_BALLOT": 2, + "MALFEASANCE_HARE": 3, + "MALFEASANCE_POST_INDEX": 4, + "MALFEASANCE_INCORRECT_PREV_ATX": 5, + "MALFEASANCE_DOUBLE_MARRY": 6, + } +) + +func (x MalfeasanceProof_MalfeasanceType) Enum() *MalfeasanceProof_MalfeasanceType { + p := new(MalfeasanceProof_MalfeasanceType) + *p = x + return p +} + +func (x MalfeasanceProof_MalfeasanceType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MalfeasanceProof_MalfeasanceType) Descriptor() protoreflect.EnumDescriptor { + return file_spacemesh_v2alpha1_malfeasance_proto_enumTypes[0].Descriptor() +} + +func (MalfeasanceProof_MalfeasanceType) Type() protoreflect.EnumType { + return &file_spacemesh_v2alpha1_malfeasance_proto_enumTypes[0] +} + +func (x MalfeasanceProof_MalfeasanceType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MalfeasanceProof_MalfeasanceType.Descriptor instead. +func (MalfeasanceProof_MalfeasanceType) EnumDescriptor() ([]byte, []int) { + return file_spacemesh_v2alpha1_malfeasance_proto_rawDescGZIP(), []int{0, 0} +} + +type MalfeasanceProof struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Smesher []byte `protobuf:"bytes,1,opt,name=smesher,proto3" json:"smesher,omitempty"` + Layer uint32 `protobuf:"varint,2,opt,name=layer,proto3" json:"layer,omitempty"` + Kind MalfeasanceProof_MalfeasanceType `protobuf:"varint,3,opt,name=kind,proto3,enum=spacemesh.v2alpha1.MalfeasanceProof_MalfeasanceType" json:"kind,omitempty"` + DebugInfo string `protobuf:"bytes,4,opt,name=debug_info,json=debugInfo,proto3" json:"debug_info,omitempty"` + Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` +} + +func (x *MalfeasanceProof) Reset() { + *x = MalfeasanceProof{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2alpha1_malfeasance_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MalfeasanceProof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MalfeasanceProof) ProtoMessage() {} + +func (x *MalfeasanceProof) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2alpha1_malfeasance_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MalfeasanceProof.ProtoReflect.Descriptor instead. +func (*MalfeasanceProof) Descriptor() ([]byte, []int) { + return file_spacemesh_v2alpha1_malfeasance_proto_rawDescGZIP(), []int{0} +} + +func (x *MalfeasanceProof) GetSmesher() []byte { + if x != nil { + return x.Smesher + } + return nil +} + +func (x *MalfeasanceProof) GetLayer() uint32 { + if x != nil { + return x.Layer + } + return 0 +} + +func (x *MalfeasanceProof) GetKind() MalfeasanceProof_MalfeasanceType { + if x != nil { + return x.Kind + } + return MalfeasanceProof_MALFEASANCE_UNSPECIFIED +} + +func (x *MalfeasanceProof) GetDebugInfo() string { + if x != nil { + return x.DebugInfo + } + return "" +} + +func (x *MalfeasanceProof) GetProof() []byte { + if x != nil { + return x.Proof + } + return nil +} + +type MalfeasanceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SmesherId [][]byte `protobuf:"bytes,1,rep,name=smesher_id,json=smesherId,proto3" json:"smesher_id,omitempty"` + IncludeProof bool `protobuf:"varint,2,opt,name=include_proof,json=includeProof,proto3" json:"include_proof,omitempty"` // whether to include proof + Offset uint64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` // adjusts the starting point for data + Limit uint64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` // specifies max number of items to fetch +} + +func (x *MalfeasanceRequest) Reset() { + *x = MalfeasanceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2alpha1_malfeasance_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MalfeasanceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MalfeasanceRequest) ProtoMessage() {} + +func (x *MalfeasanceRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2alpha1_malfeasance_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MalfeasanceRequest.ProtoReflect.Descriptor instead. +func (*MalfeasanceRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2alpha1_malfeasance_proto_rawDescGZIP(), []int{1} +} + +func (x *MalfeasanceRequest) GetSmesherId() [][]byte { + if x != nil { + return x.SmesherId + } + return nil +} + +func (x *MalfeasanceRequest) GetIncludeProof() bool { + if x != nil { + return x.IncludeProof + } + return false +} + +func (x *MalfeasanceRequest) GetOffset() uint64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *MalfeasanceRequest) GetLimit() uint64 { + if x != nil { + return x.Limit + } + return 0 +} + +type MalfeasanceList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Malfeasances []*MalfeasanceProof `protobuf:"bytes,1,rep,name=malfeasances,proto3" json:"malfeasances,omitempty"` +} + +func (x *MalfeasanceList) Reset() { + *x = MalfeasanceList{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2alpha1_malfeasance_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MalfeasanceList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MalfeasanceList) ProtoMessage() {} + +func (x *MalfeasanceList) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2alpha1_malfeasance_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MalfeasanceList.ProtoReflect.Descriptor instead. +func (*MalfeasanceList) Descriptor() ([]byte, []int) { + return file_spacemesh_v2alpha1_malfeasance_proto_rawDescGZIP(), []int{2} +} + +func (x *MalfeasanceList) GetMalfeasances() []*MalfeasanceProof { + if x != nil { + return x.Malfeasances + } + return nil +} + +type MalfeasanceStreamRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IncludeProof bool `protobuf:"varint,1,opt,name=include_proof,json=includeProof,proto3" json:"include_proof,omitempty"` // whether to include proof +} + +func (x *MalfeasanceStreamRequest) Reset() { + *x = MalfeasanceStreamRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_spacemesh_v2alpha1_malfeasance_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MalfeasanceStreamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MalfeasanceStreamRequest) ProtoMessage() {} + +func (x *MalfeasanceStreamRequest) ProtoReflect() protoreflect.Message { + mi := &file_spacemesh_v2alpha1_malfeasance_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MalfeasanceStreamRequest.ProtoReflect.Descriptor instead. +func (*MalfeasanceStreamRequest) Descriptor() ([]byte, []int) { + return file_spacemesh_v2alpha1_malfeasance_proto_rawDescGZIP(), []int{3} +} + +func (x *MalfeasanceStreamRequest) GetIncludeProof() bool { + if x != nil { + return x.IncludeProof + } + return false +} + +var File_spacemesh_v2alpha1_malfeasance_proto protoreflect.FileDescriptor + +var file_spacemesh_v2alpha1_malfeasance_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x03, 0x0a, 0x10, 0x4d, 0x61, 0x6c, 0x66, + 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, + 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x04, + 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x34, 0x2e, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, + 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x65, 0x62, 0x75, + 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0xcf, 0x01, 0x0a, 0x0f, + 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1b, 0x0a, 0x17, 0x4d, 0x41, 0x4c, 0x46, 0x45, 0x41, 0x53, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, + 0x4d, 0x41, 0x4c, 0x46, 0x45, 0x41, 0x53, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x41, 0x54, 0x58, 0x10, + 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4d, 0x41, 0x4c, 0x46, 0x45, 0x41, 0x53, 0x41, 0x4e, 0x43, 0x45, + 0x5f, 0x42, 0x41, 0x4c, 0x4c, 0x4f, 0x54, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x41, 0x4c, + 0x46, 0x45, 0x41, 0x53, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x48, 0x41, 0x52, 0x45, 0x10, 0x03, 0x12, + 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x4c, 0x46, 0x45, 0x41, 0x53, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x50, + 0x4f, 0x53, 0x54, 0x5f, 0x49, 0x4e, 0x44, 0x45, 0x58, 0x10, 0x04, 0x12, 0x22, 0x0a, 0x1e, 0x4d, + 0x41, 0x4c, 0x46, 0x45, 0x41, 0x53, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x52, + 0x52, 0x45, 0x43, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x56, 0x5f, 0x41, 0x54, 0x58, 0x10, 0x05, 0x12, + 0x1c, 0x0a, 0x18, 0x4d, 0x41, 0x4c, 0x46, 0x45, 0x41, 0x53, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x44, + 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x5f, 0x4d, 0x41, 0x52, 0x52, 0x59, 0x10, 0x06, 0x22, 0x86, 0x01, + 0x0a, 0x12, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x63, 0x6c, + 0x75, 0x64, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x5b, 0x0a, 0x0f, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, + 0x73, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0c, 0x6d, 0x61, 0x6c, + 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0c, 0x6d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x22, 0x3f, 0x0a, 0x18, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, + 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x32, 0x75, 0x0a, 0x12, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, + 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x04, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x26, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, + 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, + 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x1a, + 0x0a, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x04, 0x12, 0x02, 0x56, 0x32, 0x32, 0x8c, 0x01, 0x0a, 0x18, + 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5e, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x12, 0x2c, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, + 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, + 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x24, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, + 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x30, 0x01, 0x1a, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, + 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x42, 0xdf, 0x01, 0x0a, 0x16, 0x63, + 0x6f, 0x6d, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, + 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, + 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, + 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x3b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x76, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x12, 0x53, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0xca, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, + 0x68, 0x5c, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x73, 0x68, 0x3a, 0x3a, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_spacemesh_v2alpha1_malfeasance_proto_rawDescOnce sync.Once + file_spacemesh_v2alpha1_malfeasance_proto_rawDescData = file_spacemesh_v2alpha1_malfeasance_proto_rawDesc +) + +func file_spacemesh_v2alpha1_malfeasance_proto_rawDescGZIP() []byte { + file_spacemesh_v2alpha1_malfeasance_proto_rawDescOnce.Do(func() { + file_spacemesh_v2alpha1_malfeasance_proto_rawDescData = protoimpl.X.CompressGZIP(file_spacemesh_v2alpha1_malfeasance_proto_rawDescData) + }) + return file_spacemesh_v2alpha1_malfeasance_proto_rawDescData +} + +var file_spacemesh_v2alpha1_malfeasance_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_spacemesh_v2alpha1_malfeasance_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_spacemesh_v2alpha1_malfeasance_proto_goTypes = []interface{}{ + (MalfeasanceProof_MalfeasanceType)(0), // 0: spacemesh.v2alpha1.MalfeasanceProof.MalfeasanceType + (*MalfeasanceProof)(nil), // 1: spacemesh.v2alpha1.MalfeasanceProof + (*MalfeasanceRequest)(nil), // 2: spacemesh.v2alpha1.MalfeasanceRequest + (*MalfeasanceList)(nil), // 3: spacemesh.v2alpha1.MalfeasanceList + (*MalfeasanceStreamRequest)(nil), // 4: spacemesh.v2alpha1.MalfeasanceStreamRequest +} +var file_spacemesh_v2alpha1_malfeasance_proto_depIdxs = []int32{ + 0, // 0: spacemesh.v2alpha1.MalfeasanceProof.kind:type_name -> spacemesh.v2alpha1.MalfeasanceProof.MalfeasanceType + 1, // 1: spacemesh.v2alpha1.MalfeasanceList.malfeasances:type_name -> spacemesh.v2alpha1.MalfeasanceProof + 2, // 2: spacemesh.v2alpha1.MalfeasanceService.List:input_type -> spacemesh.v2alpha1.MalfeasanceRequest + 4, // 3: spacemesh.v2alpha1.MalfeasanceStreamService.Stream:input_type -> spacemesh.v2alpha1.MalfeasanceStreamRequest + 3, // 4: spacemesh.v2alpha1.MalfeasanceService.List:output_type -> spacemesh.v2alpha1.MalfeasanceList + 1, // 5: spacemesh.v2alpha1.MalfeasanceStreamService.Stream:output_type -> spacemesh.v2alpha1.MalfeasanceProof + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_spacemesh_v2alpha1_malfeasance_proto_init() } +func file_spacemesh_v2alpha1_malfeasance_proto_init() { + if File_spacemesh_v2alpha1_malfeasance_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_spacemesh_v2alpha1_malfeasance_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MalfeasanceProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2alpha1_malfeasance_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MalfeasanceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2alpha1_malfeasance_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MalfeasanceList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_spacemesh_v2alpha1_malfeasance_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MalfeasanceStreamRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_spacemesh_v2alpha1_malfeasance_proto_rawDesc, + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_spacemesh_v2alpha1_malfeasance_proto_goTypes, + DependencyIndexes: file_spacemesh_v2alpha1_malfeasance_proto_depIdxs, + EnumInfos: file_spacemesh_v2alpha1_malfeasance_proto_enumTypes, + MessageInfos: file_spacemesh_v2alpha1_malfeasance_proto_msgTypes, + }.Build() + File_spacemesh_v2alpha1_malfeasance_proto = out.File + file_spacemesh_v2alpha1_malfeasance_proto_rawDesc = nil + file_spacemesh_v2alpha1_malfeasance_proto_goTypes = nil + file_spacemesh_v2alpha1_malfeasance_proto_depIdxs = nil +} diff --git a/release/go/spacemesh/v2alpha1/malfeasance.pb.gw.go b/release/go/spacemesh/v2alpha1/malfeasance.pb.gw.go new file mode 100644 index 00000000..b16d7537 --- /dev/null +++ b/release/go/spacemesh/v2alpha1/malfeasance.pb.gw.go @@ -0,0 +1,271 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: spacemesh/v2alpha1/malfeasance.proto + +/* +Package spacemeshv2alpha1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package spacemeshv2alpha1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_MalfeasanceService_List_0(ctx context.Context, marshaler runtime.Marshaler, client MalfeasanceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MalfeasanceRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.List(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MalfeasanceService_List_0(ctx context.Context, marshaler runtime.Marshaler, server MalfeasanceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MalfeasanceRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.List(ctx, &protoReq) + return msg, metadata, err + +} + +func request_MalfeasanceStreamService_Stream_0(ctx context.Context, marshaler runtime.Marshaler, client MalfeasanceStreamServiceClient, req *http.Request, pathParams map[string]string) (MalfeasanceStreamService_StreamClient, runtime.ServerMetadata, error) { + var protoReq MalfeasanceStreamRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.Stream(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +// RegisterMalfeasanceServiceHandlerServer registers the http handlers for service MalfeasanceService to "mux". +// UnaryRPC :call MalfeasanceServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMalfeasanceServiceHandlerFromEndpoint instead. +func RegisterMalfeasanceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MalfeasanceServiceServer) error { + + mux.Handle("POST", pattern_MalfeasanceService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/spacemesh.v2alpha1.MalfeasanceService/List", runtime.WithHTTPPathPattern("/spacemesh.v2alpha1.MalfeasanceService/List")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MalfeasanceService_List_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MalfeasanceService_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterMalfeasanceStreamServiceHandlerServer registers the http handlers for service MalfeasanceStreamService to "mux". +// UnaryRPC :call MalfeasanceStreamServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMalfeasanceStreamServiceHandlerFromEndpoint instead. +func RegisterMalfeasanceStreamServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MalfeasanceStreamServiceServer) error { + + mux.Handle("POST", pattern_MalfeasanceStreamService_Stream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + return nil +} + +// RegisterMalfeasanceServiceHandlerFromEndpoint is same as RegisterMalfeasanceServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterMalfeasanceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterMalfeasanceServiceHandler(ctx, mux, conn) +} + +// RegisterMalfeasanceServiceHandler registers the http handlers for service MalfeasanceService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterMalfeasanceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterMalfeasanceServiceHandlerClient(ctx, mux, NewMalfeasanceServiceClient(conn)) +} + +// RegisterMalfeasanceServiceHandlerClient registers the http handlers for service MalfeasanceService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MalfeasanceServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MalfeasanceServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "MalfeasanceServiceClient" to call the correct interceptors. +func RegisterMalfeasanceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MalfeasanceServiceClient) error { + + mux.Handle("POST", pattern_MalfeasanceService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2alpha1.MalfeasanceService/List", runtime.WithHTTPPathPattern("/spacemesh.v2alpha1.MalfeasanceService/List")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MalfeasanceService_List_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MalfeasanceService_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_MalfeasanceService_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2alpha1.MalfeasanceService", "List"}, "")) +) + +var ( + forward_MalfeasanceService_List_0 = runtime.ForwardResponseMessage +) + +// RegisterMalfeasanceStreamServiceHandlerFromEndpoint is same as RegisterMalfeasanceStreamServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterMalfeasanceStreamServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterMalfeasanceStreamServiceHandler(ctx, mux, conn) +} + +// RegisterMalfeasanceStreamServiceHandler registers the http handlers for service MalfeasanceStreamService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterMalfeasanceStreamServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterMalfeasanceStreamServiceHandlerClient(ctx, mux, NewMalfeasanceStreamServiceClient(conn)) +} + +// RegisterMalfeasanceStreamServiceHandlerClient registers the http handlers for service MalfeasanceStreamService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MalfeasanceStreamServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MalfeasanceStreamServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "MalfeasanceStreamServiceClient" to call the correct interceptors. +func RegisterMalfeasanceStreamServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MalfeasanceStreamServiceClient) error { + + mux.Handle("POST", pattern_MalfeasanceStreamService_Stream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/spacemesh.v2alpha1.MalfeasanceStreamService/Stream", runtime.WithHTTPPathPattern("/spacemesh.v2alpha1.MalfeasanceStreamService/Stream")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MalfeasanceStreamService_Stream_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MalfeasanceStreamService_Stream_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_MalfeasanceStreamService_Stream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"spacemesh.v2alpha1.MalfeasanceStreamService", "Stream"}, "")) +) + +var ( + forward_MalfeasanceStreamService_Stream_0 = runtime.ForwardResponseStream +) diff --git a/release/go/spacemesh/v2alpha1/malfeasance_grpc.pb.go b/release/go/spacemesh/v2alpha1/malfeasance_grpc.pb.go new file mode 100644 index 00000000..91488ea3 --- /dev/null +++ b/release/go/spacemesh/v2alpha1/malfeasance_grpc.pb.go @@ -0,0 +1,222 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: spacemesh/v2alpha1/malfeasance.proto + +package spacemeshv2alpha1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + MalfeasanceService_List_FullMethodName = "/spacemesh.v2alpha1.MalfeasanceService/List" +) + +// MalfeasanceServiceClient is the client API for MalfeasanceService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MalfeasanceServiceClient interface { + List(ctx context.Context, in *MalfeasanceRequest, opts ...grpc.CallOption) (*MalfeasanceList, error) +} + +type malfeasanceServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMalfeasanceServiceClient(cc grpc.ClientConnInterface) MalfeasanceServiceClient { + return &malfeasanceServiceClient{cc} +} + +func (c *malfeasanceServiceClient) List(ctx context.Context, in *MalfeasanceRequest, opts ...grpc.CallOption) (*MalfeasanceList, error) { + out := new(MalfeasanceList) + err := c.cc.Invoke(ctx, MalfeasanceService_List_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MalfeasanceServiceServer is the server API for MalfeasanceService service. +// All implementations should embed UnimplementedMalfeasanceServiceServer +// for forward compatibility +type MalfeasanceServiceServer interface { + List(context.Context, *MalfeasanceRequest) (*MalfeasanceList, error) +} + +// UnimplementedMalfeasanceServiceServer should be embedded to have forward compatible implementations. +type UnimplementedMalfeasanceServiceServer struct { +} + +func (UnimplementedMalfeasanceServiceServer) List(context.Context, *MalfeasanceRequest) (*MalfeasanceList, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} + +// UnsafeMalfeasanceServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MalfeasanceServiceServer will +// result in compilation errors. +type UnsafeMalfeasanceServiceServer interface { + mustEmbedUnimplementedMalfeasanceServiceServer() +} + +func RegisterMalfeasanceServiceServer(s grpc.ServiceRegistrar, srv MalfeasanceServiceServer) { + s.RegisterService(&MalfeasanceService_ServiceDesc, srv) +} + +func _MalfeasanceService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MalfeasanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MalfeasanceServiceServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MalfeasanceService_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MalfeasanceServiceServer).List(ctx, req.(*MalfeasanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// MalfeasanceService_ServiceDesc is the grpc.ServiceDesc for MalfeasanceService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MalfeasanceService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spacemesh.v2alpha1.MalfeasanceService", + HandlerType: (*MalfeasanceServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "List", + Handler: _MalfeasanceService_List_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "spacemesh/v2alpha1/malfeasance.proto", +} + +const ( + MalfeasanceStreamService_Stream_FullMethodName = "/spacemesh.v2alpha1.MalfeasanceStreamService/Stream" +) + +// MalfeasanceStreamServiceClient is the client API for MalfeasanceStreamService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MalfeasanceStreamServiceClient interface { + Stream(ctx context.Context, in *MalfeasanceStreamRequest, opts ...grpc.CallOption) (MalfeasanceStreamService_StreamClient, error) +} + +type malfeasanceStreamServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMalfeasanceStreamServiceClient(cc grpc.ClientConnInterface) MalfeasanceStreamServiceClient { + return &malfeasanceStreamServiceClient{cc} +} + +func (c *malfeasanceStreamServiceClient) Stream(ctx context.Context, in *MalfeasanceStreamRequest, opts ...grpc.CallOption) (MalfeasanceStreamService_StreamClient, error) { + stream, err := c.cc.NewStream(ctx, &MalfeasanceStreamService_ServiceDesc.Streams[0], MalfeasanceStreamService_Stream_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &malfeasanceStreamServiceStreamClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type MalfeasanceStreamService_StreamClient interface { + Recv() (*MalfeasanceProof, error) + grpc.ClientStream +} + +type malfeasanceStreamServiceStreamClient struct { + grpc.ClientStream +} + +func (x *malfeasanceStreamServiceStreamClient) Recv() (*MalfeasanceProof, error) { + m := new(MalfeasanceProof) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// MalfeasanceStreamServiceServer is the server API for MalfeasanceStreamService service. +// All implementations should embed UnimplementedMalfeasanceStreamServiceServer +// for forward compatibility +type MalfeasanceStreamServiceServer interface { + Stream(*MalfeasanceStreamRequest, MalfeasanceStreamService_StreamServer) error +} + +// UnimplementedMalfeasanceStreamServiceServer should be embedded to have forward compatible implementations. +type UnimplementedMalfeasanceStreamServiceServer struct { +} + +func (UnimplementedMalfeasanceStreamServiceServer) Stream(*MalfeasanceStreamRequest, MalfeasanceStreamService_StreamServer) error { + return status.Errorf(codes.Unimplemented, "method Stream not implemented") +} + +// UnsafeMalfeasanceStreamServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MalfeasanceStreamServiceServer will +// result in compilation errors. +type UnsafeMalfeasanceStreamServiceServer interface { + mustEmbedUnimplementedMalfeasanceStreamServiceServer() +} + +func RegisterMalfeasanceStreamServiceServer(s grpc.ServiceRegistrar, srv MalfeasanceStreamServiceServer) { + s.RegisterService(&MalfeasanceStreamService_ServiceDesc, srv) +} + +func _MalfeasanceStreamService_Stream_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(MalfeasanceStreamRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(MalfeasanceStreamServiceServer).Stream(m, &malfeasanceStreamServiceStreamServer{stream}) +} + +type MalfeasanceStreamService_StreamServer interface { + Send(*MalfeasanceProof) error + grpc.ServerStream +} + +type malfeasanceStreamServiceStreamServer struct { + grpc.ServerStream +} + +func (x *malfeasanceStreamServiceStreamServer) Send(m *MalfeasanceProof) error { + return x.ServerStream.SendMsg(m) +} + +// MalfeasanceStreamService_ServiceDesc is the grpc.ServiceDesc for MalfeasanceStreamService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MalfeasanceStreamService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spacemesh.v2alpha1.MalfeasanceStreamService", + HandlerType: (*MalfeasanceStreamServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Stream", + Handler: _MalfeasanceStreamService_Stream_Handler, + ServerStreams: true, + }, + }, + Metadata: "spacemesh/v2alpha1/malfeasance.proto", +} diff --git a/release/openapi/swagger/src/api.swagger.json b/release/openapi/swagger/src/api.swagger.json index a5ee4d1d..57480b0e 100644 --- a/release/openapi/swagger/src/api.swagger.json +++ b/release/openapi/swagger/src/api.swagger.json @@ -151,6 +151,38 @@ } } }, + "/spacemesh.v2alpha1.MalfeasanceService/List": { + "post": { + "tags": [ + "MalfeasanceService" + ], + "operationId": "MalfeasanceService_List", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/spacemeshv2alpha1MalfeasanceRequest" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v2alpha1MalfeasanceList" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + } + } + }, "/spacemesh.v2alpha1.NetworkService/Info": { "post": { "tags": [ @@ -578,6 +610,68 @@ "LAYER_STATUS_VERIFIED" ] }, + "spacemeshv2alpha1MalfeasanceProof": { + "type": "object", + "properties": { + "debugInfo": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/spacemeshv2alpha1MalfeasanceProofMalfeasanceType" + }, + "layer": { + "type": "integer", + "format": "int64" + }, + "proof": { + "type": "string", + "format": "byte" + }, + "smesher": { + "type": "string", + "format": "byte" + } + } + }, + "spacemeshv2alpha1MalfeasanceProofMalfeasanceType": { + "type": "string", + "default": "MALFEASANCE_UNSPECIFIED", + "enum": [ + "MALFEASANCE_UNSPECIFIED", + "MALFEASANCE_ATX", + "MALFEASANCE_BALLOT", + "MALFEASANCE_HARE", + "MALFEASANCE_POST_INDEX", + "MALFEASANCE_INCORRECT_PREV_ATX", + "MALFEASANCE_DOUBLE_MARRY" + ] + }, + "spacemeshv2alpha1MalfeasanceRequest": { + "type": "object", + "properties": { + "includeProof": { + "type": "boolean", + "title": "whether to include proof" + }, + "limit": { + "type": "string", + "format": "uint64", + "title": "specifies max number of items to fetch" + }, + "offset": { + "type": "string", + "format": "uint64", + "title": "adjusts the starting point for data" + }, + "smesherId": { + "type": "array", + "items": { + "type": "string", + "format": "byte" + } + } + } + }, "spacemeshv2alpha1NetworkInfoResponse": { "type": "object", "properties": { @@ -1031,6 +1125,18 @@ } } }, + "v2alpha1MalfeasanceList": { + "type": "object", + "properties": { + "malfeasances": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/spacemeshv2alpha1MalfeasanceProof" + } + } + } + }, "v2alpha1NetworkInfoRequest": { "type": "object" }, @@ -1236,6 +1342,9 @@ { "name": "LayerService" }, + { + "name": "MalfeasanceService" + }, { "name": "NetworkService" }, diff --git a/spacemesh/v2alpha1/malfeasance.proto b/spacemesh/v2alpha1/malfeasance.proto new file mode 100644 index 00000000..6f3400c2 --- /dev/null +++ b/spacemesh/v2alpha1/malfeasance.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; + +import "google/api/visibility.proto"; + +package spacemesh.v2alpha1; + +message MalfeasanceProof { + bytes smesher = 1; + uint32 layer = 2; + enum MalfeasanceType { + MALFEASANCE_UNSPECIFIED = 0; + MALFEASANCE_ATX = 1; + MALFEASANCE_BALLOT = 2; + MALFEASANCE_HARE = 3; + MALFEASANCE_POST_INDEX = 4; + MALFEASANCE_INCORRECT_PREV_ATX = 5; + MALFEASANCE_DOUBLE_MARRY = 6; + } + MalfeasanceType kind = 3; + string debug_info = 4; + bytes proof = 5; +} + +message MalfeasanceRequest { + repeated bytes smesher_id = 1; + bool include_proof = 2; // whether to include proof + uint64 offset = 3; // adjusts the starting point for data + uint64 limit = 4; // specifies max number of items to fetch +} + +message MalfeasanceList { + repeated MalfeasanceProof malfeasances = 1; +} + +service MalfeasanceService { + option (google.api.api_visibility).restriction = "V2"; + + rpc List(MalfeasanceRequest) returns (MalfeasanceList); +} + +message MalfeasanceStreamRequest { + bool include_proof = 1; // whether to include proof +} + +service MalfeasanceStreamService { + option (google.api.api_visibility).restriction = "INTERNAL"; + + rpc Stream(MalfeasanceStreamRequest) returns (stream MalfeasanceProof); +} \ No newline at end of file From 74b6c7b27a06ae8062e4eee610e84caca2d1f3ad Mon Sep 17 00:00:00 2001 From: Kacper Sawicki Date: Tue, 23 Jul 2024 11:34:38 +0200 Subject: [PATCH 2/4] Fix stream request --- .../go/spacemesh/v2alpha1/malfeasance.pb.go | 93 +++++++++++-------- release/openapi/swagger/src/api.swagger.json | 1 + spacemesh/v2alpha1/malfeasance.proto | 6 +- 3 files changed, 61 insertions(+), 39 deletions(-) diff --git a/release/go/spacemesh/v2alpha1/malfeasance.pb.go b/release/go/spacemesh/v2alpha1/malfeasance.pb.go index 06468319..ff956e63 100644 --- a/release/go/spacemesh/v2alpha1/malfeasance.pb.go +++ b/release/go/spacemesh/v2alpha1/malfeasance.pb.go @@ -166,7 +166,7 @@ type MalfeasanceRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SmesherId [][]byte `protobuf:"bytes,1,rep,name=smesher_id,json=smesherId,proto3" json:"smesher_id,omitempty"` + SmesherId [][]byte `protobuf:"bytes,1,rep,name=smesher_id,json=smesherId,proto3" json:"smesher_id,omitempty"` // list of smesher ids to fetch IncludeProof bool `protobuf:"varint,2,opt,name=include_proof,json=includeProof,proto3" json:"include_proof,omitempty"` // whether to include proof Offset uint64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` // adjusts the starting point for data Limit uint64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` // specifies max number of items to fetch @@ -284,7 +284,9 @@ type MalfeasanceStreamRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - IncludeProof bool `protobuf:"varint,1,opt,name=include_proof,json=includeProof,proto3" json:"include_proof,omitempty"` // whether to include proof + SmesherId [][]byte `protobuf:"bytes,1,rep,name=smesher_id,json=smesherId,proto3" json:"smesher_id,omitempty"` // list of smesher ids to watch + IncludeProof bool `protobuf:"varint,2,opt,name=include_proof,json=includeProof,proto3" json:"include_proof,omitempty"` // whether to include proof + Watch bool `protobuf:"varint,3,opt,name=watch,proto3" json:"watch,omitempty"` } func (x *MalfeasanceStreamRequest) Reset() { @@ -319,6 +321,13 @@ func (*MalfeasanceStreamRequest) Descriptor() ([]byte, []int) { return file_spacemesh_v2alpha1_malfeasance_proto_rawDescGZIP(), []int{3} } +func (x *MalfeasanceStreamRequest) GetSmesherId() [][]byte { + if x != nil { + return x.SmesherId + } + return nil +} + func (x *MalfeasanceStreamRequest) GetIncludeProof() bool { if x != nil { return x.IncludeProof @@ -326,6 +335,13 @@ func (x *MalfeasanceStreamRequest) GetIncludeProof() bool { return false } +func (x *MalfeasanceStreamRequest) GetWatch() bool { + if x != nil { + return x.Watch + } + return false +} + var File_spacemesh_v2alpha1_malfeasance_proto protoreflect.FileDescriptor var file_spacemesh_v2alpha1_malfeasance_proto_rawDesc = []byte{ @@ -374,42 +390,45 @@ var file_spacemesh_v2alpha1_malfeasance_proto_rawDesc = []byte{ 0x24, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0c, 0x6d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, - 0x63, 0x65, 0x73, 0x22, 0x3f, 0x0a, 0x18, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x22, 0x74, 0x0a, 0x18, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x32, 0x75, 0x0a, 0x12, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, - 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x04, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x26, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, - 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, - 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x1a, - 0x0a, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x04, 0x12, 0x02, 0x56, 0x32, 0x32, 0x8c, 0x01, 0x0a, 0x18, - 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5e, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x12, 0x2c, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, - 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, - 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x24, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, - 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x30, 0x01, 0x1a, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, - 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x42, 0xdf, 0x01, 0x0a, 0x16, 0x63, - 0x6f, 0x6d, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, - 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, - 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, - 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x3b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x76, 0x32, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x12, 0x53, 0x70, - 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0xca, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, - 0x68, 0x5c, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, - 0x73, 0x68, 0x3a, 0x3a, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x1d, 0x0a, 0x0a, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x49, 0x64, 0x12, 0x23, + 0x0a, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x05, 0x77, 0x61, 0x74, 0x63, 0x68, 0x32, 0x75, 0x0a, 0x12, 0x4d, 0x61, 0x6c, + 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x53, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, + 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, + 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x23, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, + 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x0a, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x04, 0x12, 0x02, 0x56, 0x32, + 0x32, 0x8c, 0x01, 0x0a, 0x18, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5e, 0x0a, + 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2c, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, + 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, + 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, + 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x30, 0x01, 0x1a, 0x10, 0xfa, + 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x42, + 0xdf, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x4d, 0x61, 0x6c, 0x66, + 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, + 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x73, 0x68, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, + 0xaa, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x56, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, + 0x68, 0x5c, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x53, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x53, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x3a, 0x3a, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/release/openapi/swagger/src/api.swagger.json b/release/openapi/swagger/src/api.swagger.json index 57480b0e..b034dd7a 100644 --- a/release/openapi/swagger/src/api.swagger.json +++ b/release/openapi/swagger/src/api.swagger.json @@ -665,6 +665,7 @@ }, "smesherId": { "type": "array", + "title": "list of smesher ids to fetch", "items": { "type": "string", "format": "byte" diff --git a/spacemesh/v2alpha1/malfeasance.proto b/spacemesh/v2alpha1/malfeasance.proto index 6f3400c2..4afb00a8 100644 --- a/spacemesh/v2alpha1/malfeasance.proto +++ b/spacemesh/v2alpha1/malfeasance.proto @@ -22,7 +22,7 @@ message MalfeasanceProof { } message MalfeasanceRequest { - repeated bytes smesher_id = 1; + repeated bytes smesher_id = 1; // list of smesher ids to fetch bool include_proof = 2; // whether to include proof uint64 offset = 3; // adjusts the starting point for data uint64 limit = 4; // specifies max number of items to fetch @@ -39,7 +39,9 @@ service MalfeasanceService { } message MalfeasanceStreamRequest { - bool include_proof = 1; // whether to include proof + repeated bytes smesher_id = 1; // list of smesher ids to watch + bool include_proof = 2; // whether to include proof + bool watch = 3; } service MalfeasanceStreamService { From 4e7cb6b24a77b3562b097116da01af2571718985 Mon Sep 17 00:00:00 2001 From: Matthias <5011972+fasmat@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:32:27 +0000 Subject: [PATCH 3/4] Update API --- .../go/spacemesh/v2alpha1/malfeasance.pb.go | 299 ++++++++---------- release/openapi/swagger/src/api.swagger.json | 51 ++- spacemesh/v2alpha1/malfeasance.proto | 39 +-- 3 files changed, 173 insertions(+), 216 deletions(-) diff --git a/release/go/spacemesh/v2alpha1/malfeasance.pb.go b/release/go/spacemesh/v2alpha1/malfeasance.pb.go index ff956e63..93354f67 100644 --- a/release/go/spacemesh/v2alpha1/malfeasance.pb.go +++ b/release/go/spacemesh/v2alpha1/malfeasance.pb.go @@ -21,64 +21,46 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type MalfeasanceProof_MalfeasanceType int32 +type MalfeasanceProof_MalfeasanceDomain int32 const ( - MalfeasanceProof_MALFEASANCE_UNSPECIFIED MalfeasanceProof_MalfeasanceType = 0 - MalfeasanceProof_MALFEASANCE_ATX MalfeasanceProof_MalfeasanceType = 1 - MalfeasanceProof_MALFEASANCE_BALLOT MalfeasanceProof_MalfeasanceType = 2 - MalfeasanceProof_MALFEASANCE_HARE MalfeasanceProof_MalfeasanceType = 3 - MalfeasanceProof_MALFEASANCE_POST_INDEX MalfeasanceProof_MalfeasanceType = 4 - MalfeasanceProof_MALFEASANCE_INCORRECT_PREV_ATX MalfeasanceProof_MalfeasanceType = 5 - MalfeasanceProof_MALFEASANCE_DOUBLE_MARRY MalfeasanceProof_MalfeasanceType = 6 + MalfeasanceProof_DOMAIN_UNSPECIFIED MalfeasanceProof_MalfeasanceDomain = 0 // for legacy proofs ) -// Enum value maps for MalfeasanceProof_MalfeasanceType. +// Enum value maps for MalfeasanceProof_MalfeasanceDomain. var ( - MalfeasanceProof_MalfeasanceType_name = map[int32]string{ - 0: "MALFEASANCE_UNSPECIFIED", - 1: "MALFEASANCE_ATX", - 2: "MALFEASANCE_BALLOT", - 3: "MALFEASANCE_HARE", - 4: "MALFEASANCE_POST_INDEX", - 5: "MALFEASANCE_INCORRECT_PREV_ATX", - 6: "MALFEASANCE_DOUBLE_MARRY", + MalfeasanceProof_MalfeasanceDomain_name = map[int32]string{ + 0: "DOMAIN_UNSPECIFIED", } - MalfeasanceProof_MalfeasanceType_value = map[string]int32{ - "MALFEASANCE_UNSPECIFIED": 0, - "MALFEASANCE_ATX": 1, - "MALFEASANCE_BALLOT": 2, - "MALFEASANCE_HARE": 3, - "MALFEASANCE_POST_INDEX": 4, - "MALFEASANCE_INCORRECT_PREV_ATX": 5, - "MALFEASANCE_DOUBLE_MARRY": 6, + MalfeasanceProof_MalfeasanceDomain_value = map[string]int32{ + "DOMAIN_UNSPECIFIED": 0, } ) -func (x MalfeasanceProof_MalfeasanceType) Enum() *MalfeasanceProof_MalfeasanceType { - p := new(MalfeasanceProof_MalfeasanceType) +func (x MalfeasanceProof_MalfeasanceDomain) Enum() *MalfeasanceProof_MalfeasanceDomain { + p := new(MalfeasanceProof_MalfeasanceDomain) *p = x return p } -func (x MalfeasanceProof_MalfeasanceType) String() string { +func (x MalfeasanceProof_MalfeasanceDomain) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (MalfeasanceProof_MalfeasanceType) Descriptor() protoreflect.EnumDescriptor { +func (MalfeasanceProof_MalfeasanceDomain) Descriptor() protoreflect.EnumDescriptor { return file_spacemesh_v2alpha1_malfeasance_proto_enumTypes[0].Descriptor() } -func (MalfeasanceProof_MalfeasanceType) Type() protoreflect.EnumType { +func (MalfeasanceProof_MalfeasanceDomain) Type() protoreflect.EnumType { return &file_spacemesh_v2alpha1_malfeasance_proto_enumTypes[0] } -func (x MalfeasanceProof_MalfeasanceType) Number() protoreflect.EnumNumber { +func (x MalfeasanceProof_MalfeasanceDomain) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use MalfeasanceProof_MalfeasanceType.Descriptor instead. -func (MalfeasanceProof_MalfeasanceType) EnumDescriptor() ([]byte, []int) { +// Deprecated: Use MalfeasanceProof_MalfeasanceDomain.Descriptor instead. +func (MalfeasanceProof_MalfeasanceDomain) EnumDescriptor() ([]byte, []int) { return file_spacemesh_v2alpha1_malfeasance_proto_rawDescGZIP(), []int{0, 0} } @@ -87,11 +69,20 @@ type MalfeasanceProof struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Smesher []byte `protobuf:"bytes,1,opt,name=smesher,proto3" json:"smesher,omitempty"` - Layer uint32 `protobuf:"varint,2,opt,name=layer,proto3" json:"layer,omitempty"` - Kind MalfeasanceProof_MalfeasanceType `protobuf:"varint,3,opt,name=kind,proto3,enum=spacemesh.v2alpha1.MalfeasanceProof_MalfeasanceType" json:"kind,omitempty"` - DebugInfo string `protobuf:"bytes,4,opt,name=debug_info,json=debugInfo,proto3" json:"debug_info,omitempty"` - Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` + Smesher []byte `protobuf:"bytes,1,opt,name=smesher,proto3" json:"smesher,omitempty"` + Domain MalfeasanceProof_MalfeasanceDomain `protobuf:"varint,2,opt,name=domain,proto3,enum=spacemesh.v2alpha1.MalfeasanceProof_MalfeasanceDomain" json:"domain,omitempty"` + // type of the malfeasance proof, depends on domain + // + // for legacy proofs the types are + // + // 1 - Double publish of ATX + // 2 - Multiple ballots for a layer by same smesher + // 3 - Hare Equivocation (currently unused) + // 4 - ATX with invalid PoST proof publised + // 5 - ATX referencing an invalid previous ATX published + Type uint32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` + // Properties of the Malfeasance proof, different for every type of proof + Properties map[string]string `protobuf:"bytes,4,rep,name=properties,proto3" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *MalfeasanceProof) Reset() { @@ -133,30 +124,23 @@ func (x *MalfeasanceProof) GetSmesher() []byte { return nil } -func (x *MalfeasanceProof) GetLayer() uint32 { +func (x *MalfeasanceProof) GetDomain() MalfeasanceProof_MalfeasanceDomain { if x != nil { - return x.Layer + return x.Domain } - return 0 -} - -func (x *MalfeasanceProof) GetKind() MalfeasanceProof_MalfeasanceType { - if x != nil { - return x.Kind - } - return MalfeasanceProof_MALFEASANCE_UNSPECIFIED + return MalfeasanceProof_DOMAIN_UNSPECIFIED } -func (x *MalfeasanceProof) GetDebugInfo() string { +func (x *MalfeasanceProof) GetType() uint32 { if x != nil { - return x.DebugInfo + return x.Type } - return "" + return 0 } -func (x *MalfeasanceProof) GetProof() []byte { +func (x *MalfeasanceProof) GetProperties() map[string]string { if x != nil { - return x.Proof + return x.Properties } return nil } @@ -166,10 +150,9 @@ type MalfeasanceRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SmesherId [][]byte `protobuf:"bytes,1,rep,name=smesher_id,json=smesherId,proto3" json:"smesher_id,omitempty"` // list of smesher ids to fetch - IncludeProof bool `protobuf:"varint,2,opt,name=include_proof,json=includeProof,proto3" json:"include_proof,omitempty"` // whether to include proof - Offset uint64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` // adjusts the starting point for data - Limit uint64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` // specifies max number of items to fetch + SmesherId [][]byte `protobuf:"bytes,1,rep,name=smesher_id,json=smesherId,proto3" json:"smesher_id,omitempty"` // list of smesher ids to fetch + Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` // adjusts the starting point for data + Limit uint64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` // specifies max number of items to fetch } func (x *MalfeasanceRequest) Reset() { @@ -211,13 +194,6 @@ func (x *MalfeasanceRequest) GetSmesherId() [][]byte { return nil } -func (x *MalfeasanceRequest) GetIncludeProof() bool { - if x != nil { - return x.IncludeProof - } - return false -} - func (x *MalfeasanceRequest) GetOffset() uint64 { if x != nil { return x.Offset @@ -284,9 +260,8 @@ type MalfeasanceStreamRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SmesherId [][]byte `protobuf:"bytes,1,rep,name=smesher_id,json=smesherId,proto3" json:"smesher_id,omitempty"` // list of smesher ids to watch - IncludeProof bool `protobuf:"varint,2,opt,name=include_proof,json=includeProof,proto3" json:"include_proof,omitempty"` // whether to include proof - Watch bool `protobuf:"varint,3,opt,name=watch,proto3" json:"watch,omitempty"` + SmesherId [][]byte `protobuf:"bytes,1,rep,name=smesher_id,json=smesherId,proto3" json:"smesher_id,omitempty"` // list of smesher ids to watch + Watch bool `protobuf:"varint,2,opt,name=watch,proto3" json:"watch,omitempty"` } func (x *MalfeasanceStreamRequest) Reset() { @@ -328,13 +303,6 @@ func (x *MalfeasanceStreamRequest) GetSmesherId() [][]byte { return nil } -func (x *MalfeasanceStreamRequest) GetIncludeProof() bool { - if x != nil { - return x.IncludeProof - } - return false -} - func (x *MalfeasanceStreamRequest) GetWatch() bool { if x != nil { return x.Watch @@ -350,85 +318,76 @@ var file_spacemesh_v2alpha1_malfeasance_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, - 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x03, 0x0a, 0x10, 0x4d, 0x61, 0x6c, 0x66, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd2, 0x02, 0x0a, 0x10, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, - 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x04, - 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x34, 0x2e, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, - 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x65, 0x62, 0x75, - 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0xcf, 0x01, 0x0a, 0x0f, - 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x1b, 0x0a, 0x17, 0x4d, 0x41, 0x4c, 0x46, 0x45, 0x41, 0x53, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, - 0x4d, 0x41, 0x4c, 0x46, 0x45, 0x41, 0x53, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x41, 0x54, 0x58, 0x10, - 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4d, 0x41, 0x4c, 0x46, 0x45, 0x41, 0x53, 0x41, 0x4e, 0x43, 0x45, - 0x5f, 0x42, 0x41, 0x4c, 0x4c, 0x4f, 0x54, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x41, 0x4c, - 0x46, 0x45, 0x41, 0x53, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x48, 0x41, 0x52, 0x45, 0x10, 0x03, 0x12, - 0x1a, 0x0a, 0x16, 0x4d, 0x41, 0x4c, 0x46, 0x45, 0x41, 0x53, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x50, - 0x4f, 0x53, 0x54, 0x5f, 0x49, 0x4e, 0x44, 0x45, 0x58, 0x10, 0x04, 0x12, 0x22, 0x0a, 0x1e, 0x4d, - 0x41, 0x4c, 0x46, 0x45, 0x41, 0x53, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x52, - 0x52, 0x45, 0x43, 0x54, 0x5f, 0x50, 0x52, 0x45, 0x56, 0x5f, 0x41, 0x54, 0x58, 0x10, 0x05, 0x12, - 0x1c, 0x0a, 0x18, 0x4d, 0x41, 0x4c, 0x46, 0x45, 0x41, 0x53, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x44, - 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x5f, 0x4d, 0x41, 0x52, 0x52, 0x59, 0x10, 0x06, 0x22, 0x86, 0x01, - 0x0a, 0x12, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x63, 0x6c, - 0x75, 0x64, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x5b, 0x0a, 0x0f, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, - 0x73, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0c, 0x6d, 0x61, 0x6c, - 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, - 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0c, 0x6d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, - 0x63, 0x65, 0x73, 0x22, 0x74, 0x0a, 0x18, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, - 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1d, 0x0a, 0x0a, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x49, 0x64, 0x12, 0x23, - 0x0a, 0x0d, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x05, 0x77, 0x61, 0x74, 0x63, 0x68, 0x32, 0x75, 0x0a, 0x12, 0x4d, 0x61, 0x6c, - 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x53, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, - 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, - 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x23, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, - 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x0a, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x04, 0x12, 0x02, 0x56, 0x32, - 0x32, 0x8c, 0x01, 0x0a, 0x18, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5e, 0x0a, - 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2c, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, - 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, - 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, - 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, - 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x30, 0x01, 0x1a, 0x10, 0xfa, - 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x42, - 0xdf, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, - 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x4d, 0x61, 0x6c, 0x66, - 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, - 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, - 0x73, 0x68, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, - 0xaa, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x56, 0x32, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, - 0x68, 0x5c, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x53, 0x70, 0x61, - 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x53, 0x70, - 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x3a, 0x3a, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, + 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, + 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x61, 0x6c, + 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x06, + 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x54, 0x0a, 0x0a, 0x70, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, + 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, + 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x2b, 0x0a, 0x11, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x6f, + 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x4f, 0x4d, 0x41, 0x49, 0x4e, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x22, 0x61, 0x0a, 0x12, + 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, + 0x5b, 0x0a, 0x0f, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0c, 0x6d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, + 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0c, + 0x6d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x18, + 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6d, 0x65, 0x73, + 0x68, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x6d, + 0x65, 0x73, 0x68, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x61, 0x74, 0x63, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x77, 0x61, 0x74, 0x63, 0x68, 0x32, 0x75, 0x0a, + 0x12, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x2e, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, + 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, + 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x0a, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x04, + 0x12, 0x02, 0x56, 0x32, 0x32, 0x8c, 0x01, 0x0a, 0x18, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, + 0x61, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x5e, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2c, 0x2e, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, + 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x30, + 0x01, 0x1a, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, + 0x4e, 0x41, 0x4c, 0x42, 0xdf, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, + 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, + 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, + 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, + 0x2e, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, + 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, + 0x1e, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x13, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x3a, 0x3a, 0x56, 0x32, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -444,26 +403,28 @@ func file_spacemesh_v2alpha1_malfeasance_proto_rawDescGZIP() []byte { } var file_spacemesh_v2alpha1_malfeasance_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_spacemesh_v2alpha1_malfeasance_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_spacemesh_v2alpha1_malfeasance_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_spacemesh_v2alpha1_malfeasance_proto_goTypes = []interface{}{ - (MalfeasanceProof_MalfeasanceType)(0), // 0: spacemesh.v2alpha1.MalfeasanceProof.MalfeasanceType - (*MalfeasanceProof)(nil), // 1: spacemesh.v2alpha1.MalfeasanceProof - (*MalfeasanceRequest)(nil), // 2: spacemesh.v2alpha1.MalfeasanceRequest - (*MalfeasanceList)(nil), // 3: spacemesh.v2alpha1.MalfeasanceList - (*MalfeasanceStreamRequest)(nil), // 4: spacemesh.v2alpha1.MalfeasanceStreamRequest + (MalfeasanceProof_MalfeasanceDomain)(0), // 0: spacemesh.v2alpha1.MalfeasanceProof.MalfeasanceDomain + (*MalfeasanceProof)(nil), // 1: spacemesh.v2alpha1.MalfeasanceProof + (*MalfeasanceRequest)(nil), // 2: spacemesh.v2alpha1.MalfeasanceRequest + (*MalfeasanceList)(nil), // 3: spacemesh.v2alpha1.MalfeasanceList + (*MalfeasanceStreamRequest)(nil), // 4: spacemesh.v2alpha1.MalfeasanceStreamRequest + nil, // 5: spacemesh.v2alpha1.MalfeasanceProof.PropertiesEntry } var file_spacemesh_v2alpha1_malfeasance_proto_depIdxs = []int32{ - 0, // 0: spacemesh.v2alpha1.MalfeasanceProof.kind:type_name -> spacemesh.v2alpha1.MalfeasanceProof.MalfeasanceType - 1, // 1: spacemesh.v2alpha1.MalfeasanceList.malfeasances:type_name -> spacemesh.v2alpha1.MalfeasanceProof - 2, // 2: spacemesh.v2alpha1.MalfeasanceService.List:input_type -> spacemesh.v2alpha1.MalfeasanceRequest - 4, // 3: spacemesh.v2alpha1.MalfeasanceStreamService.Stream:input_type -> spacemesh.v2alpha1.MalfeasanceStreamRequest - 3, // 4: spacemesh.v2alpha1.MalfeasanceService.List:output_type -> spacemesh.v2alpha1.MalfeasanceList - 1, // 5: spacemesh.v2alpha1.MalfeasanceStreamService.Stream:output_type -> spacemesh.v2alpha1.MalfeasanceProof - 4, // [4:6] is the sub-list for method output_type - 2, // [2:4] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 0, // 0: spacemesh.v2alpha1.MalfeasanceProof.domain:type_name -> spacemesh.v2alpha1.MalfeasanceProof.MalfeasanceDomain + 5, // 1: spacemesh.v2alpha1.MalfeasanceProof.properties:type_name -> spacemesh.v2alpha1.MalfeasanceProof.PropertiesEntry + 1, // 2: spacemesh.v2alpha1.MalfeasanceList.malfeasances:type_name -> spacemesh.v2alpha1.MalfeasanceProof + 2, // 3: spacemesh.v2alpha1.MalfeasanceService.List:input_type -> spacemesh.v2alpha1.MalfeasanceRequest + 4, // 4: spacemesh.v2alpha1.MalfeasanceStreamService.Stream:input_type -> spacemesh.v2alpha1.MalfeasanceStreamRequest + 3, // 5: spacemesh.v2alpha1.MalfeasanceService.List:output_type -> spacemesh.v2alpha1.MalfeasanceList + 1, // 6: spacemesh.v2alpha1.MalfeasanceStreamService.Stream:output_type -> spacemesh.v2alpha1.MalfeasanceProof + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_spacemesh_v2alpha1_malfeasance_proto_init() } @@ -527,7 +488,7 @@ func file_spacemesh_v2alpha1_malfeasance_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_spacemesh_v2alpha1_malfeasance_proto_rawDesc, NumEnums: 1, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 2, }, diff --git a/release/openapi/swagger/src/api.swagger.json b/release/openapi/swagger/src/api.swagger.json index b034dd7a..0a507a20 100644 --- a/release/openapi/swagger/src/api.swagger.json +++ b/release/openapi/swagger/src/api.swagger.json @@ -409,6 +409,14 @@ } }, "definitions": { + "MalfeasanceProofMalfeasanceDomain": { + "type": "string", + "title": "- DOMAIN_UNSPECIFIED: for legacy proofs", + "default": "DOMAIN_UNSPECIFIED", + "enum": [ + "DOMAIN_UNSPECIFIED" + ] + }, "NodeStatusResponseSyncStatus": { "type": "string", "default": "SYNC_STATUS_UNSPECIFIED", @@ -613,46 +621,31 @@ "spacemeshv2alpha1MalfeasanceProof": { "type": "object", "properties": { - "debugInfo": { - "type": "string" - }, - "kind": { - "$ref": "#/definitions/spacemeshv2alpha1MalfeasanceProofMalfeasanceType" + "domain": { + "$ref": "#/definitions/MalfeasanceProofMalfeasanceDomain" }, - "layer": { - "type": "integer", - "format": "int64" - }, - "proof": { - "type": "string", - "format": "byte" + "properties": { + "type": "object", + "title": "Properties of the Malfeasance proof, different for every type of proof", + "additionalProperties": { + "type": "string" + } }, "smesher": { "type": "string", "format": "byte" + }, + "type": { + "description": "for legacy proofs the types are\n 1 - Double publish of ATX\n 2 - Multiple ballots for a layer by same smesher\n 3 - Hare Equivocation (currently unused)\n 4 - ATX with invalid PoST proof publised\n 5 - ATX referencing an invalid previous ATX published", + "type": "integer", + "format": "int64", + "title": "type of the malfeasance proof, depends on domain" } } }, - "spacemeshv2alpha1MalfeasanceProofMalfeasanceType": { - "type": "string", - "default": "MALFEASANCE_UNSPECIFIED", - "enum": [ - "MALFEASANCE_UNSPECIFIED", - "MALFEASANCE_ATX", - "MALFEASANCE_BALLOT", - "MALFEASANCE_HARE", - "MALFEASANCE_POST_INDEX", - "MALFEASANCE_INCORRECT_PREV_ATX", - "MALFEASANCE_DOUBLE_MARRY" - ] - }, "spacemeshv2alpha1MalfeasanceRequest": { "type": "object", "properties": { - "includeProof": { - "type": "boolean", - "title": "whether to include proof" - }, "limit": { "type": "string", "format": "uint64", diff --git a/spacemesh/v2alpha1/malfeasance.proto b/spacemesh/v2alpha1/malfeasance.proto index 4afb00a8..3d42bcff 100644 --- a/spacemesh/v2alpha1/malfeasance.proto +++ b/spacemesh/v2alpha1/malfeasance.proto @@ -6,26 +6,30 @@ package spacemesh.v2alpha1; message MalfeasanceProof { bytes smesher = 1; - uint32 layer = 2; - enum MalfeasanceType { - MALFEASANCE_UNSPECIFIED = 0; - MALFEASANCE_ATX = 1; - MALFEASANCE_BALLOT = 2; - MALFEASANCE_HARE = 3; - MALFEASANCE_POST_INDEX = 4; - MALFEASANCE_INCORRECT_PREV_ATX = 5; - MALFEASANCE_DOUBLE_MARRY = 6; + + enum MalfeasanceDomain { + DOMAIN_UNSPECIFIED = 0; // for legacy proofs } - MalfeasanceType kind = 3; - string debug_info = 4; - bytes proof = 5; + MalfeasanceDomain domain = 2; + + // type of the malfeasance proof, depends on domain + // + // for legacy proofs the types are + // 1 - Double publish of ATX + // 2 - Multiple ballots for a layer by same smesher + // 3 - Hare Equivocation (currently unused) + // 4 - ATX with invalid PoST proof publised + // 5 - ATX referencing an invalid previous ATX published + uint32 type = 3; + + // Properties of the Malfeasance proof, different for every type of proof + map properties = 4; } message MalfeasanceRequest { repeated bytes smesher_id = 1; // list of smesher ids to fetch - bool include_proof = 2; // whether to include proof - uint64 offset = 3; // adjusts the starting point for data - uint64 limit = 4; // specifies max number of items to fetch + uint64 offset = 2; // adjusts the starting point for data + uint64 limit = 3; // specifies max number of items to fetch } message MalfeasanceList { @@ -40,12 +44,11 @@ service MalfeasanceService { message MalfeasanceStreamRequest { repeated bytes smesher_id = 1; // list of smesher ids to watch - bool include_proof = 2; // whether to include proof - bool watch = 3; + bool watch = 2; } service MalfeasanceStreamService { option (google.api.api_visibility).restriction = "INTERNAL"; rpc Stream(MalfeasanceStreamRequest) returns (stream MalfeasanceProof); -} \ No newline at end of file +} From 3c53cc20e36c41701b1fb693eaf0ab2fe8e62b04 Mon Sep 17 00:00:00 2001 From: Matthias <5011972+fasmat@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:08:06 +0000 Subject: [PATCH 4/4] Review feedback --- .../go/spacemesh/v2alpha1/malfeasance.pb.go | 94 +++++++++---------- release/openapi/swagger/src/api.swagger.json | 4 +- spacemesh/v2alpha1/malfeasance.proto | 4 +- 3 files changed, 51 insertions(+), 51 deletions(-) diff --git a/release/go/spacemesh/v2alpha1/malfeasance.pb.go b/release/go/spacemesh/v2alpha1/malfeasance.pb.go index 93354f67..b05abfea 100644 --- a/release/go/spacemesh/v2alpha1/malfeasance.pb.go +++ b/release/go/spacemesh/v2alpha1/malfeasance.pb.go @@ -150,7 +150,7 @@ type MalfeasanceRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SmesherId [][]byte `protobuf:"bytes,1,rep,name=smesher_id,json=smesherId,proto3" json:"smesher_id,omitempty"` // list of smesher ids to fetch + SmesherId [][]byte `protobuf:"bytes,1,rep,name=smesher_id,json=smesherId,proto3" json:"smesher_id,omitempty"` // list of smesher ids to fetch (can be empty for all) Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` // adjusts the starting point for data Limit uint64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` // specifies max number of items to fetch } @@ -213,7 +213,7 @@ type MalfeasanceList struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Malfeasances []*MalfeasanceProof `protobuf:"bytes,1,rep,name=malfeasances,proto3" json:"malfeasances,omitempty"` + Proofs []*MalfeasanceProof `protobuf:"bytes,1,rep,name=proofs,proto3" json:"proofs,omitempty"` } func (x *MalfeasanceList) Reset() { @@ -248,9 +248,9 @@ func (*MalfeasanceList) Descriptor() ([]byte, []int) { return file_spacemesh_v2alpha1_malfeasance_proto_rawDescGZIP(), []int{2} } -func (x *MalfeasanceList) GetMalfeasances() []*MalfeasanceProof { +func (x *MalfeasanceList) GetProofs() []*MalfeasanceProof { if x != nil { - return x.Malfeasances + return x.Proofs } return nil } @@ -346,48 +346,48 @@ var file_spacemesh_v2alpha1_malfeasance_proto_rawDesc = []byte{ 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, - 0x5b, 0x0a, 0x0f, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0c, 0x6d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, - 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0c, - 0x6d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x18, - 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6d, 0x65, 0x73, - 0x68, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x6d, - 0x65, 0x73, 0x68, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x61, 0x74, 0x63, 0x68, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x77, 0x61, 0x74, 0x63, 0x68, 0x32, 0x75, 0x0a, - 0x12, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x2e, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, - 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, - 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x0a, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x04, - 0x12, 0x02, 0x56, 0x32, 0x32, 0x8c, 0x01, 0x0a, 0x18, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, - 0x61, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x5e, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2c, 0x2e, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, - 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x30, - 0x01, 0x1a, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, - 0x4e, 0x41, 0x4c, 0x42, 0xdf, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, - 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, - 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, - 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, - 0x2e, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, - 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, - 0x1e, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x13, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x3a, 0x3a, 0x56, 0x32, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x4f, 0x0a, 0x0f, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, + 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, + 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, + 0x22, 0x4f, 0x0a, 0x18, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, + 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, + 0x52, 0x09, 0x73, 0x6d, 0x65, 0x73, 0x68, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x77, + 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x77, 0x61, 0x74, 0x63, + 0x68, 0x32, 0x75, 0x0a, 0x12, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x26, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, + 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, + 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x0a, 0xfa, 0xd2, + 0xe4, 0x93, 0x02, 0x04, 0x12, 0x02, 0x56, 0x32, 0x32, 0x8c, 0x01, 0x0a, 0x18, 0x4d, 0x61, 0x6c, + 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5e, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, + 0x2c, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x30, 0x01, 0x1a, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, + 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x42, 0xdf, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x42, 0x10, 0x4d, 0x61, 0x6c, 0x66, 0x65, 0x61, 0x73, 0x61, 0x6e, 0x63, 0x65, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x6f, 0x73, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x3b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x76, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x58, 0x58, 0xaa, 0x02, 0x12, 0x53, 0x70, 0x61, 0x63, 0x65, + 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x12, + 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x5c, 0x56, + 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x53, 0x70, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x73, 0x68, 0x3a, + 0x3a, 0x56, 0x32, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -415,7 +415,7 @@ var file_spacemesh_v2alpha1_malfeasance_proto_goTypes = []interface{}{ var file_spacemesh_v2alpha1_malfeasance_proto_depIdxs = []int32{ 0, // 0: spacemesh.v2alpha1.MalfeasanceProof.domain:type_name -> spacemesh.v2alpha1.MalfeasanceProof.MalfeasanceDomain 5, // 1: spacemesh.v2alpha1.MalfeasanceProof.properties:type_name -> spacemesh.v2alpha1.MalfeasanceProof.PropertiesEntry - 1, // 2: spacemesh.v2alpha1.MalfeasanceList.malfeasances:type_name -> spacemesh.v2alpha1.MalfeasanceProof + 1, // 2: spacemesh.v2alpha1.MalfeasanceList.proofs:type_name -> spacemesh.v2alpha1.MalfeasanceProof 2, // 3: spacemesh.v2alpha1.MalfeasanceService.List:input_type -> spacemesh.v2alpha1.MalfeasanceRequest 4, // 4: spacemesh.v2alpha1.MalfeasanceStreamService.Stream:input_type -> spacemesh.v2alpha1.MalfeasanceStreamRequest 3, // 5: spacemesh.v2alpha1.MalfeasanceService.List:output_type -> spacemesh.v2alpha1.MalfeasanceList diff --git a/release/openapi/swagger/src/api.swagger.json b/release/openapi/swagger/src/api.swagger.json index 0a507a20..8025c050 100644 --- a/release/openapi/swagger/src/api.swagger.json +++ b/release/openapi/swagger/src/api.swagger.json @@ -658,7 +658,7 @@ }, "smesherId": { "type": "array", - "title": "list of smesher ids to fetch", + "title": "list of smesher ids to fetch (can be empty for all)", "items": { "type": "string", "format": "byte" @@ -1122,7 +1122,7 @@ "v2alpha1MalfeasanceList": { "type": "object", "properties": { - "malfeasances": { + "proofs": { "type": "array", "items": { "type": "object", diff --git a/spacemesh/v2alpha1/malfeasance.proto b/spacemesh/v2alpha1/malfeasance.proto index 3d42bcff..4d0c1851 100644 --- a/spacemesh/v2alpha1/malfeasance.proto +++ b/spacemesh/v2alpha1/malfeasance.proto @@ -27,13 +27,13 @@ message MalfeasanceProof { } message MalfeasanceRequest { - repeated bytes smesher_id = 1; // list of smesher ids to fetch + repeated bytes smesher_id = 1; // list of smesher ids to fetch (can be empty for all) uint64 offset = 2; // adjusts the starting point for data uint64 limit = 3; // specifies max number of items to fetch } message MalfeasanceList { - repeated MalfeasanceProof malfeasances = 1; + repeated MalfeasanceProof proofs = 1; } service MalfeasanceService {