-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(api): first action handlers #7
Conversation
Quick note: for any actions on the registry state (reading / writing), the idea is to first call |
77b25e6
to
e90f4f3
Compare
ba22856
to
957022d
Compare
I see, it makes sense! However as it currently stands this comes with the drawback that if we are still syncing the API will just hang until it is synced. The only good alternative I see is to perhaps return an error saying that the registry is still syncing and to try again later. Wdyt? |
Yeah that's the drawback indeed. I think waiting for a second (hopefully not more than that) might be a better option no? Or we return HTTP Too Early, which would require the client to retry. |
I like the timeout option, and didn't know about that specific HTTP code. nice! |
src/main.rs
Outdated
// TODO: fetch pubkeys from indices from beacon node | ||
// let res = registry.get_validators_by_indices(indices).await; | ||
// let _ = response.send(res); |
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.
We could also do this at registration time (& at sync time for external sources) and save them in the DB. We might actually have to do that anyway to check if the validator is valid.
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.
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.
addressed in #12
src/registry.rs
Outdated
|
||
pub(crate) async fn get_registrations( | ||
&mut self, | ||
pubkeys: Option<&[BlsPublicKey]>, |
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.
Why is this an Option
?
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.
Oh I see, if None
we return everything. I think we should disambiguate with list_registrations
, list_validators
, list_operators
instead (which take no arguments)
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.
done in latest commit
feat(registry): validate proposer pubkey and fetch validator index
Action
handling #3