-
Notifications
You must be signed in to change notification settings - Fork 919
Migrating eip-3076 #8011
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
base: stable
Are you sure you want to change the base?
Migrating eip-3076 #8011
Conversation
Signed-off-by: Aliaksei Misiukevich <[email protected]>
Signed-off-by: Aliaksei Misiukevich <[email protected]>
|
1 similar comment
|
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 PR doesn't accomplish the desired goal. You've moved all of the slashing_protection
crate into eip_3076
, but what we would ideally do, is just extract the "pure" EIP-3076 code (without database dependencies) into eip_3076
, while leaving all of the database code and Lighthouse-specific logic in the slashing_protection
crate.
This would allow us to reduce the dependency surface of crates like eth2
which only need the "pure" EIP-3076 code, and should not depend on Lighthouse's implementation details (our choice of sqlite for the slashing protection database).
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.
The whole interchange-tests
directory should not be committed. It was part of the .gitignore
in slashing_protection
, and should continue to be ignored.
The source lives here:
Makes sense, I'll do changes accordingly |
Thanks! Let us know if you have any questions, some of the stuff might be tricky to extract |
It was matter of migrating interchange, signed_block and signed_attestation and corresponding tests, wasn't it? For some reason, I moved the whole thing) |
Signed-off-by: Aliaksei Misiukevich <[email protected]>
I think just moving the interchange and its immediate dependents is the way to go, yeah. |
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 the wrong SignedAttestation
. You should move this one:
lighthouse/validator_client/slashing_protection/src/interchange.rs
Lines 36 to 46 in fd10b63
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)] | |
#[serde(deny_unknown_fields)] | |
#[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))] | |
pub struct SignedAttestation { | |
#[serde(with = "serde_utils::quoted_u64::require_quotes")] | |
pub source_epoch: Epoch, | |
#[serde(with = "serde_utils::quoted_u64::require_quotes")] | |
pub target_epoch: Epoch, | |
#[serde(skip_serializing_if = "Option::is_none")] | |
pub signing_root: Option<Hash256>, | |
} |
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.
Also the wrong SignedBlock
.
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 don't think Safe
, NotSafe
or SigningRoot
need to be here either. Just move the Interchange
type. Start by moving interchange.rs
I also thought that interchange file format needs be moved out along with inner data structures. Separating interchange from database is cumbersome |
The interchange format is the main thing we need to pull out, even if it's just the type definition. Can you elaborate on the interaction with the database that makes it hard to extract? |
Interchange test modules are harder to migrate because of cohesion with db. |
Yeah that sounds acceptable. The main thing we're trying to accomplish is pulling out the type definitions so we can remove the dependency of the |
This should close #7894