From 179a38ddd545557f029f0f8bf9ea6dc79cacec0e Mon Sep 17 00:00:00 2001 From: dudong2 Date: Fri, 5 Jul 2024 18:45:25 +0900 Subject: [PATCH 1/9] test: Fix lint --- app/upgrades.go | 2 +- rpc/websockets.go | 2 +- server/start.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/upgrades.go b/app/upgrades.go index df2307ad41..95f6ddec2c 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -91,7 +91,7 @@ func (app *EthermintApp) RegisterUpgradeHandlers( baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) app.UpgradeKeeper.SetUpgradeHandler( planName, - func(ctx context.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) if fromVM, err := app.ModuleManager.RunMigrations(ctx, app.configurator, fromVM); err != nil { diff --git a/rpc/websockets.go b/rpc/websockets.go index 2da557363f..5b1bec3a29 100644 --- a/rpc/websockets.go +++ b/rpc/websockets.go @@ -127,7 +127,7 @@ func (s *websocketsServer) Start() { func (s *websocketsServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { upgrader := websocket.Upgrader{ - CheckOrigin: func(r *http.Request) bool { + CheckOrigin: func(_ *http.Request) bool { return true }, } diff --git a/server/start.go b/server/start.go index f8354e0ebf..b4806253a4 100644 --- a/server/start.go +++ b/server/start.go @@ -226,7 +226,7 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. cmd.Flags().Uint32(server.FlagStateSyncSnapshotKeepRecent, 2, "State sync snapshot to keep") // support old flags name for backwards compatibility - cmd.Flags().SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName { + cmd.Flags().SetNormalizeFunc(func(_ *pflag.FlagSet, name string) pflag.NormalizedName { if name == "with-tendermint" { name = srvflags.WithComet } From 8d592bd33b105292067393208b9c38aa25118370 Mon Sep 17 00:00:00 2001 From: dudong2 Date: Fri, 5 Jul 2024 18:45:35 +0900 Subject: [PATCH 2/9] test: Fix cosmovisor upgrade test --- app/app.go | 8 +- app/upgrades.go | 15 +-- .../configs/cosmovisor.jsonnet | 6 + tests/integration_tests/test_upgrade.py | 127 ++++++++++++------ tests/integration_tests/utils.py | 18 +++ 5 files changed, 119 insertions(+), 55 deletions(-) diff --git a/app/app.go b/app/app.go index d67979f2a1..14987af30f 100644 --- a/app/app.go +++ b/app/app.go @@ -121,6 +121,8 @@ import ( ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" ibc "github.com/cosmos/ibc-go/v8/modules/core" + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" @@ -1085,8 +1087,12 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(slashingtypes.ModuleName) paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint: staticcheck paramsKeeper.Subspace(crisistypes.ModuleName) - paramsKeeper.Subspace(ibcexported.ModuleName) // TODO(dudong2): withkeytable paramsKeeper.Subspace(ibctransfertypes.ModuleName) + + keyTable := ibcclienttypes.ParamKeyTable() + keyTable.RegisterParamSet(&ibcconnectiontypes.Params{}) + paramsKeeper.Subspace(ibcexported.ModuleName).WithKeyTable(keyTable) + // ethermint subspaces paramsKeeper.Subspace(evmtypes.ModuleName).WithKeyTable(evmtypes.ParamKeyTable()) //nolint:staticcheck paramsKeeper.Subspace(feemarkettypes.ModuleName).WithKeyTable(feemarkettypes.ParamKeyTable()) diff --git a/app/upgrades.go b/app/upgrades.go index 95f6ddec2c..520c738824 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -40,7 +40,7 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" - clientkeeper "github.com/cosmos/ibc-go/v8/modules/core/02-client/keeper" + ibcclientkeeper "github.com/cosmos/ibc-go/v8/modules/core/02-client/keeper" "github.com/cosmos/ibc-go/v8/modules/core/exported" ibctmmigrations "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint/migrations" evmtypes "github.com/evmos/ethermint/x/evm/types" @@ -49,7 +49,7 @@ import ( func (app *EthermintApp) RegisterUpgradeHandlers( cdc codec.BinaryCodec, - clientKeeper clientkeeper.Keeper, + ibcClientKeeper ibcclientkeeper.Keeper, consensusParamsKeeper consensusparamskeeper.Keeper, paramsKeeper paramskeeper.Keeper, ) { @@ -100,20 +100,15 @@ func (app *EthermintApp) RegisterUpgradeHandlers( // ibc v7 // OPTIONAL: prune expired tendermint consensus states to save storage space - if _, err := ibctmmigrations.PruneExpiredConsensusStates(sdkCtx, cdc, clientKeeper); err != nil { - return fromVM, err - } - - legacyBaseAppSubspace := paramsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) - if err := baseapp.MigrateParams(sdkCtx, legacyBaseAppSubspace, &consensusParamsKeeper.ParamsStore); err != nil { + if _, err := ibctmmigrations.PruneExpiredConsensusStates(sdkCtx, cdc, ibcClientKeeper); err != nil { return fromVM, err } // ibc v7.1 // explicitly update the IBC 02-client params, adding the localhost client type - params := clientKeeper.GetParams(sdkCtx) + params := ibcClientKeeper.GetParams(sdkCtx) params.AllowedClients = append(params.AllowedClients, exported.Localhost) - clientKeeper.SetParams(sdkCtx, params) + ibcClientKeeper.SetParams(sdkCtx, params) // cosmos-sdk v047 // Migrate Tendermint consensus parameters from x/params module to a dedicated x/consensus module. diff --git a/tests/integration_tests/configs/cosmovisor.jsonnet b/tests/integration_tests/configs/cosmovisor.jsonnet index dc3cb1a4a2..6d72849146 100644 --- a/tests/integration_tests/configs/cosmovisor.jsonnet +++ b/tests/integration_tests/configs/cosmovisor.jsonnet @@ -6,6 +6,12 @@ config { 'minimum-gas-prices': '100000000000aphoton', }, genesis+: { + consensus_params+: { + block+: { + bax_bytes: '1048576', + max_gas: '81500000', + }, + }, app_state+: { feemarket+: { params+: { diff --git a/tests/integration_tests/test_upgrade.py b/tests/integration_tests/test_upgrade.py index a2118efb97..14075fe1d0 100644 --- a/tests/integration_tests/test_upgrade.py +++ b/tests/integration_tests/test_upgrade.py @@ -2,6 +2,7 @@ import json import re import subprocess +import time from pathlib import Path import pytest @@ -17,7 +18,8 @@ parse_events, send_transaction, wait_for_block, - wait_for_block_time, + wait_for_new_blocks_legacy, + wait_for_block_time_legacy, wait_for_port, ) @@ -53,9 +55,9 @@ def post_init(path, base_port, config): i = m.group(1) ini[section].update( { - "command": f"cosmovisor start --home %(here)s/node{i}", + "command": f"cosmovisor run start --home %(here)s/node{i}", "environment": ( - f"DAEMON_NAME=ethermintd,DAEMON_HOME=%(here)s/node{i}" + f"DAEMON_NAME=ethermintd,DAEMON_HOME=%(here)s/node{i},DAEMON_RESTART_AFTER_UPGRADE=false" ), } ) @@ -119,7 +121,10 @@ def test_cosmovisor_upgrade(custom_ethermint: Ethermint): assert rsp["code"] == 0, rsp["raw_log"] # get proposal_id - ev = parse_events(rsp["logs"])["submit_proposal"] + wait_for_new_blocks_legacy(cli, 1, sleep=0.1) + logs = cli.query_tx("hash", rsp["txhash"])["logs"] + + ev = parse_events(logs)["submit_proposal"] proposal_id = ev["proposal_id"] rsp = cli.gov_vote("validator", proposal_id, "yes") @@ -128,7 +133,7 @@ def test_cosmovisor_upgrade(custom_ethermint: Ethermint): # assert rsp["code"] == 0, rsp["raw_log"] proposal = cli.query_proposal(proposal_id) - wait_for_block_time(cli, isoparse(proposal["voting_end_time"])) + wait_for_block_time_legacy(cli, isoparse(proposal["voting_end_time"])) proposal = cli.query_proposal(proposal_id) assert proposal["status"] == "PROPOSAL_STATUS_PASSED", proposal @@ -137,46 +142,80 @@ def test_cosmovisor_upgrade(custom_ethermint: Ethermint): Path(custom_ethermint.chain_binary).parent.parent.parent / f"{plan_name}/bin/ethermintd" ) - cli = custom_ethermint.cosmos_cli() - - # block should pass the target height - wait_for_block(cli, target_height + 1, timeout=480) - wait_for_port(ports.rpc_port(custom_ethermint.base_port(0))) - # test migrate keystore - cli.migrate_keystore() - - # check basic tx works after upgrade - wait_for_port(ports.evmrpc_port(custom_ethermint.base_port(0))) + # wait until cosmovosor finished + proc = [] + for i in range(2): + while True: + try: + c = custom_ethermint.cosmos_cli(i) + c.status() + except: + break + finally: + time.sleep(5) + + # start ethermint + for i in range(2): + with (custom_ethermint.base_dir / f"node{i}.log").open("a") as logfile: + p = subprocess.Popen( + [ + custom_ethermint.chain_binary, + "start", + "--home", + custom_ethermint.base_dir / f"node{i}", + ], + stdout=logfile, + stderr=subprocess.STDOUT, + ) + proc.append(p) + cli = custom_ethermint.cosmos_cli() - receipt = send_transaction( - w3, - { - "to": ADDRS["community"], - "value": 1000, - "maxFeePerGas": 1000000000000, - "maxPriorityFeePerGas": 10000, - }, - ) - assert receipt.status == 1 + try: + # block should pass the target height + wait_for_block(cli, target_height + 1, timeout=20) + wait_for_port(ports.rpc_port(custom_ethermint.base_port(0))) + + # test migrate keystore + cli.migrate_keystore() + + # check basic tx works after upgrade + wait_for_port(ports.evmrpc_port(custom_ethermint.base_port(0))) + + receipt = send_transaction( + w3, + { + "to": ADDRS["community"], + "value": 1000, + "maxFeePerGas": 1000000000000, + "maxPriorityFeePerGas": 10000, + }, + ) + assert receipt.status == 1 - # check json-rpc query on older blocks works - assert old_balance == w3.eth.get_balance( - ADDRS["validator"], block_identifier=old_height - ) - assert old_base_fee == w3.eth.get_block(old_height).baseFeePerGas - - # check eth_call on older blocks works - assert old_erc20_balance == contract.caller( - block_identifier=target_height - 2 - ).balanceOf(ADDRS["validator"]) - p = json.loads( - cli.raw( - "query", - "ibc", - "client", - "params", - home=cli.data_dir, + # check json-rpc query on older blocks works + assert old_balance == w3.eth.get_balance( + ADDRS["validator"], block_identifier=old_height ) - ) - assert p == {"allowed_clients": ["06-solomachine", "07-tendermint", "09-localhost"]} + assert old_base_fee == w3.eth.get_block(old_height).baseFeePerGas + + # check eth_call on older blocks works + assert old_erc20_balance == contract.caller( + block_identifier=target_height - 2 + ).balanceOf(ADDRS["validator"]) + p = json.loads( + cli.raw( + "query", + "ibc", + "client", + "params", + home=cli.data_dir, + node=cli.node_rpc, + output="json", + ) + ) + assert p == {"allowed_clients": ["06-solomachine", "07-tendermint", "09-localhost"]} + finally: + for p in proc: + p.terminate() + p.wait() \ No newline at end of file diff --git a/tests/integration_tests/utils.py b/tests/integration_tests/utils.py index cec66a7f00..1c0ae46f15 100644 --- a/tests/integration_tests/utils.py +++ b/tests/integration_tests/utils.py @@ -83,6 +83,14 @@ def wait_for_new_blocks(cli, n, sleep=0.5): return cur_height +def wait_for_new_blocks_legacy(cli, n, sleep=0.5): + cur_height = begin_height = int((cli.status())["SyncInfo"]["latest_block_height"]) + while cur_height - begin_height < n: + time.sleep(sleep) + cur_height = int((cli.status())["SyncInfo"]["latest_block_height"]) + return cur_height + + def wait_for_block(cli, height, timeout=240): for _ in range(timeout * 2): try: @@ -124,6 +132,16 @@ def wait_for_block_time(cli, t): time.sleep(0.5) +def wait_for_block_time_legacy(cli, t): + print("wait for block time", t) + while True: + now = isoparse((cli.status())["SyncInfo"]["latest_block_time"]) + print("block time now: ", now) + if now >= t: + break + time.sleep(0.5) + + def deploy_contract(w3, jsonfile, args=(), key=KEYS["validator"]): """ deploy contract and return the deployed contract instance From 1ad19f6748b0d0a9cffcb976a3d7ba48bf7fb778 Mon Sep 17 00:00:00 2001 From: dudong2 Date: Fri, 5 Jul 2024 18:51:52 +0900 Subject: [PATCH 3/9] test: Update gomod2nix.toml --- gomod2nix.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gomod2nix.toml b/gomod2nix.toml index 87267066fb..d1c7ab106d 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -181,8 +181,8 @@ schema = 3 version = "v1.0.0" hash = "sha256-xOeHJWUj6fTc2EUGiE4dgfY2WkvrqTg/FWewoUvQcvg=" [mod."github.com/cosmos/ibc-go/v8"] - version = "v8.0.0" - hash = "sha256-RBj66/3xB8KTD9wbryv/tpRYYdKIDCJ/4u6u6s1Eeuo=" + version = "v8.2.1" + hash = "sha256-FYMkZG3dYTXkqoSSyJSSe5NDd9K+3KlMWKfQKahXz3s=" [mod."github.com/cosmos/ics23/go"] version = "v0.10.0" hash = "sha256-KYEv727BO/ht63JO02xiKFGFAddg41Ve9l2vSSZZBq0=" From b6a95a30bc48ae4729b6dc34346c1d71ac53777c Mon Sep 17 00:00:00 2001 From: dudong2 Date: Fri, 5 Jul 2024 18:56:49 +0900 Subject: [PATCH 4/9] test: Fix lint - remove paramskeeper from upgrade handler --- app/app.go | 2 +- app/upgrades.go | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/app.go b/app/app.go index 14987af30f..7946157cec 100644 --- a/app/app.go +++ b/app/app.go @@ -748,7 +748,7 @@ func NewEthermintApp( // RegisterUpgradeHandlers is used for registering any on-chain upgrades. // Make sure it's called after `app.mm` and `app.configurator` are set. - app.RegisterUpgradeHandlers(app.appCodec, app.IBCKeeper.ClientKeeper, app.ConsensusParamsKeeper, app.ParamsKeeper) + app.RegisterUpgradeHandlers(app.appCodec, app.IBCKeeper.ClientKeeper, app.ConsensusParamsKeeper) autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.ModuleManager.Modules)) diff --git a/app/upgrades.go b/app/upgrades.go index 520c738824..44f131ac70 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -35,7 +35,6 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -51,7 +50,6 @@ func (app *EthermintApp) RegisterUpgradeHandlers( cdc codec.BinaryCodec, ibcClientKeeper ibcclientkeeper.Keeper, consensusParamsKeeper consensusparamskeeper.Keeper, - paramsKeeper paramskeeper.Keeper, ) { planName := "integration-test-upgrade" // Set param key table for params module migration From 849ec749f69773b25f74a359779999b245c17d4a Mon Sep 17 00:00:00 2001 From: dudong2 Date: Fri, 5 Jul 2024 19:10:18 +0900 Subject: [PATCH 5/9] test: Fix flake8 --- tests/integration_tests/test_upgrade.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/integration_tests/test_upgrade.py b/tests/integration_tests/test_upgrade.py index 14075fe1d0..0d2c4cb114 100644 --- a/tests/integration_tests/test_upgrade.py +++ b/tests/integration_tests/test_upgrade.py @@ -18,8 +18,8 @@ parse_events, send_transaction, wait_for_block, - wait_for_new_blocks_legacy, wait_for_block_time_legacy, + wait_for_new_blocks_legacy, wait_for_port, ) @@ -57,7 +57,9 @@ def post_init(path, base_port, config): { "command": f"cosmovisor run start --home %(here)s/node{i}", "environment": ( - f"DAEMON_NAME=ethermintd,DAEMON_HOME=%(here)s/node{i},DAEMON_RESTART_AFTER_UPGRADE=false" + f"DAEMON_NAME=ethermintd," + f"DAEMON_HOME=%(here)s/node{i}," + "DAEMON_RESTART_AFTER_UPGRADE=false" ), } ) @@ -123,7 +125,7 @@ def test_cosmovisor_upgrade(custom_ethermint: Ethermint): # get proposal_id wait_for_new_blocks_legacy(cli, 1, sleep=0.1) logs = cli.query_tx("hash", rsp["txhash"])["logs"] - + ev = parse_events(logs)["submit_proposal"] proposal_id = ev["proposal_id"] @@ -150,7 +152,7 @@ def test_cosmovisor_upgrade(custom_ethermint: Ethermint): try: c = custom_ethermint.cosmos_cli(i) c.status() - except: + except Exception: break finally: time.sleep(5) @@ -214,8 +216,14 @@ def test_cosmovisor_upgrade(custom_ethermint: Ethermint): output="json", ) ) - assert p == {"allowed_clients": ["06-solomachine", "07-tendermint", "09-localhost"]} + assert p == { + "allowed_clients": [ + "06-solomachine", + "07-tendermint", + "09-localhost" + ] + } finally: for p in proc: p.terminate() - p.wait() \ No newline at end of file + p.wait() From d20e83be670787dd7ecc308f1d1a3e772b769827 Mon Sep 17 00:00:00 2001 From: dudong2 Date: Fri, 5 Jul 2024 19:18:40 +0900 Subject: [PATCH 6/9] test: Fix lint - ignore G114 --- rpc/websockets.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rpc/websockets.go b/rpc/websockets.go index 5b1bec3a29..b1c3f1d4f3 100644 --- a/rpc/websockets.go +++ b/rpc/websockets.go @@ -108,11 +108,10 @@ func (s *websocketsServer) Start() { go func() { var err error - /* #nosec G114 -- http functions have no support for timeouts */ if s.certFile == "" || s.keyFile == "" { - err = http.ListenAndServe(s.wsAddr, ws) + err = http.ListenAndServe(s.wsAddr, ws) // #nosec G114 } else { - err = http.ListenAndServeTLS(s.wsAddr, s.certFile, s.keyFile, ws) + err = http.ListenAndServeTLS(s.wsAddr, s.certFile, s.keyFile, ws) // #nosec G114 } if err != nil { From 53855c32cc42482e36c8f126399420cfc8b3f1d2 Mon Sep 17 00:00:00 2001 From: dudong2 Date: Wed, 10 Jul 2024 12:22:44 +0900 Subject: [PATCH 7/9] test: Add sleep for ethermint node graceful shutdown --- tests/integration_tests/test_upgrade.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/integration_tests/test_upgrade.py b/tests/integration_tests/test_upgrade.py index 0d2c4cb114..a362ee42a4 100644 --- a/tests/integration_tests/test_upgrade.py +++ b/tests/integration_tests/test_upgrade.py @@ -157,6 +157,8 @@ def test_cosmovisor_upgrade(custom_ethermint: Ethermint): finally: time.sleep(5) + time.sleep(60) # wait graceful shutdown for ethermint node + # start ethermint for i in range(2): with (custom_ethermint.base_dir / f"node{i}.log").open("a") as logfile: From d3e6f1ebbf07e063a236e1a62e56289b736dd88a Mon Sep 17 00:00:00 2001 From: dudong2 Date: Wed, 10 Jul 2024 13:04:21 +0900 Subject: [PATCH 8/9] test: Fix flake8 --- tests/integration_tests/test_upgrade.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration_tests/test_upgrade.py b/tests/integration_tests/test_upgrade.py index a362ee42a4..e2fd6c6ede 100644 --- a/tests/integration_tests/test_upgrade.py +++ b/tests/integration_tests/test_upgrade.py @@ -157,7 +157,8 @@ def test_cosmovisor_upgrade(custom_ethermint: Ethermint): finally: time.sleep(5) - time.sleep(60) # wait graceful shutdown for ethermint node + # wait graceful shutdown for ethermint node + time.sleep(60) # start ethermint for i in range(2): From 4261b2225837e2e1ab7927d97800a6ebb28b0296 Mon Sep 17 00:00:00 2001 From: dudong2 Date: Wed, 10 Jul 2024 23:22:21 +0900 Subject: [PATCH 9/9] Fix: fix default home dir for client.toml --- cmd/ethermintd/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/ethermintd/root.go b/cmd/ethermintd/root.go index 0669e46ae1..d1a5a74d89 100644 --- a/cmd/ethermintd/root.go +++ b/cmd/ethermintd/root.go @@ -136,7 +136,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { initRootCmd(tempApp, encodingConfig, rootCmd, encodingConfig.TxConfig, tempApp.BasicModuleManager) autoCliOpts := tempApp.AutoCliOpts() - initClientCtx, _ = config.ReadFromClientConfig(initClientCtx) + initClientCtx, _ = config.ReadDefaultValuesFromDefaultClientConfig(initClientCtx) autoCliOpts.Keyring, _ = keyring.NewAutoCLIKeyring(initClientCtx.Keyring) autoCliOpts.ClientCtx = initClientCtx