mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Add log capitalization analyzer and apply changes (#15452)
* Add log capitalization analyzer and apply fixes across codebase Implements a new nogo analyzer to enforce proper log message capitalization and applies the fixes to all affected log statements throughout the beacon chain, validator, and supporting components. Co-Authored-By: Claude <noreply@anthropic.com> * Radek's feedback --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,7 @@ func (c *grpcNodeClient) Peers(ctx context.Context, in *empty.Empty) (*ethpb.Pee
|
||||
func (c *grpcNodeClient) IsHealthy(ctx context.Context) bool {
|
||||
_, err := c.nodeClient.GetHealth(ctx, ðpb.HealthRequest{})
|
||||
if err != nil {
|
||||
log.WithError(err).Error("failed to get health of node")
|
||||
log.WithError(err).Error("Failed to get health of node")
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
||||
@@ -33,7 +33,7 @@ func (c *grpcValidatorClient) Duties(ctx context.Context, in *ethpb.DutiesReques
|
||||
dutiesResponse, err := c.beaconNodeValidatorClient.GetDutiesV2(ctx, in)
|
||||
if err != nil {
|
||||
if status.Code(err) == codes.Unimplemented {
|
||||
log.Warn("beaconNodeValidatorClient.GetDutiesV2() returned status code unavailable, falling back to GetDuties")
|
||||
log.Warn("GetDutiesV2 returned status code unavailable, falling back to GetDuties")
|
||||
return c.getDuties(ctx, in)
|
||||
}
|
||||
return nil, errors.Wrap(
|
||||
|
||||
@@ -275,7 +275,7 @@ func (*FakeValidator) HasProposerSettings() bool {
|
||||
func (fv *FakeValidator) PushProposerSettings(ctx context.Context, _ primitives.Slot, _ bool) error {
|
||||
time.Sleep(fv.ProposerSettingWait)
|
||||
if errors.Is(ctx.Err(), context.DeadlineExceeded) {
|
||||
log.Error("deadline exceeded")
|
||||
log.Error("Deadline exceeded")
|
||||
// can't return error as it will trigger a log.fatal
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -565,7 +565,7 @@ func (v *validator) UpdateDuties(ctx context.Context) error {
|
||||
v.dutiesLock.Lock()
|
||||
v.duties = nil // Clear assignments so we know to retry the request.
|
||||
v.dutiesLock.Unlock()
|
||||
log.WithError(err).Error("error getting validator duties")
|
||||
log.WithError(err).Error("Error getting validator duties")
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1141,7 +1141,7 @@ func (v *validator) PushProposerSettings(ctx context.Context, slot primitives.Sl
|
||||
if len(signedRegReqs) > 0 {
|
||||
go func() {
|
||||
if err := SubmitValidatorRegistrations(ctx, v.validatorClient, signedRegReqs, v.validatorsRegBatchSize); err != nil {
|
||||
log.WithError(errors.Wrap(ErrBuilderValidatorRegistration, err.Error())).Warn("failed to register validator on builder")
|
||||
log.WithError(errors.Wrap(ErrBuilderValidatorRegistration, err.Error())).Warn("Failed to register validator on builder")
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ func (km *Keymanager) ImportKeystores(
|
||||
}
|
||||
}
|
||||
if len(importedKeys) == 0 {
|
||||
log.Warn("no keys were imported")
|
||||
log.Warn("No keys were imported")
|
||||
return statuses, nil
|
||||
}
|
||||
// 2) Update copied keystore with new keys,clear duplicates in existing set
|
||||
|
||||
@@ -243,7 +243,7 @@ func TestLocalKeymanager_ImportKeystores(t *testing.T) {
|
||||
fmt.Sprintf("incorrect password for key 0x%s", keystores[1].Pubkey),
|
||||
statuses[1].Message,
|
||||
)
|
||||
require.LogsContain(t, hook, "no keys were imported")
|
||||
require.LogsContain(t, hook, "No keys were imported")
|
||||
})
|
||||
t.Run("file write fails during import", func(t *testing.T) {
|
||||
wallet.HasWriteFileError = true
|
||||
|
||||
@@ -174,7 +174,7 @@ func (client *ApiClient) doRequest(ctx context.Context, httpMethod, fullPath str
|
||||
"status": resp.StatusCode,
|
||||
"request": string(requestDump),
|
||||
"response": string(responseDump),
|
||||
}).Error("web3signer request failed")
|
||||
}).Error("Web3signer request failed")
|
||||
}
|
||||
if resp.StatusCode == http.StatusInternalServerError {
|
||||
err = fmt.Errorf("internal Web3Signer server error, Signing Request URL: %v Status: %v", fullPath, resp.StatusCode)
|
||||
@@ -217,6 +217,6 @@ func unmarshalSignatureResponse(responseBody io.ReadCloser) (bls.Signature, erro
|
||||
// closeBody a utility method to wrap an error for closing
|
||||
func closeBody(body io.Closer) {
|
||||
if err := body.Close(); err != nil {
|
||||
log.WithError(err).Error("could not close response body")
|
||||
log.WithError(err).Error("Could not close response body")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ func (c *ValidatorClient) getLegacyDatabaseLocation(
|
||||
|
||||
func getWallet(cliCtx *cli.Context) (*wallet.Wallet, error) {
|
||||
if cliCtx.IsSet(flags.InteropNumValidators.Name) {
|
||||
log.Info("no wallet required for interop validation")
|
||||
log.Info("No wallet required for interop validation")
|
||||
return nil, nil
|
||||
}
|
||||
if cliCtx.IsSet(flags.Web3SignerURLFlag.Name) {
|
||||
|
||||
Reference in New Issue
Block a user