-
Notifications
You must be signed in to change notification settings - Fork 195
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
[batcher] Replace Fireblocks wallet with KMS wallet #550
Conversation
3eb8571
to
9a928a0
Compare
@@ -95,10 +95,10 @@ func ReadLoggerCLIConfig(ctx *cli.Context, flagPrefix string) (*LoggerConfig, er | |||
|
|||
func NewLogger(cfg LoggerConfig) (logging.Logger, error) { | |||
if cfg.Format == JSONLogFormat { | |||
return logging.NewSlogJsonLogger(cfg.OutputWriter, &cfg.HandlerOpts), nil |
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.
This constructor has been deprecated
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
if config.KMSKeyConfig.KeyID == "" || config.KMSKeyConfig.Region == "" { | ||
return errors.New("KMS key ID and region must be specified unless KMS wallet is disabled") | ||
} | ||
kmsClient, err := kms.NewKMSClient(context.Background(), config.KMSKeyConfig.Region) |
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.
Is it ok to use context.Background()?
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.
We can add a timeout there, but I think it's ok during the initialization
Name: PrefixFlag(flagPrefix, "kms-key-id"), | ||
Usage: "KMS key ID that stores the private key", | ||
Required: false, | ||
EnvVar: PrefixEnvVar(envPrefix, "KMS_KEY_ID"), |
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.
Should we use a KMS alias rather than the key id? Think it would help when rotating the key since we wouldn't need to do a deployment.
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.
Sounds good. This has to happen in sdk first, so I'll merge this and implement that as next iteration
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.
Apparently it just works: https://docs.aws.amazon.com/kms/latest/APIReference/API_Sign.html#API_Sign_RequestSyntax
Why are these changes needed?
We're no longer using Fireblocks as hot wallet to send transactions. We're using an EOA with a private key managed by KMS instead.
This PR replaces the Fireblocks wallet to a private key wallet using KMS signer.
Checks