diff --git a/WORKSPACE b/WORKSPACE index c5b2d764e..2d2ddff4b 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1305,7 +1305,7 @@ go_repository( go_repository( name = "com_github_prysmaticlabs_ethereumapis", - commit = "4685995df20b6d7a926fb98778c940e380db33ee", + commit = "1c66911b2ef3c1a290abb2156bcecb33ac32725f", importpath = "github.com/prysmaticlabs/ethereumapis", ) diff --git a/beacon-chain/rpc/beacon/assignments.go b/beacon-chain/rpc/beacon/assignments.go index fa813475a..a889436d6 100644 --- a/beacon-chain/rpc/beacon/assignments.go +++ b/beacon-chain/rpc/beacon/assignments.go @@ -123,6 +123,7 @@ func (bs *Server) ListValidatorAssignments( AttesterSlot: comAssignment.AttesterSlot, ProposerSlots: proposerIndexToSlots[index], PublicKey: pubkey[:], + ValidatorIndex: index, } res = append(res, assign) } @@ -256,6 +257,7 @@ func (bs *Server) listValidatorAssignmentsUsingOldArchival( AttesterSlot: comAssignment.AttesterSlot, ProposerSlots: proposerIndexToSlots[index], PublicKey: pubkey[:], + ValidatorIndex: index, } res = append(res, assign) } diff --git a/beacon-chain/rpc/beacon/assignments_test.go b/beacon-chain/rpc/beacon/assignments_test.go index 31bb1c28a..e92308620 100644 --- a/beacon-chain/rpc/beacon/assignments_test.go +++ b/beacon-chain/rpc/beacon/assignments_test.go @@ -257,6 +257,7 @@ func TestServer_ListAssignments_Pagination_DefaultPageSize_NoArchive(t *testing. AttesterSlot: committeeAssignments[index].AttesterSlot, ProposerSlots: proposerIndexToSlots[index], PublicKey: val.PublicKey, + ValidatorIndex: index, }) } if !reflect.DeepEqual(res.Assignments, wanted) { @@ -348,6 +349,7 @@ func TestServer_ListAssignments_Pagination_DefaultPageSize_FromArchive(t *testin AttesterSlot: committeeAssignments[index].AttesterSlot, ProposerSlots: proposerIndexToSlots[index], PublicKey: val.PublicKey, + ValidatorIndex: index, }) } @@ -437,6 +439,7 @@ func TestServer_ListAssignments_FilterPubkeysIndices_NoPagination(t *testing.T) AttesterSlot: committeeAssignments[index].AttesterSlot, ProposerSlots: proposerIndexToSlots[index], PublicKey: val.PublicKey, + ValidatorIndex: index, }) } @@ -520,6 +523,7 @@ func TestServer_ListAssignments_CanFilterPubkeysIndices_WithPagination(t *testin AttesterSlot: committeeAssignments[index].AttesterSlot, ProposerSlots: proposerIndexToSlots[index], PublicKey: val.PublicKey, + ValidatorIndex: index, }) } @@ -555,6 +559,7 @@ func TestServer_ListAssignments_CanFilterPubkeysIndices_WithPagination(t *testin AttesterSlot: cAssignments[index].AttesterSlot, ProposerSlots: proposerIndexToSlots[index], PublicKey: val.PublicKey, + ValidatorIndex: index, }) } diff --git a/beacon-chain/rpc/beacon/validators.go b/beacon-chain/rpc/beacon/validators.go index aaf763019..af1549f99 100644 --- a/beacon-chain/rpc/beacon/validators.go +++ b/beacon-chain/rpc/beacon/validators.go @@ -778,9 +778,11 @@ func (bs *Server) GetValidatorQueue( } return ðpb.ValidatorQueue{ - ChurnLimit: churnLimit, - ActivationPublicKeys: activationQueueKeys, - ExitPublicKeys: exitQueueKeys, + ChurnLimit: churnLimit, + ActivationPublicKeys: activationQueueKeys, + ExitPublicKeys: exitQueueKeys, + ActivationValidatorIndices: activationQ, + ExitValidatorIndices: exitQueueIndices, }, nil } diff --git a/beacon-chain/rpc/beacon/validators_test.go b/beacon-chain/rpc/beacon/validators_test.go index c515564e9..4ede5e2f5 100644 --- a/beacon-chain/rpc/beacon/validators_test.go +++ b/beacon-chain/rpc/beacon/validators_test.go @@ -1434,6 +1434,10 @@ func TestServer_GetValidatorQueue_PendingActivation(t *testing.T) { if !reflect.DeepEqual(res.ActivationPublicKeys, wanted) { t.Errorf("Wanted %v, received %v", wanted, res.ActivationPublicKeys) } + wantedActiveIndices := []uint64{2, 1, 0} + if !reflect.DeepEqual(res.ActivationValidatorIndices, wantedActiveIndices) { + t.Errorf("wanted %v, received %v", wantedActiveIndices, res.ActivationValidatorIndices) + } } func TestServer_GetValidatorQueue_ExitedValidatorLeavesQueue(t *testing.T) { @@ -1487,6 +1491,10 @@ func TestServer_GetValidatorQueue_ExitedValidatorLeavesQueue(t *testing.T) { if !reflect.DeepEqual(res.ExitPublicKeys, wanted) { t.Errorf("Wanted %v, received %v", wanted, res.ExitPublicKeys) } + wantedExitIndices := []uint64{1} + if !reflect.DeepEqual(res.ExitValidatorIndices, wantedExitIndices) { + t.Errorf("wanted %v, received %v", wantedExitIndices, res.ExitValidatorIndices) + } // Now, we move the state.slot past the exit epoch of the validator, and now // the validator should no longer exist in the queue.