feat(signer): sign txs via KMS#1808
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
📝 WalkthroughWalkthroughAdds AWS KMS-backed ECDSA secp256k1 transaction signing to the rollup sender. A new ChangesAWS KMS Signer Integration
Version Bump
Sequence Diagram(s)sequenceDiagram
participant NewSender
participant NewTransactionSigner
participant newKMSSigner
participant kmsAPI
participant SignTransaction
NewSender->>NewTransactionSigner: ctx, signerConfig(AWSKMS), chainID
NewTransactionSigner->>newKMSSigner: ctx, AWSKMSSignerConfig
newKMSSigner->>kmsAPI: GetPublicKey(KeyID)
kmsAPI-->>newKMSSigner: DER SPKI public key bytes
newKMSSigner->>newKMSSigner: parse secp256k1 pubkey, derive address
newKMSSigner->>newKMSSigner: validate == SignerAddress
newKMSSigner-->>NewTransactionSigner: kmsSigner
NewTransactionSigner-->>NewSender: TransactionSigner{kmsSigner, kmsTxSigner}
Note over SignTransaction: At signing time
SignTransaction->>SignTransaction: hash = kmsTxSigner.Hash(tx)
SignTransaction->>newKMSSigner: sign(hash)
newKMSSigner->>kmsAPI: Sign(KeyID, hash, EcdsaSha256)
kmsAPI-->>newKMSSigner: DER(r, s)
newKMSSigner->>newKMSSigner: low-s normalization, recover v
newKMSSigner-->>SignTransaction: [R||S||V]
SignTransaction->>SignTransaction: tx.WithSignature(kmsTxSigner, sig)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #1808 +/- ##
===========================================
+ Coverage 35.31% 35.43% +0.12%
===========================================
Files 260 261 +1
Lines 22426 22564 +138
===========================================
+ Hits 7920 7996 +76
- Misses 13677 13728 +51
- Partials 829 840 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Purpose or design rationale of this PR
Adds an AWSKMS transaction signer type for the rollup senders (
gas_oracle_sender,commit_sender,finalize_sender) so signing keys can live in AWS KMS instead of being mounted as plaintext secrets.RemoteSignerpath, works for every transaction type including EIP-4844 blob transactions, so it coverscommit_sender.aws_kms_signer_configblock (key_id, optionalregion, requiredsigner_address) selects the signer; the configured address is validated at startup against the address derived from the KMS public key (GetPublicKey), AWS credentials resolve via the standard SDK chain (IRSA/instance role/env), and the cachedLatestSignerForChainIDmakes it correct for both L1 (Ethereum) and L2 (Scroll).IsHexAddressvalidation, context propagation intoNewTransactionSigner, unit tests covering legacy/dynamic-fee/blob signing plus malformed-input cases, and a README documenting configuration, IAM scoping, and key provisioning (generate-in-HSM vs. import).Summary by CodeRabbit
Release Notes
New Features
Documentation
Chores