-
Notifications
You must be signed in to change notification settings - Fork 717
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
Replace Guardian Key with abstracted Guardian Signer #4120
Replace Guardian Key with abstracted Guardian Signer #4120
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.
Just one edge case and some small nits
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 some minor comments related to naming and clarity. Overall the implementation looks good
Another approach would be to rewrite this function to use the new Guardian signer though it would be a breaking change to modify the function signature. |
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.
Very cool!
13e82f8
to
32fa31d
Compare
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.
All of my suggestions here are in general nits or things that make future maintenance a bit nicer. This is a nice clean implementation from all I see here. Nicely done sir! 🥳
5c19304
5c19304
to
63ee311
Compare
…ion#4103) The `set -u` options in these scripts caused them to fail with 'unbound variable' errors when CLI args or env variables were unset. This commit fixes the validation so that the scripts output usage info or helpful errors instead of exiting with unbound variable errors that the user must read the source to diagnose. for the script `ethereum/sh/upgrade_all_testnet.sh`, the commit updates a variable name that appears incorrect. node/hack: Print potential USD stablecoins that appear depegged (wormhole-foundation#4130) * node/hack: Print potential USD stablecoins that appear depegged * PR feedback whitepapers: Clarify CCQ sol_pda support (wormhole-foundation#4129) GitHub: Update code owners for go sdk (wormhole-foundation#4133) Deploy Unichain testnet (wormhole-foundation#4134) * Deploy Unichain testnet * Add snaxchain to proto node: Governor token list update (wormhole-foundation#4126) * node: governor token list update * Manually fix token price --------- Co-authored-by: djb15 <djb15@users.noreply.github.com> docs: Update SECURITY.md Replace Guardian Key with abstracted Guardian Signer (wormhole-foundation#4120) * node: add guardiansigner node/pkg * node: replace use of guardian key with guardian signer * node: replace use of vaa.AddSigner with guardian signer * node: add nolint for armor import and fix test * node: handle error returned from signing * apply draft review suggestions * apply pr reviews * apply pr reviews * apply pr reviews * apply pr reviews --------- Co-authored-by: pleasew8t <jason@asymmetric.re> Deploy Worldchain testnet (wormhole-foundation#4140) * Deploy Worldchain testnet * Update WETH address * Fix cli test and add token bridge VAAs add deprecation warning to the top of SDK readme (wormhole-foundation#4142) spy: respect --port if set (wormhole-foundation#4139) codeowners: Update for audits folder (wormhole-foundation#4144) Deploy Monad Devnet (wormhole-foundation#4145) * Deploy Monad Devnet * Code review rework docs: Audit reports (wormhole-foundation#4143) * docs: Audit reports * Rename cosmwasm: add wormchain ibc receiver tests (wormhole-foundation#4121) cosmwasm: add support for json schemas for all contracts (wormhole-foundation#4118) * cosmwasm: add support for json schemas for all contracts * cosmwasm: fixed formatting as per the linter Node: Remove cutover checks (wormhole-foundation#4149) Add interchaintest tests to wormchain
This pull request introduces the
GuardianSigner
interface, defined in theguardiansigner
package, which is meant to replace directly using the guardian key (private key) for data signing. In doing so, it becomes easier to introduce alternative signing mechanisms without too much modification of code outside of the newguardiansigner
package. Additional signing mechanisms include HSMs or KMS's (such as AWS or GCP).The changes made to the repository are summarised as follows:
guardiansigner
package, which includes aFileSigner
implementation that works with the current guardian key.--guardianSignerUri
commandline argument. Node operators can still make use ofguardianKeyPath
, as support is provided to translate the path to the appropriateguardianSignerUri
. As additional signer implementations are introduced, more URI schemes will be added. But for now onlyfile://
is supported, loading a private key from disk.GuardianSigner
.Notable Code Change
One change in the PR that we are not yet certain about is the use of
AddSignature
defined insdk/vaa/structs.go
. The changes innode/pkg/adminrpc/adminserver.go
removed the use ofAddSignature
and adds the signature manually, to make use of aGuardianSigner
. There were some alternative ideas surrounding this:An alternative idea was to make
AddSignature
accept aGuardianSigner
instead of a private key. This did not seem right, as it would create a dependency on thenode
packages that seems unneccessary, and also modify what is defined as an SDK, potentially breaking functionality for other projects that might make use of the SDK.Additional comment by @johnsaigle that is also worth considering: #4120 (comment)