-
Notifications
You must be signed in to change notification settings - Fork 2
Validator fixes: Removed dead code, devnet-2 feature flag leftover, moved tests to separate file. #63
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
Validator fixes: Removed dead code, devnet-2 feature flag leftover, moved tests to separate file. #63
Changes from all commits
70b6ee6
70ce0ec
54b1cbd
0e50f12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,15 +16,18 @@ env-config = { path = "../env-config", default-features = false } | |
| ssz = { workspace = true } | ||
| serde = { workspace = true } | ||
| ssz_derive = { workspace = true } | ||
| tracing = "0.1" | ||
| typenum = "1" | ||
| serde_json = "1.0" | ||
| serde_yaml = "0.9" | ||
| hex = "0.4.3" | ||
| sha2 = "0.10" | ||
| leansig = { git = "https://github.com/leanEthereum/leanSig", branch = "main" } | ||
| lean-multisig = { git = "https://github.com/leanEthereum/leanMultisig", branch = "main" } | ||
| leansig = { git = "https://github.com/leanEthereum/leanSig", rev = "73bedc26ed961b110df7ac2e234dc11361a4bf25" } | ||
| lean-multisig = { git = "https://github.com/leanEthereum/leanMultisig", rev = "e4474138487eeb1ed7c2e1013674fe80ac9f3165" } | ||
|
Comment on lines
+25
to
+26
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice! wanted to do the same thing 👍 |
||
| anyhow = "1.0.100" | ||
| alloy-primitives = "1.5.2" | ||
| # ethereum_ssz for lean-multisig types (aliased to avoid conflict with grandine ssz) | ||
| eth_ssz = { package = "ethereum_ssz", version = "0.10.0" } | ||
|
|
||
| [dev-dependencies] | ||
| rstest = "0.18" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -158,24 +158,24 @@ impl SignedBlockWithAttestation { | |
| ); | ||
| } | ||
|
|
||
| // let attestation_data_root: [u8; 32] = | ||
| // hash_tree_root(&aggregated_attestation.data).0.into(); | ||
| let attestation_data_root: [u8; 32] = | ||
| hash_tree_root(&aggregated_attestation.data).0.into(); | ||
|
|
||
| // Verify the lean-multisig aggregated proof for this attestation | ||
| // | ||
| // The proof verifies that all validators in aggregation_bits signed | ||
| // the same attestation_data_root at the given epoch (slot). | ||
| // TODO | ||
| // aggregated_signature_proof | ||
| // .verify_aggregated_payload( | ||
| // &validator_ids | ||
| // .iter() | ||
| // .map(|vid| validators.get(*vid).expect("validator must exist")) | ||
| // .collect::<Vec<_>>(), | ||
| // &attestation_data_root, | ||
| // aggregated_attestation.data.slot.0, | ||
| // ) | ||
| // .expect("Attestation aggregated signature verification failed"); | ||
| _aggregated_signature_proof | ||
| .proof_data | ||
| .verify_aggregated_payload( | ||
| &validator_ids | ||
| .iter() | ||
| .map(|vid| validators.get(*vid).expect("validator must exist")) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't panic here, throw proper error |
||
| .collect::<Vec<_>>(), | ||
| &attestation_data_root, | ||
| aggregated_attestation.data.slot.0 as u32, | ||
| ) | ||
| .expect("Attestation aggregated signature verification failed"); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as before, don't panic |
||
| } | ||
|
|
||
| // Verify the proposer attestation signature (outside the attestation loop) | ||
|
|
@@ -214,11 +214,12 @@ pub fn verify_xmss_signature( | |
| signature: &Signature, | ||
| ) -> bool { | ||
| let epoch = slot.0 as u32; | ||
| let signature = crate::signature::Signature::from(signature.as_bytes()); | ||
|
|
||
| signature | ||
| .verify(&public_key, epoch, message_bytes) | ||
| .unwrap_or_else(|_| false) | ||
| // Create Signature from the raw bytes | ||
| let sig = crate::signature::Signature::from(signature.as_bytes()); | ||
|
|
||
| sig.verify(&public_key, epoch, message_bytes) | ||
| .unwrap_or(false) | ||
| } | ||
|
|
||
| #[cfg(not(feature = "xmss-verify"))] | ||
|
|
||
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.
Remove commented lines