diff --git a/proto/README.md b/proto/README.md index 553dd0e686..0d9e5bec32 100644 --- a/proto/README.md +++ b/proto/README.md @@ -5,25 +5,25 @@ This package defines common protobuf messages and services used by Ethereum Sere ``` proto/ beacon/ + db/ p2p/ v1/ rpc/ v1/ - sharding/ - p2p/ - v1/ + cluster/ + slashing/ testing/ ``` We specify messages available for p2p communication common to beacon chain nodes and sharding clients. For now, we are checking in all generated code to support native go dependency -management. The generated pb.go files can be derived from bazel's bin +management. The generated pb.go files can be derived from bazel's bin directory. -For example, when we build the testing go proto library -`bazel build //proto/testing:ethereum_testing_go_proto` there is a pb.go -generated at +For example, when we build the testing go proto library +`bazel build //proto/testing:ethereum_testing_go_proto` there is a pb.go +generated at `bazel-bin/proto/testing/linux_amd64_stripped/ethereum_testing_go_proto\~/github.com/prysmaticlabs/prysm/proto/testing/test.pb.go`. This generated file can be copied, or you can use you protoc locally if you prefer. diff --git a/proto/beacon/db/powchain.pb.go b/proto/beacon/db/powchain.pb.go index 98aeb0998a..bd45c377be 100755 --- a/proto/beacon/db/powchain.pb.go +++ b/proto/beacon/db/powchain.pb.go @@ -5,10 +5,11 @@ package db import ( fmt "fmt" - proto "github.com/gogo/protobuf/proto" - v1alpha1 "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" io "io" math "math" + + proto "github.com/gogo/protobuf/proto" + v1alpha1 "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/proto/beacon/rpc/v1/BUILD.bazel b/proto/beacon/rpc/v1/BUILD.bazel index a3ed0c8c97..47927705d9 100644 --- a/proto/beacon/rpc/v1/BUILD.bazel +++ b/proto/beacon/rpc/v1/BUILD.bazel @@ -12,7 +12,6 @@ go_proto_library( visibility = ["//visibility:public"], deps = [ "//proto/beacon/p2p/v1:go_default_library", - "//proto/sharding/p2p/v1:go_default_library", "@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library", "@go_googleapis//google/api:annotations_go_proto", "@grpc_ecosystem_grpc_gateway//protoc-gen-swagger/options:options_go_proto", @@ -30,7 +29,6 @@ go_proto_library( visibility = ["//visibility:public"], deps = [ "//proto/beacon/p2p/v1:go_default_library", - "//proto/sharding/p2p/v1:go_default_library", "@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library", "@go_googleapis//google/api:annotations_go_proto", "@grpc_ecosystem_grpc_gateway//protoc-gen-swagger/options:options_go_proto", @@ -48,16 +46,15 @@ proto_library( name = "v1_proto", srcs = [ "services.proto", - "slasher.proto", ], visibility = ["//visibility:public"], deps = [ "//proto/beacon/p2p/v1:v1_proto", - "//proto/sharding/p2p/v1:v1_proto", "@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:proto", "@com_google_protobuf//:empty_proto", "@com_google_protobuf//:timestamp_proto", "@go_googleapis//google/api:annotations_proto", + "@gogo_special_proto//github.com/gogo/protobuf/gogoproto", "@grpc_ecosystem_grpc_gateway//protoc-gen-swagger/options:options_proto", ], ) diff --git a/proto/beacon/rpc/v1/slasher.pb.go b/proto/beacon/rpc/v1/slasher.pb.go deleted file mode 100755 index 1aba896a49..0000000000 --- a/proto/beacon/rpc/v1/slasher.pb.go +++ /dev/null @@ -1,2042 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: proto/beacon/rpc/v1/slasher.proto - -package ethereum_beacon_rpc_v1 - -import ( - context "context" - fmt "fmt" - io "io" - math "math" - - proto "github.com/gogo/protobuf/proto" - types "github.com/gogo/protobuf/types" - v1alpha1 "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package - -type ValidatorIDToIdxAtt struct { - Indices []uint64 `protobuf:"varint,1,rep,packed,name=indices,proto3" json:"indices,omitempty"` - DataRoot []byte `protobuf:"bytes,2,opt,name=data_root,json=dataRoot,proto3" json:"data_root,omitempty"` - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ValidatorIDToIdxAtt) Reset() { *m = ValidatorIDToIdxAtt{} } -func (m *ValidatorIDToIdxAtt) String() string { return proto.CompactTextString(m) } -func (*ValidatorIDToIdxAtt) ProtoMessage() {} -func (*ValidatorIDToIdxAtt) Descriptor() ([]byte, []int) { - return fileDescriptor_d75c5a5be5c552fc, []int{0} -} -func (m *ValidatorIDToIdxAtt) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorIDToIdxAtt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorIDToIdxAtt.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ValidatorIDToIdxAtt) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorIDToIdxAtt.Merge(m, src) -} -func (m *ValidatorIDToIdxAtt) XXX_Size() int { - return m.Size() -} -func (m *ValidatorIDToIdxAtt) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorIDToIdxAtt.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorIDToIdxAtt proto.InternalMessageInfo - -func (m *ValidatorIDToIdxAtt) GetIndices() []uint64 { - if m != nil { - return m.Indices - } - return nil -} - -func (m *ValidatorIDToIdxAtt) GetDataRoot() []byte { - if m != nil { - return m.DataRoot - } - return nil -} - -func (m *ValidatorIDToIdxAtt) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -type ValidatorIDToIdxAttList struct { - IndicesList []*ValidatorIDToIdxAtt `protobuf:"bytes,1,rep,name=indicesList,proto3" json:"indicesList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ValidatorIDToIdxAttList) Reset() { *m = ValidatorIDToIdxAttList{} } -func (m *ValidatorIDToIdxAttList) String() string { return proto.CompactTextString(m) } -func (*ValidatorIDToIdxAttList) ProtoMessage() {} -func (*ValidatorIDToIdxAttList) Descriptor() ([]byte, []int) { - return fileDescriptor_d75c5a5be5c552fc, []int{1} -} -func (m *ValidatorIDToIdxAttList) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorIDToIdxAttList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorIDToIdxAttList.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ValidatorIDToIdxAttList) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorIDToIdxAttList.Merge(m, src) -} -func (m *ValidatorIDToIdxAttList) XXX_Size() int { - return m.Size() -} -func (m *ValidatorIDToIdxAttList) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorIDToIdxAttList.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorIDToIdxAttList proto.InternalMessageInfo - -func (m *ValidatorIDToIdxAttList) GetIndicesList() []*ValidatorIDToIdxAtt { - if m != nil { - return m.IndicesList - } - return nil -} - -type ProposerSlashingRequest struct { - BlockHeader *v1alpha1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=block_header,json=blockHeader,proto3" json:"block_header,omitempty"` - ValidatorIndex uint64 `protobuf:"varint,2,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ProposerSlashingRequest) Reset() { *m = ProposerSlashingRequest{} } -func (m *ProposerSlashingRequest) String() string { return proto.CompactTextString(m) } -func (*ProposerSlashingRequest) ProtoMessage() {} -func (*ProposerSlashingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d75c5a5be5c552fc, []int{2} -} -func (m *ProposerSlashingRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProposerSlashingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProposerSlashingRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ProposerSlashingRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProposerSlashingRequest.Merge(m, src) -} -func (m *ProposerSlashingRequest) XXX_Size() int { - return m.Size() -} -func (m *ProposerSlashingRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ProposerSlashingRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ProposerSlashingRequest proto.InternalMessageInfo - -func (m *ProposerSlashingRequest) GetBlockHeader() *v1alpha1.BeaconBlockHeader { - if m != nil { - return m.BlockHeader - } - return nil -} - -func (m *ProposerSlashingRequest) GetValidatorIndex() uint64 { - if m != nil { - return m.ValidatorIndex - } - return 0 -} - -type ProposerSlashingResponse struct { - ProposerSlashing []*v1alpha1.ProposerSlashing `protobuf:"bytes,1,rep,name=proposer_slashing,json=proposerSlashing,proto3" json:"proposer_slashing,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ProposerSlashingResponse) Reset() { *m = ProposerSlashingResponse{} } -func (m *ProposerSlashingResponse) String() string { return proto.CompactTextString(m) } -func (*ProposerSlashingResponse) ProtoMessage() {} -func (*ProposerSlashingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d75c5a5be5c552fc, []int{3} -} -func (m *ProposerSlashingResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProposerSlashingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProposerSlashingResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ProposerSlashingResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProposerSlashingResponse.Merge(m, src) -} -func (m *ProposerSlashingResponse) XXX_Size() int { - return m.Size() -} -func (m *ProposerSlashingResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ProposerSlashingResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ProposerSlashingResponse proto.InternalMessageInfo - -func (m *ProposerSlashingResponse) GetProposerSlashing() []*v1alpha1.ProposerSlashing { - if m != nil { - return m.ProposerSlashing - } - return nil -} - -type AttesterSlashingResponse struct { - AttesterSlashing []*v1alpha1.AttesterSlashing `protobuf:"bytes,1,rep,name=attester_slashing,json=attesterSlashing,proto3" json:"attester_slashing,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AttesterSlashingResponse) Reset() { *m = AttesterSlashingResponse{} } -func (m *AttesterSlashingResponse) String() string { return proto.CompactTextString(m) } -func (*AttesterSlashingResponse) ProtoMessage() {} -func (*AttesterSlashingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d75c5a5be5c552fc, []int{4} -} -func (m *AttesterSlashingResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AttesterSlashingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AttesterSlashingResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *AttesterSlashingResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AttesterSlashingResponse.Merge(m, src) -} -func (m *AttesterSlashingResponse) XXX_Size() int { - return m.Size() -} -func (m *AttesterSlashingResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AttesterSlashingResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AttesterSlashingResponse proto.InternalMessageInfo - -func (m *AttesterSlashingResponse) GetAttesterSlashing() []*v1alpha1.AttesterSlashing { - if m != nil { - return m.AttesterSlashing - } - return nil -} - -type MinMaxEpochSpan struct { - MinEpochSpan uint32 `protobuf:"varint,1,opt,name=min_epoch_span,json=minEpochSpan,proto3" json:"min_epoch_span,omitempty"` - MaxEpochSpan uint32 `protobuf:"varint,2,opt,name=max_epoch_span,json=maxEpochSpan,proto3" json:"max_epoch_span,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MinMaxEpochSpan) Reset() { *m = MinMaxEpochSpan{} } -func (m *MinMaxEpochSpan) String() string { return proto.CompactTextString(m) } -func (*MinMaxEpochSpan) ProtoMessage() {} -func (*MinMaxEpochSpan) Descriptor() ([]byte, []int) { - return fileDescriptor_d75c5a5be5c552fc, []int{5} -} -func (m *MinMaxEpochSpan) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MinMaxEpochSpan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MinMaxEpochSpan.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MinMaxEpochSpan) XXX_Merge(src proto.Message) { - xxx_messageInfo_MinMaxEpochSpan.Merge(m, src) -} -func (m *MinMaxEpochSpan) XXX_Size() int { - return m.Size() -} -func (m *MinMaxEpochSpan) XXX_DiscardUnknown() { - xxx_messageInfo_MinMaxEpochSpan.DiscardUnknown(m) -} - -var xxx_messageInfo_MinMaxEpochSpan proto.InternalMessageInfo - -func (m *MinMaxEpochSpan) GetMinEpochSpan() uint32 { - if m != nil { - return m.MinEpochSpan - } - return 0 -} - -func (m *MinMaxEpochSpan) GetMaxEpochSpan() uint32 { - if m != nil { - return m.MaxEpochSpan - } - return 0 -} - -type EpochSpanMap struct { - EpochSpanMap map[uint64]*MinMaxEpochSpan `protobuf:"bytes,1,rep,name=epoch_span_map,json=epochSpanMap,proto3" json:"epoch_span_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EpochSpanMap) Reset() { *m = EpochSpanMap{} } -func (m *EpochSpanMap) String() string { return proto.CompactTextString(m) } -func (*EpochSpanMap) ProtoMessage() {} -func (*EpochSpanMap) Descriptor() ([]byte, []int) { - return fileDescriptor_d75c5a5be5c552fc, []int{6} -} -func (m *EpochSpanMap) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EpochSpanMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EpochSpanMap.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EpochSpanMap) XXX_Merge(src proto.Message) { - xxx_messageInfo_EpochSpanMap.Merge(m, src) -} -func (m *EpochSpanMap) XXX_Size() int { - return m.Size() -} -func (m *EpochSpanMap) XXX_DiscardUnknown() { - xxx_messageInfo_EpochSpanMap.DiscardUnknown(m) -} - -var xxx_messageInfo_EpochSpanMap proto.InternalMessageInfo - -func (m *EpochSpanMap) GetEpochSpanMap() map[uint64]*MinMaxEpochSpan { - if m != nil { - return m.EpochSpanMap - } - return nil -} - -func init() { - proto.RegisterType((*ValidatorIDToIdxAtt)(nil), "ethereum.beacon.rpc.v1.ValidatorIDToIdxAtt") - proto.RegisterType((*ValidatorIDToIdxAttList)(nil), "ethereum.beacon.rpc.v1.ValidatorIDToIdxAttList") - proto.RegisterType((*ProposerSlashingRequest)(nil), "ethereum.beacon.rpc.v1.ProposerSlashingRequest") - proto.RegisterType((*ProposerSlashingResponse)(nil), "ethereum.beacon.rpc.v1.ProposerSlashingResponse") - proto.RegisterType((*AttesterSlashingResponse)(nil), "ethereum.beacon.rpc.v1.AttesterSlashingResponse") - proto.RegisterType((*MinMaxEpochSpan)(nil), "ethereum.beacon.rpc.v1.MinMaxEpochSpan") - proto.RegisterType((*EpochSpanMap)(nil), "ethereum.beacon.rpc.v1.EpochSpanMap") - proto.RegisterMapType((map[uint64]*MinMaxEpochSpan)(nil), "ethereum.beacon.rpc.v1.EpochSpanMap.EpochSpanMapEntry") -} - -func init() { proto.RegisterFile("proto/beacon/rpc/v1/slasher.proto", fileDescriptor_d75c5a5be5c552fc) } - -var fileDescriptor_d75c5a5be5c552fc = []byte{ - // 615 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xdd, 0x6a, 0x13, 0x41, - 0x14, 0x66, 0x9b, 0x6a, 0xed, 0x49, 0x6c, 0xd3, 0x11, 0xdb, 0x90, 0x4a, 0xad, 0x41, 0x68, 0x44, - 0xd8, 0x6d, 0x2a, 0x88, 0x08, 0x5e, 0xb4, 0x58, 0x30, 0x68, 0x40, 0xb6, 0x45, 0x41, 0x94, 0x65, - 0xb2, 0x7b, 0xcc, 0xae, 0xdd, 0xcc, 0x8c, 0x33, 0xb3, 0x21, 0x7d, 0x0a, 0x5f, 0xc4, 0x07, 0xf1, - 0xd2, 0x2b, 0xaf, 0xa5, 0x4f, 0x22, 0x3b, 0xbb, 0x69, 0x36, 0x3f, 0x0b, 0xf5, 0x6e, 0xcf, 0x39, - 0xdf, 0xf9, 0xbe, 0x33, 0xdf, 0x9e, 0x19, 0x78, 0x24, 0x24, 0xd7, 0xdc, 0xe9, 0x23, 0xf5, 0x39, - 0x73, 0xa4, 0xf0, 0x9d, 0x51, 0xc7, 0x51, 0x31, 0x55, 0x21, 0x4a, 0xdb, 0xd4, 0xc8, 0x36, 0xea, - 0x10, 0x25, 0x26, 0x43, 0x3b, 0x43, 0xd9, 0x52, 0xf8, 0xf6, 0xa8, 0xd3, 0xdc, 0x1d, 0x70, 0x3e, - 0x88, 0xd1, 0x31, 0xa8, 0x7e, 0xf2, 0xd5, 0xc1, 0xa1, 0xd0, 0x97, 0x59, 0x53, 0xf3, 0x21, 0xea, - 0xd0, 0x19, 0x75, 0x68, 0x2c, 0x42, 0xda, 0xc9, 0xe9, 0xbd, 0x7e, 0xcc, 0xfd, 0x8b, 0x0c, 0xd0, - 0xfa, 0x06, 0xf7, 0x3e, 0xd0, 0x38, 0x0a, 0xa8, 0xe6, 0xb2, 0xfb, 0xfa, 0x9c, 0x77, 0x83, 0xf1, - 0xb1, 0xd6, 0xa4, 0x01, 0x6b, 0x11, 0x0b, 0x22, 0x1f, 0x55, 0xc3, 0xda, 0xaf, 0xb4, 0x57, 0xdd, - 0x49, 0x48, 0x76, 0x61, 0x3d, 0xa0, 0x9a, 0x7a, 0x92, 0x73, 0xdd, 0x58, 0xd9, 0xb7, 0xda, 0x35, - 0xf7, 0x4e, 0x9a, 0x70, 0x39, 0xd7, 0xe4, 0x01, 0xac, 0xab, 0x68, 0xc0, 0xa8, 0x4e, 0x24, 0x36, - 0x2a, 0xa6, 0x38, 0x4d, 0xb4, 0x42, 0xd8, 0x59, 0xa2, 0xf5, 0x2e, 0x52, 0x9a, 0xf4, 0xa0, 0x9a, - 0x0b, 0xa4, 0xa1, 0xd1, 0xac, 0x1e, 0x3d, 0xb5, 0x97, 0x1f, 0xd9, 0x5e, 0xc2, 0xe2, 0x16, 0xfb, - 0x5b, 0x3f, 0x2c, 0xd8, 0x79, 0x2f, 0xb9, 0xe0, 0x0a, 0xe5, 0x59, 0xea, 0x62, 0xc4, 0x06, 0x2e, - 0x7e, 0x4f, 0x50, 0x69, 0xf2, 0x16, 0x6a, 0xc6, 0x00, 0x2f, 0x44, 0x1a, 0xa0, 0x6c, 0x58, 0xfb, - 0x56, 0xbb, 0x7a, 0xd4, 0x9e, 0x6a, 0xa1, 0x0e, 0xed, 0x89, 0x65, 0xf6, 0x89, 0x11, 0x3e, 0x49, - 0x1b, 0xde, 0x18, 0xbc, 0x5b, 0xed, 0x4f, 0x03, 0x72, 0x00, 0x9b, 0xa3, 0xc9, 0x30, 0x5e, 0xc4, - 0x02, 0x1c, 0x1b, 0x4f, 0x56, 0xdd, 0x8d, 0xeb, 0x74, 0x37, 0xcd, 0xb6, 0x04, 0x34, 0x16, 0x07, - 0x52, 0x82, 0x33, 0x85, 0xe4, 0x1c, 0xb6, 0x44, 0x5e, 0xf3, 0x54, 0x5e, 0xcc, 0x2d, 0x38, 0x28, - 0x19, 0x6b, 0x81, 0xab, 0x2e, 0xe6, 0x32, 0xa9, 0xe2, 0xb1, 0xd6, 0xa8, 0xf4, 0x72, 0x45, 0x9a, - 0xd7, 0x6e, 0xaa, 0xb8, 0xc0, 0x55, 0xa7, 0x73, 0x99, 0xd6, 0x17, 0xd8, 0xec, 0x45, 0xac, 0x47, - 0xc7, 0xa7, 0x82, 0xfb, 0xe1, 0x99, 0xa0, 0x8c, 0x3c, 0x86, 0x8d, 0x61, 0xc4, 0x3c, 0x4c, 0x13, - 0x9e, 0x12, 0x94, 0x19, 0xbb, 0xef, 0xba, 0xb5, 0x61, 0xc4, 0x66, 0x51, 0x74, 0x5c, 0x44, 0xad, - 0xe4, 0xa8, 0x02, 0x57, 0xeb, 0x8f, 0x05, 0xb5, 0xeb, 0xa8, 0x47, 0x05, 0xf9, 0x0c, 0x1b, 0xd3, - 0x16, 0x6f, 0x48, 0x45, 0x7e, 0x84, 0xe7, 0x65, 0x7b, 0x53, 0xec, 0x9e, 0x09, 0x4e, 0x99, 0x96, - 0x97, 0x6e, 0x0d, 0x0b, 0xa9, 0x66, 0x08, 0x5b, 0x0b, 0x10, 0x52, 0x87, 0xca, 0x05, 0x5e, 0x9a, - 0x43, 0xac, 0xba, 0xe9, 0x27, 0x79, 0x05, 0xb7, 0x46, 0x34, 0x4e, 0xd0, 0x8c, 0x3c, 0x63, 0xdf, - 0xac, 0xf6, 0x9c, 0x33, 0x6e, 0xd6, 0xf5, 0x72, 0xe5, 0x85, 0x75, 0xf4, 0xb3, 0x02, 0x6b, 0x67, - 0xd9, 0x5d, 0x27, 0x09, 0x6c, 0x77, 0x95, 0x09, 0x68, 0x3f, 0xc6, 0xcc, 0x74, 0xaa, 0x23, 0xce, - 0xc8, 0x93, 0x92, 0x1f, 0x63, 0xf6, 0x0b, 0x83, 0x02, 0xb4, 0x79, 0x58, 0x36, 0x44, 0xe9, 0x42, - 0x24, 0x50, 0x2f, 0xc8, 0x9a, 0x75, 0x27, 0x4e, 0x19, 0x4b, 0xc9, 0xcd, 0x2a, 0x97, 0x2d, 0xdd, - 0xfc, 0x8f, 0x40, 0xae, 0x45, 0x33, 0x10, 0x8d, 0x15, 0xd9, 0xb6, 0xb3, 0x27, 0xcd, 0x9e, 0x3c, - 0x69, 0xf6, 0x69, 0xfa, 0xa4, 0x35, 0x6f, 0x7a, 0x19, 0x0e, 0x2d, 0xf2, 0x09, 0xee, 0x2f, 0x33, - 0xf1, 0xff, 0xb9, 0xe7, 0x1d, 0x3b, 0xb4, 0x4e, 0x6a, 0xbf, 0xae, 0xf6, 0xac, 0xdf, 0x57, 0x7b, - 0xd6, 0xdf, 0xab, 0x3d, 0xab, 0x7f, 0xdb, 0x10, 0x3d, 0xfb, 0x17, 0x00, 0x00, 0xff, 0xff, 0xbc, - 0x4a, 0x19, 0xe8, 0xc2, 0x05, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// SlasherClient is the client API for Slasher service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type SlasherClient interface { - IsSlashableAttestation(ctx context.Context, in *v1alpha1.IndexedAttestation, opts ...grpc.CallOption) (*AttesterSlashingResponse, error) - IsSlashableBlock(ctx context.Context, in *ProposerSlashingRequest, opts ...grpc.CallOption) (*ProposerSlashingResponse, error) - SlashableProposals(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (Slasher_SlashableProposalsClient, error) - SlashableAttestations(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (Slasher_SlashableAttestationsClient, error) -} - -type slasherClient struct { - cc *grpc.ClientConn -} - -func NewSlasherClient(cc *grpc.ClientConn) SlasherClient { - return &slasherClient{cc} -} - -func (c *slasherClient) IsSlashableAttestation(ctx context.Context, in *v1alpha1.IndexedAttestation, opts ...grpc.CallOption) (*AttesterSlashingResponse, error) { - out := new(AttesterSlashingResponse) - err := c.cc.Invoke(ctx, "/ethereum.beacon.rpc.v1.Slasher/IsSlashableAttestation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *slasherClient) IsSlashableBlock(ctx context.Context, in *ProposerSlashingRequest, opts ...grpc.CallOption) (*ProposerSlashingResponse, error) { - out := new(ProposerSlashingResponse) - err := c.cc.Invoke(ctx, "/ethereum.beacon.rpc.v1.Slasher/IsSlashableBlock", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *slasherClient) SlashableProposals(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (Slasher_SlashableProposalsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Slasher_serviceDesc.Streams[0], "/ethereum.beacon.rpc.v1.Slasher/SlashableProposals", opts...) - if err != nil { - return nil, err - } - x := &slasherSlashableProposalsClient{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 Slasher_SlashableProposalsClient interface { - Recv() (*v1alpha1.ProposerSlashing, error) - grpc.ClientStream -} - -type slasherSlashableProposalsClient struct { - grpc.ClientStream -} - -func (x *slasherSlashableProposalsClient) Recv() (*v1alpha1.ProposerSlashing, error) { - m := new(v1alpha1.ProposerSlashing) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *slasherClient) SlashableAttestations(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (Slasher_SlashableAttestationsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Slasher_serviceDesc.Streams[1], "/ethereum.beacon.rpc.v1.Slasher/SlashableAttestations", opts...) - if err != nil { - return nil, err - } - x := &slasherSlashableAttestationsClient{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 Slasher_SlashableAttestationsClient interface { - Recv() (*v1alpha1.AttesterSlashing, error) - grpc.ClientStream -} - -type slasherSlashableAttestationsClient struct { - grpc.ClientStream -} - -func (x *slasherSlashableAttestationsClient) Recv() (*v1alpha1.AttesterSlashing, error) { - m := new(v1alpha1.AttesterSlashing) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// SlasherServer is the server API for Slasher service. -type SlasherServer interface { - IsSlashableAttestation(context.Context, *v1alpha1.IndexedAttestation) (*AttesterSlashingResponse, error) - IsSlashableBlock(context.Context, *ProposerSlashingRequest) (*ProposerSlashingResponse, error) - SlashableProposals(*types.Empty, Slasher_SlashableProposalsServer) error - SlashableAttestations(*types.Empty, Slasher_SlashableAttestationsServer) error -} - -func RegisterSlasherServer(s *grpc.Server, srv SlasherServer) { - s.RegisterService(&_Slasher_serviceDesc, srv) -} - -func _Slasher_IsSlashableAttestation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(v1alpha1.IndexedAttestation) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SlasherServer).IsSlashableAttestation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ethereum.beacon.rpc.v1.Slasher/IsSlashableAttestation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SlasherServer).IsSlashableAttestation(ctx, req.(*v1alpha1.IndexedAttestation)) - } - return interceptor(ctx, in, info, handler) -} - -func _Slasher_IsSlashableBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ProposerSlashingRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SlasherServer).IsSlashableBlock(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ethereum.beacon.rpc.v1.Slasher/IsSlashableBlock", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SlasherServer).IsSlashableBlock(ctx, req.(*ProposerSlashingRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Slasher_SlashableProposals_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(types.Empty) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(SlasherServer).SlashableProposals(m, &slasherSlashableProposalsServer{stream}) -} - -type Slasher_SlashableProposalsServer interface { - Send(*v1alpha1.ProposerSlashing) error - grpc.ServerStream -} - -type slasherSlashableProposalsServer struct { - grpc.ServerStream -} - -func (x *slasherSlashableProposalsServer) Send(m *v1alpha1.ProposerSlashing) error { - return x.ServerStream.SendMsg(m) -} - -func _Slasher_SlashableAttestations_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(types.Empty) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(SlasherServer).SlashableAttestations(m, &slasherSlashableAttestationsServer{stream}) -} - -type Slasher_SlashableAttestationsServer interface { - Send(*v1alpha1.AttesterSlashing) error - grpc.ServerStream -} - -type slasherSlashableAttestationsServer struct { - grpc.ServerStream -} - -func (x *slasherSlashableAttestationsServer) Send(m *v1alpha1.AttesterSlashing) error { - return x.ServerStream.SendMsg(m) -} - -var _Slasher_serviceDesc = grpc.ServiceDesc{ - ServiceName: "ethereum.beacon.rpc.v1.Slasher", - HandlerType: (*SlasherServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "IsSlashableAttestation", - Handler: _Slasher_IsSlashableAttestation_Handler, - }, - { - MethodName: "IsSlashableBlock", - Handler: _Slasher_IsSlashableBlock_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "SlashableProposals", - Handler: _Slasher_SlashableProposals_Handler, - ServerStreams: true, - }, - { - StreamName: "SlashableAttestations", - Handler: _Slasher_SlashableAttestations_Handler, - ServerStreams: true, - }, - }, - Metadata: "proto/beacon/rpc/v1/slasher.proto", -} - -func (m *ValidatorIDToIdxAtt) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ValidatorIDToIdxAtt) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Indices) > 0 { - dAtA2 := make([]byte, len(m.Indices)*10) - var j1 int - for _, num := range m.Indices { - for num >= 1<<7 { - dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA2[j1] = uint8(num) - j1++ - } - dAtA[i] = 0xa - i++ - i = encodeVarintSlasher(dAtA, i, uint64(j1)) - i += copy(dAtA[i:], dAtA2[:j1]) - } - if len(m.DataRoot) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintSlasher(dAtA, i, uint64(len(m.DataRoot))) - i += copy(dAtA[i:], m.DataRoot) - } - if len(m.Signature) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintSlasher(dAtA, i, uint64(len(m.Signature))) - i += copy(dAtA[i:], m.Signature) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ValidatorIDToIdxAttList) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ValidatorIDToIdxAttList) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.IndicesList) > 0 { - for _, msg := range m.IndicesList { - dAtA[i] = 0xa - i++ - i = encodeVarintSlasher(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ProposerSlashingRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProposerSlashingRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.BlockHeader != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintSlasher(dAtA, i, uint64(m.BlockHeader.Size())) - n3, err := m.BlockHeader.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 - } - if m.ValidatorIndex != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintSlasher(dAtA, i, uint64(m.ValidatorIndex)) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ProposerSlashingResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProposerSlashingResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.ProposerSlashing) > 0 { - for _, msg := range m.ProposerSlashing { - dAtA[i] = 0xa - i++ - i = encodeVarintSlasher(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *AttesterSlashingResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AttesterSlashingResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.AttesterSlashing) > 0 { - for _, msg := range m.AttesterSlashing { - dAtA[i] = 0xa - i++ - i = encodeVarintSlasher(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *MinMaxEpochSpan) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MinMaxEpochSpan) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.MinEpochSpan != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintSlasher(dAtA, i, uint64(m.MinEpochSpan)) - } - if m.MaxEpochSpan != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintSlasher(dAtA, i, uint64(m.MaxEpochSpan)) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *EpochSpanMap) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EpochSpanMap) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.EpochSpanMap) > 0 { - for k := range m.EpochSpanMap { - dAtA[i] = 0xa - i++ - v := m.EpochSpanMap[k] - msgSize := 0 - if v != nil { - msgSize = v.Size() - msgSize += 1 + sovSlasher(uint64(msgSize)) - } - mapSize := 1 + sovSlasher(uint64(k)) + msgSize - i = encodeVarintSlasher(dAtA, i, uint64(mapSize)) - dAtA[i] = 0x8 - i++ - i = encodeVarintSlasher(dAtA, i, uint64(k)) - if v != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintSlasher(dAtA, i, uint64(v.Size())) - n4, err := v.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 - } - } - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeVarintSlasher(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *ValidatorIDToIdxAtt) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Indices) > 0 { - l = 0 - for _, e := range m.Indices { - l += sovSlasher(uint64(e)) - } - n += 1 + sovSlasher(uint64(l)) + l - } - l = len(m.DataRoot) - if l > 0 { - n += 1 + l + sovSlasher(uint64(l)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovSlasher(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ValidatorIDToIdxAttList) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.IndicesList) > 0 { - for _, e := range m.IndicesList { - l = e.Size() - n += 1 + l + sovSlasher(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ProposerSlashingRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockHeader != nil { - l = m.BlockHeader.Size() - n += 1 + l + sovSlasher(uint64(l)) - } - if m.ValidatorIndex != 0 { - n += 1 + sovSlasher(uint64(m.ValidatorIndex)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ProposerSlashingResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ProposerSlashing) > 0 { - for _, e := range m.ProposerSlashing { - l = e.Size() - n += 1 + l + sovSlasher(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AttesterSlashingResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.AttesterSlashing) > 0 { - for _, e := range m.AttesterSlashing { - l = e.Size() - n += 1 + l + sovSlasher(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MinMaxEpochSpan) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MinEpochSpan != 0 { - n += 1 + sovSlasher(uint64(m.MinEpochSpan)) - } - if m.MaxEpochSpan != 0 { - n += 1 + sovSlasher(uint64(m.MaxEpochSpan)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *EpochSpanMap) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.EpochSpanMap) > 0 { - for k, v := range m.EpochSpanMap { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovSlasher(uint64(l)) - } - mapEntrySize := 1 + sovSlasher(uint64(k)) + l - n += mapEntrySize + 1 + sovSlasher(uint64(mapEntrySize)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovSlasher(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozSlasher(x uint64) (n int) { - return sovSlasher(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ValidatorIDToIdxAtt) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ValidatorIDToIdxAtt: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorIDToIdxAtt: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Indices = append(m.Indices, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthSlasher - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthSlasher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Indices) == 0 { - m.Indices = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Indices = append(m.Indices, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Indices", wireType) - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DataRoot", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSlasher - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSlasher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DataRoot = append(m.DataRoot[:0], dAtA[iNdEx:postIndex]...) - if m.DataRoot == nil { - m.DataRoot = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSlasher - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSlasher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSlasher(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorIDToIdxAttList) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ValidatorIDToIdxAttList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorIDToIdxAttList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IndicesList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSlasher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSlasher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IndicesList = append(m.IndicesList, &ValidatorIDToIdxAtt{}) - if err := m.IndicesList[len(m.IndicesList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSlasher(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProposerSlashingRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProposerSlashingRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProposerSlashingRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSlasher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSlasher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BlockHeader == nil { - m.BlockHeader = &v1alpha1.BeaconBlockHeader{} - } - if err := m.BlockHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorIndex", wireType) - } - m.ValidatorIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ValidatorIndex |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSlasher(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProposerSlashingResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProposerSlashingResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProposerSlashingResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposerSlashing", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSlasher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSlasher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProposerSlashing = append(m.ProposerSlashing, &v1alpha1.ProposerSlashing{}) - if err := m.ProposerSlashing[len(m.ProposerSlashing)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSlasher(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AttesterSlashingResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AttesterSlashingResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AttesterSlashingResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AttesterSlashing", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSlasher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSlasher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AttesterSlashing = append(m.AttesterSlashing, &v1alpha1.AttesterSlashing{}) - if err := m.AttesterSlashing[len(m.AttesterSlashing)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSlasher(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MinMaxEpochSpan) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MinMaxEpochSpan: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MinMaxEpochSpan: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinEpochSpan", wireType) - } - m.MinEpochSpan = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinEpochSpan |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxEpochSpan", wireType) - } - m.MaxEpochSpan = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxEpochSpan |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSlasher(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EpochSpanMap) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EpochSpanMap: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EpochSpanMap: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochSpanMap", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSlasher - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSlasher - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.EpochSpanMap == nil { - m.EpochSpanMap = make(map[uint64]*MinMaxEpochSpan) - } - var mapkey uint64 - var mapvalue *MinMaxEpochSpan - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSlasher - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthSlasher - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthSlasher - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &MinMaxEpochSpan{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipSlasher(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.EpochSpanMap[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSlasher(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthSlasher - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSlasher(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSlasher - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSlasher - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSlasher - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSlasher - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthSlasher - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSlasher - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipSlasher(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthSlasher - } - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthSlasher = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSlasher = fmt.Errorf("proto: integer overflow") -) diff --git a/proto/sharding/p2p/v1/BUILD.bazel b/proto/sharding/p2p/v1/BUILD.bazel deleted file mode 100644 index ac954afd44..0000000000 --- a/proto/sharding/p2p/v1/BUILD.bazel +++ /dev/null @@ -1,28 +0,0 @@ -load("@rules_proto//proto:defs.bzl", "proto_library") - -# gazelle:ignore -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") - -go_proto_library( - name = "v1_go_proto", - compiler = "//:proto_compiler", - importpath = "github.com/prysmaticlabs/prysm/proto/sharding/p2p/v1", - proto = ":v1_proto", - visibility = ["//visibility:public"], - deps = ["//proto/beacon/p2p/v1:go_default_library"], -) - -go_library( - name = "go_default_library", - embed = [":v1_go_proto"], - importpath = "github.com/prysmaticlabs/prysm/proto/sharding/p2p/v1", - visibility = ["//visibility:public"], -) - -proto_library( - name = "v1_proto", - srcs = ["messages.proto"], - visibility = ["//visibility:public"], - deps = ["//proto/beacon/p2p/v1:v1_proto"], -) diff --git a/proto/sharding/p2p/v1/messages.pb.go b/proto/sharding/p2p/v1/messages.pb.go deleted file mode 100644 index 61228b93de..0000000000 --- a/proto/sharding/p2p/v1/messages.pb.go +++ /dev/null @@ -1,1474 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: proto/sharding/p2p/v1/messages.proto - -package ethereum_sharding_p2p_v1 - -import ( - fmt "fmt" - io "io" - math "math" - - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package - -type Topic int32 - -const ( - Topic_UNKNOWN Topic = 0 - Topic_COLLATION_BODY_REQUEST Topic = 1 - Topic_COLLATION_BODY_RESPONSE Topic = 2 - Topic_TRANSACTIONS Topic = 3 -) - -var Topic_name = map[int32]string{ - 0: "UNKNOWN", - 1: "COLLATION_BODY_REQUEST", - 2: "COLLATION_BODY_RESPONSE", - 3: "TRANSACTIONS", -} - -var Topic_value = map[string]int32{ - "UNKNOWN": 0, - "COLLATION_BODY_REQUEST": 1, - "COLLATION_BODY_RESPONSE": 2, - "TRANSACTIONS": 3, -} - -func (x Topic) String() string { - return proto.EnumName(Topic_name, int32(x)) -} - -func (Topic) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_6b281833bfe9b3ff, []int{0} -} - -type CollationBodyRequest struct { - ShardId uint64 `protobuf:"varint,1,opt,name=shard_id,json=shardId,proto3" json:"shard_id,omitempty"` - Period uint64 `protobuf:"varint,2,opt,name=period,proto3" json:"period,omitempty"` - ChunkRoot []byte `protobuf:"bytes,3,opt,name=chunk_root,json=chunkRoot,proto3" json:"chunk_root,omitempty"` - ProposerAddress []byte `protobuf:"bytes,4,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` - Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollationBodyRequest) Reset() { *m = CollationBodyRequest{} } -func (m *CollationBodyRequest) String() string { return proto.CompactTextString(m) } -func (*CollationBodyRequest) ProtoMessage() {} -func (*CollationBodyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_6b281833bfe9b3ff, []int{0} -} -func (m *CollationBodyRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CollationBodyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CollationBodyRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CollationBodyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollationBodyRequest.Merge(m, src) -} -func (m *CollationBodyRequest) XXX_Size() int { - return m.Size() -} -func (m *CollationBodyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CollationBodyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CollationBodyRequest proto.InternalMessageInfo - -func (m *CollationBodyRequest) GetShardId() uint64 { - if m != nil { - return m.ShardId - } - return 0 -} - -func (m *CollationBodyRequest) GetPeriod() uint64 { - if m != nil { - return m.Period - } - return 0 -} - -func (m *CollationBodyRequest) GetChunkRoot() []byte { - if m != nil { - return m.ChunkRoot - } - return nil -} - -func (m *CollationBodyRequest) GetProposerAddress() []byte { - if m != nil { - return m.ProposerAddress - } - return nil -} - -func (m *CollationBodyRequest) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -type CollationBodyResponse struct { - HeaderHash []byte `protobuf:"bytes,1,opt,name=header_hash,json=headerHash,proto3" json:"header_hash,omitempty"` - Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollationBodyResponse) Reset() { *m = CollationBodyResponse{} } -func (m *CollationBodyResponse) String() string { return proto.CompactTextString(m) } -func (*CollationBodyResponse) ProtoMessage() {} -func (*CollationBodyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_6b281833bfe9b3ff, []int{1} -} -func (m *CollationBodyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CollationBodyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CollationBodyResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CollationBodyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollationBodyResponse.Merge(m, src) -} -func (m *CollationBodyResponse) XXX_Size() int { - return m.Size() -} -func (m *CollationBodyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CollationBodyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CollationBodyResponse proto.InternalMessageInfo - -func (m *CollationBodyResponse) GetHeaderHash() []byte { - if m != nil { - return m.HeaderHash - } - return nil -} - -func (m *CollationBodyResponse) GetBody() []byte { - if m != nil { - return m.Body - } - return nil -} - -type Transaction struct { - Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` - GasPrice uint64 `protobuf:"varint,2,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` - GasLimit uint64 `protobuf:"varint,3,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - Recipient []byte `protobuf:"bytes,4,opt,name=recipient,proto3" json:"recipient,omitempty"` - Value uint64 `protobuf:"varint,5,opt,name=value,proto3" json:"value,omitempty"` - Input []byte `protobuf:"bytes,6,opt,name=input,proto3" json:"input,omitempty"` - Signature *Signature `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Transaction) Reset() { *m = Transaction{} } -func (m *Transaction) String() string { return proto.CompactTextString(m) } -func (*Transaction) ProtoMessage() {} -func (*Transaction) Descriptor() ([]byte, []int) { - return fileDescriptor_6b281833bfe9b3ff, []int{2} -} -func (m *Transaction) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Transaction.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Transaction) XXX_Merge(src proto.Message) { - xxx_messageInfo_Transaction.Merge(m, src) -} -func (m *Transaction) XXX_Size() int { - return m.Size() -} -func (m *Transaction) XXX_DiscardUnknown() { - xxx_messageInfo_Transaction.DiscardUnknown(m) -} - -var xxx_messageInfo_Transaction proto.InternalMessageInfo - -func (m *Transaction) GetNonce() uint64 { - if m != nil { - return m.Nonce - } - return 0 -} - -func (m *Transaction) GetGasPrice() uint64 { - if m != nil { - return m.GasPrice - } - return 0 -} - -func (m *Transaction) GetGasLimit() uint64 { - if m != nil { - return m.GasLimit - } - return 0 -} - -func (m *Transaction) GetRecipient() []byte { - if m != nil { - return m.Recipient - } - return nil -} - -func (m *Transaction) GetValue() uint64 { - if m != nil { - return m.Value - } - return 0 -} - -func (m *Transaction) GetInput() []byte { - if m != nil { - return m.Input - } - return nil -} - -func (m *Transaction) GetSignature() *Signature { - if m != nil { - return m.Signature - } - return nil -} - -type Signature struct { - V uint64 `protobuf:"varint,1,opt,name=v,proto3" json:"v,omitempty"` - R uint64 `protobuf:"varint,2,opt,name=r,proto3" json:"r,omitempty"` - S uint64 `protobuf:"varint,3,opt,name=s,proto3" json:"s,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Signature) Reset() { *m = Signature{} } -func (m *Signature) String() string { return proto.CompactTextString(m) } -func (*Signature) ProtoMessage() {} -func (*Signature) Descriptor() ([]byte, []int) { - return fileDescriptor_6b281833bfe9b3ff, []int{3} -} -func (m *Signature) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Signature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Signature.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Signature) XXX_Merge(src proto.Message) { - xxx_messageInfo_Signature.Merge(m, src) -} -func (m *Signature) XXX_Size() int { - return m.Size() -} -func (m *Signature) XXX_DiscardUnknown() { - xxx_messageInfo_Signature.DiscardUnknown(m) -} - -var xxx_messageInfo_Signature proto.InternalMessageInfo - -func (m *Signature) GetV() uint64 { - if m != nil { - return m.V - } - return 0 -} - -func (m *Signature) GetR() uint64 { - if m != nil { - return m.R - } - return 0 -} - -func (m *Signature) GetS() uint64 { - if m != nil { - return m.S - } - return 0 -} - -func init() { - proto.RegisterEnum("ethereum.sharding.p2p.v1.Topic", Topic_name, Topic_value) - proto.RegisterType((*CollationBodyRequest)(nil), "ethereum.sharding.p2p.v1.CollationBodyRequest") - proto.RegisterType((*CollationBodyResponse)(nil), "ethereum.sharding.p2p.v1.CollationBodyResponse") - proto.RegisterType((*Transaction)(nil), "ethereum.sharding.p2p.v1.Transaction") - proto.RegisterType((*Signature)(nil), "ethereum.sharding.p2p.v1.Signature") -} - -func init() { - proto.RegisterFile("proto/sharding/p2p/v1/messages.proto", fileDescriptor_6b281833bfe9b3ff) -} - -var fileDescriptor_6b281833bfe9b3ff = []byte{ - // 479 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xdf, 0x6e, 0xd3, 0x3c, - 0x18, 0xc6, 0x3f, 0x6f, 0xfd, 0xb3, 0xbe, 0x8d, 0xf4, 0x45, 0xd6, 0x18, 0x81, 0x41, 0xa9, 0x0a, - 0x07, 0x85, 0x83, 0x54, 0x2b, 0xe2, 0x02, 0xda, 0x52, 0x89, 0x89, 0x2a, 0x19, 0x49, 0x26, 0xc4, - 0x51, 0xe4, 0x25, 0x56, 0x62, 0xd1, 0xda, 0xc6, 0x4e, 0x22, 0xed, 0xb2, 0xb8, 0x0b, 0x0e, 0xb9, - 0x04, 0xd4, 0x43, 0xae, 0x02, 0xc5, 0x49, 0xc7, 0x04, 0xe2, 0x2c, 0xbf, 0xe7, 0x79, 0xe5, 0xbc, - 0x3f, 0x27, 0xf0, 0x42, 0x2a, 0x51, 0x88, 0x99, 0xce, 0x89, 0x4a, 0x19, 0xcf, 0x66, 0x72, 0x2e, - 0x67, 0xd5, 0xc5, 0x6c, 0x47, 0xb5, 0x26, 0x19, 0xd5, 0xae, 0xa9, 0xb1, 0x43, 0x8b, 0x9c, 0x2a, - 0x5a, 0xee, 0xdc, 0xc3, 0xa0, 0x2b, 0xe7, 0xd2, 0xad, 0x2e, 0x26, 0x5f, 0x11, 0x9c, 0xae, 0xc4, - 0x76, 0x4b, 0x0a, 0x26, 0xf8, 0x52, 0xa4, 0xb7, 0x01, 0xfd, 0x52, 0x52, 0x5d, 0xe0, 0x47, 0x70, - 0x62, 0x66, 0x63, 0x96, 0x3a, 0x68, 0x8c, 0xa6, 0x9d, 0xa0, 0x6f, 0xf8, 0x32, 0xc5, 0x67, 0xd0, - 0x93, 0x54, 0x31, 0x91, 0x3a, 0x47, 0xa6, 0x68, 0x09, 0x3f, 0x05, 0x48, 0xf2, 0x92, 0x7f, 0x8e, - 0x95, 0x10, 0x85, 0x73, 0x3c, 0x46, 0x53, 0x2b, 0x18, 0x98, 0x24, 0x10, 0xa2, 0xc0, 0x2f, 0xc1, - 0x96, 0x4a, 0x48, 0xa1, 0xa9, 0x8a, 0x49, 0x9a, 0x2a, 0xaa, 0xb5, 0xd3, 0x31, 0x43, 0xff, 0x1f, - 0xf2, 0x45, 0x13, 0xe3, 0x27, 0x30, 0xd0, 0x2c, 0xe3, 0xa4, 0x28, 0x15, 0x75, 0xba, 0xcd, 0x41, - 0x77, 0xc1, 0x64, 0x03, 0x0f, 0xfe, 0x58, 0x59, 0x4b, 0xc1, 0x35, 0xc5, 0xcf, 0x60, 0x98, 0x53, - 0x92, 0x52, 0x15, 0xe7, 0x44, 0xe7, 0x66, 0x6d, 0x2b, 0x80, 0x26, 0x7a, 0x47, 0x74, 0x8e, 0x31, - 0x74, 0x6e, 0x44, 0x7a, 0x6b, 0xf6, 0xb6, 0x02, 0xf3, 0x3c, 0xf9, 0x89, 0x60, 0x18, 0x29, 0xc2, - 0x35, 0x49, 0xea, 0x03, 0xf1, 0x29, 0x74, 0xb9, 0xe0, 0x09, 0x6d, 0xad, 0x1b, 0xc0, 0xe7, 0x30, - 0xc8, 0x88, 0x8e, 0xa5, 0x62, 0x09, 0x6d, 0xb5, 0x4f, 0x32, 0xa2, 0xaf, 0x6a, 0x3e, 0x94, 0x5b, - 0xb6, 0x63, 0x8d, 0x77, 0x53, 0x6e, 0x6a, 0xae, 0x5d, 0x14, 0x4d, 0x98, 0x64, 0x94, 0x17, 0xad, - 0xef, 0xef, 0xa0, 0x7e, 0x5b, 0x45, 0xb6, 0x65, 0x63, 0xd9, 0x09, 0x1a, 0xa8, 0x53, 0xc6, 0x65, - 0x59, 0x38, 0x3d, 0x33, 0xdf, 0x00, 0x5e, 0xdc, 0xbf, 0x95, 0xfe, 0x18, 0x4d, 0x87, 0xf3, 0xe7, - 0xee, 0xbf, 0xbe, 0xac, 0x1b, 0x1e, 0x46, 0xef, 0x5f, 0xdd, 0x1b, 0x18, 0xdc, 0xe5, 0xd8, 0x02, - 0x54, 0xb5, 0x96, 0xa8, 0xaa, 0x49, 0xb5, 0x66, 0x48, 0xd5, 0xa4, 0x5b, 0x15, 0xa4, 0x5f, 0xc5, - 0xd0, 0x8d, 0x84, 0x64, 0x09, 0x1e, 0x42, 0xff, 0xda, 0x7b, 0xef, 0xf9, 0x1f, 0x3d, 0xfb, 0x3f, - 0xfc, 0x18, 0xce, 0x56, 0xfe, 0x66, 0xb3, 0x88, 0x2e, 0x7d, 0x2f, 0x5e, 0xfa, 0x6f, 0x3f, 0xc5, - 0xc1, 0xfa, 0xc3, 0xf5, 0x3a, 0x8c, 0x6c, 0x84, 0xcf, 0xe1, 0xe1, 0x5f, 0x5d, 0x78, 0xe5, 0x7b, - 0xe1, 0xda, 0x3e, 0xc2, 0x36, 0x58, 0x51, 0xb0, 0xf0, 0xc2, 0xc5, 0xaa, 0xae, 0x43, 0xfb, 0x78, - 0x69, 0x7d, 0xdb, 0x8f, 0xd0, 0xf7, 0xfd, 0x08, 0xfd, 0xd8, 0x8f, 0xd0, 0x4d, 0xcf, 0xfc, 0xb5, - 0xaf, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0xc4, 0x1a, 0xde, 0xa7, 0xdd, 0x02, 0x00, 0x00, -} - -func (m *CollationBodyRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CollationBodyRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ShardId != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintMessages(dAtA, i, uint64(m.ShardId)) - } - if m.Period != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintMessages(dAtA, i, uint64(m.Period)) - } - if len(m.ChunkRoot) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(m.ChunkRoot))) - i += copy(dAtA[i:], m.ChunkRoot) - } - if len(m.ProposerAddress) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(m.ProposerAddress))) - i += copy(dAtA[i:], m.ProposerAddress) - } - if len(m.Signature) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(m.Signature))) - i += copy(dAtA[i:], m.Signature) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *CollationBodyResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CollationBodyResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.HeaderHash) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(m.HeaderHash))) - i += copy(dAtA[i:], m.HeaderHash) - } - if len(m.Body) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(m.Body))) - i += copy(dAtA[i:], m.Body) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Transaction) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Transaction) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Nonce != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintMessages(dAtA, i, uint64(m.Nonce)) - } - if m.GasPrice != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintMessages(dAtA, i, uint64(m.GasPrice)) - } - if m.GasLimit != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintMessages(dAtA, i, uint64(m.GasLimit)) - } - if len(m.Recipient) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(m.Recipient))) - i += copy(dAtA[i:], m.Recipient) - } - if m.Value != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintMessages(dAtA, i, uint64(m.Value)) - } - if len(m.Input) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(m.Input))) - i += copy(dAtA[i:], m.Input) - } - if m.Signature != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintMessages(dAtA, i, uint64(m.Signature.Size())) - n1, err := m.Signature.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Signature) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Signature) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.V != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintMessages(dAtA, i, uint64(m.V)) - } - if m.R != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintMessages(dAtA, i, uint64(m.R)) - } - if m.S != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintMessages(dAtA, i, uint64(m.S)) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeVarintMessages(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *CollationBodyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ShardId != 0 { - n += 1 + sovMessages(uint64(m.ShardId)) - } - if m.Period != 0 { - n += 1 + sovMessages(uint64(m.Period)) - } - l = len(m.ChunkRoot) - if l > 0 { - n += 1 + l + sovMessages(uint64(l)) - } - l = len(m.ProposerAddress) - if l > 0 { - n += 1 + l + sovMessages(uint64(l)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *CollationBodyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.HeaderHash) - if l > 0 { - n += 1 + l + sovMessages(uint64(l)) - } - l = len(m.Body) - if l > 0 { - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Transaction) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Nonce != 0 { - n += 1 + sovMessages(uint64(m.Nonce)) - } - if m.GasPrice != 0 { - n += 1 + sovMessages(uint64(m.GasPrice)) - } - if m.GasLimit != 0 { - n += 1 + sovMessages(uint64(m.GasLimit)) - } - l = len(m.Recipient) - if l > 0 { - n += 1 + l + sovMessages(uint64(l)) - } - if m.Value != 0 { - n += 1 + sovMessages(uint64(m.Value)) - } - l = len(m.Input) - if l > 0 { - n += 1 + l + sovMessages(uint64(l)) - } - if m.Signature != nil { - l = m.Signature.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Signature) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.V != 0 { - n += 1 + sovMessages(uint64(m.V)) - } - if m.R != 0 { - n += 1 + sovMessages(uint64(m.R)) - } - if m.S != 0 { - n += 1 + sovMessages(uint64(m.S)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovMessages(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozMessages(x uint64) (n int) { - return sovMessages(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *CollationBodyRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CollationBodyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CollationBodyRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ShardId", wireType) - } - m.ShardId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ShardId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) - } - m.Period = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Period |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunkRoot", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthMessages - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChunkRoot = append(m.ChunkRoot[:0], dAtA[iNdEx:postIndex]...) - if m.ChunkRoot == nil { - m.ChunkRoot = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthMessages - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) - if m.ProposerAddress == nil { - m.ProposerAddress = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthMessages - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMessages(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CollationBodyResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CollationBodyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CollationBodyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HeaderHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthMessages - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HeaderHash = append(m.HeaderHash[:0], dAtA[iNdEx:postIndex]...) - if m.HeaderHash == nil { - m.HeaderHash = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthMessages - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Body = append(m.Body[:0], dAtA[iNdEx:postIndex]...) - if m.Body == nil { - m.Body = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMessages(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Transaction) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Transaction: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Transaction: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) - } - m.Nonce = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Nonce |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasPrice", wireType) - } - m.GasPrice = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GasPrice |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasLimit", wireType) - } - m.GasLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GasLimit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthMessages - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Recipient = append(m.Recipient[:0], dAtA[iNdEx:postIndex]...) - if m.Recipient == nil { - m.Recipient = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - m.Value = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Value |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Input", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthMessages - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Input = append(m.Input[:0], dAtA[iNdEx:postIndex]...) - if m.Input == nil { - m.Input = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMessages - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Signature == nil { - m.Signature = &Signature{} - } - if err := m.Signature.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMessages(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Signature) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Signature: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Signature: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field V", wireType) - } - m.V = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.V |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field R", wireType) - } - m.R = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.R |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field S", wireType) - } - m.S = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.S |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipMessages(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipMessages(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMessages - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMessages - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMessages - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthMessages - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthMessages - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMessages - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipMessages(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthMessages - } - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthMessages = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMessages = fmt.Errorf("proto: integer overflow") -) diff --git a/proto/sharding/p2p/v1/messages.proto b/proto/sharding/p2p/v1/messages.proto deleted file mode 100644 index a4fd0b9a03..0000000000 --- a/proto/sharding/p2p/v1/messages.proto +++ /dev/null @@ -1,39 +0,0 @@ -syntax = "proto3"; - -package ethereum.sharding.p2p.v1; - -enum Topic { - UNKNOWN = 0; - COLLATION_BODY_REQUEST = 1; - COLLATION_BODY_RESPONSE = 2; - TRANSACTIONS = 3; -} - -message CollationBodyRequest { - uint64 shard_id = 1; - uint64 period = 2; - bytes chunk_root = 3; - bytes proposer_address = 4; - bytes signature = 5; -} - -message CollationBodyResponse { - bytes header_hash = 1; - bytes body = 2; -} - -message Transaction { - uint64 nonce = 1; - uint64 gas_price = 2; - uint64 gas_limit = 3; - bytes recipient = 4; - uint64 value = 5; - bytes input = 6; - Signature signature = 7; -} - -message Signature { - uint64 v = 1; - uint64 r = 2; - uint64 s = 3; -} diff --git a/proto/slashing/BUILD.bazel b/proto/slashing/BUILD.bazel new file mode 100644 index 0000000000..265d42c9a8 --- /dev/null +++ b/proto/slashing/BUILD.bazel @@ -0,0 +1,33 @@ +load("@rules_proto//proto:defs.bzl", "proto_library") + +# gazelle:ignore +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") + +proto_library( + name = "ethereum_slashing_proto", + srcs = ["slashing.proto"], + visibility = ["//visibility:public"], + deps = [ + "@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:proto", + "@com_google_protobuf//:empty_proto", + ], +) + +go_proto_library( + name = "ethereum_slashing_go_proto", + compilers = ["@io_bazel_rules_go//proto:go_grpc"], + importpath = "github.com/prysmaticlabs/prysm/proto/slashing", + proto = ":ethereum_slashing_proto", + visibility = ["//visibility:public"], + deps = [ + "@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library", + ], +) + +go_library( + name = "go_default_library", + embed = [":ethereum_slashing_go_proto"], + importpath = "github.com/prysmaticlabs/prysm/proto/slashing", + visibility = ["//visibility:public"], +) diff --git a/proto/slashing/slashing.pb.go b/proto/slashing/slashing.pb.go new file mode 100644 index 0000000000..1d4048e659 --- /dev/null +++ b/proto/slashing/slashing.pb.go @@ -0,0 +1,630 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: proto/slashing/slashing.proto + +package ethereum_slashing + +import ( + context "context" + fmt "fmt" + math "math" + + proto "github.com/golang/protobuf/proto" + empty "github.com/golang/protobuf/ptypes/empty" + v1alpha1 "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type ValidatorIDToIdxAtt struct { + Indices []uint64 `protobuf:"varint,1,rep,packed,name=indices,proto3" json:"indices,omitempty"` + DataRoot []byte `protobuf:"bytes,2,opt,name=data_root,json=dataRoot,proto3" json:"data_root,omitempty"` + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ValidatorIDToIdxAtt) Reset() { *m = ValidatorIDToIdxAtt{} } +func (m *ValidatorIDToIdxAtt) String() string { return proto.CompactTextString(m) } +func (*ValidatorIDToIdxAtt) ProtoMessage() {} +func (*ValidatorIDToIdxAtt) Descriptor() ([]byte, []int) { + return fileDescriptor_da7e95107d0081b4, []int{0} +} + +func (m *ValidatorIDToIdxAtt) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ValidatorIDToIdxAtt.Unmarshal(m, b) +} +func (m *ValidatorIDToIdxAtt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ValidatorIDToIdxAtt.Marshal(b, m, deterministic) +} +func (m *ValidatorIDToIdxAtt) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorIDToIdxAtt.Merge(m, src) +} +func (m *ValidatorIDToIdxAtt) XXX_Size() int { + return xxx_messageInfo_ValidatorIDToIdxAtt.Size(m) +} +func (m *ValidatorIDToIdxAtt) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorIDToIdxAtt.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorIDToIdxAtt proto.InternalMessageInfo + +func (m *ValidatorIDToIdxAtt) GetIndices() []uint64 { + if m != nil { + return m.Indices + } + return nil +} + +func (m *ValidatorIDToIdxAtt) GetDataRoot() []byte { + if m != nil { + return m.DataRoot + } + return nil +} + +func (m *ValidatorIDToIdxAtt) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +type ValidatorIDToIdxAttList struct { + IndicesList []*ValidatorIDToIdxAtt `protobuf:"bytes,1,rep,name=indicesList,proto3" json:"indicesList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ValidatorIDToIdxAttList) Reset() { *m = ValidatorIDToIdxAttList{} } +func (m *ValidatorIDToIdxAttList) String() string { return proto.CompactTextString(m) } +func (*ValidatorIDToIdxAttList) ProtoMessage() {} +func (*ValidatorIDToIdxAttList) Descriptor() ([]byte, []int) { + return fileDescriptor_da7e95107d0081b4, []int{1} +} + +func (m *ValidatorIDToIdxAttList) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ValidatorIDToIdxAttList.Unmarshal(m, b) +} +func (m *ValidatorIDToIdxAttList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ValidatorIDToIdxAttList.Marshal(b, m, deterministic) +} +func (m *ValidatorIDToIdxAttList) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorIDToIdxAttList.Merge(m, src) +} +func (m *ValidatorIDToIdxAttList) XXX_Size() int { + return xxx_messageInfo_ValidatorIDToIdxAttList.Size(m) +} +func (m *ValidatorIDToIdxAttList) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorIDToIdxAttList.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorIDToIdxAttList proto.InternalMessageInfo + +func (m *ValidatorIDToIdxAttList) GetIndicesList() []*ValidatorIDToIdxAtt { + if m != nil { + return m.IndicesList + } + return nil +} + +type ProposerSlashingRequest struct { + BlockHeader *v1alpha1.BeaconBlockHeader `protobuf:"bytes,1,opt,name=block_header,json=blockHeader,proto3" json:"block_header,omitempty"` + ValidatorIndex uint64 `protobuf:"varint,2,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ProposerSlashingRequest) Reset() { *m = ProposerSlashingRequest{} } +func (m *ProposerSlashingRequest) String() string { return proto.CompactTextString(m) } +func (*ProposerSlashingRequest) ProtoMessage() {} +func (*ProposerSlashingRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_da7e95107d0081b4, []int{2} +} + +func (m *ProposerSlashingRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ProposerSlashingRequest.Unmarshal(m, b) +} +func (m *ProposerSlashingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ProposerSlashingRequest.Marshal(b, m, deterministic) +} +func (m *ProposerSlashingRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposerSlashingRequest.Merge(m, src) +} +func (m *ProposerSlashingRequest) XXX_Size() int { + return xxx_messageInfo_ProposerSlashingRequest.Size(m) +} +func (m *ProposerSlashingRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ProposerSlashingRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposerSlashingRequest proto.InternalMessageInfo + +func (m *ProposerSlashingRequest) GetBlockHeader() *v1alpha1.BeaconBlockHeader { + if m != nil { + return m.BlockHeader + } + return nil +} + +func (m *ProposerSlashingRequest) GetValidatorIndex() uint64 { + if m != nil { + return m.ValidatorIndex + } + return 0 +} + +type ProposerSlashingResponse struct { + ProposerSlashing []*v1alpha1.ProposerSlashing `protobuf:"bytes,1,rep,name=proposer_slashing,json=proposerSlashing,proto3" json:"proposer_slashing,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ProposerSlashingResponse) Reset() { *m = ProposerSlashingResponse{} } +func (m *ProposerSlashingResponse) String() string { return proto.CompactTextString(m) } +func (*ProposerSlashingResponse) ProtoMessage() {} +func (*ProposerSlashingResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_da7e95107d0081b4, []int{3} +} + +func (m *ProposerSlashingResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ProposerSlashingResponse.Unmarshal(m, b) +} +func (m *ProposerSlashingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ProposerSlashingResponse.Marshal(b, m, deterministic) +} +func (m *ProposerSlashingResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposerSlashingResponse.Merge(m, src) +} +func (m *ProposerSlashingResponse) XXX_Size() int { + return xxx_messageInfo_ProposerSlashingResponse.Size(m) +} +func (m *ProposerSlashingResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ProposerSlashingResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposerSlashingResponse proto.InternalMessageInfo + +func (m *ProposerSlashingResponse) GetProposerSlashing() []*v1alpha1.ProposerSlashing { + if m != nil { + return m.ProposerSlashing + } + return nil +} + +type AttesterSlashingResponse struct { + AttesterSlashing []*v1alpha1.AttesterSlashing `protobuf:"bytes,1,rep,name=attester_slashing,json=attesterSlashing,proto3" json:"attester_slashing,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AttesterSlashingResponse) Reset() { *m = AttesterSlashingResponse{} } +func (m *AttesterSlashingResponse) String() string { return proto.CompactTextString(m) } +func (*AttesterSlashingResponse) ProtoMessage() {} +func (*AttesterSlashingResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_da7e95107d0081b4, []int{4} +} + +func (m *AttesterSlashingResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AttesterSlashingResponse.Unmarshal(m, b) +} +func (m *AttesterSlashingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AttesterSlashingResponse.Marshal(b, m, deterministic) +} +func (m *AttesterSlashingResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AttesterSlashingResponse.Merge(m, src) +} +func (m *AttesterSlashingResponse) XXX_Size() int { + return xxx_messageInfo_AttesterSlashingResponse.Size(m) +} +func (m *AttesterSlashingResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AttesterSlashingResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AttesterSlashingResponse proto.InternalMessageInfo + +func (m *AttesterSlashingResponse) GetAttesterSlashing() []*v1alpha1.AttesterSlashing { + if m != nil { + return m.AttesterSlashing + } + return nil +} + +type MinMaxEpochSpan struct { + MinEpochSpan uint32 `protobuf:"varint,1,opt,name=min_epoch_span,json=minEpochSpan,proto3" json:"min_epoch_span,omitempty"` + MaxEpochSpan uint32 `protobuf:"varint,2,opt,name=max_epoch_span,json=maxEpochSpan,proto3" json:"max_epoch_span,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MinMaxEpochSpan) Reset() { *m = MinMaxEpochSpan{} } +func (m *MinMaxEpochSpan) String() string { return proto.CompactTextString(m) } +func (*MinMaxEpochSpan) ProtoMessage() {} +func (*MinMaxEpochSpan) Descriptor() ([]byte, []int) { + return fileDescriptor_da7e95107d0081b4, []int{5} +} + +func (m *MinMaxEpochSpan) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MinMaxEpochSpan.Unmarshal(m, b) +} +func (m *MinMaxEpochSpan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MinMaxEpochSpan.Marshal(b, m, deterministic) +} +func (m *MinMaxEpochSpan) XXX_Merge(src proto.Message) { + xxx_messageInfo_MinMaxEpochSpan.Merge(m, src) +} +func (m *MinMaxEpochSpan) XXX_Size() int { + return xxx_messageInfo_MinMaxEpochSpan.Size(m) +} +func (m *MinMaxEpochSpan) XXX_DiscardUnknown() { + xxx_messageInfo_MinMaxEpochSpan.DiscardUnknown(m) +} + +var xxx_messageInfo_MinMaxEpochSpan proto.InternalMessageInfo + +func (m *MinMaxEpochSpan) GetMinEpochSpan() uint32 { + if m != nil { + return m.MinEpochSpan + } + return 0 +} + +func (m *MinMaxEpochSpan) GetMaxEpochSpan() uint32 { + if m != nil { + return m.MaxEpochSpan + } + return 0 +} + +type EpochSpanMap struct { + EpochSpanMap map[uint64]*MinMaxEpochSpan `protobuf:"bytes,1,rep,name=epoch_span_map,json=epochSpanMap,proto3" json:"epoch_span_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EpochSpanMap) Reset() { *m = EpochSpanMap{} } +func (m *EpochSpanMap) String() string { return proto.CompactTextString(m) } +func (*EpochSpanMap) ProtoMessage() {} +func (*EpochSpanMap) Descriptor() ([]byte, []int) { + return fileDescriptor_da7e95107d0081b4, []int{6} +} + +func (m *EpochSpanMap) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EpochSpanMap.Unmarshal(m, b) +} +func (m *EpochSpanMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EpochSpanMap.Marshal(b, m, deterministic) +} +func (m *EpochSpanMap) XXX_Merge(src proto.Message) { + xxx_messageInfo_EpochSpanMap.Merge(m, src) +} +func (m *EpochSpanMap) XXX_Size() int { + return xxx_messageInfo_EpochSpanMap.Size(m) +} +func (m *EpochSpanMap) XXX_DiscardUnknown() { + xxx_messageInfo_EpochSpanMap.DiscardUnknown(m) +} + +var xxx_messageInfo_EpochSpanMap proto.InternalMessageInfo + +func (m *EpochSpanMap) GetEpochSpanMap() map[uint64]*MinMaxEpochSpan { + if m != nil { + return m.EpochSpanMap + } + return nil +} + +func init() { + proto.RegisterType((*ValidatorIDToIdxAtt)(nil), "ethereum.slashing.ValidatorIDToIdxAtt") + proto.RegisterType((*ValidatorIDToIdxAttList)(nil), "ethereum.slashing.ValidatorIDToIdxAttList") + proto.RegisterType((*ProposerSlashingRequest)(nil), "ethereum.slashing.ProposerSlashingRequest") + proto.RegisterType((*ProposerSlashingResponse)(nil), "ethereum.slashing.ProposerSlashingResponse") + proto.RegisterType((*AttesterSlashingResponse)(nil), "ethereum.slashing.AttesterSlashingResponse") + proto.RegisterType((*MinMaxEpochSpan)(nil), "ethereum.slashing.MinMaxEpochSpan") + proto.RegisterType((*EpochSpanMap)(nil), "ethereum.slashing.EpochSpanMap") + proto.RegisterMapType((map[uint64]*MinMaxEpochSpan)(nil), "ethereum.slashing.EpochSpanMap.EpochSpanMapEntry") +} + +func init() { proto.RegisterFile("proto/slashing/slashing.proto", fileDescriptor_da7e95107d0081b4) } + +var fileDescriptor_da7e95107d0081b4 = []byte{ + // 583 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xd1, 0x6e, 0xd3, 0x4a, + 0x10, 0x95, 0x9b, 0xde, 0x5b, 0x3a, 0x09, 0x6d, 0xba, 0x88, 0xd6, 0x4a, 0x41, 0x54, 0x16, 0xa2, + 0x01, 0x24, 0xa7, 0x0d, 0x2f, 0x15, 0x6f, 0xad, 0x88, 0xd4, 0x08, 0x22, 0x21, 0xb7, 0xa2, 0x12, + 0x12, 0xb2, 0xd6, 0xf6, 0x10, 0x9b, 0x38, 0xbb, 0x8b, 0x77, 0x13, 0x25, 0x5f, 0xc1, 0x17, 0xf0, + 0x47, 0x7c, 0x14, 0xf2, 0xda, 0x4e, 0xdc, 0xc4, 0x91, 0xca, 0x9b, 0xe7, 0xcc, 0x99, 0x39, 0x33, + 0x27, 0x93, 0x85, 0xe7, 0x22, 0xe1, 0x8a, 0x77, 0x64, 0x4c, 0x65, 0x18, 0xb1, 0xe1, 0xe2, 0xc3, + 0xd6, 0x38, 0x39, 0x40, 0x15, 0x62, 0x82, 0x93, 0xb1, 0x5d, 0x24, 0x5a, 0xc7, 0x43, 0xce, 0x87, + 0x31, 0x76, 0x34, 0xc1, 0x9b, 0x7c, 0xef, 0xe0, 0x58, 0xa8, 0x79, 0xc6, 0x6f, 0xbd, 0x40, 0x15, + 0x76, 0xa6, 0xe7, 0x34, 0x16, 0x21, 0x3d, 0xef, 0x78, 0x48, 0x7d, 0xce, 0x5c, 0x2f, 0xe6, 0xfe, + 0x28, 0x23, 0x58, 0x3f, 0xe0, 0xc9, 0x17, 0x1a, 0x47, 0x01, 0x55, 0x3c, 0xe9, 0x7f, 0xb8, 0xe5, + 0xfd, 0x60, 0x76, 0xa9, 0x14, 0x31, 0x61, 0x27, 0x62, 0x41, 0xe4, 0xa3, 0x34, 0x8d, 0x93, 0x5a, + 0x7b, 0xdb, 0x29, 0x42, 0x72, 0x0c, 0xbb, 0x01, 0x55, 0xd4, 0x4d, 0x38, 0x57, 0xe6, 0xd6, 0x89, + 0xd1, 0x6e, 0x38, 0x8f, 0x52, 0xc0, 0xe1, 0x5c, 0x91, 0x67, 0xb0, 0x2b, 0xa3, 0x21, 0xa3, 0x6a, + 0x92, 0xa0, 0x59, 0xd3, 0xc9, 0x25, 0x60, 0xf9, 0x70, 0x54, 0xa1, 0xf5, 0x29, 0x92, 0x8a, 0x5c, + 0x43, 0x3d, 0x17, 0x48, 0x43, 0xad, 0x59, 0xef, 0xbe, 0xb2, 0xd7, 0xb6, 0xb5, 0x2b, 0x1a, 0x38, + 0xe5, 0x52, 0xeb, 0x97, 0x01, 0x47, 0x9f, 0x13, 0x2e, 0xb8, 0xc4, 0xe4, 0x26, 0xaf, 0x72, 0xf0, + 0xe7, 0x04, 0xa5, 0x22, 0x1f, 0xa1, 0xa1, 0x77, 0x77, 0x43, 0xa4, 0x01, 0x26, 0xa6, 0x71, 0x62, + 0xb4, 0xeb, 0xdd, 0xf6, 0x52, 0x06, 0x55, 0x68, 0x17, 0x6e, 0xd9, 0x57, 0xda, 0xad, 0xab, 0xb4, + 0xe0, 0x5a, 0xf3, 0x9d, 0xba, 0xb7, 0x0c, 0xc8, 0x29, 0xec, 0x4f, 0x8b, 0x61, 0xdc, 0x88, 0x05, + 0x38, 0xd3, 0x76, 0x6c, 0x3b, 0x7b, 0x0b, 0xb8, 0x9f, 0xa2, 0x96, 0x00, 0x73, 0x7d, 0x20, 0x29, + 0x38, 0x93, 0x48, 0x6e, 0xe1, 0x40, 0xe4, 0x39, 0xb7, 0xd8, 0x31, 0xdf, 0xfe, 0x74, 0xc3, 0x58, + 0x6b, 0xbd, 0x9a, 0x62, 0x05, 0x49, 0x15, 0x2f, 0x95, 0x42, 0xa9, 0xaa, 0x15, 0x69, 0x9e, 0x7b, + 0xa8, 0xe2, 0x5a, 0xaf, 0x26, 0x5d, 0x41, 0xac, 0x6f, 0xb0, 0x3f, 0x88, 0xd8, 0x80, 0xce, 0x7a, + 0x82, 0xfb, 0xe1, 0x8d, 0xa0, 0x8c, 0xbc, 0x84, 0xbd, 0x71, 0xc4, 0x5c, 0x4c, 0x01, 0x57, 0x0a, + 0xca, 0xb4, 0xdd, 0x8f, 0x9d, 0xc6, 0x38, 0x62, 0xf7, 0x59, 0x74, 0x56, 0x66, 0x6d, 0xe5, 0xac, + 0x52, 0x2f, 0xeb, 0x8f, 0x01, 0x8d, 0x45, 0x34, 0xa0, 0x82, 0xdc, 0xc1, 0xde, 0xb2, 0xc4, 0x1d, + 0x53, 0x91, 0xaf, 0x70, 0x5e, 0x71, 0x32, 0xe5, 0xc2, 0x7b, 0x41, 0x8f, 0xa9, 0x64, 0xee, 0x34, + 0xb0, 0x04, 0xb5, 0x7c, 0x38, 0x58, 0xa3, 0x90, 0x26, 0xd4, 0x46, 0x38, 0xd7, 0xf3, 0x6f, 0x3b, + 0xe9, 0x27, 0xb9, 0x80, 0xff, 0xa6, 0x34, 0x9e, 0xa0, 0x9e, 0xb6, 0xde, 0xb5, 0x2a, 0x64, 0x57, + 0xfc, 0x70, 0xb2, 0x82, 0xf7, 0x5b, 0x17, 0x46, 0xf7, 0x77, 0x0d, 0x76, 0xb4, 0x75, 0x98, 0x10, + 0x01, 0x87, 0x7d, 0xa9, 0x03, 0xea, 0xc5, 0x98, 0x59, 0x4d, 0x55, 0xc4, 0x19, 0x79, 0xbd, 0xe1, + 0xe7, 0xd0, 0x57, 0x85, 0x41, 0x89, 0xda, 0x7a, 0x5b, 0xa1, 0xbf, 0xf1, 0x02, 0x46, 0xd0, 0x2c, + 0x29, 0xea, 0xfb, 0x26, 0x6f, 0x2a, 0x1a, 0x6c, 0xf8, 0x17, 0x55, 0x8a, 0x6d, 0x3c, 0xf0, 0x3b, + 0x20, 0x0b, 0xa9, 0x8c, 0x44, 0x63, 0x49, 0x0e, 0xed, 0xec, 0xd1, 0xb2, 0x8b, 0x47, 0xcb, 0xee, + 0xa5, 0x8f, 0x56, 0xeb, 0xa1, 0x37, 0x7f, 0x66, 0x90, 0xaf, 0xf0, 0xb4, 0xca, 0xb5, 0x7f, 0xef, + 0xbd, 0xea, 0xd3, 0x99, 0xe1, 0xfd, 0xaf, 0x4b, 0xdf, 0xfd, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x52, + 0xc8, 0x82, 0x62, 0x8d, 0x05, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// SlasherClient is the client API for Slasher service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type SlasherClient interface { + IsSlashableAttestation(ctx context.Context, in *v1alpha1.IndexedAttestation, opts ...grpc.CallOption) (*AttesterSlashingResponse, error) + IsSlashableBlock(ctx context.Context, in *ProposerSlashingRequest, opts ...grpc.CallOption) (*ProposerSlashingResponse, error) + SlashableProposals(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (Slasher_SlashableProposalsClient, error) + SlashableAttestations(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (Slasher_SlashableAttestationsClient, error) +} + +type slasherClient struct { + cc *grpc.ClientConn +} + +func NewSlasherClient(cc *grpc.ClientConn) SlasherClient { + return &slasherClient{cc} +} + +func (c *slasherClient) IsSlashableAttestation(ctx context.Context, in *v1alpha1.IndexedAttestation, opts ...grpc.CallOption) (*AttesterSlashingResponse, error) { + out := new(AttesterSlashingResponse) + err := c.cc.Invoke(ctx, "/ethereum.slashing.Slasher/IsSlashableAttestation", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *slasherClient) IsSlashableBlock(ctx context.Context, in *ProposerSlashingRequest, opts ...grpc.CallOption) (*ProposerSlashingResponse, error) { + out := new(ProposerSlashingResponse) + err := c.cc.Invoke(ctx, "/ethereum.slashing.Slasher/IsSlashableBlock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *slasherClient) SlashableProposals(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (Slasher_SlashableProposalsClient, error) { + stream, err := c.cc.NewStream(ctx, &_Slasher_serviceDesc.Streams[0], "/ethereum.slashing.Slasher/SlashableProposals", opts...) + if err != nil { + return nil, err + } + x := &slasherSlashableProposalsClient{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 Slasher_SlashableProposalsClient interface { + Recv() (*v1alpha1.ProposerSlashing, error) + grpc.ClientStream +} + +type slasherSlashableProposalsClient struct { + grpc.ClientStream +} + +func (x *slasherSlashableProposalsClient) Recv() (*v1alpha1.ProposerSlashing, error) { + m := new(v1alpha1.ProposerSlashing) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *slasherClient) SlashableAttestations(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (Slasher_SlashableAttestationsClient, error) { + stream, err := c.cc.NewStream(ctx, &_Slasher_serviceDesc.Streams[1], "/ethereum.slashing.Slasher/SlashableAttestations", opts...) + if err != nil { + return nil, err + } + x := &slasherSlashableAttestationsClient{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 Slasher_SlashableAttestationsClient interface { + Recv() (*v1alpha1.AttesterSlashing, error) + grpc.ClientStream +} + +type slasherSlashableAttestationsClient struct { + grpc.ClientStream +} + +func (x *slasherSlashableAttestationsClient) Recv() (*v1alpha1.AttesterSlashing, error) { + m := new(v1alpha1.AttesterSlashing) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// SlasherServer is the server API for Slasher service. +type SlasherServer interface { + IsSlashableAttestation(context.Context, *v1alpha1.IndexedAttestation) (*AttesterSlashingResponse, error) + IsSlashableBlock(context.Context, *ProposerSlashingRequest) (*ProposerSlashingResponse, error) + SlashableProposals(*empty.Empty, Slasher_SlashableProposalsServer) error + SlashableAttestations(*empty.Empty, Slasher_SlashableAttestationsServer) error +} + +// UnimplementedSlasherServer can be embedded to have forward compatible implementations. +type UnimplementedSlasherServer struct { +} + +func (*UnimplementedSlasherServer) IsSlashableAttestation(ctx context.Context, req *v1alpha1.IndexedAttestation) (*AttesterSlashingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IsSlashableAttestation not implemented") +} +func (*UnimplementedSlasherServer) IsSlashableBlock(ctx context.Context, req *ProposerSlashingRequest) (*ProposerSlashingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IsSlashableBlock not implemented") +} +func (*UnimplementedSlasherServer) SlashableProposals(req *empty.Empty, srv Slasher_SlashableProposalsServer) error { + return status.Errorf(codes.Unimplemented, "method SlashableProposals not implemented") +} +func (*UnimplementedSlasherServer) SlashableAttestations(req *empty.Empty, srv Slasher_SlashableAttestationsServer) error { + return status.Errorf(codes.Unimplemented, "method SlashableAttestations not implemented") +} + +func RegisterSlasherServer(s *grpc.Server, srv SlasherServer) { + s.RegisterService(&_Slasher_serviceDesc, srv) +} + +func _Slasher_IsSlashableAttestation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(v1alpha1.IndexedAttestation) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SlasherServer).IsSlashableAttestation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.slashing.Slasher/IsSlashableAttestation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SlasherServer).IsSlashableAttestation(ctx, req.(*v1alpha1.IndexedAttestation)) + } + return interceptor(ctx, in, info, handler) +} + +func _Slasher_IsSlashableBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProposerSlashingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SlasherServer).IsSlashableBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.slashing.Slasher/IsSlashableBlock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SlasherServer).IsSlashableBlock(ctx, req.(*ProposerSlashingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Slasher_SlashableProposals_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(empty.Empty) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(SlasherServer).SlashableProposals(m, &slasherSlashableProposalsServer{stream}) +} + +type Slasher_SlashableProposalsServer interface { + Send(*v1alpha1.ProposerSlashing) error + grpc.ServerStream +} + +type slasherSlashableProposalsServer struct { + grpc.ServerStream +} + +func (x *slasherSlashableProposalsServer) Send(m *v1alpha1.ProposerSlashing) error { + return x.ServerStream.SendMsg(m) +} + +func _Slasher_SlashableAttestations_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(empty.Empty) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(SlasherServer).SlashableAttestations(m, &slasherSlashableAttestationsServer{stream}) +} + +type Slasher_SlashableAttestationsServer interface { + Send(*v1alpha1.AttesterSlashing) error + grpc.ServerStream +} + +type slasherSlashableAttestationsServer struct { + grpc.ServerStream +} + +func (x *slasherSlashableAttestationsServer) Send(m *v1alpha1.AttesterSlashing) error { + return x.ServerStream.SendMsg(m) +} + +var _Slasher_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ethereum.slashing.Slasher", + HandlerType: (*SlasherServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "IsSlashableAttestation", + Handler: _Slasher_IsSlashableAttestation_Handler, + }, + { + MethodName: "IsSlashableBlock", + Handler: _Slasher_IsSlashableBlock_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "SlashableProposals", + Handler: _Slasher_SlashableProposals_Handler, + ServerStreams: true, + }, + { + StreamName: "SlashableAttestations", + Handler: _Slasher_SlashableAttestations_Handler, + ServerStreams: true, + }, + }, + Metadata: "proto/slashing/slashing.proto", +} diff --git a/proto/beacon/rpc/v1/slasher.proto b/proto/slashing/slashing.proto similarity index 91% rename from proto/beacon/rpc/v1/slasher.proto rename to proto/slashing/slashing.proto index f783bf3a55..aae03b35c2 100644 --- a/proto/beacon/rpc/v1/slasher.proto +++ b/proto/slashing/slashing.proto @@ -1,28 +1,28 @@ syntax = "proto3"; -package ethereum.beacon.rpc.v1; +package ethereum.slashing; import "google/protobuf/empty.proto"; import "eth/v1alpha1/beacon_block.proto"; // Slasher service API -// +// // Slasher service provides an interface for validators and beacon chain server to query -// and subscribe for slashable events on the network as well as to make sure that the -// attestation or proposal they are going to submit to the network are not going to +// and subscribe for slashable events on the network as well as to make sure that the +// attestation or proposal they are going to submit to the network are not going to // produce a slashable event. service Slasher { - // Gets AttesterSlashing container if the attestation that + // Gets AttesterSlashing container if the attestation that // was received produces a slashable event. rpc IsSlashableAttestation(ethereum.eth.v1alpha1.IndexedAttestation) returns (AttesterSlashingResponse); - // Gets ProposerSlashing container if the block header that + // Gets ProposerSlashing container if the block header that // was received produces a slashable event. rpc IsSlashableBlock(ProposerSlashingRequest) returns (ProposerSlashingResponse); // Subscription to receive all slashable proposer slashing events found by the watchtower. rpc SlashableProposals(google.protobuf.Empty) returns (stream ethereum.eth.v1alpha1.ProposerSlashing); - + // Subscription to receive all slashable attester slashing events found by the watchtower. rpc SlashableAttestations(google.protobuf.Empty) returns (stream ethereum.eth.v1alpha1.AttesterSlashing); } diff --git a/slasher/db/BUILD.bazel b/slasher/db/BUILD.bazel index 83a02b06a1..5c67d5fd32 100644 --- a/slasher/db/BUILD.bazel +++ b/slasher/db/BUILD.bazel @@ -14,7 +14,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/slasher/db", visibility = ["//slasher:__subpackages__"], deps = [ - "//proto/beacon/rpc/v1:go_default_library", + "//proto/slashing:go_default_library", "//shared/bytesutil:go_default_library", "//shared/params:go_default_library", "@com_github_boltdb_bolt//:go_default_library", @@ -37,7 +37,7 @@ go_test( ], embed = [":go_default_library"], deps = [ - "//proto/beacon/rpc/v1:go_default_library", + "//proto/slashing:go_default_library", "@com_github_gogo_protobuf//proto:go_default_library", "@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library", ], diff --git a/slasher/db/indexed_attestations.go b/slasher/db/indexed_attestations.go index b939c03a36..36ef8e556a 100644 --- a/slasher/db/indexed_attestations.go +++ b/slasher/db/indexed_attestations.go @@ -10,7 +10,7 @@ import ( "github.com/pkg/errors" ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" "github.com/prysmaticlabs/go-ssz" - pb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" + slashpb "github.com/prysmaticlabs/prysm/proto/slashing" "github.com/prysmaticlabs/prysm/shared/bytesutil" "github.com/prysmaticlabs/prysm/shared/params" ) @@ -24,8 +24,8 @@ func createIndexedAttestation(enc []byte) (*ethpb.IndexedAttestation, error) { return protoIdxAtt, nil } -func createValidatorIDsToIndexedAttestationList(enc []byte) (*pb.ValidatorIDToIdxAttList, error) { - protoIdxAtt := &pb.ValidatorIDToIdxAttList{} +func createValidatorIDsToIndexedAttestationList(enc []byte) (*slashpb.ValidatorIDToIdxAttList, error) { + protoIdxAtt := &slashpb.ValidatorIDToIdxAttList{} err := proto.Unmarshal(enc, protoIdxAtt) if err != nil { return nil, errors.Wrap(err, "failed to unmarshal encoding") @@ -158,7 +158,7 @@ func createIndexedAttestationIndicesFromData(idxAttestation *ethpb.IndexedAttest if err != nil { return errors.Wrap(err, "failed to hash indexed attestation data.") } - protoIdxAtt := &pb.ValidatorIDToIdxAtt{ + protoIdxAtt := &slashpb.ValidatorIDToIdxAtt{ Signature: idxAttestation.Signature, Indices: indices, DataRoot: dataRoot[:], @@ -203,7 +203,7 @@ func (db *Store) DeleteIndexedAttestation(idxAttestation *ethpb.IndexedAttestati func removeIndexedAttestationIndicesFromData(idxAttestation *ethpb.IndexedAttestation, tx *bolt.Tx) error { indices := append(idxAttestation.CustodyBit_0Indices, idxAttestation.CustodyBit_1Indices...) dataRoot, err := ssz.HashTreeRoot(idxAttestation.Data) - protoIdxAtt := &pb.ValidatorIDToIdxAtt{ + protoIdxAtt := &slashpb.ValidatorIDToIdxAtt{ Signature: idxAttestation.Signature, Indices: indices, DataRoot: dataRoot[:], diff --git a/slasher/db/min_max_span.go b/slasher/db/min_max_span.go index 2535c12240..8f7db28a10 100644 --- a/slasher/db/min_max_span.go +++ b/slasher/db/min_max_span.go @@ -4,12 +4,12 @@ import ( "github.com/boltdb/bolt" "github.com/gogo/protobuf/proto" "github.com/pkg/errors" - ethpb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" + slashpb "github.com/prysmaticlabs/prysm/proto/slashing" "github.com/prysmaticlabs/prysm/shared/bytesutil" ) -func createEpochSpanMap(enc []byte) (*ethpb.EpochSpanMap, error) { - epochSpanMap := ðpb.EpochSpanMap{} +func createEpochSpanMap(enc []byte) (*slashpb.EpochSpanMap, error) { + epochSpanMap := &slashpb.EpochSpanMap{} err := proto.Unmarshal(enc, epochSpanMap) if err != nil { return nil, errors.Wrap(err, "failed to unmarshal encoding") @@ -20,8 +20,8 @@ func createEpochSpanMap(enc []byte) (*ethpb.EpochSpanMap, error) { // ValidatorSpansMap accepts validator index and returns the corresponding spans // map for slashing detection. // Returns nil if the span map for this validator index does not exist. -func (db *Store) ValidatorSpansMap(validatorIdx uint64) (*ethpb.EpochSpanMap, error) { - var sm *ethpb.EpochSpanMap +func (db *Store) ValidatorSpansMap(validatorIdx uint64) (*slashpb.EpochSpanMap, error) { + var sm *slashpb.EpochSpanMap err := db.view(func(tx *bolt.Tx) error { b := tx.Bucket(validatorsMinMaxSpanBucket) enc := b.Get(bytesutil.Bytes4(validatorIdx)) @@ -33,13 +33,13 @@ func (db *Store) ValidatorSpansMap(validatorIdx uint64) (*ethpb.EpochSpanMap, er return nil }) if sm.EpochSpanMap == nil { - sm.EpochSpanMap = make(map[uint64]*ethpb.MinMaxEpochSpan) + sm.EpochSpanMap = make(map[uint64]*slashpb.MinMaxEpochSpan) } return sm, err } // SaveValidatorSpansMap accepts a validator index and span map and writes it to disk. -func (db *Store) SaveValidatorSpansMap(validatorIdx uint64, spanMap *ethpb.EpochSpanMap) error { +func (db *Store) SaveValidatorSpansMap(validatorIdx uint64, spanMap *slashpb.EpochSpanMap) error { err := db.batch(func(tx *bolt.Tx) error { bucket := tx.Bucket(validatorsMinMaxSpanBucket) key := bytesutil.Bytes4(validatorIdx) diff --git a/slasher/db/min_max_span_test.go b/slasher/db/min_max_span_test.go index ab296b0256..48b2d4b3b0 100644 --- a/slasher/db/min_max_span_test.go +++ b/slasher/db/min_max_span_test.go @@ -5,12 +5,12 @@ import ( "testing" "github.com/gogo/protobuf/proto" - ethpb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" + slashpb "github.com/prysmaticlabs/prysm/proto/slashing" ) type spanMapTestStruct struct { validatorIdx uint64 - spanMap *ethpb.EpochSpanMap + spanMap *slashpb.EpochSpanMap } var spanTests []spanMapTestStruct @@ -19,8 +19,8 @@ func init() { spanTests = []spanMapTestStruct{ { validatorIdx: 1, - spanMap: ðpb.EpochSpanMap{ - EpochSpanMap: map[uint64]*ethpb.MinMaxEpochSpan{ + spanMap: &slashpb.EpochSpanMap{ + EpochSpanMap: map[uint64]*slashpb.MinMaxEpochSpan{ 1: {MinEpochSpan: 10, MaxEpochSpan: 20}, 2: {MinEpochSpan: 11, MaxEpochSpan: 21}, 3: {MinEpochSpan: 12, MaxEpochSpan: 22}, @@ -29,8 +29,8 @@ func init() { }, { validatorIdx: 2, - spanMap: ðpb.EpochSpanMap{ - EpochSpanMap: map[uint64]*ethpb.MinMaxEpochSpan{ + spanMap: &slashpb.EpochSpanMap{ + EpochSpanMap: map[uint64]*slashpb.MinMaxEpochSpan{ 1: {MinEpochSpan: 10, MaxEpochSpan: 20}, 2: {MinEpochSpan: 11, MaxEpochSpan: 21}, 3: {MinEpochSpan: 12, MaxEpochSpan: 22}, @@ -39,8 +39,8 @@ func init() { }, { validatorIdx: 3, - spanMap: ðpb.EpochSpanMap{ - EpochSpanMap: map[uint64]*ethpb.MinMaxEpochSpan{ + spanMap: &slashpb.EpochSpanMap{ + EpochSpanMap: map[uint64]*slashpb.MinMaxEpochSpan{ 1: {MinEpochSpan: 10, MaxEpochSpan: 20}, 2: {MinEpochSpan: 11, MaxEpochSpan: 21}, 3: {MinEpochSpan: 12, MaxEpochSpan: 22}, @@ -59,7 +59,7 @@ func TestValidatorSpanMap_NilDB(t *testing.T) { if err != nil { t.Fatalf("Nil ValidatorSpansMap should not return error: %v", err) } - if !reflect.DeepEqual(vsm.EpochSpanMap, map[uint64]*ethpb.MinMaxEpochSpan{}) { + if !reflect.DeepEqual(vsm.EpochSpanMap, map[uint64]*slashpb.MinMaxEpochSpan{}) { t.Fatal("ValidatorSpansMap should return nil") } } @@ -111,7 +111,7 @@ func TestValidatorSpanMap_Delete(t *testing.T) { if err != nil { t.Fatal(err) } - if !reflect.DeepEqual(sm.EpochSpanMap, map[uint64]*ethpb.MinMaxEpochSpan{}) { + if !reflect.DeepEqual(sm.EpochSpanMap, map[uint64]*slashpb.MinMaxEpochSpan{}) { t.Errorf("Expected validator span map to be deleted, received: %v", sm) } } diff --git a/slasher/rpc/BUILD.bazel b/slasher/rpc/BUILD.bazel index 60acc9c23f..a50846f979 100644 --- a/slasher/rpc/BUILD.bazel +++ b/slasher/rpc/BUILD.bazel @@ -10,14 +10,14 @@ go_library( visibility = ["//visibility:public"], deps = [ "//beacon-chain/core/helpers:go_default_library", - "//proto/beacon/rpc/v1:go_default_library", + "//proto/slashing:go_default_library", "//shared/params:go_default_library", "//slasher/db:go_default_library", "@com_github_gogo_protobuf//proto:go_default_library", - "@com_github_gogo_protobuf//types:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library", "@com_github_prysmaticlabs_go_ssz//:go_default_library", + "@io_bazel_rules_go//proto/wkt:empty_go_proto", "@org_golang_google_grpc//codes:go_default_library", "@org_golang_google_grpc//status:go_default_library", ], @@ -32,7 +32,7 @@ go_test( ], embed = [":go_default_library"], deps = [ - "//proto/beacon/rpc/v1:go_default_library", + "//proto/slashing:go_default_library", "//shared/params:go_default_library", "//slasher/db:go_default_library", "@com_github_gogo_protobuf//proto:go_default_library", diff --git a/slasher/rpc/detect_update_min_max_span.go b/slasher/rpc/detect_update_min_max_span.go index 489d0105a1..42534db2b6 100644 --- a/slasher/rpc/detect_update_min_max_span.go +++ b/slasher/rpc/detect_update_min_max_span.go @@ -4,18 +4,18 @@ import ( "context" "fmt" - ethpb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" + slashpb "github.com/prysmaticlabs/prysm/proto/slashing" "github.com/prysmaticlabs/prysm/shared/params" ) // Detector is a function type used to implement the slashable surrounding/surrounded // vote detection methods. -type detectFn = func(attestationEpochSpan uint64, recorderEpochSpan *ethpb.MinMaxEpochSpan, sourceEpoch uint64) uint64 +type detectFn = func(attestationEpochSpan uint64, recorderEpochSpan *slashpb.MinMaxEpochSpan, sourceEpoch uint64) uint64 // detectMax is a function for maxDetector used to detect surrounding attestations. func detectMax( attestationEpochSpan uint64, - recorderEpochSpan *ethpb.MinMaxEpochSpan, + recorderEpochSpan *slashpb.MinMaxEpochSpan, attestationSourceEpoch uint64) uint64 { maxSpan := uint64(recorderEpochSpan.MaxEpochSpan) @@ -27,7 +27,7 @@ func detectMax( // detectMin is a function for minDetecter used to detect surrounded attestations. func detectMin(attestationEpochSpan uint64, - recorderEpochSpan *ethpb.MinMaxEpochSpan, + recorderEpochSpan *slashpb.MinMaxEpochSpan, attestationSourceEpoch uint64) uint64 { minSpan := uint64(recorderEpochSpan.MinEpochSpan) @@ -49,8 +49,8 @@ func (ss *Server) DetectAndUpdateMaxEpochSpan( source uint64, target uint64, validatorIdx uint64, - spanMap *ethpb.EpochSpanMap, -) (uint64, *ethpb.EpochSpanMap, error) { + spanMap *slashpb.EpochSpanMap, +) (uint64, *slashpb.EpochSpanMap, error) { if target < source { return 0, nil, fmt.Errorf( "target: %d < source: %d ", @@ -68,7 +68,7 @@ func (ss *Server) DetectAndUpdateMaxEpochSpan( for i := uint64(1); i < target-source; i++ { val := uint32(span - i) if _, ok := spanMap.EpochSpanMap[source+i]; !ok { - spanMap.EpochSpanMap[source+i] = ðpb.MinMaxEpochSpan{} + spanMap.EpochSpanMap[source+i] = &slashpb.MinMaxEpochSpan{} } if spanMap.EpochSpanMap[source+i].MaxEpochSpan < val { spanMap.EpochSpanMap[source+i].MaxEpochSpan = val @@ -94,8 +94,8 @@ func (ss *Server) DetectAndUpdateMinEpochSpan( source uint64, target uint64, validatorIdx uint64, - spanMap *ethpb.EpochSpanMap, -) (uint64, *ethpb.EpochSpanMap, error) { + spanMap *slashpb.EpochSpanMap, +) (uint64, *slashpb.EpochSpanMap, error) { if target < source { return 0, nil, fmt.Errorf( "target: %d < source: %d ", @@ -116,7 +116,7 @@ func (ss *Server) DetectAndUpdateMinEpochSpan( for i := source - 1; i > 0; i-- { val := uint32(target - (i)) if _, ok := spanMap.EpochSpanMap[i]; !ok { - spanMap.EpochSpanMap[i] = ðpb.MinMaxEpochSpan{} + spanMap.EpochSpanMap[i] = &slashpb.MinMaxEpochSpan{} } if spanMap.EpochSpanMap[i].MinEpochSpan == 0 || spanMap.EpochSpanMap[i].MinEpochSpan > val { spanMap.EpochSpanMap[i].MinEpochSpan = val @@ -134,9 +134,9 @@ func (ss *Server) DetectAndUpdateMinEpochSpan( func (ss *Server) detectSlashingByEpochSpan( source, target uint64, - spanMap *ethpb.EpochSpanMap, + spanMap *slashpb.EpochSpanMap, detector detectFn, -) (uint64, uint64, *ethpb.EpochSpanMap, error) { +) (uint64, uint64, *slashpb.EpochSpanMap, error) { span := target - source if span > params.BeaconConfig().WeakSubjectivityPeriod { return 0, span, nil, fmt.Errorf("target: %d - source: %d > weakSubjectivityPeriod", diff --git a/slasher/rpc/detect_update_min_max_span_test.go b/slasher/rpc/detect_update_min_max_span_test.go index 9590af99b7..e2d47a7485 100644 --- a/slasher/rpc/detect_update_min_max_span_test.go +++ b/slasher/rpc/detect_update_min_max_span_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/gogo/protobuf/proto" - ethpb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" + slashpb "github.com/prysmaticlabs/prysm/proto/slashing" "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/slasher/db" ) @@ -15,7 +15,7 @@ type spanMapTestStruct struct { sourceEpoch uint64 targetEpoch uint64 slashingTargetEpoch uint64 - resultSpanMap *ethpb.EpochSpanMap + resultSpanMap *slashpb.EpochSpanMap } var spanTestsMax []spanMapTestStruct @@ -30,8 +30,8 @@ func init() { sourceEpoch: 3, targetEpoch: 6, slashingTargetEpoch: 0, - resultSpanMap: ðpb.EpochSpanMap{ - EpochSpanMap: map[uint64]*ethpb.MinMaxEpochSpan{ + resultSpanMap: &slashpb.EpochSpanMap{ + EpochSpanMap: map[uint64]*slashpb.MinMaxEpochSpan{ 4: {MinEpochSpan: 0, MaxEpochSpan: 2}, 5: {MinEpochSpan: 0, MaxEpochSpan: 1}, }, @@ -42,8 +42,8 @@ func init() { sourceEpoch: 8, targetEpoch: 18, slashingTargetEpoch: 0, - resultSpanMap: ðpb.EpochSpanMap{ - EpochSpanMap: map[uint64]*ethpb.MinMaxEpochSpan{ + resultSpanMap: &slashpb.EpochSpanMap{ + EpochSpanMap: map[uint64]*slashpb.MinMaxEpochSpan{ 4: {MinEpochSpan: 0, MaxEpochSpan: 2}, 5: {MinEpochSpan: 0, MaxEpochSpan: 1}, 9: {MinEpochSpan: 0, MaxEpochSpan: 9}, @@ -63,8 +63,8 @@ func init() { sourceEpoch: 4, targetEpoch: 12, slashingTargetEpoch: 0, - resultSpanMap: ðpb.EpochSpanMap{ - EpochSpanMap: map[uint64]*ethpb.MinMaxEpochSpan{ + resultSpanMap: &slashpb.EpochSpanMap{ + EpochSpanMap: map[uint64]*slashpb.MinMaxEpochSpan{ 4: {MinEpochSpan: 0, MaxEpochSpan: 2}, 5: {MinEpochSpan: 0, MaxEpochSpan: 7}, 6: {MinEpochSpan: 0, MaxEpochSpan: 6}, @@ -87,8 +87,8 @@ func init() { sourceEpoch: 10, targetEpoch: 15, slashingTargetEpoch: 18, - resultSpanMap: ðpb.EpochSpanMap{ - EpochSpanMap: map[uint64]*ethpb.MinMaxEpochSpan{ + resultSpanMap: &slashpb.EpochSpanMap{ + EpochSpanMap: map[uint64]*slashpb.MinMaxEpochSpan{ 4: {MinEpochSpan: 0, MaxEpochSpan: 2}, 5: {MinEpochSpan: 0, MaxEpochSpan: 7}, 6: {MinEpochSpan: 0, MaxEpochSpan: 6}, @@ -114,8 +114,8 @@ func init() { sourceEpoch: 4, targetEpoch: 6, slashingTargetEpoch: 0, - resultSpanMap: ðpb.EpochSpanMap{ - EpochSpanMap: map[uint64]*ethpb.MinMaxEpochSpan{ + resultSpanMap: &slashpb.EpochSpanMap{ + EpochSpanMap: map[uint64]*slashpb.MinMaxEpochSpan{ 1: {MinEpochSpan: 5, MaxEpochSpan: 0}, 2: {MinEpochSpan: 4, MaxEpochSpan: 0}, 3: {MinEpochSpan: 3, MaxEpochSpan: 0}, @@ -127,8 +127,8 @@ func init() { sourceEpoch: 13, targetEpoch: 18, slashingTargetEpoch: 0, - resultSpanMap: ðpb.EpochSpanMap{ - EpochSpanMap: map[uint64]*ethpb.MinMaxEpochSpan{ + resultSpanMap: &slashpb.EpochSpanMap{ + EpochSpanMap: map[uint64]*slashpb.MinMaxEpochSpan{ 1: {MinEpochSpan: 5, MaxEpochSpan: 0}, 2: {MinEpochSpan: 4, MaxEpochSpan: 0}, 3: {MinEpochSpan: 3, MaxEpochSpan: 0}, @@ -149,8 +149,8 @@ func init() { sourceEpoch: 11, targetEpoch: 15, slashingTargetEpoch: 0, - resultSpanMap: ðpb.EpochSpanMap{ - EpochSpanMap: map[uint64]*ethpb.MinMaxEpochSpan{ + resultSpanMap: &slashpb.EpochSpanMap{ + EpochSpanMap: map[uint64]*slashpb.MinMaxEpochSpan{ 1: {MinEpochSpan: 5, MaxEpochSpan: 0}, 2: {MinEpochSpan: 4, MaxEpochSpan: 0}, 3: {MinEpochSpan: 3, MaxEpochSpan: 0}, @@ -171,8 +171,8 @@ func init() { sourceEpoch: 10, targetEpoch: 20, slashingTargetEpoch: 15, - resultSpanMap: ðpb.EpochSpanMap{ - EpochSpanMap: map[uint64]*ethpb.MinMaxEpochSpan{ + resultSpanMap: &slashpb.EpochSpanMap{ + EpochSpanMap: map[uint64]*slashpb.MinMaxEpochSpan{ 1: {MinEpochSpan: 5, MaxEpochSpan: 0}, 2: {MinEpochSpan: 4, MaxEpochSpan: 0}, 3: {MinEpochSpan: 3, MaxEpochSpan: 0}, @@ -267,8 +267,8 @@ func TestServer_FailToUpdate(t *testing.T) { sourceEpoch: 0, slashingTargetEpoch: 0, targetEpoch: params.BeaconConfig().WeakSubjectivityPeriod + 1, - resultSpanMap: ðpb.EpochSpanMap{ - EpochSpanMap: map[uint64]*ethpb.MinMaxEpochSpan{ + resultSpanMap: &slashpb.EpochSpanMap{ + EpochSpanMap: map[uint64]*slashpb.MinMaxEpochSpan{ 4: {MinEpochSpan: 0, MaxEpochSpan: 2}, 5: {MinEpochSpan: 0, MaxEpochSpan: 1}, }, diff --git a/slasher/rpc/server.go b/slasher/rpc/server.go index 1b5bd7336a..f1673c7f41 100644 --- a/slasher/rpc/server.go +++ b/slasher/rpc/server.go @@ -6,12 +6,12 @@ import ( "sync" "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/types" + "github.com/golang/protobuf/ptypes/empty" "github.com/pkg/errors" ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" "github.com/prysmaticlabs/go-ssz" "github.com/prysmaticlabs/prysm/beacon-chain/core/helpers" - slashpb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" + slashpb "github.com/prysmaticlabs/prysm/proto/slashing" "github.com/prysmaticlabs/prysm/slasher/db" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -110,13 +110,13 @@ func (ss *Server) IsSlashableBlock(ctx context.Context, psr *slashpb.ProposerSla } // SlashableProposals is a subscription to receive all slashable proposer slashing events found by the watchtower. -func (ss *Server) SlashableProposals(req *types.Empty, server slashpb.Slasher_SlashableProposalsServer) error { +func (ss *Server) SlashableProposals(req *empty.Empty, server slashpb.Slasher_SlashableProposalsServer) error { //TODO(3133): implement stream provider for newly discovered listening to slashable proposals. return status.Error(codes.Unimplemented, "not implemented") } // SlashableAttestations is a subscription to receive all slashable attester slashing events found by the watchtower. -func (ss *Server) SlashableAttestations(req *types.Empty, server slashpb.Slasher_SlashableAttestationsServer) error { +func (ss *Server) SlashableAttestations(req *empty.Empty, server slashpb.Slasher_SlashableAttestationsServer) error { //TODO(3133): implement stream provider for newly discovered listening to slashable attestation. return status.Error(codes.Unimplemented, "not implemented") } diff --git a/slasher/rpc/server_test.go b/slasher/rpc/server_test.go index 4f5a16eb95..6e3ba894bf 100644 --- a/slasher/rpc/server_test.go +++ b/slasher/rpc/server_test.go @@ -7,7 +7,7 @@ import ( "github.com/gogo/protobuf/proto" ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" - slashpb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" + slashpb "github.com/prysmaticlabs/prysm/proto/slashing" "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/slasher/db" ) diff --git a/slasher/service/BUILD.bazel b/slasher/service/BUILD.bazel index 89080c61ac..5ace3da19d 100644 --- a/slasher/service/BUILD.bazel +++ b/slasher/service/BUILD.bazel @@ -9,7 +9,7 @@ go_library( importpath = "github.com/prysmaticlabs/prysm/slasher/service", visibility = ["//visibility:public"], deps = [ - "//proto/beacon/rpc/v1:go_default_library", + "//proto/slashing:go_default_library", "//shared/cmd:go_default_library", "//shared/debug:go_default_library", "//shared/params:go_default_library", diff --git a/slasher/service/service.go b/slasher/service/service.go index c3d4f19f68..07fb3cadde 100644 --- a/slasher/service/service.go +++ b/slasher/service/service.go @@ -17,7 +17,7 @@ import ( grpc_opentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing" grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" eth "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" - slashpb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" + slashpb "github.com/prysmaticlabs/prysm/proto/slashing" "github.com/prysmaticlabs/prysm/shared/cmd" "github.com/prysmaticlabs/prysm/shared/debug" "github.com/prysmaticlabs/prysm/shared/version"