feat(keysplit): Split multiple validator keys into one file#440
feat(keysplit): Split multiple validator keys into one file#440mergify[bot] merged 16 commits intosigp:unstablefrom
Conversation
There was a problem hiding this comment.
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.
Personally, it's not clear to me what the difference between Vec<KeyShare> and Split<KeyShare> is.
| @@ -65,10 +65,11 @@ pub struct Manual { | |||
| pub struct SharedKeygenOptions { | |||
There was a problem hiding this comment.
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.
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. |
jking-aus
left a comment
There was a problem hiding this comment.
This is good - I used it for the hoodi vals. Good qol improvement.
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.