diff --git a/release/go/spacemesh/v2alpha1/malfeasance.pb.go b/release/go/spacemesh/v2alpha1/malfeasance.pb.go new file mode 100644 index 00000000..b05abfea --- /dev/null +++ b/release/go/spacemesh/v2alpha1/malfeasance.pb.go @@ -0,0 +1,504 @@ +// 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_MalfeasanceDomain int32 + +const ( + MalfeasanceProof_DOMAIN_UNSPECIFIED MalfeasanceProof_MalfeasanceDomain = 0 // for legacy proofs +) + +// Enum value maps for MalfeasanceProof_MalfeasanceDomain. +var ( + MalfeasanceProof_MalfeasanceDomain_name = map[int32]string{ + 0: "DOMAIN_UNSPECIFIED", + } + MalfeasanceProof_MalfeasanceDomain_value = map[string]int32{ + "DOMAIN_UNSPECIFIED": 0, + } +) + +func (x MalfeasanceProof_MalfeasanceDomain) Enum() *MalfeasanceProof_MalfeasanceDomain { + p := new(MalfeasanceProof_MalfeasanceDomain) + *p = x + return p +} + +func (x MalfeasanceProof_MalfeasanceDomain) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MalfeasanceProof_MalfeasanceDomain) Descriptor() protoreflect.EnumDescriptor { + return file_spacemesh_v2alpha1_malfeasance_proto_enumTypes[0].Descriptor() +} + +func (MalfeasanceProof_MalfeasanceDomain) Type() protoreflect.EnumType { + return &file_spacemesh_v2alpha1_malfeasance_proto_enumTypes[0] +} + +func (x MalfeasanceProof_MalfeasanceDomain) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MalfeasanceProof_MalfeasanceDomain.Descriptor instead. +func (MalfeasanceProof_MalfeasanceDomain) 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"` + 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() { + *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) GetDomain() MalfeasanceProof_MalfeasanceDomain { + if x != nil { + return x.Domain + } + return MalfeasanceProof_DOMAIN_UNSPECIFIED +} + +func (x *MalfeasanceProof) GetType() uint32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *MalfeasanceProof) GetProperties() map[string]string { + if x != nil { + return x.Properties + } + 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"` // 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 +} + +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) 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 + + Proofs []*MalfeasanceProof `protobuf:"bytes,1,rep,name=proofs,proto3" json:"proofs,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) GetProofs() []*MalfeasanceProof { + if x != nil { + return x.Proofs + } + return nil +} + +type MalfeasanceStreamRequest 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"` // list of smesher ids to watch + Watch bool `protobuf:"varint,2,opt,name=watch,proto3" json:"watch,omitempty"` +} + +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) GetSmesherId() [][]byte { + if x != nil { + return x.SmesherId + } + return nil +} + +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{ + 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, 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, 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, + 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 ( + 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, 5) +var file_spacemesh_v2alpha1_malfeasance_proto_goTypes = []interface{}{ + (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.domain:type_name -> spacemesh.v2alpha1.MalfeasanceProof.MalfeasanceDomain + 5, // 1: spacemesh.v2alpha1.MalfeasanceProof.properties:type_name -> spacemesh.v2alpha1.MalfeasanceProof.PropertiesEntry + 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 + 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() } +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: 5, + 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..8025c050 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": [ @@ -377,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", @@ -578,6 +618,54 @@ "LAYER_STATUS_VERIFIED" ] }, + "spacemeshv2alpha1MalfeasanceProof": { + "type": "object", + "properties": { + "domain": { + "$ref": "#/definitions/MalfeasanceProofMalfeasanceDomain" + }, + "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" + } + } + }, + "spacemeshv2alpha1MalfeasanceRequest": { + "type": "object", + "properties": { + "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", + "title": "list of smesher ids to fetch (can be empty for all)", + "items": { + "type": "string", + "format": "byte" + } + } + } + }, "spacemeshv2alpha1NetworkInfoResponse": { "type": "object", "properties": { @@ -1031,6 +1119,18 @@ } } }, + "v2alpha1MalfeasanceList": { + "type": "object", + "properties": { + "proofs": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/spacemeshv2alpha1MalfeasanceProof" + } + } + } + }, "v2alpha1NetworkInfoRequest": { "type": "object" }, @@ -1236,6 +1336,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..4d0c1851 --- /dev/null +++ b/spacemesh/v2alpha1/malfeasance.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; + +import "google/api/visibility.proto"; + +package spacemesh.v2alpha1; + +message MalfeasanceProof { + bytes smesher = 1; + + enum MalfeasanceDomain { + DOMAIN_UNSPECIFIED = 0; // for legacy proofs + } + 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 (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 proofs = 1; +} + +service MalfeasanceService { + option (google.api.api_visibility).restriction = "V2"; + + rpc List(MalfeasanceRequest) returns (MalfeasanceList); +} + +message MalfeasanceStreamRequest { + repeated bytes smesher_id = 1; // list of smesher ids to watch + bool watch = 2; +} + +service MalfeasanceStreamService { + option (google.api.api_visibility).restriction = "INTERNAL"; + + rpc Stream(MalfeasanceStreamRequest) returns (stream MalfeasanceProof); +}