Streaming Validator Assignment Service Definition (#554)

This commit is contained in:
Raul Jordan
2018-09-22 13:19:34 -05:00
committed by GitHub
parent e5569c88f8
commit 673c4f840f
6 changed files with 662 additions and 225 deletions

View File

@@ -230,6 +230,12 @@ func (s *Service) LatestCrystallizedState(req *empty.Empty, stream pb.BeaconServ
}
}
// ValidatorAssignment streams validator assignments every slot to clients that request
// to watch a subset of public keys in the CrystallizedState's active validator set.
func (s *Service) ValidatorAssignment(req *pb.ValidatorAssignmentRequest, stream pb.ValidatorService_ValidatorAssignmentServer) error {
return nil
}
// ValidatorShardID is called by a validator to get the shard ID of where it's suppose
// to proposer or attest.
func (s *Service) ValidatorShardID(ctx context.Context, req *pb.PublicKey) (*pb.ShardIDResponse, error) {

View File

@@ -26,6 +26,32 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type ValidatorAssignmentResponse_Role int32
const (
ValidatorAssignmentResponse_UNKNOWN ValidatorAssignmentResponse_Role = 0
ValidatorAssignmentResponse_ATTESTER ValidatorAssignmentResponse_Role = 1
ValidatorAssignmentResponse_PROPOSER ValidatorAssignmentResponse_Role = 2
)
var ValidatorAssignmentResponse_Role_name = map[int32]string{
0: "UNKNOWN",
1: "ATTESTER",
2: "PROPOSER",
}
var ValidatorAssignmentResponse_Role_value = map[string]int32{
"UNKNOWN": 0,
"ATTESTER": 1,
"PROPOSER": 2,
}
func (x ValidatorAssignmentResponse_Role) String() string {
return proto.EnumName(ValidatorAssignmentResponse_Role_name, int32(x))
}
func (ValidatorAssignmentResponse_Role) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_services_c6a6f3b554d979ac, []int{6, 0}
}
type GenesisTimeAndStateResponse struct {
GenesisTimestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=genesis_timestamp,json=genesisTimestamp,proto3" json:"genesis_timestamp,omitempty"`
LatestCrystallizedState *v1.CrystallizedState `protobuf:"bytes,2,opt,name=latest_crystallized_state,json=latestCrystallizedState,proto3" json:"latest_crystallized_state,omitempty"`
@@ -38,7 +64,7 @@ func (m *GenesisTimeAndStateResponse) Reset() { *m = GenesisTimeAndState
func (m *GenesisTimeAndStateResponse) String() string { return proto.CompactTextString(m) }
func (*GenesisTimeAndStateResponse) ProtoMessage() {}
func (*GenesisTimeAndStateResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_services_593701c51c9f5594, []int{0}
return fileDescriptor_services_c6a6f3b554d979ac, []int{0}
}
func (m *GenesisTimeAndStateResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GenesisTimeAndStateResponse.Unmarshal(m, b)
@@ -88,7 +114,7 @@ func (m *ProposeRequest) Reset() { *m = ProposeRequest{} }
func (m *ProposeRequest) String() string { return proto.CompactTextString(m) }
func (*ProposeRequest) ProtoMessage() {}
func (*ProposeRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_services_593701c51c9f5594, []int{1}
return fileDescriptor_services_c6a6f3b554d979ac, []int{1}
}
func (m *ProposeRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ProposeRequest.Unmarshal(m, b)
@@ -161,7 +187,7 @@ func (m *ProposeResponse) Reset() { *m = ProposeResponse{} }
func (m *ProposeResponse) String() string { return proto.CompactTextString(m) }
func (*ProposeResponse) ProtoMessage() {}
func (*ProposeResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_services_593701c51c9f5594, []int{2}
return fileDescriptor_services_c6a6f3b554d979ac, []int{2}
}
func (m *ProposeResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ProposeResponse.Unmarshal(m, b)
@@ -199,7 +225,7 @@ func (m *AttestRequest) Reset() { *m = AttestRequest{} }
func (m *AttestRequest) String() string { return proto.CompactTextString(m) }
func (*AttestRequest) ProtoMessage() {}
func (*AttestRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_services_593701c51c9f5594, []int{3}
return fileDescriptor_services_c6a6f3b554d979ac, []int{3}
}
func (m *AttestRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AttestRequest.Unmarshal(m, b)
@@ -237,7 +263,7 @@ func (m *AttestResponse) Reset() { *m = AttestResponse{} }
func (m *AttestResponse) String() string { return proto.CompactTextString(m) }
func (*AttestResponse) ProtoMessage() {}
func (*AttestResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_services_593701c51c9f5594, []int{4}
return fileDescriptor_services_c6a6f3b554d979ac, []int{4}
}
func (m *AttestResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AttestResponse.Unmarshal(m, b)
@@ -264,6 +290,154 @@ func (m *AttestResponse) GetAttestationHash() []byte {
return nil
}
type ValidatorAssignmentRequest struct {
AllValidators bool `protobuf:"varint,1,opt,name=all_validators,json=allValidators,proto3" json:"all_validators,omitempty"`
PublicKeys []*PublicKey `protobuf:"bytes,2,rep,name=public_keys,json=publicKeys,proto3" json:"public_keys,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ValidatorAssignmentRequest) Reset() { *m = ValidatorAssignmentRequest{} }
func (m *ValidatorAssignmentRequest) String() string { return proto.CompactTextString(m) }
func (*ValidatorAssignmentRequest) ProtoMessage() {}
func (*ValidatorAssignmentRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_services_c6a6f3b554d979ac, []int{5}
}
func (m *ValidatorAssignmentRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValidatorAssignmentRequest.Unmarshal(m, b)
}
func (m *ValidatorAssignmentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ValidatorAssignmentRequest.Marshal(b, m, deterministic)
}
func (dst *ValidatorAssignmentRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValidatorAssignmentRequest.Merge(dst, src)
}
func (m *ValidatorAssignmentRequest) XXX_Size() int {
return xxx_messageInfo_ValidatorAssignmentRequest.Size(m)
}
func (m *ValidatorAssignmentRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ValidatorAssignmentRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ValidatorAssignmentRequest proto.InternalMessageInfo
func (m *ValidatorAssignmentRequest) GetAllValidators() bool {
if m != nil {
return m.AllValidators
}
return false
}
func (m *ValidatorAssignmentRequest) GetPublicKeys() []*PublicKey {
if m != nil {
return m.PublicKeys
}
return nil
}
type ValidatorAssignmentResponse struct {
Assignments []*ValidatorAssignmentResponse_Assignment `protobuf:"bytes,1,rep,name=assignments,proto3" json:"assignments,omitempty"`
Slot uint64 `protobuf:"varint,2,opt,name=slot,proto3" json:"slot,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ValidatorAssignmentResponse) Reset() { *m = ValidatorAssignmentResponse{} }
func (m *ValidatorAssignmentResponse) String() string { return proto.CompactTextString(m) }
func (*ValidatorAssignmentResponse) ProtoMessage() {}
func (*ValidatorAssignmentResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_services_c6a6f3b554d979ac, []int{6}
}
func (m *ValidatorAssignmentResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValidatorAssignmentResponse.Unmarshal(m, b)
}
func (m *ValidatorAssignmentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ValidatorAssignmentResponse.Marshal(b, m, deterministic)
}
func (dst *ValidatorAssignmentResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValidatorAssignmentResponse.Merge(dst, src)
}
func (m *ValidatorAssignmentResponse) XXX_Size() int {
return xxx_messageInfo_ValidatorAssignmentResponse.Size(m)
}
func (m *ValidatorAssignmentResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ValidatorAssignmentResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ValidatorAssignmentResponse proto.InternalMessageInfo
func (m *ValidatorAssignmentResponse) GetAssignments() []*ValidatorAssignmentResponse_Assignment {
if m != nil {
return m.Assignments
}
return nil
}
func (m *ValidatorAssignmentResponse) GetSlot() uint64 {
if m != nil {
return m.Slot
}
return 0
}
type ValidatorAssignmentResponse_Assignment struct {
PublicKey *PublicKey `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
ShardId uint64 `protobuf:"varint,2,opt,name=shard_id,json=shardId,proto3" json:"shard_id,omitempty"`
Role ValidatorAssignmentResponse_Role `protobuf:"varint,3,opt,name=role,proto3,enum=ethereum.beacon.rpc.v1.ValidatorAssignmentResponse_Role" json:"role,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ValidatorAssignmentResponse_Assignment) Reset() {
*m = ValidatorAssignmentResponse_Assignment{}
}
func (m *ValidatorAssignmentResponse_Assignment) String() string { return proto.CompactTextString(m) }
func (*ValidatorAssignmentResponse_Assignment) ProtoMessage() {}
func (*ValidatorAssignmentResponse_Assignment) Descriptor() ([]byte, []int) {
return fileDescriptor_services_c6a6f3b554d979ac, []int{6, 0}
}
func (m *ValidatorAssignmentResponse_Assignment) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValidatorAssignmentResponse_Assignment.Unmarshal(m, b)
}
func (m *ValidatorAssignmentResponse_Assignment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ValidatorAssignmentResponse_Assignment.Marshal(b, m, deterministic)
}
func (dst *ValidatorAssignmentResponse_Assignment) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValidatorAssignmentResponse_Assignment.Merge(dst, src)
}
func (m *ValidatorAssignmentResponse_Assignment) XXX_Size() int {
return xxx_messageInfo_ValidatorAssignmentResponse_Assignment.Size(m)
}
func (m *ValidatorAssignmentResponse_Assignment) XXX_DiscardUnknown() {
xxx_messageInfo_ValidatorAssignmentResponse_Assignment.DiscardUnknown(m)
}
var xxx_messageInfo_ValidatorAssignmentResponse_Assignment proto.InternalMessageInfo
func (m *ValidatorAssignmentResponse_Assignment) GetPublicKey() *PublicKey {
if m != nil {
return m.PublicKey
}
return nil
}
func (m *ValidatorAssignmentResponse_Assignment) GetShardId() uint64 {
if m != nil {
return m.ShardId
}
return 0
}
func (m *ValidatorAssignmentResponse_Assignment) GetRole() ValidatorAssignmentResponse_Role {
if m != nil {
return m.Role
}
return ValidatorAssignmentResponse_UNKNOWN
}
type PublicKey struct {
PublicKey uint64 `protobuf:"varint,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@@ -275,7 +449,7 @@ func (m *PublicKey) Reset() { *m = PublicKey{} }
func (m *PublicKey) String() string { return proto.CompactTextString(m) }
func (*PublicKey) ProtoMessage() {}
func (*PublicKey) Descriptor() ([]byte, []int) {
return fileDescriptor_services_593701c51c9f5594, []int{5}
return fileDescriptor_services_c6a6f3b554d979ac, []int{7}
}
func (m *PublicKey) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PublicKey.Unmarshal(m, b)
@@ -302,82 +476,6 @@ func (m *PublicKey) GetPublicKey() uint64 {
return 0
}
type ShardIDResponse struct {
ShardId uint64 `protobuf:"varint,1,opt,name=shard_id,json=shardId,proto3" json:"shard_id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ShardIDResponse) Reset() { *m = ShardIDResponse{} }
func (m *ShardIDResponse) String() string { return proto.CompactTextString(m) }
func (*ShardIDResponse) ProtoMessage() {}
func (*ShardIDResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_services_593701c51c9f5594, []int{6}
}
func (m *ShardIDResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ShardIDResponse.Unmarshal(m, b)
}
func (m *ShardIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ShardIDResponse.Marshal(b, m, deterministic)
}
func (dst *ShardIDResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ShardIDResponse.Merge(dst, src)
}
func (m *ShardIDResponse) XXX_Size() int {
return xxx_messageInfo_ShardIDResponse.Size(m)
}
func (m *ShardIDResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ShardIDResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ShardIDResponse proto.InternalMessageInfo
func (m *ShardIDResponse) GetShardId() uint64 {
if m != nil {
return m.ShardId
}
return 0
}
type IndexResponse struct {
Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *IndexResponse) Reset() { *m = IndexResponse{} }
func (m *IndexResponse) String() string { return proto.CompactTextString(m) }
func (*IndexResponse) ProtoMessage() {}
func (*IndexResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_services_593701c51c9f5594, []int{7}
}
func (m *IndexResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_IndexResponse.Unmarshal(m, b)
}
func (m *IndexResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_IndexResponse.Marshal(b, m, deterministic)
}
func (dst *IndexResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_IndexResponse.Merge(dst, src)
}
func (m *IndexResponse) XXX_Size() int {
return xxx_messageInfo_IndexResponse.Size(m)
}
func (m *IndexResponse) XXX_DiscardUnknown() {
xxx_messageInfo_IndexResponse.DiscardUnknown(m)
}
var xxx_messageInfo_IndexResponse proto.InternalMessageInfo
func (m *IndexResponse) GetIndex() uint32 {
if m != nil {
return m.Index
}
return 0
}
type SlotResponse struct {
Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@@ -389,7 +487,7 @@ func (m *SlotResponse) Reset() { *m = SlotResponse{} }
func (m *SlotResponse) String() string { return proto.CompactTextString(m) }
func (*SlotResponse) ProtoMessage() {}
func (*SlotResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_services_593701c51c9f5594, []int{8}
return fileDescriptor_services_c6a6f3b554d979ac, []int{8}
}
func (m *SlotResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SlotResponse.Unmarshal(m, b)
@@ -416,16 +514,96 @@ func (m *SlotResponse) GetSlot() uint64 {
return 0
}
type IndexResponse struct {
Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *IndexResponse) Reset() { *m = IndexResponse{} }
func (m *IndexResponse) String() string { return proto.CompactTextString(m) }
func (*IndexResponse) ProtoMessage() {}
func (*IndexResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_services_c6a6f3b554d979ac, []int{9}
}
func (m *IndexResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_IndexResponse.Unmarshal(m, b)
}
func (m *IndexResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_IndexResponse.Marshal(b, m, deterministic)
}
func (dst *IndexResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_IndexResponse.Merge(dst, src)
}
func (m *IndexResponse) XXX_Size() int {
return xxx_messageInfo_IndexResponse.Size(m)
}
func (m *IndexResponse) XXX_DiscardUnknown() {
xxx_messageInfo_IndexResponse.DiscardUnknown(m)
}
var xxx_messageInfo_IndexResponse proto.InternalMessageInfo
func (m *IndexResponse) GetIndex() uint32 {
if m != nil {
return m.Index
}
return 0
}
type ShardIDResponse struct {
ShardId uint64 `protobuf:"varint,1,opt,name=shard_id,json=shardId,proto3" json:"shard_id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ShardIDResponse) Reset() { *m = ShardIDResponse{} }
func (m *ShardIDResponse) String() string { return proto.CompactTextString(m) }
func (*ShardIDResponse) ProtoMessage() {}
func (*ShardIDResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_services_c6a6f3b554d979ac, []int{10}
}
func (m *ShardIDResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ShardIDResponse.Unmarshal(m, b)
}
func (m *ShardIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ShardIDResponse.Marshal(b, m, deterministic)
}
func (dst *ShardIDResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ShardIDResponse.Merge(dst, src)
}
func (m *ShardIDResponse) XXX_Size() int {
return xxx_messageInfo_ShardIDResponse.Size(m)
}
func (m *ShardIDResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ShardIDResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ShardIDResponse proto.InternalMessageInfo
func (m *ShardIDResponse) GetShardId() uint64 {
if m != nil {
return m.ShardId
}
return 0
}
func init() {
proto.RegisterType((*GenesisTimeAndStateResponse)(nil), "ethereum.beacon.rpc.v1.GenesisTimeAndStateResponse")
proto.RegisterType((*ProposeRequest)(nil), "ethereum.beacon.rpc.v1.ProposeRequest")
proto.RegisterType((*ProposeResponse)(nil), "ethereum.beacon.rpc.v1.ProposeResponse")
proto.RegisterType((*AttestRequest)(nil), "ethereum.beacon.rpc.v1.AttestRequest")
proto.RegisterType((*AttestResponse)(nil), "ethereum.beacon.rpc.v1.AttestResponse")
proto.RegisterType((*ValidatorAssignmentRequest)(nil), "ethereum.beacon.rpc.v1.ValidatorAssignmentRequest")
proto.RegisterType((*ValidatorAssignmentResponse)(nil), "ethereum.beacon.rpc.v1.ValidatorAssignmentResponse")
proto.RegisterType((*ValidatorAssignmentResponse_Assignment)(nil), "ethereum.beacon.rpc.v1.ValidatorAssignmentResponse.Assignment")
proto.RegisterType((*PublicKey)(nil), "ethereum.beacon.rpc.v1.PublicKey")
proto.RegisterType((*ShardIDResponse)(nil), "ethereum.beacon.rpc.v1.ShardIDResponse")
proto.RegisterType((*IndexResponse)(nil), "ethereum.beacon.rpc.v1.IndexResponse")
proto.RegisterType((*SlotResponse)(nil), "ethereum.beacon.rpc.v1.SlotResponse")
proto.RegisterType((*IndexResponse)(nil), "ethereum.beacon.rpc.v1.IndexResponse")
proto.RegisterType((*ShardIDResponse)(nil), "ethereum.beacon.rpc.v1.ShardIDResponse")
proto.RegisterEnum("ethereum.beacon.rpc.v1.ValidatorAssignmentResponse_Role", ValidatorAssignmentResponse_Role_name, ValidatorAssignmentResponse_Role_value)
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -786,9 +964,14 @@ var _ProposerService_serviceDesc = grpc.ServiceDesc{
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ValidatorServiceClient interface {
// These endpoints can be called on demand in the future
// by some web3 API for users to conveniently know their assignment.
ValidatorShardID(ctx context.Context, in *PublicKey, opts ...grpc.CallOption) (*ShardIDResponse, error)
ValidatorIndex(ctx context.Context, in *PublicKey, opts ...grpc.CallOption) (*IndexResponse, error)
ValidatorSlot(ctx context.Context, in *PublicKey, opts ...grpc.CallOption) (*SlotResponse, error)
// This endpoint is called by all validator clients to watch for assignments
// for a subset of public keys in the active validator set.
ValidatorAssignment(ctx context.Context, in *ValidatorAssignmentRequest, opts ...grpc.CallOption) (ValidatorService_ValidatorAssignmentClient, error)
}
type validatorServiceClient struct {
@@ -826,11 +1009,48 @@ func (c *validatorServiceClient) ValidatorSlot(ctx context.Context, in *PublicKe
return out, nil
}
func (c *validatorServiceClient) ValidatorAssignment(ctx context.Context, in *ValidatorAssignmentRequest, opts ...grpc.CallOption) (ValidatorService_ValidatorAssignmentClient, error) {
stream, err := c.cc.NewStream(ctx, &_ValidatorService_serviceDesc.Streams[0], "/ethereum.beacon.rpc.v1.ValidatorService/ValidatorAssignment", opts...)
if err != nil {
return nil, err
}
x := &validatorServiceValidatorAssignmentClient{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 ValidatorService_ValidatorAssignmentClient interface {
Recv() (*ValidatorAssignmentResponse, error)
grpc.ClientStream
}
type validatorServiceValidatorAssignmentClient struct {
grpc.ClientStream
}
func (x *validatorServiceValidatorAssignmentClient) Recv() (*ValidatorAssignmentResponse, error) {
m := new(ValidatorAssignmentResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// ValidatorServiceServer is the server API for ValidatorService service.
type ValidatorServiceServer interface {
// These endpoints can be called on demand in the future
// by some web3 API for users to conveniently know their assignment.
ValidatorShardID(context.Context, *PublicKey) (*ShardIDResponse, error)
ValidatorIndex(context.Context, *PublicKey) (*IndexResponse, error)
ValidatorSlot(context.Context, *PublicKey) (*SlotResponse, error)
// This endpoint is called by all validator clients to watch for assignments
// for a subset of public keys in the active validator set.
ValidatorAssignment(*ValidatorAssignmentRequest, ValidatorService_ValidatorAssignmentServer) error
}
func RegisterValidatorServiceServer(s *grpc.Server, srv ValidatorServiceServer) {
@@ -891,6 +1111,27 @@ func _ValidatorService_ValidatorSlot_Handler(srv interface{}, ctx context.Contex
return interceptor(ctx, in, info, handler)
}
func _ValidatorService_ValidatorAssignment_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(ValidatorAssignmentRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ValidatorServiceServer).ValidatorAssignment(m, &validatorServiceValidatorAssignmentServer{stream})
}
type ValidatorService_ValidatorAssignmentServer interface {
Send(*ValidatorAssignmentResponse) error
grpc.ServerStream
}
type validatorServiceValidatorAssignmentServer struct {
grpc.ServerStream
}
func (x *validatorServiceValidatorAssignmentServer) Send(m *ValidatorAssignmentResponse) error {
return x.ServerStream.SendMsg(m)
}
var _ValidatorService_serviceDesc = grpc.ServiceDesc{
ServiceName: "ethereum.beacon.rpc.v1.ValidatorService",
HandlerType: (*ValidatorServiceServer)(nil),
@@ -908,61 +1149,80 @@ var _ValidatorService_serviceDesc = grpc.ServiceDesc{
Handler: _ValidatorService_ValidatorSlot_Handler,
},
},
Streams: []grpc.StreamDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "ValidatorAssignment",
Handler: _ValidatorService_ValidatorAssignment_Handler,
ServerStreams: true,
},
},
Metadata: "proto/beacon/rpc/v1/services.proto",
}
func init() {
proto.RegisterFile("proto/beacon/rpc/v1/services.proto", fileDescriptor_services_593701c51c9f5594)
proto.RegisterFile("proto/beacon/rpc/v1/services.proto", fileDescriptor_services_c6a6f3b554d979ac)
}
var fileDescriptor_services_593701c51c9f5594 = []byte{
// 742 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xd1, 0x52, 0xd3, 0x50,
0x10, 0x9d, 0x42, 0x41, 0xbb, 0x34, 0x14, 0xa2, 0x03, 0xa5, 0xe8, 0x80, 0x41, 0x14, 0x1c, 0x4d,
0xa1, 0xbc, 0x38, 0xfa, 0x54, 0xd0, 0x01, 0x46, 0x46, 0x99, 0x94, 0x71, 0x1c, 0x75, 0x88, 0xb7,
0xc9, 0x9a, 0x66, 0x9a, 0xe4, 0xc6, 0xdc, 0xdb, 0x8e, 0xf5, 0x0b, 0xfc, 0x0a, 0x9f, 0xfd, 0x19,
0xff, 0xc9, 0xc9, 0xbd, 0x49, 0x9a, 0x02, 0x11, 0x7c, 0xeb, 0x3d, 0xbb, 0x7b, 0xf6, 0x74, 0x77,
0x4f, 0x40, 0x0b, 0x23, 0xca, 0x69, 0xb3, 0x8b, 0xc4, 0xa2, 0x41, 0x33, 0x0a, 0xad, 0xe6, 0x70,
0xb7, 0xc9, 0x30, 0x1a, 0xba, 0x16, 0x32, 0x5d, 0x04, 0xd5, 0x25, 0xe4, 0x3d, 0x8c, 0x70, 0xe0,
0xeb, 0x32, 0x4d, 0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 0x9e, 0x78, 0xae, 0x4d, 0x38, 0xcd, 0xba, 0x9e, 0xe7, 0x31, 0xe9, 0x02, 0xf5, 0x41, 0x21,
0x63, 0xea, 0x99, 0xe2, 0xa6, 0x17, 0x9d, 0xf4, 0x11, 0xe6, 0x33, 0x7e, 0xe1, 0x9b, 0x9b, 0xb0,
0x17, 0x0e, 0x7b, 0xd2, 0x79, 0x1f, 0x40, 0x19, 0x6b, 0xf7, 0x28, 0xbf, 0x09, 0xf5, 0xc3, 0x42,
0xe1, 0x39, 0xb7, 0x76, 0x67, 0xc5, 0x3d, 0xed, 0xfd, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x79, 0xa1,
0x46, 0xbd, 0xa7, 0x07, 0x00, 0x00,
var fileDescriptor_services_c6a6f3b554d979ac = []byte{
// 945 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xdd, 0x6e, 0x1b, 0x45,
0x14, 0x66, 0x6d, 0xb7, 0x4d, 0x8e, 0x7f, 0xe2, 0x4e, 0x51, 0xe3, 0x38, 0xa0, 0x86, 0x2d, 0x81,
0x14, 0xc1, 0x3a, 0x71, 0x6e, 0x2a, 0x90, 0x10, 0x4e, 0x89, 0xda, 0xaa, 0x51, 0x12, 0xad, 0xcd,
0x8f, 0x00, 0x75, 0x3b, 0xf6, 0x1e, 0xd6, 0xab, 0x8c, 0x77, 0x96, 0x9d, 0xb1, 0x45, 0xb8, 0xe2,
0x0e, 0x9e, 0x82, 0x17, 0xe0, 0x01, 0x78, 0x0a, 0x5e, 0x09, 0xa1, 0x9d, 0xd9, 0x3f, 0xa7, 0xd9,
0x26, 0xcd, 0xdd, 0xce, 0x99, 0x73, 0xbe, 0xf3, 0xcd, 0x77, 0x66, 0xbe, 0x05, 0x33, 0x8c, 0xb8,
0xe4, 0xbd, 0x31, 0xd2, 0x09, 0x0f, 0x7a, 0x51, 0x38, 0xe9, 0x2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2, 0x82, 0x96, 0x42,
0x2d, 0xff, 0xd4, 0xba, 0x1f, 0x5f, 0x99, 0x97, 0xf4, 0xfc, 0xbb, 0x0a, 0xed, 0xec, 0xbd, 0xa5,
0x5d, 0x5f, 0x16, 0x63, 0xfa, 0xea, 0x92, 0xab, 0x4d, 0xa0, 0xbc, 0xe9, 0xc5, 0xeb, 0xff, 0x03,
0xb4, 0x32, 0x7c, 0xf5, 0x82, 0xae, 0x83, 0x5e, 0x2a, 0xf6, 0xf2, 0x1b, 0xfc, 0x1e, 0x9a, 0x39,
0x77, 0xc6, 0xe5, 0x75, 0xa0, 0x3f, 0x2c, 0x25, 0x5e, 0xb4, 0x80, 0xdf, 0x0d, 0xb8, 0x77, 0x89,
0x35, 0x91, 0xfe, 0x5b, 0xf9, 0x98, 0x9e, 0xcf, 0xfe, 0x0d, 0xbc, 0x6f, 0xd7, 0x18, 0xdf, 0x56,
0x57, 0x7a, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5f, 0xb4, 0xa2, 0x3d, 0x35, 0x0a, 0x00,
0x00,
}

View File

@@ -22,23 +22,28 @@ service ProposerService {
}
service ValidatorService {
// These endpoints can be called on demand in the future
// by some web3 API for users to conveniently know their assignment.
rpc ValidatorShardID(PublicKey) returns (ShardIDResponse);
rpc ValidatorIndex(PublicKey) returns (IndexResponse);
rpc ValidatorSlot(PublicKey) returns (SlotResponse);
// This endpoint is called by all validator clients to watch for assignments
// for a subset of public keys in the active validator set.
rpc ValidatorAssignment(ValidatorAssignmentRequest) returns(stream ValidatorAssignmentResponse);
}
message GenesisTimeAndStateResponse {
google.protobuf.Timestamp genesis_timestamp = 1;
ethereum.beacon.p2p.v1.CrystallizedState latest_crystallized_state = 2;
google.protobuf.Timestamp genesis_timestamp = 1;
ethereum.beacon.p2p.v1.CrystallizedState latest_crystallized_state = 2;
}
message ProposeRequest {
bytes parent_hash = 1;
uint64 slot_number = 2;
bytes randao_reveal = 3;
bytes attestation_bitmask = 4;
repeated uint32 attestation_aggregate_sig = 5;
google.protobuf.Timestamp timestamp = 6;
bytes parent_hash = 1;
uint64 slot_number = 2;
bytes randao_reveal = 3;
bytes attestation_bitmask = 4;
repeated uint32 attestation_aggregate_sig = 5;
google.protobuf.Timestamp timestamp = 6;
}
message ProposeResponse {
@@ -53,18 +58,42 @@ message AttestResponse {
bytes attestation_hash = 1;
}
// Request assignment updates for either all validators or a subset of validators
// defined by their public keys.
message ValidatorAssignmentRequest {
bool all_validators = 1;
repeated PublicKey public_keys = 2;
}
message ValidatorAssignmentResponse {
repeated Assignment assignments = 1;
uint64 slot = 2;
message Assignment {
PublicKey public_key = 1;
uint64 shard_id = 2;
Role role = 3;
}
enum Role {
UNKNOWN = 0;
ATTESTER = 1;
PROPOSER = 2;
}
}
message PublicKey {
uint64 public_key = 1;
}
message ShardIDResponse {
uint64 shard_id = 1;
message SlotResponse {
uint64 slot = 1;
}
message IndexResponse {
uint32 index = 1;
}
message SlotResponse {
uint64 slot = 1;
message ShardIDResponse {
uint64 shard_id = 1;
}

View File

@@ -7,6 +7,7 @@ go_library(
"attester_service_mock.go",
"beacon_service_mock.go",
"proposer_service_mock.go",
"validator_service_mock.go",
],
importpath = "github.com/prysmaticlabs/prysm/validator/internal",
visibility = ["//validator:__subpackages__"],

View File

@@ -52,80 +52,3 @@ func (mr *MockAttesterServiceClientMockRecorder) AttestHead(arg0, arg1 interface
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttestHead", reflect.TypeOf((*MockAttesterServiceClient)(nil).AttestHead), varargs...)
}
// MockValidatorServiceClient is a mock of ValidatorServiceClient interface
type MockValidatorServiceClient struct {
ctrl *gomock.Controller
recorder *MockValidatorServiceClientMockRecorder
}
// MockValidatorServiceClientMockRecorder is the mock recorder for MockValidatorServiceClient
type MockValidatorServiceClientMockRecorder struct {
mock *MockValidatorServiceClient
}
// NewMockValidatorServiceClient creates a new mock instance
func NewMockValidatorServiceClient(ctrl *gomock.Controller) *MockValidatorServiceClient {
mock := &MockValidatorServiceClient{ctrl: ctrl}
mock.recorder = &MockValidatorServiceClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockValidatorServiceClient) EXPECT() *MockValidatorServiceClientMockRecorder {
return m.recorder
}
// ValidatorIndex mocks base method
func (m *MockValidatorServiceClient) ValidatorIndex(arg0 context.Context, arg1 *v1.PublicKey, arg2 ...grpc.CallOption) (*v1.IndexResponse, error) {
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ValidatorIndex", varargs...)
ret0, _ := ret[0].(*v1.IndexResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ValidatorIndex indicates an expected call of ValidatorIndex
func (mr *MockValidatorServiceClientMockRecorder) ValidatorIndex(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorIndex", reflect.TypeOf((*MockValidatorServiceClient)(nil).ValidatorIndex), varargs...)
}
// ValidatorShardID mocks base method
func (m *MockValidatorServiceClient) ValidatorShardID(arg0 context.Context, arg1 *v1.PublicKey, arg2 ...grpc.CallOption) (*v1.ShardIDResponse, error) {
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ValidatorShardID", varargs...)
ret0, _ := ret[0].(*v1.ShardIDResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ValidatorShardID indicates an expected call of ValidatorShardID
func (mr *MockValidatorServiceClientMockRecorder) ValidatorShardID(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorShardID", reflect.TypeOf((*MockValidatorServiceClient)(nil).ValidatorShardID), varargs...)
}
// ValidatorSlot mocks base method
func (m *MockValidatorServiceClient) ValidatorSlot(arg0 context.Context, arg1 *v1.PublicKey, arg2 ...grpc.CallOption) (*v1.SlotResponse, error) {
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ValidatorSlot", varargs...)
ret0, _ := ret[0].(*v1.SlotResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ValidatorSlot indicates an expected call of ValidatorSlot
func (mr *MockValidatorServiceClientMockRecorder) ValidatorSlot(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorSlot", reflect.TypeOf((*MockValidatorServiceClient)(nil).ValidatorSlot), varargs...)
}

View File

@@ -0,0 +1,218 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1 (interfaces: ValidatorServiceClient,ValidatorService_ValidatorAssignmentClient)
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
v1 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
grpc "google.golang.org/grpc"
metadata "google.golang.org/grpc/metadata"
)
// MockValidatorServiceClient is a mock of ValidatorServiceClient interface
type MockValidatorServiceClient struct {
ctrl *gomock.Controller
recorder *MockValidatorServiceClientMockRecorder
}
// MockValidatorServiceClientMockRecorder is the mock recorder for MockValidatorServiceClient
type MockValidatorServiceClientMockRecorder struct {
mock *MockValidatorServiceClient
}
// NewMockValidatorServiceClient creates a new mock instance
func NewMockValidatorServiceClient(ctrl *gomock.Controller) *MockValidatorServiceClient {
mock := &MockValidatorServiceClient{ctrl: ctrl}
mock.recorder = &MockValidatorServiceClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockValidatorServiceClient) EXPECT() *MockValidatorServiceClientMockRecorder {
return m.recorder
}
// ValidatorAssignment mocks base method
func (m *MockValidatorServiceClient) ValidatorAssignment(arg0 context.Context, arg1 *v1.ValidatorAssignmentRequest, arg2 ...grpc.CallOption) (v1.ValidatorService_ValidatorAssignmentClient, error) {
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ValidatorAssignment", varargs...)
ret0, _ := ret[0].(v1.ValidatorService_ValidatorAssignmentClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ValidatorAssignment indicates an expected call of ValidatorAssignment
func (mr *MockValidatorServiceClientMockRecorder) ValidatorAssignment(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorAssignment", reflect.TypeOf((*MockValidatorServiceClient)(nil).ValidatorAssignment), varargs...)
}
// ValidatorIndex mocks base method
func (m *MockValidatorServiceClient) ValidatorIndex(arg0 context.Context, arg1 *v1.PublicKey, arg2 ...grpc.CallOption) (*v1.IndexResponse, error) {
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ValidatorIndex", varargs...)
ret0, _ := ret[0].(*v1.IndexResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ValidatorIndex indicates an expected call of ValidatorIndex
func (mr *MockValidatorServiceClientMockRecorder) ValidatorIndex(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorIndex", reflect.TypeOf((*MockValidatorServiceClient)(nil).ValidatorIndex), varargs...)
}
// ValidatorShardID mocks base method
func (m *MockValidatorServiceClient) ValidatorShardID(arg0 context.Context, arg1 *v1.PublicKey, arg2 ...grpc.CallOption) (*v1.ShardIDResponse, error) {
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ValidatorShardID", varargs...)
ret0, _ := ret[0].(*v1.ShardIDResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ValidatorShardID indicates an expected call of ValidatorShardID
func (mr *MockValidatorServiceClientMockRecorder) ValidatorShardID(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorShardID", reflect.TypeOf((*MockValidatorServiceClient)(nil).ValidatorShardID), varargs...)
}
// ValidatorSlot mocks base method
func (m *MockValidatorServiceClient) ValidatorSlot(arg0 context.Context, arg1 *v1.PublicKey, arg2 ...grpc.CallOption) (*v1.SlotResponse, error) {
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "ValidatorSlot", varargs...)
ret0, _ := ret[0].(*v1.SlotResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ValidatorSlot indicates an expected call of ValidatorSlot
func (mr *MockValidatorServiceClientMockRecorder) ValidatorSlot(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorSlot", reflect.TypeOf((*MockValidatorServiceClient)(nil).ValidatorSlot), varargs...)
}
// MockValidatorService_ValidatorAssignmentClient is a mock of ValidatorService_ValidatorAssignmentClient interface
type MockValidatorService_ValidatorAssignmentClient struct {
ctrl *gomock.Controller
recorder *MockValidatorService_ValidatorAssignmentClientMockRecorder
}
// MockValidatorService_ValidatorAssignmentClientMockRecorder is the mock recorder for MockValidatorService_ValidatorAssignmentClient
type MockValidatorService_ValidatorAssignmentClientMockRecorder struct {
mock *MockValidatorService_ValidatorAssignmentClient
}
// NewMockValidatorService_ValidatorAssignmentClient creates a new mock instance
func NewMockValidatorService_ValidatorAssignmentClient(ctrl *gomock.Controller) *MockValidatorService_ValidatorAssignmentClient {
mock := &MockValidatorService_ValidatorAssignmentClient{ctrl: ctrl}
mock.recorder = &MockValidatorService_ValidatorAssignmentClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockValidatorService_ValidatorAssignmentClient) EXPECT() *MockValidatorService_ValidatorAssignmentClientMockRecorder {
return m.recorder
}
// CloseSend mocks base method
func (m *MockValidatorService_ValidatorAssignmentClient) CloseSend() error {
ret := m.ctrl.Call(m, "CloseSend")
ret0, _ := ret[0].(error)
return ret0
}
// CloseSend indicates an expected call of CloseSend
func (mr *MockValidatorService_ValidatorAssignmentClientMockRecorder) CloseSend() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockValidatorService_ValidatorAssignmentClient)(nil).CloseSend))
}
// Context mocks base method
func (m *MockValidatorService_ValidatorAssignmentClient) Context() context.Context {
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context
func (mr *MockValidatorService_ValidatorAssignmentClientMockRecorder) Context() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockValidatorService_ValidatorAssignmentClient)(nil).Context))
}
// Header mocks base method
func (m *MockValidatorService_ValidatorAssignmentClient) Header() (metadata.MD, error) {
ret := m.ctrl.Call(m, "Header")
ret0, _ := ret[0].(metadata.MD)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Header indicates an expected call of Header
func (mr *MockValidatorService_ValidatorAssignmentClientMockRecorder) Header() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockValidatorService_ValidatorAssignmentClient)(nil).Header))
}
// Recv mocks base method
func (m *MockValidatorService_ValidatorAssignmentClient) Recv() (*v1.ValidatorAssignmentResponse, error) {
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*v1.ValidatorAssignmentResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv
func (mr *MockValidatorService_ValidatorAssignmentClientMockRecorder) Recv() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockValidatorService_ValidatorAssignmentClient)(nil).Recv))
}
// RecvMsg mocks base method
func (m *MockValidatorService_ValidatorAssignmentClient) RecvMsg(arg0 interface{}) error {
ret := m.ctrl.Call(m, "RecvMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg
func (mr *MockValidatorService_ValidatorAssignmentClientMockRecorder) RecvMsg(arg0 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockValidatorService_ValidatorAssignmentClient)(nil).RecvMsg), arg0)
}
// SendMsg mocks base method
func (m *MockValidatorService_ValidatorAssignmentClient) SendMsg(arg0 interface{}) error {
ret := m.ctrl.Call(m, "SendMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg
func (mr *MockValidatorService_ValidatorAssignmentClientMockRecorder) SendMsg(arg0 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockValidatorService_ValidatorAssignmentClient)(nil).SendMsg), arg0)
}
// Trailer mocks base method
func (m *MockValidatorService_ValidatorAssignmentClient) Trailer() metadata.MD {
ret := m.ctrl.Call(m, "Trailer")
ret0, _ := ret[0].(metadata.MD)
return ret0
}
// Trailer indicates an expected call of Trailer
func (mr *MockValidatorService_ValidatorAssignmentClientMockRecorder) Trailer() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockValidatorService_ValidatorAssignmentClient)(nil).Trailer))
}