Refactor ValidatorSlot RPC and Casper to Return ValidatorSlotAndResponsibility (#565)

* slot responsibility casper refactor

* fix
This commit is contained in:
Raul Jordan
2018-09-24 10:18:27 -05:00
committed by Nishant Das
parent b59a4eef4e
commit 78ccea9865
7 changed files with 183 additions and 161 deletions

View File

@@ -142,24 +142,27 @@ func ValidatorShardID(pubKey uint64, dynasty uint64, validators []*pb.ValidatorR
return 0, fmt.Errorf("can't find shard ID for validator with public key %d", pubKey)
}
// ValidatorSlot returns the slot number of when the validator gets to attest or proposer.
func ValidatorSlot(pubKey uint64, dynasty uint64, validators []*pb.ValidatorRecord, shardCommittees []*pb.ShardAndCommitteeArray) (uint64, error) {
// ValidatorSlotAndResponsibility returns a validator's assingned slot number
// and whether it should act as an attester or proposer.
func ValidatorSlotAndResponsibility(pubKey uint64, dynasty uint64, validators []*pb.ValidatorRecord, shardCommittees []*pb.ShardAndCommitteeArray) (uint64, string, error) {
index, err := ValidatorIndex(pubKey, dynasty, validators)
if err != nil {
return 0, err
return 0, "", err
}
for slot, slotCommittee := range shardCommittees {
for _, committee := range slotCommittee.ArrayShardAndCommittee {
for _, validator := range committee.Committee {
for i, committee := range slotCommittee.ArrayShardAndCommittee {
for v, validator := range committee.Committee {
if i == 0 && v == slot%len(committee.Committee) && validator == index {
return uint64(slot), "proposer", nil
}
if validator == index {
return uint64(slot), nil
return uint64(slot), "attester", nil
}
}
}
}
return 0, fmt.Errorf("can't find slot number for validator with public key %d", pubKey)
return 0, "", fmt.Errorf("can't find slot number for validator with public key %d", pubKey)
}
// TotalActiveValidatorDeposit returns the total deposited amount in wei for all active validators.

View File

@@ -217,7 +217,7 @@ func TestValidatorShardID(t *testing.T) {
}
}
func TestValidatorSlot(t *testing.T) {
func TestValidatorSlotAndResponsibility(t *testing.T) {
var validators []*pb.ValidatorRecord
for i := 0; i < 61; i++ {
validators = append(validators, &pb.ValidatorRecord{StartDynasty: 0, EndDynasty: 10, PublicKey: 0})
@@ -239,12 +239,12 @@ func TestValidatorSlot(t *testing.T) {
{ShardId: 8, Committee: []uint32{54, 55, 56, 57, 58, 59}},
}},
}
if _, err := ValidatorSlot(100, 0, validators, shardCommittees); err == nil {
if _, _, err := ValidatorSlotAndResponsibility(100, 0, validators, shardCommittees); err == nil {
t.Fatalf("ValidatorSlot should have failed, there's no validator with pubkey 100")
}
validators[59].PublicKey = 100
slot, err := ValidatorSlot(100, 0, validators, shardCommittees)
slot, _, err := ValidatorSlotAndResponsibility(100, 0, validators, shardCommittees)
if err != nil {
t.Fatalf("call ValidatorSlot failed: %v", err)
}
@@ -253,7 +253,7 @@ func TestValidatorSlot(t *testing.T) {
}
validators[60].PublicKey = 101
if _, err := ValidatorSlot(101, 0, validators, shardCommittees); err == nil {
if _, _, err := ValidatorSlotAndResponsibility(101, 0, validators, shardCommittees); err == nil {
t.Fatalf("ValidatorSlot should have failed, validator indexed at 60 is not in the committee")
}
}

View File

@@ -259,12 +259,12 @@ func (s *Service) ValidatorShardID(ctx context.Context, req *pb.PublicKey) (*pb.
return &pb.ShardIDResponse{ShardId: shardID}, nil
}
// ValidatorSlot is called by a validator to get the slot number of when it's suppose
// to proposer or attest.
func (s *Service) ValidatorSlot(ctx context.Context, req *pb.PublicKey) (*pb.SlotResponse, error) {
// ValidatorSlotAndResponsibility fetches a validator's assigned slot number
// and whether it should act as a proposer/attester.
func (s *Service) ValidatorSlotAndResponsibility(ctx context.Context, req *pb.PublicKey) (*pb.SlotResponsibilityResponse, error) {
cState := s.chainService.CurrentCrystallizedState()
slot, err := casper.ValidatorSlot(
slot, responsibility, err := casper.ValidatorSlotAndResponsibility(
req.PublicKey,
cState.CurrentDynasty(),
cState.Validators(),
@@ -274,7 +274,14 @@ func (s *Service) ValidatorSlot(ctx context.Context, req *pb.PublicKey) (*pb.Slo
return nil, fmt.Errorf("could not get validator slot for attester/propose: %v", err)
}
return &pb.SlotResponse{Slot: slot}, nil
var role pb.ValidatorRole
if responsibility == "proposer" {
role = pb.ValidatorRole_PROPOSER
} else if responsibility == "attester" {
role = pb.ValidatorRole_ATTESTER
}
return &pb.SlotResponsibilityResponse{Slot: slot, Role: role}, nil
}
// ValidatorIndex is called by a validator to get its index location that corresponds

View File

@@ -355,7 +355,7 @@ func TestLatestAttestation(t *testing.T) {
exitRoutine <- true
}
func TestValidatorSlot(t *testing.T) {
func TestValidatorSlotAndResponsibility(t *testing.T) {
mockChain := &mockChainService{}
rpcService := NewRPCService(context.Background(), &Config{
Port: "6372",
@@ -364,7 +364,7 @@ func TestValidatorSlot(t *testing.T) {
req := &pb.PublicKey{
PublicKey: 0,
}
if _, err := rpcService.ValidatorSlot(context.Background(), req); err != nil {
if _, err := rpcService.ValidatorSlotAndResponsibility(context.Background(), req); err != nil {
t.Errorf("Could not get validator slot: %v", err)
}
}

View File

@@ -26,30 +26,30 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type ValidatorAssignmentResponse_Role int32
type ValidatorRole int32
const (
ValidatorAssignmentResponse_UNKNOWN ValidatorAssignmentResponse_Role = 0
ValidatorAssignmentResponse_ATTESTER ValidatorAssignmentResponse_Role = 1
ValidatorAssignmentResponse_PROPOSER ValidatorAssignmentResponse_Role = 2
ValidatorRole_UNKNOWN ValidatorRole = 0
ValidatorRole_ATTESTER ValidatorRole = 1
ValidatorRole_PROPOSER ValidatorRole = 2
)
var ValidatorAssignmentResponse_Role_name = map[int32]string{
var ValidatorRole_name = map[int32]string{
0: "UNKNOWN",
1: "ATTESTER",
2: "PROPOSER",
}
var ValidatorAssignmentResponse_Role_value = map[string]int32{
var ValidatorRole_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 (x ValidatorRole) String() string {
return proto.EnumName(ValidatorRole_name, int32(x))
}
func (ValidatorAssignmentResponse_Role) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_services_c6a6f3b554d979ac, []int{6, 0}
func (ValidatorRole) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_services_f900aa593bb90835, []int{0}
}
type GenesisTimeAndStateResponse struct {
@@ -64,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_c6a6f3b554d979ac, []int{0}
return fileDescriptor_services_f900aa593bb90835, []int{0}
}
func (m *GenesisTimeAndStateResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GenesisTimeAndStateResponse.Unmarshal(m, b)
@@ -114,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_c6a6f3b554d979ac, []int{1}
return fileDescriptor_services_f900aa593bb90835, []int{1}
}
func (m *ProposeRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ProposeRequest.Unmarshal(m, b)
@@ -187,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_c6a6f3b554d979ac, []int{2}
return fileDescriptor_services_f900aa593bb90835, []int{2}
}
func (m *ProposeResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ProposeResponse.Unmarshal(m, b)
@@ -225,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_c6a6f3b554d979ac, []int{3}
return fileDescriptor_services_f900aa593bb90835, []int{3}
}
func (m *AttestRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AttestRequest.Unmarshal(m, b)
@@ -263,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_c6a6f3b554d979ac, []int{4}
return fileDescriptor_services_f900aa593bb90835, []int{4}
}
func (m *AttestResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AttestResponse.Unmarshal(m, b)
@@ -290,6 +290,8 @@ func (m *AttestResponse) GetAttestationHash() []byte {
return nil
}
// Request assignment updates for either all validators or a subset of validators
// defined by their public keys.
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"`
@@ -302,7 +304,7 @@ func (m *ValidatorAssignmentRequest) Reset() { *m = ValidatorAssignmentR
func (m *ValidatorAssignmentRequest) String() string { return proto.CompactTextString(m) }
func (*ValidatorAssignmentRequest) ProtoMessage() {}
func (*ValidatorAssignmentRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_services_c6a6f3b554d979ac, []int{5}
return fileDescriptor_services_f900aa593bb90835, []int{5}
}
func (m *ValidatorAssignmentRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValidatorAssignmentRequest.Unmarshal(m, b)
@@ -348,7 +350,7 @@ func (m *ValidatorAssignmentResponse) Reset() { *m = ValidatorAssignment
func (m *ValidatorAssignmentResponse) String() string { return proto.CompactTextString(m) }
func (*ValidatorAssignmentResponse) ProtoMessage() {}
func (*ValidatorAssignmentResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_services_c6a6f3b554d979ac, []int{6}
return fileDescriptor_services_f900aa593bb90835, []int{6}
}
func (m *ValidatorAssignmentResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValidatorAssignmentResponse.Unmarshal(m, b)
@@ -383,12 +385,12 @@ func (m *ValidatorAssignmentResponse) GetSlot() uint64 {
}
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:"-"`
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 ValidatorRole `protobuf:"varint,3,opt,name=role,proto3,enum=ethereum.beacon.rpc.v1.ValidatorRole" json:"role,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ValidatorAssignmentResponse_Assignment) Reset() {
@@ -397,7 +399,7 @@ func (m *ValidatorAssignmentResponse_Assignment) Reset() {
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}
return fileDescriptor_services_f900aa593bb90835, []int{6, 0}
}
func (m *ValidatorAssignmentResponse_Assignment) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValidatorAssignmentResponse_Assignment.Unmarshal(m, b)
@@ -431,11 +433,11 @@ func (m *ValidatorAssignmentResponse_Assignment) GetShardId() uint64 {
return 0
}
func (m *ValidatorAssignmentResponse_Assignment) GetRole() ValidatorAssignmentResponse_Role {
func (m *ValidatorAssignmentResponse_Assignment) GetRole() ValidatorRole {
if m != nil {
return m.Role
}
return ValidatorAssignmentResponse_UNKNOWN
return ValidatorRole_UNKNOWN
}
type PublicKey struct {
@@ -449,7 +451,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_c6a6f3b554d979ac, []int{7}
return fileDescriptor_services_f900aa593bb90835, []int{7}
}
func (m *PublicKey) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PublicKey.Unmarshal(m, b)
@@ -476,44 +478,52 @@ func (m *PublicKey) GetPublicKey() uint64 {
return 0
}
type SlotResponse struct {
Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
type SlotResponsibilityResponse struct {
Slot uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"`
Role ValidatorRole `protobuf:"varint,2,opt,name=role,proto3,enum=ethereum.beacon.rpc.v1.ValidatorRole" json:"role,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
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_c6a6f3b554d979ac, []int{8}
func (m *SlotResponsibilityResponse) Reset() { *m = SlotResponsibilityResponse{} }
func (m *SlotResponsibilityResponse) String() string { return proto.CompactTextString(m) }
func (*SlotResponsibilityResponse) ProtoMessage() {}
func (*SlotResponsibilityResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_services_f900aa593bb90835, []int{8}
}
func (m *SlotResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SlotResponse.Unmarshal(m, b)
func (m *SlotResponsibilityResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SlotResponsibilityResponse.Unmarshal(m, b)
}
func (m *SlotResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SlotResponse.Marshal(b, m, deterministic)
func (m *SlotResponsibilityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SlotResponsibilityResponse.Marshal(b, m, deterministic)
}
func (dst *SlotResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_SlotResponse.Merge(dst, src)
func (dst *SlotResponsibilityResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_SlotResponsibilityResponse.Merge(dst, src)
}
func (m *SlotResponse) XXX_Size() int {
return xxx_messageInfo_SlotResponse.Size(m)
func (m *SlotResponsibilityResponse) XXX_Size() int {
return xxx_messageInfo_SlotResponsibilityResponse.Size(m)
}
func (m *SlotResponse) XXX_DiscardUnknown() {
xxx_messageInfo_SlotResponse.DiscardUnknown(m)
func (m *SlotResponsibilityResponse) XXX_DiscardUnknown() {
xxx_messageInfo_SlotResponsibilityResponse.DiscardUnknown(m)
}
var xxx_messageInfo_SlotResponse proto.InternalMessageInfo
var xxx_messageInfo_SlotResponsibilityResponse proto.InternalMessageInfo
func (m *SlotResponse) GetSlot() uint64 {
func (m *SlotResponsibilityResponse) GetSlot() uint64 {
if m != nil {
return m.Slot
}
return 0
}
func (m *SlotResponsibilityResponse) GetRole() ValidatorRole {
if m != nil {
return m.Role
}
return ValidatorRole_UNKNOWN
}
type IndexResponse struct {
Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@@ -525,7 +535,7 @@ 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}
return fileDescriptor_services_f900aa593bb90835, []int{9}
}
func (m *IndexResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_IndexResponse.Unmarshal(m, b)
@@ -563,7 +573,7 @@ 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}
return fileDescriptor_services_f900aa593bb90835, []int{10}
}
func (m *ShardIDResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ShardIDResponse.Unmarshal(m, b)
@@ -600,10 +610,10 @@ func init() {
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((*SlotResponse)(nil), "ethereum.beacon.rpc.v1.SlotResponse")
proto.RegisterType((*SlotResponsibilityResponse)(nil), "ethereum.beacon.rpc.v1.SlotResponsibilityResponse")
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)
proto.RegisterEnum("ethereum.beacon.rpc.v1.ValidatorRole", ValidatorRole_name, ValidatorRole_value)
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -968,7 +978,7 @@ type ValidatorServiceClient interface {
// 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)
ValidatorSlotAndResponsibility(ctx context.Context, in *PublicKey, opts ...grpc.CallOption) (*SlotResponsibilityResponse, 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)
@@ -1000,9 +1010,9 @@ func (c *validatorServiceClient) ValidatorIndex(ctx context.Context, in *PublicK
return out, nil
}
func (c *validatorServiceClient) ValidatorSlot(ctx context.Context, in *PublicKey, opts ...grpc.CallOption) (*SlotResponse, error) {
out := new(SlotResponse)
err := c.cc.Invoke(ctx, "/ethereum.beacon.rpc.v1.ValidatorService/ValidatorSlot", in, out, opts...)
func (c *validatorServiceClient) ValidatorSlotAndResponsibility(ctx context.Context, in *PublicKey, opts ...grpc.CallOption) (*SlotResponsibilityResponse, error) {
out := new(SlotResponsibilityResponse)
err := c.cc.Invoke(ctx, "/ethereum.beacon.rpc.v1.ValidatorService/ValidatorSlotAndResponsibility", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1047,7 +1057,7 @@ type ValidatorServiceServer interface {
// 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)
ValidatorSlotAndResponsibility(context.Context, *PublicKey) (*SlotResponsibilityResponse, 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
@@ -1093,20 +1103,20 @@ func _ValidatorService_ValidatorIndex_Handler(srv interface{}, ctx context.Conte
return interceptor(ctx, in, info, handler)
}
func _ValidatorService_ValidatorSlot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _ValidatorService_ValidatorSlotAndResponsibility_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PublicKey)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ValidatorServiceServer).ValidatorSlot(ctx, in)
return srv.(ValidatorServiceServer).ValidatorSlotAndResponsibility(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ethereum.beacon.rpc.v1.ValidatorService/ValidatorSlot",
FullMethod: "/ethereum.beacon.rpc.v1.ValidatorService/ValidatorSlotAndResponsibility",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ValidatorServiceServer).ValidatorSlot(ctx, req.(*PublicKey))
return srv.(ValidatorServiceServer).ValidatorSlotAndResponsibility(ctx, req.(*PublicKey))
}
return interceptor(ctx, in, info, handler)
}
@@ -1145,8 +1155,8 @@ var _ValidatorService_serviceDesc = grpc.ServiceDesc{
Handler: _ValidatorService_ValidatorIndex_Handler,
},
{
MethodName: "ValidatorSlot",
Handler: _ValidatorService_ValidatorSlot_Handler,
MethodName: "ValidatorSlotAndResponsibility",
Handler: _ValidatorService_ValidatorSlotAndResponsibility_Handler,
},
},
Streams: []grpc.StreamDesc{
@@ -1160,69 +1170,70 @@ var _ValidatorService_serviceDesc = grpc.ServiceDesc{
}
func init() {
proto.RegisterFile("proto/beacon/rpc/v1/services.proto", fileDescriptor_services_c6a6f3b554d979ac)
proto.RegisterFile("proto/beacon/rpc/v1/services.proto", fileDescriptor_services_f900aa593bb90835)
}
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, 0x2d, 0xf6, 0x7a, 0x02, 0xa3, 0x85,
0x3f, 0x41, 0x61, 0xa9, 0x4d, 0x72, 0x1f, 0xe5, 0x14, 0x23, 0x9c, 0xcf, 0x2c, 0x9d, 0x66, 0x45,
0xe1, 0xc4, 0x5a, 0xec, 0x75, 0x97, 0x6b, 0xc3, 0x7e, 0x18, 0xd7, 0xce, 0x50, 0x08, 0xea, 0xa5,
0xb5, 0xdd, 0x4d, 0x8f, 0x73, 0x8f, 0x61, 0x4f, 0xad, 0xc6, 0xf3, 0x9f, 0x7b, 0x38, 0x0b, 0xe5,
0x79, 0xb2, 0xf9, 0xe0, 0xe2, 0xa6, 0xf4, 0x67, 0x28, 0x24, 0x9d, 0x85, 0x3a, 0xc1, 0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35, 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,
var fileDescriptor_services_f900aa593bb90835 = []byte{
// 963 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xdd, 0x72, 0xdb, 0x44,
0x14, 0x46, 0xb6, 0xdb, 0x26, 0xc7, 0xb1, 0xe3, 0x6e, 0x99, 0xc6, 0x71, 0x80, 0x06, 0x75, 0x02,
0x69, 0x07, 0xe4, 0x44, 0xb9, 0x29, 0x30, 0xc3, 0xe0, 0x94, 0x4c, 0xdb, 0x69, 0x27, 0xc9, 0xc8,
0x06, 0x66, 0x80, 0xa9, 0xba, 0xb6, 0x0e, 0xb2, 0xc6, 0xab, 0x1f, 0xb4, 0x6b, 0x83, 0xb9, 0xe2,
0x0e, 0x9e, 0x82, 0x2b, 0x9e, 0x82, 0x47, 0x60, 0x86, 0x77, 0x62, 0xb4, 0x2b, 0xc9, 0x72, 0x1a,
0xd5, 0x49, 0xef, 0xa4, 0x6f, 0xcf, 0xf9, 0xce, 0xb7, 0xdf, 0x9e, 0x3d, 0x0b, 0x7a, 0x14, 0x87,
0x22, 0xec, 0x0e, 0x91, 0x8e, 0xc2, 0xa0, 0x1b, 0x47, 0xa3, 0xee, 0xec, 0xb0, 0xcb, 0x31, 0x9e,
0x79, 0x23, 0xe4, 0x86, 0x5c, 0x24, 0x77, 0x51, 0x8c, 0x31, 0xc6, 0xa9, 0x6f, 0xa8, 0x30, 0x23,
0x8e, 0x46, 0xc6, 0xec, 0xb0, 0xb3, 0x9c, 0x1b, 0x99, 0x51, 0x92, 0xeb, 0x23, 0xe7, 0xd4, 0xcd,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f4, 0x64, 0xf5, 0x0c, 0x29, 0x2f, 0x7a, 0xf1, 0xe2, 0x7c, 0x0f, 0xcd, 0x9c, 0x5f, 0xde,
0xbd, 0xab, 0xb0, 0x97, 0x9a, 0xbd, 0x7c, 0x7b, 0x7f, 0x81, 0x0f, 0x16, 0xda, 0x59, 0x28, 0x7a,
0x81, 0xb3, 0x3c, 0x47, 0xae, 0x52, 0xcb, 0x2c, 0xdd, 0x49, 0xf9, 0x58, 0xfa, 0x5d, 0x83, 0x3b,
0x97, 0xcc, 0x74, 0x62, 0x5e, 0xeb, 0x01, 0x50, 0xc7, 0x77, 0xf4, 0x16, 0x8f, 0xc6, 0x81, 0x36,
0xbc, 0x29, 0x3b, 0xfe, 0xe8, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xbd, 0x66, 0x8c, 0x93,
0x0a, 0x00, 0x00,
}

View File

@@ -26,7 +26,7 @@ service ValidatorService {
// 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);
rpc ValidatorSlotAndResponsibility(PublicKey) returns (SlotResponsibilityResponse);
// 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);
@@ -72,22 +72,23 @@ message ValidatorAssignmentResponse {
message Assignment {
PublicKey public_key = 1;
uint64 shard_id = 2;
Role role = 3;
ValidatorRole role = 3;
}
}
enum Role {
UNKNOWN = 0;
ATTESTER = 1;
PROPOSER = 2;
}
enum ValidatorRole {
UNKNOWN = 0;
ATTESTER = 1;
PROPOSER = 2;
}
message PublicKey {
uint64 public_key = 1;
}
message SlotResponse {
message SlotResponsibilityResponse {
uint64 slot = 1;
ValidatorRole role = 2;
}
message IndexResponse {

View File

@@ -90,22 +90,22 @@ func (mr *MockValidatorServiceClientMockRecorder) ValidatorShardID(arg0, arg1 in
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) {
// ValidatorSlotAndResponsibility mocks base method
func (m *MockValidatorServiceClient) ValidatorSlotAndResponsibility(arg0 context.Context, arg1 *v1.PublicKey, arg2 ...grpc.CallOption) (*v1.SlotResponsibilityResponse, 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)
ret := m.ctrl.Call(m, "ValidatorSlotAndResponsibility", varargs...)
ret0, _ := ret[0].(*v1.SlotResponsibilityResponse)
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 {
// ValidatorSlotAndResponsibility indicates an expected call of ValidatorSlotAndResponsibility
func (mr *MockValidatorServiceClientMockRecorder) ValidatorSlotAndResponsibility(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...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorSlotAndResponsibility", reflect.TypeOf((*MockValidatorServiceClient)(nil).ValidatorSlotAndResponsibility), varargs...)
}
// MockValidatorService_ValidatorAssignmentClient is a mock of ValidatorService_ValidatorAssignmentClient interface