-
Notifications
You must be signed in to change notification settings - Fork 905
Modularize validator store #6705
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
Conversation
3c253b4
to
838eed6
Compare
|
1 similar comment
|
Will rebase this to clean up the messy history after are merged. Still, feel free to start reviewing already. |
This pull request has merge conflicts. Could you please resolve them @dknopik? 🙏 |
dee1f90
to
394ef61
Compare
394ef61
to
36f2916
Compare
36f2916
to
29b4ce5
Compare
29b4ce5
to
0ab9c9a
Compare
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.
This is fantastic, very clean!
I'm highly motivated to get this merged soon, not just because of Anchor, but also because I want to solve this FIXME building on your branch:
// FIXME: ignore this clippy lint until the validator store is refactored to use async locks |
It will require changing a few of the ValidatorStore
methods to return impl Future
, but I think we should merge this first, and then adapt Anchor to that change once it's also ready and merged.
object, | ||
Web3SignerObject::Deposit { .. } | Web3SignerObject::ValidatorRegistration(_) | ||
) && fork_info.is_some() | ||
if matches!(message_type, MessageType::ValidatorRegistration) && fork_info.is_some() |
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.
Is this a bugfix?
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.
Co-authored-by: Michael Sproul <[email protected]>
There is one more change that would be nice: currently, Does that sound fine by you? |
Yeah that sounds totally fine, happy for it to move to |
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.
Let's goooo
While the Lighthouse implementation of the `ValidatorStore` does not really care about blobs, Anchor needs to be able to return different blobs from `sign_blocks` than what was passed into it, in case it decides to sign another Anchor node's block. Only passing the unsigned block into `sign_block` and only returning a signed block from it (without any blobs and proofs) was an oversight in #6705. - Replace `validator_store::{Uns,S}ignedBlock` with `validator_store::block_service::{Uns,S}ignedBlock`, as we need all data in there. - In `lighthouse_validator_store`, just add the received blobs back to the signed block after signing it.
This is a PR that modularises the validator store so that we can reuse the validator services in Anchor.
Proposed Changes
ValidatorStore
with all functions used by thevalidator_services
validator_services
generic onS: ValidatorStore
LighthouseValidatorStore
, which has identical functionality to the oldValidatorStore
environment
) fromvalidator_services
andbeacon_node_fallback
in order to be able to cleanly use them in AnchorAdditional Info
This also includes some changes from @jxs's closed PR #6727 to remove
E
from somestruct
s and make functions generic instead (where possible).