lodestar icon indicating copy to clipboard operation
lodestar copied to clipboard

Better logging for exit-validator if key is not yet activated on beacon chain

Open philknows opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

As described by Somer, when trying to voluntary-exit a validator that is not yet activated on the beacon chain, Lodestar responds with an error such as:

ethstaker@ETH-STAKER-001:/usr/local/bin/lodestar$ ./lodestar validator voluntary-exit --network goerli --dataDir /var/lib/lodestar/validators --pubkeys 0x874aef47324f0d1af666c25607f01f2f02e1c5297be17ade9f35205d3ef8e5d511ae1054f8876a33af67e6c329e5d18e
 ✖ Error: beacon node did not return status for pubkey 0x874aef47324f0d1af666c25607f01f2f02e1c5297be17ade9f35205d3ef8e5d511ae1054f8876a33af67e6c329e5d18e
    at file:///usr/local/bin/lodestar/packages/cli/src/cmds/validator/voluntaryExit.ts:153:13
    at Array.map (<anonymous>)
    at resolveValidatorIndexes (file:///usr/local/bin/lodestar/packages/cli/src/cmds/validator/voluntaryExit.ts:150:24)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.handler (file:///usr/local/bin/lodestar/packages/cli/src/cmds/validator/voluntaryExit.ts:82:30)

Describe the solution you'd like

A better log response from Lodestar to the user. Something along the lines of: Validator is not yet active and cannot be exited is more understandable to a user.

philknows avatar Sep 12 '22 19:09 philknows

Note that if the key has a typo it will also get the same respond, even if the key is already active. What's really happening is that the key is not known in current beacon chain state. But that's not that a helpful message

dapplion avatar Sep 13 '22 07:09 dapplion

Maybe something at least that encompasses the fact that the Validator pubkey is unknown: Re-check the pubkey submitted or wait until activated on the beacon chain to voluntary-exit

philknows avatar Sep 13 '22 07:09 philknows

./lodestar validator voluntary-exit and it said: 100% of local key stores imported. current=0 total=0 rate=0.00keys/m Loaded keystores via keystore cache “? Confirm to exit pub keys at epoch 207748 from network main net?”

The voluntary exit command might also be confusing ☝️ if there are no pub keys to exit because no keys are imported. Ideally, we don't want to print out Confirm to exit pub keys at epoch 207748 from network main net at all if validatorsToExit=0. https://github.com/ChainSafe/lodestar/blob/739febbd658b2eee0f7c4508431e274797a202a8/packages/cli/src/cmds/validator/voluntaryExit.ts#L83

There must be a more explicit message that tells the user that there are 0 validators to exit which should be considered an error condition for this command.

nflaig avatar Jun 13 '23 05:06 nflaig