sigp / lighthouse

Ethereum consensus client in Rust
https://lighthouse.sigmaprime.io/
Apache License 2.0
2.91k stars 738 forks source link

`GET /eth/v1/validator/{pubkey}/feerecipient` returns HTTP 500 when fee recipient is not set #3507

Open hukkin opened 2 years ago

hukkin commented 2 years ago

Description

This keymanager API endpoint returns a server error if fee recipient is not set in validator_definitions.yml or via --suggested-fee-recipient

Version

https://hub.docker.com/layers/lighthouse/sigp/lighthouse/v3.0.0-modern/images/sha256-d34333dbdbd4a3b3266cb908945ede038c923af90bb49d2399da4375173cdef5?context=explore

Present Behaviour

HTTP 500 Internal Server Error

Expected Behaviour

Keymanager API docs don't seem to define expected behavior for this edge case.

Perhaps return a HTTP 404 along with a message explaining that no fee recipient is currently set? Or alternatively default to some fee recipient (zero address? a lighthouse dev tip jar?) and return that?

xrchz commented 2 years ago

What fee recipient will be used for block production in this case? That's probably what should be returned (with HTTP 200).

michaelsproul commented 2 years ago

It depends on the beacon node. If the BN has a fee recipient set then it will be used, but the VC doesn't have a way of knowing that so I think a 404 response is most feasible.

In the case where the BN doesn't have a fee recipient, the funds are burnt at the 0x01 address: https://github.com/sigp/lighthouse/blob/aa022f46855df2a1420a6a80a788c73dc2779aa7/beacon_node/execution_layer/src/lib.rs#L57-L65