Here are the Prysm validator features that I’ve been working on last week:
GetDuties
While the beacon REST API separates the duties retrieval in 3 distinct endpoints (/eth/v1/validator/duties/attester/{epoch}
, /eth/v1/validator/duties/proposer/{epoch}
and /eth/v1/validator/duties/sync/{epoch}
), the Prysm gRPC API does everything in a single function called GetDuties
. Moreover, GetDuties
automatically retrieves the duties for the current epoch and the next epoch while the beacon REST API endpoints only target a single epoch at a time. For these reasons, this endpoint required combining a lot of endpoints together and massaging the data to make it fit into a single giant data structure containing all duties for epoch
and epoch+1
.
To make sure that the mapping respected all requirements of the gRPC API, a few rules and details have to be kept in mind:
pending
state.epoch
and epoch+1
epoch+1
)epoch>=AltairForkEpoch
.With those rules in mind, the implementation was relatively straightforward:
/eth/v1/beacon/states/head/validators
endpoint to get the indices and status of each validator.{committeeIndex, slot} -> validatorIndices
mapepoch
and epoch+1
and cache them in a validatorIndex -> {committeeIndex, slot}
mapepoch
and epoch+1
(if epoch>=AltairForkEpoch
) and cache the validator indices that have a sync dutie for this epoch in a setepoch
and cache them in a validatorIndex -> slot
mapIsSyncCommittee
value of the output struct to true
Although the implementation is done and I have verified that it passes all tests, I haven't created a PR yet because it's dependent on 2 pending PRs:
Also, implementing this endpoint revealed bugs in the implementation of all 3 duties endpoint, where an epoch would be erroneously rejected because it was in the future. When the Prysm team comes back from the holidays break, I'll work with them to tackle this issue.
Next week, I'm planning to implement the StreamBlocksAltair
API. This is pretty exciting because it's the last endpoint that hasn't been assigned to someone yet, which means that all endpoints have either been merged into the develop
branch, have a PR opened for them or are actively being worked on by an EPF fellow:
Legend:
Symbol | State |
---|---|
![]() |
Not ready for PR |
![]() |
PR opened |
![]() |
Merged into develop |
Done | Owner | Endpoint |
---|---|---|
![]() |
pavignol | GetDuties |
![]() |
pavignol | GetBeaconBlock |
![]() |
pavignol | ProposeBeaconBlock |
![]() |
pavignol | PrepareBeaconProposer |
![]() |
pavignol | GetAttestationData |
![]() |
dhruv | ProposeAttestation |
![]() |
dhruv | SubmitAggregateSelectionProof |
![]() |
dhruv | SubmitSignedAggregateSelectionProof |
![]() |
pavignol | ProposeExit |
![]() |
pavignol | SubscribeCommitteeSubnets |
![]() |
manu | SubmitValidatorRegistrations |
![]() |
manu | ValidatorIndex |
![]() |
manu | ValidatorStatus |
![]() |
manu | MultipleValidatorStatus |
![]() |
pavignol | SubmitSignedContributionAndProof |
![]() |
manu | SubmitSyncMessage |
![]() |
dhruv | GetSyncSubcommitteeIndex |
![]() |
dhruv | GetSyncMessageBlockRoot |
![]() |
pavignol | StreamDuties |
![]() |
pavignol | WaitForChainStart |
![]() |
manu | WaitForActivation |
![]() |
pavignol | StreamBlocksAltair |
![]() |
pavignol | DomainData |
![]() |
manu | GetFeeRecipientByPubKey |
![]() |
manu | CheckDoppelGanger |
![]() |
dhruv | GetSyncCommitteeContribution |