-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add private key file configuration for sequencer signing #161
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
feat: add private key file configuration for sequencer signing #161
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.
Added some minor suggestions inline around using hex-encoded private keys and migrating tests to signer
crate.
I think we should introduce an integration test similar to the one below for the key file singer you've introduced in this PR.
rollup-node/crates/signer/src/lib.rs
Lines 131 to 151 in b8b4c6b
#[tokio::test] | |
async fn test_signer_local() { | |
reth_tracing::init_test_tracing(); | |
let signer = PrivateKeySigner::random(); | |
let mut handle = Signer::spawn(Box::new(signer.clone())); | |
// Test sending a request | |
let block = ScrollBlock::default(); | |
handle.sign_block(block.clone()).unwrap(); | |
// Test receiving an event | |
let event = handle.next().await.unwrap(); | |
let (event_block, signature) = match event { | |
SignerEvent::SignedBlock { block, signature } => (block, signature), | |
}; | |
let hash = sig_encode_hash(&event_block); | |
let recovered_address = signature.recover_address_from_prehash(&hash).unwrap(); | |
assert_eq!(event_block, block); | |
assert_eq!(recovered_address, signer.address()); | |
} |
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.
Looks good, I left a few minor nits inline.
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.
Left a minor nit inline. LGTM
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.
LGTM
Thanks! And merged this PR. |
Overview
This PR introduces signing key configuration for the sequencer by adding CLI support for specifying a private key file. It adds a new
SignerArgs
struct with the--signer.key-file
parameter and implements conditional validation to ensure the key file is required when the sequencer is enabled (and test mode is disabled).closes #146.