# Ethereum Protocol Fellowship - The Third Cohort (Update 10)
## Long term topic I'm working on
Rewrite the validator client code to be compatible with the Beacon API instead of prysmaticlabs' internal API.
Ticket [here](https://github.com/prysmaticlabs/prysm/issues/11580).
## Actions done
### `GetFeeRecipientByPubKey`
I wrote [this (merged) PR](https://github.com/prysmaticlabs/prysm/pull/11970):
### What does this PR do? Why is it needed?
This PR introduces two main changes:
#### FeeRecipientconfig
In `ProposerOption`, a new wrapper `FeeRecipientConfig` around `FeeRecipient` is created:
```go
type FeeRecipientConfig struct {
FeeRecipient common.Address
}
// ProposerOption is a Prysm internal representation of the ProposerOptionPayload on the validator client in bytes format instead of hex.
type ProposerOption struct {
FeeRecipientConfig *FeeRecipientConfig
BuilderConfig *BuilderConfig
}
```
This change enables the fact that `FeeRecipient` could be undefined while `BuilderConfig` is defined.
This fixes https://github.com/prysmaticlabs/prysm/issues/11948.
This PR ensures `PrepareBeaconProposer` and `SubmitValidatorRegistrations` are called only for pubkeys with a (custom or default) fee recipient.
==> We can call [POST setGasLimit](https://ethereum.github.io/keymanager-APIs/#/Gas%20Limit/setGasLimit) on a pubkey without fee recipient without automatically defined the corresponding fee recipient to burn address.
#### GetFeeRecipientByPubKey
Before this PR, `GetFeeRecipientByPubKey` gRPC call is called in:
- `SetGasLimit`,
- `SetFeeRecipientByPubkey`, and
- `ListFeeRecipientByPubkey`
There is no (direct or indirect) equivalent of `GetFeeRecipientByPubKey` in Beacon API.
The idea of this PR is to reduce usage of `GetFeeRecipientByPubKey` gRPC call as low as possible.
After this PR, `GetFeeRecipientByPubKey` gRPC is only used in `ListFeeRecipientByPubkey`.
A next PR will handle this last case in order to be fully Beacon API compatible.
---------------
Also, I wrote [this (not yet merged) PR](https://github.com/prysmaticlabs/prysm/pull/11991):
### What does this PR do? Why is it needed?
This PR deals with the (lack of) implementation for the `GetFeeRecipientByPubKey` method in beacon API.
With gRPC implementation, if, for a given `{pubkey}`:
- no `{pubkey}` specific fee recipient is set in validator client, AND
- no default fee recipient is set in validator client, AND
- the `GetFeeRecipientByPubKey` gRPC beacon API call responds on error, then:
**Before this PR**, the call to `GET /eth/v1/validator/{pubkey}/feerecipient` returns the burn address `0x0000....`
**After this PR** the call to `GET /eth/v1/validator/{pubkey}/feerecipient` returns:
```
{
"message": "Failed to retrieve default fee recipient from beacon node",
"code": 500
}
```
With gRPC implementation, if, for a given `{pubkey}`:
- no `{pubkey}` specific fee recipient is set in validator client, AND
- no default fee recipient is set in validator client, AND
- the `GetFeeRecipientByPubKey` gRPC beacon API call responds with a `nil` value or with an empty value, then:
**Before this PR**, the call to `GET /eth/v1/validator/{pubkey}/feerecipient` returns the burn address `0x0000....`
**After this PR** the call to `GET /eth/v1/validator/{pubkey}/feerecipient` returns:
```
{
"message": "No fee recipient set",
"code": 400
}
```
With beacon API implementation, if, for a given `{pubkey}`:
- no `{pubkey}` specific fee recipient is set in validator client, AND
- no default fee recipient is set in validator client, then:
the call to `GET /eth/v1/validator/{pubkey}/feerecipient` returns:
```
{
"message": "No fee recipient set",
"code": 400
}
```
**Warning:**
The 400 and 500 code listed above will cause, in Prysm validator WebUI, the following error:
<img width="1458" alt="image" src="https://user-images.githubusercontent.com/4943830/218890041-fdc8b0ed-8c6e-4df9-a9f3-5052de6b685c.png">
Because this PR breaks the Prysm validator client WebUI, it is marked as `blocked` waiting for the Prysm validator client WebUI (which is in another git repo) update.