Skip to content

Conversation

@ZanCorDX
Copy link
Collaborator

@ZanCorDX ZanCorDX commented Sep 4, 2025

the relay secret key configuration option was not compatible with BIP44 input, e.g. the output of a mnemonic seed phrase and a given path in the tree

this PR now supports this feature which was simplest by just exposing a BIP44 compatible API the underlying ethereum-consensus dependency

✅ I have completed the following steps:

  • Run make lint
  • Run make test
  • Added tests (if applicable)

@ZanCorDX ZanCorDX requested a review from dvush as a code owner September 4, 2025 17:32
@metachris metachris requested a review from Copilot September 5, 2025 08:18
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 BIP44-compatible inputs for relay secret key configuration by updating the key parsing logic to accept various input formats including mnemonic seed phrase outputs.

  • Updated the secret key parsing logic to use hex decoding and bytes-based key creation
  • Added hex module import to support the new decoding functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +324 to +325
let input = hex::decode(resolved_key)?;
SecretKey::from_bytes(&input)?
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from SecretKey::try_from(resolved_key)? to hex decoding breaks backward compatibility with existing non-hex secret key formats. The original code likely supported multiple input formats, but this change forces all inputs to be hex-encoded. Consider adding format detection or maintaining support for the original format alongside hex decoding.

Suggested change
let input = hex::decode(resolved_key)?;
SecretKey::from_bytes(&input)?
// Try legacy format first, then fallback to hex decoding
match SecretKey::try_from(resolved_key.clone()) {
Ok(key) => key,
Err(_) => {
let input = hex::decode(resolved_key)?;
SecretKey::from_bytes(&input)?
}
}

Copilot uses AI. Check for mistakes.
@ZanCorDX ZanCorDX merged commit b7c0700 into develop Sep 5, 2025
6 of 11 checks passed
@ZanCorDX ZanCorDX deleted the relay-key-format branch September 5, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants