-
Notifications
You must be signed in to change notification settings - Fork 25
feat(keysplit): Split multiple validator keys into one file #440
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: unstable
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds support for splitting multiple validator keys into a single JSON file, enabling users to register multiple validators in one operation. The changes refactor the keysplit functionality to handle multiple keys instead of just one.
- Support for multiple keystore file paths instead of a single path
- Refactored splitting functions to process multiple keys and return a
Splitstruct containing key shares and nonce - Updated output format to handle multiple validator keys in a single file
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
anchor/keysplit/src/split.rs |
Modified split functions to handle multiple keys and return Split struct |
anchor/keysplit/src/output.rs |
Updated output generation to handle multiple encrypted key splits |
anchor/keysplit/src/lib.rs |
Modified main logic to process multiple keystore files with parallel processing |
anchor/keysplit/src/crypto.rs |
Updated encryption function to work with Split struct |
anchor/keysplit/src/cli.rs |
Changed CLI to accept multiple keystore paths |
anchor/keysplit/Cargo.toml |
Added rayon dependency for parallel processing |
anchor/database/src/keysplit_operations.rs |
Updated function signature to accept slice instead of owned vector |
| key_shares: Vec<KeyShare>, | ||
| ) -> Result<Vec<EncryptedKeyShare>, KeysplitError> { | ||
| key_shares | ||
| split: Split<KeyShare>, |
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.
Personally, it's not clear to me what the difference between Vec<KeyShare> and Split<KeyShare> is.
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.
added a comment
|
|
||
| // Options that are releveant to both onchain and manual keysplitting | ||
| #[derive(Parser, Clone, Debug)] | ||
| pub struct SharedKeygenOptions { |
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.
something I thought of is that we should probably adjust our cli names here to match their docs https://docs.ssv.network/stakers/tools/ssv-keys-cli/
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.
Some of our flags function differently, e.g. keystore_paths takes multiple paths instead of a folder if the user wants to split multiple and output_path points to the folder to place the input into (instead of being the path for the file to be written). We could change that of course, but personally I prefer our current behavior. wdyt?
My point is that matching the names (IMO) only has value if we also match the behavior.
|
Thanks both, will address |
|
This pull request has merge conflicts. Could you please resolve them @dknopik? 🙏 |
# Conflicts: # anchor/keysplit/src/split.rs
|
Hi @dknopik, this pull request has been closed automatically due to 30 days of inactivity. If you’d like to continue working on it, feel free to reopen at any time. |
Proposed Changes
Support splitting multiple keys into a single json file, to allow the user registering multiple validators in one go.
Additional Info
This is part of finally mainlining some features I implemented for a demo a while ago.