Skip to content

[Merged by Bors] - Implement feerecipient API for keymanager#3213

Closed
ethDreamer wants to merge 13 commits intosigp:unstablefrom
ethDreamer:move_fee_recipient
Closed

[Merged by Bors] - Implement feerecipient API for keymanager#3213
ethDreamer wants to merge 13 commits intosigp:unstablefrom
ethDreamer:move_fee_recipient

Conversation

@ethDreamer
Copy link
Member

Issue Addressed

Proposed Changes

Moved all fee_recipient_file related logic inside the ValidatorStore as it makes more sense to have this all together there. I tested this with the validators I have on mainnet-shadow-fork-5 and everything appeared to work well. Only technicality is that I can't get the method to return 401 when the authorization header is not specified (it returns 400 instead). Fixing this is probably quite difficult given that none of warp's rejections have code 401.. I don't really think this matters too much though as long as it fails.

@ethDreamer ethDreamer force-pushed the move_fee_recipient branch from e62a28d to 72a38e1 Compare May 24, 2022 04:51
@ethDreamer ethDreamer added ready-for-review The code is ready for review bellatrix Required to support the Bellatrix Upgrade labels May 24, 2022
@ethDreamer ethDreamer requested a review from michaelsproul May 24, 2022 05:03
@ethDreamer
Copy link
Member Author

For convenience, this is how the fee recipient page of the lighthouse book renders:
fee_recipient

@ethDreamer ethDreamer force-pushed the move_fee_recipient branch 2 times, most recently from d6e65e2 to fb0c84a Compare May 24, 2022 15:48
Copy link
Member

@realbigsean realbigsean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Couple of small things. Moving the fee recipient file management to the validator store makes sense to me as well.

Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

I think it would be good to add a test or two in validator_client/src/http_api/tests/keystores.rs. The rest of the API is quite well tested and I think it would be straight forward to incorporate some feerecipient tests

@michaelsproul michaelsproul added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels May 27, 2022
@ethDreamer
Copy link
Member Author

I added some tests which test the API endpoint as well as the fee_recipient_file fallback functionality..
@realbigsean and I were talking and we were wondering if we should just remove the fee_recipient_file functionality entirely now that we have an API endpoint to set the fee_recipient on the fly that will override the file if used.

It seems like it's redundant and less desirable now. On top of that, if we are to remove this, we should do it before the merge when people might start using it in their workflows..

what do you guys think @paulhauner @michaelsproul ?

@ethDreamer ethDreamer added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Jun 3, 2022
@ethDreamer ethDreamer requested a review from michaelsproul June 3, 2022 21:04
Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on the fence about deleting the fee-recipient file. I think seeing as we already have it we might as well keep it. I think it might also be easier for some users to work with than the HTTP API. E.g. you can can update the default without knowing the pubkey of the validator you want to update the fee recipient for (which could be useful for some kinds of round-robin).

Other than that, there's also the matter of the recently added delete API: ethereum/keymanager-APIs#30. We could add it to this PR before merging, or bring it in separately seeing as this PR is already nicely self-contained and has been sitting in the merge queue so long. What's your preference @ethDreamer?

@ethDreamer ethDreamer force-pushed the move_fee_recipient branch 2 times, most recently from 53312f7 to d7857c1 Compare June 15, 2022 18:04
@realbigsean
Copy link
Member

Keeping the fee recipient file and storing fee recipients in the validator_definitions file seems like it adds too much complexity to be worth it to me. We'd have to decide whether to persist it in one place or both after API requests, and then also determine fallback order in different scenarios. I don't think these would be intuitive to users and we wouldn't want that to lead to misconfigurations that aren't apparent until proposal. To me it makes the most sense to have a single source of truth.

Would it be better to create a default_fee_recipient field in the validator_definitions file and re-use the logic from the fee recipient file around that?

@michaelsproul michaelsproul added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Jun 19, 2022
@ethDreamer ethDreamer force-pushed the move_fee_recipient branch from d1b4fd9 to b8642ea Compare July 5, 2022 18:34
Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this now and come back for future enhancements:

  1. If the fee recipient setting API proves too slow with large number of validators, optimise it (possibly by batching disk writes), or if that isn't possible, add an alternative mechanism for loading fee recipients in bulk (possibly from a URL a la Teku).
  2. Add a default field for the fee recipient in the validator_definitions.yml. For now this can be worked around by using the process-level default (i.e. the value of the --suggested-fee-recipient flag).

@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Jul 6, 2022
@michaelsproul
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Jul 6, 2022
## Issue Addressed

* #3173 

## Proposed Changes

Moved all `fee_recipient_file` related logic inside the `ValidatorStore` as it makes more sense to have this all together there. I tested this with the validators I have on `mainnet-shadow-fork-5` and everything appeared to work well. Only technicality is that I can't get the method to return `401` when the authorization header is not specified (it returns `400` instead). Fixing this is probably quite difficult given that none of `warp`'s rejections have code `401`.. I don't really think this matters too much though as long as it fails.
@bors
Copy link

bors bot commented Jul 6, 2022

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Jul 6, 2022
## Issue Addressed

* #3173 

## Proposed Changes

Moved all `fee_recipient_file` related logic inside the `ValidatorStore` as it makes more sense to have this all together there. I tested this with the validators I have on `mainnet-shadow-fork-5` and everything appeared to work well. Only technicality is that I can't get the method to return `401` when the authorization header is not specified (it returns `400` instead). Fixing this is probably quite difficult given that none of `warp`'s rejections have code `401`.. I don't really think this matters too much though as long as it fails.
@michaelsproul
Copy link
Member

CI failure looks spurious, I'll restart the batch

bors r-

@bors
Copy link

bors bot commented Jul 6, 2022

Canceled.

@michaelsproul
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Jul 6, 2022
## Issue Addressed

* #3173 

## Proposed Changes

Moved all `fee_recipient_file` related logic inside the `ValidatorStore` as it makes more sense to have this all together there. I tested this with the validators I have on `mainnet-shadow-fork-5` and everything appeared to work well. Only technicality is that I can't get the method to return `401` when the authorization header is not specified (it returns `400` instead). Fixing this is probably quite difficult given that none of `warp`'s rejections have code `401`.. I don't really think this matters too much though as long as it fails.
@bors
Copy link

bors bot commented Jul 6, 2022

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Jul 6, 2022
## Issue Addressed

* #3173 

## Proposed Changes

Moved all `fee_recipient_file` related logic inside the `ValidatorStore` as it makes more sense to have this all together there. I tested this with the validators I have on `mainnet-shadow-fork-5` and everything appeared to work well. Only technicality is that I can't get the method to return `401` when the authorization header is not specified (it returns `400` instead). Fixing this is probably quite difficult given that none of `warp`'s rejections have code `401`.. I don't really think this matters too much though as long as it fails.
@bors bors bot changed the title Implement feerecipient API for keymanager [Merged by Bors] - Implement feerecipient API for keymanager Jul 6, 2022
@bors bors bot closed this Jul 6, 2022
@michaelsproul michaelsproul added the backwards-incompat Backwards-incompatible API change label Jul 22, 2022
@ethDreamer ethDreamer deleted the move_fee_recipient branch December 19, 2022 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards-incompat Backwards-incompatible API change bellatrix Required to support the Bellatrix Upgrade ready-for-merge This PR is ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants