berachain / beacon-kit

A modular framework for building EVM consensus clients ⛵️✨
https://berachain.com
Other
170 stars 122 forks source link

Create-validator cli is broken since alpha.5 #2122

Closed chuck-bear closed 1 week ago

chuck-bear commented 2 weeks ago

The create-validator CLI is broken since alpha.5, last time it worked it was with alpha.4.

How to reproduce it ?

Run that command line with alpha.8 binary:

beacond deposit create-validator $VAL_WITHDRAW_CREDENTIAL $VAL_DEPOSIT_GWEI_AMOUNT $GENESIS_FORK_VERSION $GENESIS_VALIDATORS_ROOT --private-key $YOUR_ETH_WALLET_PRIVATE_KEY  --home $YOUR_BEACON_HOME_DIR

It will return open : no such file or directory

And run it with alpha.4 binary.

Let me know if you need more details.

dezzeus commented 1 week ago

It took a while, but I have found the root cause of the issue: the deposit CLI sub-command was attempting to retrieve the (viper) configuration from the command's context using the ViperContextKey key defined in the github.com/cosmos/cosmos-sdk/client package instead of the one defined in the github.com/berachain/beacon-kit/mod/cli/pkg/context one (that was used for storing the loaded configuration).

As a result, the command attempted to load the priv_validator_key_file and priv_validator_state_file files from empty strings returned by a new, empty, viper configuration.

I'll make a PR to fix it, hoping that there are no more issues down the same road.

chuck-bear commented 1 week ago

Thanks @dezzeus this looks very familiar to https://github.com/berachain/beacon-kit/issues/2123

abi87 commented 1 week ago

@chuck-bear we do have a proposed solution by @dezzeus on https://github.com/berachain/beacon-kit/pull/2128. Can you try it out?

chuck-bear commented 1 week ago

@dezzeus @abi87 just tested, it's working. Thanks!