mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
Move voluntary exit logging to accounts_exit
(#7603)
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
parent
ddbece5988
commit
17a08a75ea
@ -8,6 +8,7 @@ import (
|
||||
|
||||
"github.com/pkg/errors"
|
||||
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
|
||||
"github.com/prysmaticlabs/prysm/shared/bytesutil"
|
||||
"github.com/prysmaticlabs/prysm/shared/cmd"
|
||||
"github.com/prysmaticlabs/prysm/shared/promptutil"
|
||||
@ -195,7 +196,14 @@ func performExit(cliCtx *cli.Context, cfg performExitCfg) ([]string, error) {
|
||||
for i, key := range cfg.rawPubKeys {
|
||||
if err := client.ProposeExit(cliCtx.Context, cfg.validatorClient, cfg.nodeClient, cfg.keymanager.Sign, key); err != nil {
|
||||
rawNotExitedKeys = append(rawNotExitedKeys, key)
|
||||
log.WithError(err).Errorf("voluntary exit failed for account %s", cfg.formattedPubKeys[i])
|
||||
|
||||
msg := err.Error()
|
||||
if strings.Contains(msg, blocks.ValidatorAlreadyExitedMsg) ||
|
||||
strings.Contains(msg, blocks.ValidatorCannotExitYetMsg) {
|
||||
log.Warningf("Could not perform voluntary exit for account %s: %s", cfg.formattedPubKeys[i], msg)
|
||||
} else {
|
||||
log.WithError(err).Errorf("voluntary exit failed for account %s", cfg.formattedPubKeys[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
var formattedExitedKeys []string
|
||||
|
@ -2,9 +2,7 @@ package accounts
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
|
||||
"github.com/prysmaticlabs/prysm/shared/cmd"
|
||||
"github.com/prysmaticlabs/prysm/shared/featureconfig"
|
||||
"github.com/prysmaticlabs/prysm/shared/tos"
|
||||
@ -198,11 +196,6 @@ this command outputs a deposit data string which is required to become a validat
|
||||
Action: func(cliCtx *cli.Context) error {
|
||||
featureconfig.ConfigureValidator(cliCtx)
|
||||
if err := ExitAccountsCli(cliCtx, os.Stdin); err != nil {
|
||||
msg := err.Error()
|
||||
if strings.Contains(msg, blocks.ValidatorAlreadyExitedMsg) ||
|
||||
strings.Contains(msg, blocks.ValidatorCannotExitYetMsg) {
|
||||
log.Errorf("Could not perform voluntary exit: %s", msg)
|
||||
}
|
||||
log.Fatalf("Could not perform voluntary exit: %v", err)
|
||||
}
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user