Skip to content

Conversation

@dknopik
Copy link
Member

@dknopik dknopik commented Jul 18, 2025

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.

@dknopik dknopik added the ready-for-review This PR is ready to be reviewed label Jul 18, 2025
@diegomrsantos diegomrsantos requested a review from Copilot July 18, 2025 12:23
Copy link
Contributor

Copilot AI left a 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 Split struct 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>,
Copy link
Member

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.

Copy link
Member Author

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 {
Copy link
Member

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/

Copy link
Member Author

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.

@dknopik
Copy link
Member Author

dknopik commented Jul 25, 2025

Thanks both, will address

@mergify
Copy link

mergify bot commented Jul 29, 2025

This pull request has merge conflicts. Could you please resolve them @dknopik? 🙏

@mergify mergify bot added waiting-on-author and removed ready-for-review This PR is ready to be reviewed labels Jul 29, 2025
@mergify mergify bot closed this Oct 11, 2025
@mergify
Copy link

mergify bot commented Oct 11, 2025

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.

@mergify mergify bot added the stale label Oct 11, 2025
@dknopik dknopik removed the stale label Oct 14, 2025
@dknopik dknopik reopened this Oct 14, 2025
@dknopik dknopik requested a review from petarjuki7 November 4, 2025 16:09
@dknopik dknopik added ready-for-review This PR is ready to be reviewed and removed waiting-on-author labels Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review This PR is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants