From 3a2734f249830d03b94f9c00521c95efe1563a86 Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Thu, 15 Feb 2024 13:49:50 -0600 Subject: [PATCH] removing show deposit data flag (#13618) * removing show deposit data flag * removing flag insted of deprecating * fixing test * fixing test --- cmd/validator/accounts/accounts.go | 1 - cmd/validator/accounts/list.go | 3 --- cmd/validator/flags/flags.go | 7 +------ validator/accounts/accounts_list.go | 1 - validator/accounts/accounts_list_test.go | 9 +-------- validator/accounts/cli_manager.go | 1 - validator/accounts/cli_options.go | 8 -------- validator/keymanager/local/keymanager.go | 9 --------- validator/keymanager/types.go | 1 - 9 files changed, 2 insertions(+), 38 deletions(-) diff --git a/cmd/validator/accounts/accounts.go b/cmd/validator/accounts/accounts.go index c06ba0806..c88d69154 100644 --- a/cmd/validator/accounts/accounts.go +++ b/cmd/validator/accounts/accounts.go @@ -54,7 +54,6 @@ var Commands = &cli.Command{ Flags: cmd.WrapFlags([]cli.Flag{ flags.WalletDirFlag, flags.WalletPasswordFileFlag, - flags.ShowDepositDataFlag, flags.ShowPrivateKeysFlag, flags.ListValidatorIndices, flags.BeaconRPCProviderFlag, diff --git a/cmd/validator/accounts/list.go b/cmd/validator/accounts/list.go index fcd69284b..147b8a8a4 100644 --- a/cmd/validator/accounts/list.go +++ b/cmd/validator/accounts/list.go @@ -31,9 +31,6 @@ func accountsList(c *cli.Context) error { accounts.WithBeaconRESTApiProvider(c.String(flags.BeaconRESTApiProviderFlag.Name)), accounts.WithGRPCHeaders(grpcHeaders), } - if c.IsSet(flags.ShowDepositDataFlag.Name) { - opts = append(opts, accounts.WithShowDepositData()) - } if c.IsSet(flags.ShowPrivateKeysFlag.Name) { opts = append(opts, accounts.WithShowPrivateKeys()) } diff --git a/cmd/validator/flags/flags.go b/cmd/validator/flags/flags.go index e7fa81c53..94e84b963 100644 --- a/cmd/validator/flags/flags.go +++ b/cmd/validator/flags/flags.go @@ -174,12 +174,7 @@ var ( Name: "mnemonic-language", Usage: "Allows specifying mnemonic language. Supported languages are: english|chinese_traditional|chinese_simplified|czech|french|japanese|korean|italian|spanish.", } - // ShowDepositDataFlag for accounts. - ShowDepositDataFlag = &cli.BoolFlag{ - Name: "show-deposit-data", - Usage: "Displays raw eth1 tx deposit data for validator accounts.", - Value: false, - } + // ShowPrivateKeysFlag for accounts. ShowPrivateKeysFlag = &cli.BoolFlag{ Name: "show-private-keys", diff --git a/validator/accounts/accounts_list.go b/validator/accounts/accounts_list.go index 84167dc6e..6ea4a1b5d 100644 --- a/validator/accounts/accounts_list.go +++ b/validator/accounts/accounts_list.go @@ -23,7 +23,6 @@ func (acm *CLIManager) List(ctx context.Context) error { } return acm.keymanager.ListKeymanagerAccounts(ctx, keymanager.ListKeymanagerAccountConfig{ - ShowDepositData: acm.showDepositData, ShowPrivateKeys: acm.showPrivateKeys, WalletAccountsDir: acm.wallet.AccountsDir(), KeymanagerConfigFileName: wallet.KeymanagerConfigFileName, diff --git a/validator/accounts/accounts_list_test.go b/validator/accounts/accounts_list_test.go index 6fa0545f2..8af669914 100644 --- a/validator/accounts/accounts_list_test.go +++ b/validator/accounts/accounts_list_test.go @@ -171,7 +171,6 @@ func TestListAccounts_LocalKeymanager(t *testing.T) { t, km.ListKeymanagerAccounts(cliCtx.Context, keymanager.ListKeymanagerAccountConfig{ - ShowDepositData: true, ShowPrivateKeys: true, }), ) @@ -190,36 +189,30 @@ func TestListAccounts_LocalKeymanager(t *testing.T) { (keymanager kind) local wallet Showing 5 validator accounts - View the eth1 deposit transaction data for your accounts by running `validator accounts list --show-deposit-data Account 0 | fully-evolving-fawn [validating public key] 0xa6669aa0381c06470b9a6faf8abf4194ad5148a62e461cbef5a6bc4d292026f58b992c4cf40e50552d301cef19da75b9 [validating private key] 0x50cabc13435fcbde9d240fe720aff84f8557a6c1c445211b904f1a9620668241 - If you imported your account coming from the Ethereum launchpad, you will find your deposit_data.json in the eth2.0-deposit-cli's validator_keys folder Account 1 | preferably-mighty-heron [validating public key] 0xa7ea37fa2e2272762ffed8486f09b13cd56d76cf03a2a3e75bc36bd1719add84c20597671750be5bc1ccd3dadfebc30f [validating private key] 0x44563da0d11bc6a7219d18217cce8cdd064de3ebee5cdcf8d901c2fae7545116 - If you imported your account coming from the Ethereum eth2 launchpad, you will find your deposit_data.json in the eth2.0-deposit-cli's validator_keys folder Account 2 | conversely-good-monitor [validating public key] 0xa4c63619fb8cb87f6dd1686c9255f99c68066797bf284488ecbab64b1926d33eefdf96d1ee89ae4a89e84e7fb019d5e5 [validating private key] 0x4448d0ab17ecd73bbb636ddbfc89b181731f6cd88c33f2cecc0d04cba1a18447 - If you imported your account coming from the Ethereum eth2 launchpad, you will find your deposit_data.json in the eth2.0-deposit-cli's validator_keys folder Account 3 | rarely-joint-mako [validating public key] 0x91dd8d5bfc22aea398740ebcea66ced159df8d3f1a066d7aba9f0bef4ed6d9687fc1fd1c87bd2b6d12b0788dfb6a7d20 [validating private key] 0x4d1944bd7375185f70b3e70c68d9e6307f2009de3a4cf47ca5217443ddf81fc9 - If you imported your account coming from the Ethereum eth2 launchpad, you will find your deposit_data.json in the eth2.0-deposit-cli's validator_keys folder Account 4 | mainly-useful-catfish [validating public key] 0x83c4d722a98b599e2666bbe35146ff44800256190bc662f2dd5efbc0c4c0d57e5d297487a4f9c21a932d3b1b40e8379f [validating private key] 0x284cd65030496bf82ee2d52963cd540a1abb2cc738b8164901bbe7e2df4d57bd - If you imported your account coming from the Ethereum eth2 launchpad, you will find your deposit_data.json in the eth2.0-deposit-cli's validator_keys folder @@ -227,7 +220,7 @@ func TestListAccounts_LocalKeymanager(t *testing.T) { // Expected output format definition const prologLength = 4 - const accountLength = 6 + const accountLength = 4 const epilogLength = 2 const nameOffset = 1 const keyOffset = 2 diff --git a/validator/accounts/cli_manager.go b/validator/accounts/cli_manager.go index 62e9388c1..4d7bc81db 100644 --- a/validator/accounts/cli_manager.go +++ b/validator/accounts/cli_manager.go @@ -41,7 +41,6 @@ type CLIManager struct { wallet *wallet.Wallet keymanager keymanager.IKeymanager keymanagerKind keymanager.Kind - showDepositData bool showPrivateKeys bool listValidatorIndices bool deletePublicKeys bool diff --git a/validator/accounts/cli_options.go b/validator/accounts/cli_options.go index 8bc5348d9..20943f6e9 100644 --- a/validator/accounts/cli_options.go +++ b/validator/accounts/cli_options.go @@ -37,14 +37,6 @@ func WithKeymanagerType(k keymanager.Kind) Option { } } -// WithShowDepositData enables displaying deposit data in the accounts cli manager. -func WithShowDepositData() Option { - return func(acc *CLIManager) error { - acc.showDepositData = true - return nil - } -} - // WithShowPrivateKeys enables displaying private keys in the accounts cli manager. func WithShowPrivateKeys() Option { return func(acc *CLIManager) error { diff --git a/validator/keymanager/local/keymanager.go b/validator/keymanager/local/keymanager.go index 2fa92b5d9..5346a1107 100644 --- a/validator/keymanager/local/keymanager.go +++ b/validator/keymanager/local/keymanager.go @@ -427,15 +427,6 @@ func (km *Keymanager) ListKeymanagerAccounts(ctx context.Context, cfg keymanager fmt.Printf("%s %#x\n", au.BrightRed("[validating private key]").Bold(), privateKeys[i]) } } - if !cfg.ShowDepositData { - continue - } - fmt.Printf( - "%s\n", - au.BrightRed("If you imported your account coming from the eth2 launchpad, you will find your "+ - "deposit_data.json in the eth2.0-deposit-cli's validator_keys folder"), - ) - fmt.Println("") } fmt.Println("") return nil diff --git a/validator/keymanager/types.go b/validator/keymanager/types.go index bac441c6d..b632b2b54 100644 --- a/validator/keymanager/types.go +++ b/validator/keymanager/types.go @@ -89,7 +89,6 @@ type PublicKeyDeleter interface { } type ListKeymanagerAccountConfig struct { - ShowDepositData bool ShowPrivateKeys bool WalletAccountsDir string KeymanagerConfigFileName string