-
Notifications
You must be signed in to change notification settings - Fork 2
Changes based on Python leanSpec commit #238 #50
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
…dded readme on how to select devnet
Signature Aggregation Preparation (devnet 2)
…) method, added check for duplicate data
…ig::devnet() and update lib exports
…void. Changed AttestationSignatures to use MultisigAggregatedSignature.
| use typenum::{Prod, Sum, U100, U1024, U12, U31}; | ||
|
|
||
| // Type-level number for 1 MiB (1048576 = 1024 * 1024) | ||
| pub type U1048576 = Prod<U1024, U1024>; |
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.
probably no need for intermediate type, but definitely this shouldn't be exported
| impl MultisigAggregatedSignature { | ||
| /// Create a new MultisigAggregatedSignature from proof bytes. | ||
| pub fn new(proof: Vec<u8>) -> Self { | ||
| Self(ssz::ByteList::try_from(proof).expect("proof exceeds 1 MiB limit")) |
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.
don't panic, handle these as errors instead
| // NOTE: This stub matches Python leanSpec behavior (test_mode=True). | ||
| // Python also uses test_mode=True with TODO: "Remove test_mode once leanVM | ||
| // supports correct signature encoding." | ||
| // Once leanVM/lean-multisig supports proper signature encoding: | ||
| // 1. Extract public keys from validators | ||
| // 2. Convert message bytes to field element format | ||
| // 3. Call lean_multisig::xmss_verify_aggregated_signatures | ||
| let _ = (validators, message, epoch); | ||
|
|
||
| Ok(()) |
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.
in rust we use todo! macro for such cases. Also, you probably can implement it already: just iterate through list of validators, extract public key from each of them, and call self.verify with extracted keys
| use ssz::SszHash; | ||
| use std::collections::HashSet; |
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.
move uses to the top of the file
- added test vectors with new types - added custom serialization with new types - implemented signature verification for single XMSS signatures
Implemented changes based on leanSpec commit leanEthereum/leanSpec@e5b9140
Removed all devnet1 code and feature flags addressing issue
#36
Addressed changes mentioned in the pull request
#37