Skip to content
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

Merged
merged 2 commits into from
May 13, 2024

Conversation

ian-shim
Copy link
Contributor

@ian-shim ian-shim commented May 9, 2024

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

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@ian-shim ian-shim force-pushed the kms-hot-wallet branch 2 times, most recently from 3eb8571 to 9a928a0 Compare May 9, 2024 04:14
@@ -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
Copy link
Contributor Author

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

@ian-shim ian-shim requested review from dmanc, mooselumph and jianoaix May 9, 2024 04:19
@ian-shim ian-shim marked this pull request as ready for review May 9, 2024 04:19
Copy link
Contributor

@dmanc dmanc left a 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)
Copy link
Contributor

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()?

Copy link
Contributor Author

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

@ian-shim ian-shim requested a review from anupsv May 10, 2024 05:19
Name: PrefixFlag(flagPrefix, "kms-key-id"),
Usage: "KMS key ID that stores the private key",
Required: false,
EnvVar: PrefixEnvVar(envPrefix, "KMS_KEY_ID"),
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ian-shim ian-shim merged commit e7ec7fa into Layr-Labs:master May 13, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants