The goal of this document is to be the main place to gather notes and ideas for the Prysm projects that the Ethereum Protocol Fellowship Cohort 3 participants want to work on. The scope of the project should be limited to the duration of the fellowship cohort (4 months). So far, 2 projects came out:
Read issue on the Prysm repo for more details.
Currently, at a very high level, Prysm's validator logic to handle incoming requests looks like to following:
Ideally, after refactoring, the logic would be more similar to this:
The idea is that instead of having to go through a reverse-proxy just to call the gRPC implementation, a REST API request would be able to be completely decoupled from gRPC and instead call a common implementation that satisfies the need of both the gRPC and OpenAPI endpoints. This approach would allow us to get rid of grpc-gateway, which gives us the following benefits:
Overall, decoupling the OpenAPI and gRPC implementations should make Prysm easier to maintain while still being able to service requests from both endpoints. Also, if we decide to remove the gRPC endpoint entirely in the future, it will make transition and maintenance much easier.
Legend:
Symbol | State |
---|---|
Image Not Showing
Possible Reasons
|
Not ready for PR |
Image Not Showing
Possible Reasons
|
PR opened |
Image Not Showing
Possible Reasons
|
Merged into develop |
Done | Owner | gRPC | Beacon API | Description |
---|---|---|---|---|
Image Not Showing
Possible Reasons
|
pavignol | GetDuties | /eth/v1/validator/duties/attester/{epoch} /eth/v1/validator/duties/proposer/{epoch} |
Returns a list of duties which are the actions should be performed by validators for a given epoch. |
Image Not Showing
Possible Reasons
|
pavignol | GetBeaconBlock | /eth/v2/validator/blocks/{slot} | Retrieves the latest valid beacon block to be proposed on the beacon chain. |
Image Not Showing
Possible Reasons
|
pavignol | ProposeBeaconBlock | /eth/v1/beacon/blocks /eth/v1/beacon/blinded_blocks |
Sends the newly signed beacon block to beacon node. |
Image Not Showing
Possible Reasons
|
pavignol | PrepareBeaconProposer | /eth/v1/validator/prepare_beacon_proposer | Submits fee recipient information to be used when preparing block. |
Image Not Showing
Possible Reasons
|
pavignol | GetAttestationData | /eth/v1/beacon/blocks/head/attestations (GET) | Retrieves the latest valid attestation data to be attested on the beacon chain. |
Image Not Showing
Possible Reasons
|
dhruv | ProposeAttestation | /eth/v1/beacon/blocks/head/attestations (POST) | Sends the newly signed attestation to beacon node. |
Image Not Showing
Possible Reasons
|
dhruv | SubmitAggregateSelectionProof | /eth/v1/validator/aggregate_attestation /eth/v1/validator/aggregate_and_proofs |
Submit selection proof to the beacon node to aggregate all matching wire attestations with the same data root. |
Image Not Showing
Possible Reasons
|
dhruv | SubmitSignedAggregateSelectionProof | ||
Image Not Showing
Possible Reasons
|
pavignol | ProposeExit | /eth/v1/beacon/pool/voluntary_exits (POST) | Propose to leave the list of active validators. |
Image Not Showing
Possible Reasons
|
pavignol | SubscribeCommitteeSubnets | /eth/v1/validator/beacon_committee_subscriptions | Subscribe to particular committee ID subnets given validator's duty. |
Image Not Showing
Possible Reasons
|
manu | SubmitValidatorRegistrations | /eth/v1/validator/register_validator | Provide beacon node with registration for the given validators. |
Image Not Showing
Possible Reasons
|
manu | ValidatorIndex | /eth/v1/beacon/states/head/validators/{0x_prefixed_public_key} | Retrieves a validator's index location in the beacon state's validator registry. |
Image Not Showing
Possible Reasons
|
manu | ValidatorStatus | /eth/v1/beacon/states/head/validators/{0x_prefixed_public_key} | Returns a validator's status based on the current epoch. |
Image Not Showing
Possible Reasons
|
manu | MultipleValidatorStatus | /eth/v1/beacon/states/head/validators | Returns a list of validator statuses on the current epoch. After getting the list, filter by public keys. |
Image Not Showing
Possible Reasons
|
pavignol | SubmitSignedContributionAndProof | /eth/v1/validator/contribution_and_proofs | Submit a signed sync committee contribution and proof object. |
Image Not Showing
Possible Reasons
|
manu | SubmitSyncMessage | /eth/v1/beacon/pool/sync_committees | Submits a sync committee message to be broadcasted over network. |
Image Not Showing
Possible Reasons
|
dhruv | GetSyncSubcommitteeIndex | None | This can be computed locally compute_subnets_for_sync_committee |
Image Not Showing
Possible Reasons
|
dhruv | GetSyncMessageBlockRoot | /eth/v1/beacon/blocks/{block_id}/root | |
Image Not Showing
Possible Reasons
|
pavignol | StreamDuties | ||
Image Not Showing
Possible Reasons
|
pavignol | WaitForChainStart | /eth/v1/beacon/genesis | /eth/v1/beacon/genesis returns the same set of information that eth/v1alpha1/validator/chainstart/stream is needed for. |
Image Not Showing
Possible Reasons
|
manu | WaitForActivation | ||
Image Not Showing
Possible Reasons
|
pavignol | StreamBlocksAltair | ||
Image Not Showing
Possible Reasons
|
pavignol | DomainData | None | Can be calculated refer with fork schedule and genesis information. |
Image Not Showing
Possible Reasons
|
manu | GetFeeRecipientByPubKey | None | |
Image Not Showing
Possible Reasons
|
manu | CheckDoppelGanger | ||
Image Not Showing
Possible Reasons
|
dhruv | GetSyncCommitteeContribution | /eth/v1/validator/sync_committee_contribution?slot=%d&subcommittee_index=%d&beacon_block_root=%s | |
Image Not Showing
Possible Reasons
|
pavignol | GetSyncStatus | /eth/v1/node/syncing | |
Image Not Showing
Possible Reasons
|
pavignol | GetGenesis | /eth/v1/beacon/genesis | |
Image Not Showing
Possible Reasons
|
GetVersion | Only used for the Prysm Web UI, which is now deprecated | ||
Image Not Showing
Possible Reasons
|
ListPeers | Only used for the Prysm Web UI, which is now deprecated | ||
Image Not Showing
Possible Reasons
|
GetChainHead | Only used for the Prysm Web UI, which is now deprecated | ||
Image Not Showing
Possible Reasons
|
ListValidatorBalances | Only used for the Prysm Web UI, which is now deprecated | ||
Image Not Showing
Possible Reasons
|
pavignol | ListValidators | /eth/v1/beacon/states/head/validators | |
Image Not Showing
Possible Reasons
|
GetValidatorQueue | Only used for the Prysm Web UI, which is now deprecated | ||
Image Not Showing
Possible Reasons
|
pavignol | GetValidatorPerformance | /eth/v2/debug/beacon/states | |
Image Not Showing
Possible Reasons
|
GetValidatorParticipation | Only used for the Prysm Web UI, which is now deprecated | ||
Image Not Showing
Possible Reasons
|
IsSlashableAttestation | The gRPC version of this endpoint returns the following error: could not check if attestation is slashable: rpc error: code = Unimplemented desc = unknown service ethereum.eth.v1alpha1.Slasher |
||
Image Not Showing
Possible Reasons
|
IsSlashableBlock | The gRPC version of this endpoint returns the following error: could not check if block is slashable: rpc error: code = Unimplemented desc = unknown service ethereum.eth.v1alpha1.Slasher |
Prysm gRPC definitions are available here.
Beacon API validator status definition here
gRPC API validator status definition here
Beacon API status | gRPC Status |
---|---|
pending_initialized | PARTIALLY_DEPOSITED, DEPOSITED |
pending_queued | PENDING |
active_ongoing | ACTIVE |
active_exiting | EXITING |
active_slashed | SLASHING |
exited_unslashed | EXITED |
exited_slashed | EXITED |
withdrawal_possible | ? |
withdrawal_done | ? |
Missing gRPC Status: UNKNOWN_STATUS, INVALID
Currently, Prysm uses a wallet mechanism that is different from other clients. Other clients usually use EIP-2335 for the keystore standard and EIP-2386 for the HD Walletstore, but what Prysm is using is more like a container for the keystores that users import.
@JamesHe says that the Prysm team originally took this approach to save time for users that have a lot of keystores, since decrypting all the keystores to sign messages at runtime could add a lot of latency.
Ideally, Prysm wouldn't need this custom wallet and would instead use EIP-2335/EIP-2386 and use the keys in a way that doesn't add too much latency when signing with hundreds of keys in a filestore.
@kasey thinks that replicating the Lighthouse key management workflow as a standalone tool would be a good starting point for this project.
TODO: add bullet points list of the goals
TODO: add bullet points list of the non-goals
TODO: write down possible solutions to the problems, trade-offs, diagrams, etc.