TobiWo/eth-duties

Add API to add validators

Closed this issue · 5 comments

laibe commented

This would be a nice to have feature, instead of having a static list of validators via CLI or file allow for dynamic addition of new validators via a REST API call (e.g. using fastapi).

Hi @laibe, I'm currently working on some smaller improvements e.g. that you can also provide pubkeys. However, the rest api feature is a great idea and was already requested multiple times (although a bit differently then you suggest, see issue link). That's tracked in the following issue.

With regards to your proposed functionality: My idea is that eth-duties will read managed validator keys from the validator client itself (see here) during runtime. All clients expose the validator keymanager api. So in the end the user does not need to care about supplying validators to eth-duties at all. However, this needs some extra configuration of the validator client itself and I'm not sure if it is an security issue to expose that api.

Maybe the best idea is to add both ways (automated fetching from client, add new indices/pubkey via POST call) so the user can decide.

laibe commented

Thanks @TobiWo, agree! Fetching the keys automatically from the validator client would be the most convenient option for more sophisticated setups but this then might also need to support some kind of authentication method (e.g. lighthouse protects the api via a bearer token by default and web3signer has tls support).

For solo stakers I would not recommend enabling the keymanager api since it also supports key deletion & addition.

I 100% agree. That's why it is probably the best way to implement both ways so more experienced users and professional node operators can decide to use the automated fetching and setting up their validator clients accordingly.

Yes, the authentication handling will be interesting. Need to wrap my head around this first 😃 .

TobiWo commented

HI @laibe, just for your info: The RESTful API is now available and contains two endpoints to add and delete validator identifiers during runtime. For a full endpoint documentation please check the swagger spec which can be reached via http://localhost:5000/docs.

laibe commented

awesome, thanks!