-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Add new validator API for voluntary exit #4119
Conversation
Hi @AgeManning I've done an basic implementation based on the existing voluntary exit logic from account manager. I have a few questions:
|
Looks like we may not need to submit the message to the BN with this API, we could return the signed voluntary exit object and leave it to the UI to publish to BN. |
Looking good! |
The current implementation works, but I'd probably hold off further changes for now as we have an active discussion on this endpoint in the key manager API spec ethereum/keymanager-APIs#57 |
PR for keymanager-API spec: ethereum/keymanager-APIs#58 |
let validator_index = validator_store | ||
.validator_index(&pubkey_bytes) | ||
.ok_or_else(|| { | ||
warp_utils::reject::custom_server_error(format!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this should be a 404 "not found" rather than a 500 "internal server error"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Updated, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, I used this a couple of days ago to produce a signed exit on Prater! It worked really well. I've just made a couple of very minor suggestions based on my experience.
Happy to merge this after they've been addressed!
.validator_index(&pubkey_bytes) | ||
.ok_or_else(|| { | ||
warp_utils::reject::custom_not_found(format!( | ||
"Unable to find validator with public key: {}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was using this endpoint on Goerli on a VC with 5,000 validators on it (a pretty unreasonable amount of validators, I know). It turns out that it takes some time to obtain all the validator indices for all pubkeys when the VCs starts (on a fresh boot the VC only knows pubkeys but doesn't know validator indices). I was hitting this 404 and it took me a bit to figure out what was going on.
Here's a suggestion you're free to cherry-pick which would clarify things:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @paulhauner, thanks for this, nice changes! 👍 I've cherry-picked your changes. I wasn't aware that the validator indices were fetched / available later - good to know!
Co-authored-by: Paul Hauner <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, let's do it!
bors r+ |
## Issue Addressed Addresses #4117 ## Proposed Changes See ethereum/keymanager-APIs#58 for proposed API specification. ## TODO - [x] ~~Add submission to BN~~ - removed, see discussion in [keymanager API](ethereum/keymanager-APIs#58) - [x] ~~Add flag to allow voluntary exit via the API~~ - no longer needed now the VC doesn't submit exit directly - [x] ~~Additional verification / checks, e.g. if validator on same network as BN~~ - to be done on client side - [x] ~~Potentially wait for the message to propagate and return some exit information in the response~~ - not required - [x] Update http tests - [x] ~~Update lighthouse book~~ - not required if this endpoint makes it to the standard keymanager API Co-authored-by: Paul Hauner <[email protected]> Co-authored-by: Jimmy Chen <[email protected]>
## Issue Addressed Addresses sigp#4117 ## Proposed Changes See ethereum/keymanager-APIs#58 for proposed API specification. ## TODO - [x] ~~Add submission to BN~~ - removed, see discussion in [keymanager API](ethereum/keymanager-APIs#58) - [x] ~~Add flag to allow voluntary exit via the API~~ - no longer needed now the VC doesn't submit exit directly - [x] ~~Additional verification / checks, e.g. if validator on same network as BN~~ - to be done on client side - [x] ~~Potentially wait for the message to propagate and return some exit information in the response~~ - not required - [x] Update http tests - [x] ~~Update lighthouse book~~ - not required if this endpoint makes it to the standard keymanager API Co-authored-by: Paul Hauner <[email protected]> Co-authored-by: Jimmy Chen <[email protected]>
## Issue Addressed Addresses sigp#4117 ## Proposed Changes See ethereum/keymanager-APIs#58 for proposed API specification. ## TODO - [x] ~~Add submission to BN~~ - removed, see discussion in [keymanager API](ethereum/keymanager-APIs#58) - [x] ~~Add flag to allow voluntary exit via the API~~ - no longer needed now the VC doesn't submit exit directly - [x] ~~Additional verification / checks, e.g. if validator on same network as BN~~ - to be done on client side - [x] ~~Potentially wait for the message to propagate and return some exit information in the response~~ - not required - [x] Update http tests - [x] ~~Update lighthouse book~~ - not required if this endpoint makes it to the standard keymanager API Co-authored-by: Paul Hauner <[email protected]> Co-authored-by: Jimmy Chen <[email protected]>
Issue Addressed
Addresses #4117
Proposed Changes
See ethereum/keymanager-APIs#58 for proposed API specification.
TODO
Add submission to BNAdd flag to allow voluntary exit via the APIAdditional verification / checks, e.g. if validator on same network as BNPotentially wait for the message to propagate and return some exit information in the responseUpdate lighthouse book