-
Notifications
You must be signed in to change notification settings - Fork 807
Cubesigner keychain #4277
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
base: master
Are you sure you want to change the base?
Cubesigner keychain #4277
Conversation
Integrate CubeSigner SDK for remote key signing. Key changes: - Add CubeSigner SDK dependency and keychain implementations - Extend keychain interface with SigningOption so as to provide tx context to cubesigner - Move EthKeychain interface to the same package of the Keychain interface - Enable forced hash signing with new wallet option
…ed │ secp256k1 key types are accepted. Fix test cases and remove obsolete │ ledger keychain files from main package. │ │ Key changes: │ - Add validation for SecpAvaAddr, SecpAvaTestAddr, SecpEthAddr key types │ - Fix TestCubesignerKeychain_GetEth to test non-existent address handling │ - Remove duplicate ledger keychain implementation files
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.
Pull Request Overview
This PR integrates CubeSigner SDK support into AvalancheGo, maintaining full backward compatibility while extending the keychain interface to support additional signing backends. The implementation introduces context-aware signing and refactors ledger-specific functionality.
- Adds CubeSigner keychain implementation for remote signing service integration
- Extends keychain interface with signing options to provide transaction context (network ID, chain alias)
- Refactors ledger functionality to a dedicated package and updates wallet signers to pass network/chain context
Reviewed Changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
wallet/subnet/primary/wallet.go | Updates signer constructors to pass network ID for context-aware signing |
wallet/chain/x/signer/visitor.go | Implements signing options and force SignHash option for transaction signing |
wallet/chain/p/signer/visitor.go | Adds network ID context and force SignHash support to P-chain signing |
utils/crypto/keychain/cubesigner/ | New CubeSigner keychain implementation with client abstraction and tests |
utils/crypto/keychain/ledger/ | Refactored ledger keychain moved to dedicated package with updated interfaces |
utils/crypto/keychain/signing_options.go | New signing options framework for chain and network context |
Comments suppressed due to low confidence (1)
utils/crypto/keychain/cubesigner/cubesigner_keychain.go:1
- Remove the extra blank line to maintain consistent formatting.
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Update copyright year range from 2019-2024 to 2019-2025 across all files modified in the CubeSigner keychain integration.
- Remove package name stuttering in CubeSigner and ledger packages - Renamed CubesignerKeychain to Keychain, ledgerKeychain to KeyChain - godoc comments to exported types and functions - Extract hardcoded constants (65, 0x04) with descriptive names - Update both packages to return concrete types (*KeyChain) for consistency
- Add godoc comments to all public methods in ledger keychain - Add unit tests for ledger Sign()
Can we break this PR into individual changes? It seems like there are multiple changes being added within the scope of this PR. |
- Update P chain wallet to properly use walletsigner.WithOptions
- Remove forceSignHash functionality from wallet signers - Keep networkID support essential for CubeSigner keychain - Restore original ledger keychain implementation location - Use master's hardcoded signHash values instead of options - Remove P-chain signer with_options wrapper - Maintain EthKeychain interface in wallet/chain/c package - All tests and linting pass with reduced scope
ok the scope of this one has been reduced cc @StephenButtolph |
I made #4337 #4339 #4344 with the parts I removed from this one cc @joshua-kim @yacovm @sukantoraymond @StephenButtolph |
I am a bit confused... shouldn't you rebase the PRs one on top of the other and this PR last? Otherwise you'll have conflicts, am I wrong? |
This time I opted to present independent PRs so they can be separately reviewed and merged into master. Yes, I expect some conflicts when merging later PRs. This approach allows for parallel review and gives reviewers more focused context for each change, rather than having to understand the dependency chain. |
Why this should be merged
This PR integrates CubeSigner SDK support into AvalancheGo.
How this works
The implementation introduces several key components:
How this was tested
Need to be documented in RELEASES.md?