mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
prysmctl: withdrawal ux improvement (#11909)
* adjusting submit bls to not early exit function in partial success * Update cmd/prysmctl/validator/withdraw.go Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
@@ -87,10 +87,15 @@ func callWithdrawalEndpoints(ctx context.Context, host string, request []*apimid
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := client.SubmitChangeBLStoExecution(ctx, request); err != nil {
|
||||
err = client.SubmitChangeBLStoExecution(ctx, request)
|
||||
if err != nil && strings.Contains(err.Error(), "POST error") {
|
||||
// just log the error, so we can check the pool for partial inclusions.
|
||||
log.Error(err)
|
||||
} else if err != nil {
|
||||
return err
|
||||
} else {
|
||||
log.Infof("Successfully published messages to update %d withdrawal addresses.", len(request))
|
||||
}
|
||||
log.Infof("Successfully published messages to update %d withdrawal addresses.", len(request))
|
||||
return checkIfWithdrawsAreInPool(ctx, client, request)
|
||||
}
|
||||
|
||||
@@ -105,6 +110,7 @@ func checkIfWithdrawsAreInPool(ctx context.Context, client *beacon.Client, reque
|
||||
requestMap[w.Message.ValidatorIndex] = w.Message.ToExecutionAddress
|
||||
}
|
||||
totalMessages := len(requestMap)
|
||||
log.Infof("There are a total of %d messages known to the node's pool.", len(poolResponse.Data))
|
||||
for _, resp := range poolResponse.Data {
|
||||
value, found := requestMap[resp.Message.ValidatorIndex]
|
||||
if found && value == resp.Message.ToExecutionAddress {
|
||||
|
||||
@@ -255,7 +255,7 @@ func TestCallWithdrawalEndpoint_Errors(t *testing.T) {
|
||||
cliCtx := cli.NewContext(&app, set, nil)
|
||||
|
||||
err = setWithdrawalAddresses(cliCtx)
|
||||
assert.ErrorContains(t, "POST error", err)
|
||||
require.ErrorContains(t, "did not receive 2xx response from API", err)
|
||||
|
||||
assert.LogsContain(t, hook, "Could not validate SignedBLSToExecutionChange")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user