From 9f7711e74a022d453b5dd155bb831d5e8323b332 Mon Sep 17 00:00:00 2001 From: Justin Traglia <95511699+jtraglia@users.noreply.github.com> Date: Fri, 14 Apr 2023 05:03:11 -0500 Subject: [PATCH] Enable misspell linter & fix findings (#12272) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Radosław Kapka --- .golangci.yml | 1 + beacon-chain/blockchain/head.go | 2 +- beacon-chain/node/node.go | 2 +- beacon-chain/p2p/discovery.go | 2 +- beacon-chain/p2p/testing/p2p.go | 2 +- beacon-chain/p2p/utils.go | 2 +- beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go | 2 +- beacon-chain/sync/validate_beacon_blocks.go | 2 +- cmd/flags.go | 4 ++-- cmd/prysmctl/validator/cmd.go | 2 +- validator/accounts/wallet/wallet.go | 2 +- validator/keymanager/derived/mnemonic.go | 2 +- 12 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index a63857b2b6..078833cd5c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -17,6 +17,7 @@ linters: - errcheck - gosimple - gocognit + - misspell linters-settings: gocognit: diff --git a/beacon-chain/blockchain/head.go b/beacon-chain/blockchain/head.go index 2cbf0bee40..b5258c95ae 100644 --- a/beacon-chain/blockchain/head.go +++ b/beacon-chain/blockchain/head.go @@ -54,7 +54,7 @@ type head struct { // This saves head info to the local service cache, it also saves the // new head root to the DB. -// Caller of the method MUST aqcuire a lock on forkchoice. +// Caller of the method MUST acquire a lock on forkchoice. func (s *Service) saveHead(ctx context.Context, newHeadRoot [32]byte, headBlock interfaces.ReadOnlySignedBeaconBlock, headState state.BeaconState) error { ctx, span := trace.StartSpan(ctx, "blockChain.saveHead") defer span.End() diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index d5f6580ed3..b51f44027a 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -233,7 +233,7 @@ func New(cliCtx *cli.Context, opts ...Option) (*BeaconNode, error) { return nil, err } - log.Debugln("Registering Intial Sync Service") + log.Debugln("Registering Initial Sync Service") if err := beacon.registerInitialSyncService(); err != nil { return nil, err } diff --git a/beacon-chain/p2p/discovery.go b/beacon-chain/p2p/discovery.go index 9df654b713..d6c9840cd7 100644 --- a/beacon-chain/p2p/discovery.go +++ b/beacon-chain/p2p/discovery.go @@ -332,7 +332,7 @@ func (s *Service) isPeerAtLimit(inbound bool) bool { return activePeers >= maxPeers || numOfConns >= maxPeers } -// PeersFromStringAddrs convers peer raw ENRs into multiaddrs for p2p. +// PeersFromStringAddrs converts peer raw ENRs into multiaddrs for p2p. func PeersFromStringAddrs(addrs []string) ([]ma.Multiaddr, error) { var allAddrs []ma.Multiaddr enodeString, multiAddrString := parseGenericAddrs(addrs) diff --git a/beacon-chain/p2p/testing/p2p.go b/beacon-chain/p2p/testing/p2p.go index 861423c707..2da2c9a92e 100644 --- a/beacon-chain/p2p/testing/p2p.go +++ b/beacon-chain/p2p/testing/p2p.go @@ -272,7 +272,7 @@ func (p *TestP2P) AddConnectionHandler(f, _ func(ctx context.Context, id peer.ID p.peers.SetConnectionState(conn.RemotePeer(), peers.PeerConnecting) if err := f(ctx, conn.RemotePeer()); err != nil { - logrus.WithError(err).Error("Could not send succesful hello rpc request") + logrus.WithError(err).Error("Could not send successful hello rpc request") if err := p.Disconnect(conn.RemotePeer()); err != nil { logrus.WithError(err).Errorf("Unable to close peer %s", conn.RemotePeer()) } diff --git a/beacon-chain/p2p/utils.go b/beacon-chain/p2p/utils.go index 7026be6ec5..351ec0b575 100644 --- a/beacon-chain/p2p/utils.go +++ b/beacon-chain/p2p/utils.go @@ -59,7 +59,7 @@ func privKey(cfg *Config) (*ecdsa.PrivateKey, error) { if err != nil && defaultKeysExist { return nil, err } - // Default keys have the next highest precendence, if they exist. + // Default keys have the next highest precedence, if they exist. if defaultKeysExist { return privKeyFromFile(defaultKeyPath) } diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go index 058010356a..0eff25056d 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go @@ -503,7 +503,7 @@ func (bs *Server) GetValidatorParticipation( if err != nil { return nil, err } - // Get as close as we can to the end of the current epoch without going past the curent slot. + // Get as close as we can to the end of the current epoch without going past the current slot. // The above check ensures a future *epoch* isn't requested, but the end slot of the requested epoch could still // be past the current slot. In that case, use the current slot as the best approximation of the requested epoch. // Replayer will make sure the slot ultimately used is canonical. diff --git a/beacon-chain/sync/validate_beacon_blocks.go b/beacon-chain/sync/validate_beacon_blocks.go index bcf532b205..0c73606bd9 100644 --- a/beacon-chain/sync/validate_beacon_blocks.go +++ b/beacon-chain/sync/validate_beacon_blocks.go @@ -263,7 +263,7 @@ func (s *Service) validateBeaconBlock(ctx context.Context, blk interfaces.ReadOn // [REJECT] The block's execution payload timestamp is correct with respect to the slot -- // i.e. execution_payload.timestamp == compute_timestamp_at_slot(state, block.slot). // -// If exection_payload verification of block's parent by an execution node is not complete: +// If execution_payload verification of block's parent by an execution node is not complete: // [REJECT] The block's parent (defined by block.parent_root) passes all validation (excluding execution // node verification of the block.body.execution_payload). // otherwise: diff --git a/cmd/flags.go b/cmd/flags.go index 1022e8c095..04ed42d5c0 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -172,7 +172,7 @@ var ( // P2PDenyList defines a list of CIDR subnets to disallow connections from them. P2PDenyList = &cli.StringSliceFlag{ Name: "p2p-denylist", - Usage: "The CIDR subnets for denying certainy peer connections. " + + Usage: "The CIDR subnets for denying certainty peer connections. " + "Using \"private\" would deny all private subnets. Example: " + "192.168.0.0/16 would deny connections from peers on your local network only. The " + "default is to accept all connections.", @@ -222,7 +222,7 @@ var ( // GrpcMaxCallRecvMsgSizeFlag defines the max call message size for GRPC GrpcMaxCallRecvMsgSizeFlag = &cli.IntFlag{ Name: "grpc-max-msg-size", - Usage: "Integer to define max recieve message call size. If serving a public gRPC server, " + + Usage: "Integer to define max receive message call size. If serving a public gRPC server, " + "set this to a more reasonable size to avoid resource exhaustion from large messages. " + "Validators with as many as 10000 keys can be run with a max message size of less than " + "50Mb. The default here is set to a very high value for local users. " + diff --git a/cmd/prysmctl/validator/cmd.go b/cmd/prysmctl/validator/cmd.go index b960cadd90..f3e8ab52c4 100644 --- a/cmd/prysmctl/validator/cmd.go +++ b/cmd/prysmctl/validator/cmd.go @@ -41,7 +41,7 @@ var ( var Commands = []*cli.Command{ { Name: "validator", - Aliases: []string{"v", "sign"}, // remove sign command should be depreciated but having as backwards compatability. + Aliases: []string{"v", "sign"}, // remove sign command should be depreciated but having as backwards compatibility. Usage: "commands that affect the state of validators such as exiting or withdrawing", Subcommands: []*cli.Command{ { diff --git a/validator/accounts/wallet/wallet.go b/validator/accounts/wallet/wallet.go index 61e3ab3641..bd90fe7e79 100644 --- a/validator/accounts/wallet/wallet.go +++ b/validator/accounts/wallet/wallet.go @@ -195,7 +195,7 @@ func OpenWalletOrElseCli(cliCtx *cli.Context, otherwise func(cliCtx *cli.Context // NewWalletForWeb3Signer returns a new wallet for web3 signer which is temporary and not stored locally. func NewWalletForWeb3Signer() *Wallet { - // wallet is just a temporary wallet for web3 signer used to call intialize keymanager. + // wallet is just a temporary wallet for web3 signer used to call initialize keymanager. return &Wallet{ walletDir: "", accountsPath: "", diff --git a/validator/keymanager/derived/mnemonic.go b/validator/keymanager/derived/mnemonic.go index d774755db7..3a316d7a67 100644 --- a/validator/keymanager/derived/mnemonic.go +++ b/validator/keymanager/derived/mnemonic.go @@ -20,7 +20,7 @@ type MnemonicGenerator struct { skipMnemonicConfirm bool } -// ErrUnsupportedMnemonicLanguage is returned when trying to use an unsupported mnemonic langauge. +// ErrUnsupportedMnemonicLanguage is returned when trying to use an unsupported mnemonic language. var ( DefaultMnemonicLanguage = "english" ErrUnsupportedMnemonicLanguage = errors.New("unsupported mnemonic language")