From ee5eabb63dc9f52ed44deec12236892bf8003d1f Mon Sep 17 00:00:00 2001 From: Sebastian <159052459+sewqasreedas@users.noreply.github.com> Date: Tue, 19 Aug 2025 19:57:27 +0200 Subject: [PATCH] fix: multiple typos of different importance (#25188) Co-authored-by: Alex | Interchain Labs --- tools/confix/README.md | 4 ++-- tools/confix/upgrade.go | 2 +- tools/cosmovisor/README.md | 10 +++++----- tools/cosmovisor/args.go | 4 ++-- tools/cosmovisor/args_test.go | 2 +- tools/cosmovisor/cmd/cosmovisor/help.go | 2 +- tools/cosmovisor/cmd/cosmovisor/init.go | 2 +- tools/cosmovisor/cmd/cosmovisor/run.go | 4 ++-- tools/cosmovisor/process.go | 6 +++--- tools/cosmovisor/process_test.go | 4 ++-- types/address/hash.go | 6 +++--- types/bech32/bech32.go | 2 +- types/errors/errors.go | 2 +- 13 files changed, 25 insertions(+), 25 deletions(-) diff --git a/tools/confix/README.md b/tools/confix/README.md index 00851ede19..ab91d3360d 100644 --- a/tools/confix/README.md +++ b/tools/confix/README.md @@ -40,7 +40,7 @@ An implementation example can be found in `simapp`. The command will be available as `simd config`. :::tip -Using confix directly in the application can have less features than using it standalone. +Using confix directly in the application can have fewer features than using it standalone. This is because confix is versioned with the SDK, while `latest` is the standalone version. ::: @@ -126,7 +126,7 @@ confix diff v0.47 ~/.simapp/config/client.toml --client # gets the diff between ### View -View a configuration file, e.g: +View a configuration file, e.g.: ```shell simd config view client # views the current app client config diff --git a/tools/confix/upgrade.go b/tools/confix/upgrade.go index e0cccbce45..f337787f40 100644 --- a/tools/confix/upgrade.go +++ b/tools/confix/upgrade.go @@ -44,7 +44,7 @@ func Upgrade(ctx context.Context, plan transform.Plan, doc *tomledit.Document, c // allow to skip validation if !skipValidate { - // verify that file is valid after applying fixes + // verify that the file is valid after applying fixes if err := CheckValid(configPath, buf.Bytes()); err != nil { return fmt.Errorf("updated config is invalid: %w", err) } diff --git a/tools/cosmovisor/README.md b/tools/cosmovisor/README.md index 7c70611ffe..67d37001fe 100644 --- a/tools/cosmovisor/README.md +++ b/tools/cosmovisor/README.md @@ -45,7 +45,7 @@ Versions prior to v1.0.0 have a vulnerability that could lead to a DOS. Please u ## Contributing -Cosmovisor is part of the Cosmos SDK monorepo, but it's a separate module with it's own release schedule. +Cosmovisor is part of the Cosmos SDK monorepo, but it's a separate module with its own release schedule. Release branches have the following format `release/cosmovisor/vA.B.x`, where A and B are a number (e.g. `release/cosmovisor/v1.3.x`). Releases are tagged using the following format: `cosmovisor/vA.B.C`. @@ -84,7 +84,7 @@ The first argument passed to `cosmovisor` is the action for `cosmovisor` to take * `run` - Run the configured binary using the rest of the provided arguments. * `version` - Output the `cosmovisor` version and also run the binary with the `version` argument. * `config` - Display the current `cosmovisor` configuration, that means displaying the environment variables value that `cosmovisor` is using. -* `add-upgrade` - Add an upgrade manually to `cosmovisor`. This command allow you to easily add the binary corresponding to an upgrade in cosmovisor. +* `add-upgrade` - Add an upgrade manually to `cosmovisor`. This command allows you to easily add the binary corresponding to an upgrade in cosmovisor. All arguments passed to `cosmovisor run` will be passed to the application binary (as a subprocess). `cosmovisor` will return `/dev/stdout` and `/dev/stderr` of the subprocess as its own. For this reason, `cosmovisor run` cannot accept any command-line arguments other than those available to the application binary. @@ -105,7 +105,7 @@ All arguments passed to `cosmovisor run` will be passed to the application binar * `COSMOVISOR_COLOR_LOGS` (defaults to `true`). If set to true, this will colorise Cosmovisor logs (but not the underlying process). * `COSMOVISOR_TIMEFORMAT_LOGS` (defaults to `kitchen`). If set to a value (`layout|ansic|unixdate|rubydate|rfc822|rfc822z|rfc850|rfc1123|rfc1123z|rfc3339|rfc3339nano|kitchen`), this will add timestamp prefix to Cosmovisor logs (but not the underlying process). * `COSMOVISOR_CUSTOM_PREUPGRADE` (defaults to ``). If set, this will run $DAEMON_HOME/cosmovisor/$COSMOVISOR_CUSTOM_PREUPGRADE prior to upgrade with the arguments [ upgrade.Name, upgrade.Height ]. Executes a custom script (separate and prior to the chain daemon pre-upgrade command) -* `COSMOVISOR_DISABLE_RECASE` (defaults to `false`). If set to true, the upgrade directory will expected to match the upgrade plan name without any case changes +* `COSMOVISOR_DISABLE_RECASE` (defaults to `false`). If set to true, the upgrade directory will be expected to match the upgrade plan name without any case changes ### Folder Layout @@ -200,9 +200,9 @@ Take this into consideration when using `--upgrade-height`. Generally, `cosmovisor` requires that the system administrator place all relevant binaries on disk before the upgrade happens. However, for people who don't need such control and want an automated setup (maybe they are syncing a non-validating fullnode and want to do little maintenance), there is another option. -**NOTE: we don't recommend using auto-download** because it doesn't verify in advance if a binary is available. If there will be any issue with downloading a binary, the cosmovisor will stop and won't restart an App (which could lead to a chain halt). +**NOTE: we don't recommend using auto-download** because it doesn't verify in advance if a binary is available. If there will be any issue with downloading a binary, the cosmovisor will stop and won't restart the app (which could lead to a chain halt). -If `DAEMON_ALLOW_DOWNLOAD_BINARIES` is set to `true`, and no local binary can be found when an upgrade is triggered, `cosmovisor` will attempt to download and install the binary itself based on the instructions in the `info` attribute in the `data/upgrade-info.json` file. The files is constructed by the x/upgrade module and contains data from the upgrade `Plan` object. The `Plan` has an info field that is expected to have one of the following two valid formats to specify a download: +If `DAEMON_ALLOW_DOWNLOAD_BINARIES` is set to `true`, and no local binary can be found when an upgrade is triggered, `cosmovisor` will attempt to download and install the binary itself based on the instructions in the `info` attribute in the `data/upgrade-info.json` file. The file is constructed by the x/upgrade module and contains data from the upgrade `Plan` object. The `Plan` has an info field that is expected to have one of the following two valid formats to specify a download: 1. Store an os/architecture -> binary URI map in the upgrade plan info field as JSON under the `"binaries"` key. For example: diff --git a/tools/cosmovisor/args.go b/tools/cosmovisor/args.go index f5418a5b2c..393d4cfaf5 100644 --- a/tools/cosmovisor/args.go +++ b/tools/cosmovisor/args.go @@ -174,7 +174,7 @@ func GetConfigFromFile(filePath string) (*Config, error) { return GetConfigFromEnv(false) } - // ensure the file exist + // ensure the file exists if _, err := os.Stat(filePath); err != nil { return nil, fmt.Errorf("config not found: at %s : %w", filePath, err) } @@ -455,7 +455,7 @@ returnError: return cfg.currentUpgrade, fmt.Errorf("failed to read %q: %w", filename, err) } -// BooleanOption checks and validate env option +// BooleanOption checks and validates env option func BooleanOption(name string, defaultVal bool) (bool, error) { p := strings.ToLower(os.Getenv(name)) switch p { diff --git a/tools/cosmovisor/args_test.go b/tools/cosmovisor/args_test.go index 6394bfa034..d257beb1e8 100644 --- a/tools/cosmovisor/args_test.go +++ b/tools/cosmovisor/args_test.go @@ -192,7 +192,7 @@ func (s *argsTestSuite) TestConfigPaths() { } // Test validate -// add more test in test validate +// add more tests to test validate func (s *argsTestSuite) TestValidate() { relPath := filepath.Join("testdata", "validate") absPath, err := filepath.Abs(relPath) diff --git a/tools/cosmovisor/cmd/cosmovisor/help.go b/tools/cosmovisor/cmd/cosmovisor/help.go index 6d6df59cef..33add62cc6 100644 --- a/tools/cosmovisor/cmd/cosmovisor/help.go +++ b/tools/cosmovisor/cmd/cosmovisor/help.go @@ -14,7 +14,7 @@ Cosmovisor is a wrapper for a Cosmos SDK based App (set using the required %s en It starts the App by passing all provided arguments and monitors the %s/data/upgrade-info.json file to perform an update. The upgrade-info.json file is created by the App x/upgrade module when the blockchain height reaches an approved upgrade proposal. The file includes data from -the proposal. Cosmovisor interprets that data to perform an update: switch a current binary +the proposal. Cosmovisor interprets that data to perform an update: switch the current binary and restart the App. Configuration of Cosmovisor is done through environment variables, which are diff --git a/tools/cosmovisor/cmd/cosmovisor/init.go b/tools/cosmovisor/cmd/cosmovisor/init.go index 56717ec28a..15b364ce8d 100644 --- a/tools/cosmovisor/cmd/cosmovisor/init.go +++ b/tools/cosmovisor/cmd/cosmovisor/init.go @@ -52,7 +52,7 @@ func InitializeCosmovisor(logger log.Logger, args []string) error { return err } - // process to minimal validation + // proceed to minimal validation if err := minConfigValidate(cfg); err != nil { return err } diff --git a/tools/cosmovisor/cmd/cosmovisor/run.go b/tools/cosmovisor/cmd/cosmovisor/run.go index 4da2ac24d8..40f0cec260 100644 --- a/tools/cosmovisor/cmd/cosmovisor/run.go +++ b/tools/cosmovisor/cmd/cosmovisor/run.go @@ -53,14 +53,14 @@ func run(cfgPath string, args []string, options ...RunOption) error { } doUpgrade, err := launcher.Run(args, runCfg.StdIn, runCfg.StdOut, runCfg.StdErr) - // if RestartAfterUpgrade, we launch after a successful upgrade (given that condition launcher.Run returns nil) + // if RestartAfterUpgrade is enabled, we launch after a successful upgrade (given that the launcher.Run returns nil) for cfg.RestartAfterUpgrade && err == nil && doUpgrade { logger.Info("upgrade detected, relaunching", "app", cfg.Name) doUpgrade, err = launcher.Run(args, runCfg.StdIn, runCfg.StdOut, runCfg.StdErr) } if doUpgrade && err == nil { - logger.Info("upgrade detected, DAEMON_RESTART_AFTER_UPGRADE is off. Verify new upgrade and start cosmovisor again.") + logger.Info("upgrade detected, DAEMON_RESTART_AFTER_UPGRADE is off. Please verify the new upgrade and start cosmovisor again.") } return err diff --git a/tools/cosmovisor/process.go b/tools/cosmovisor/process.go index 81414a23c4..0a460e6705 100644 --- a/tools/cosmovisor/process.go +++ b/tools/cosmovisor/process.go @@ -183,7 +183,7 @@ pollLoop: } // Run launches the app in a subprocess and returns when the subprocess (app) -// exits (either when it dies, or *after* a successful upgrade.) and upgrade finished. +// exits (either when it dies, or *after* a successful upgrade.) and the upgrade is finished. // Returns true if the upgrade request was detected and the upgrade process started. func (l Launcher) Run(args []string, stdin io.Reader, stdout, stderr io.Writer) (bool, error) { bin, err := l.cfg.CurrentBin() @@ -351,7 +351,7 @@ func (l Launcher) doBackup() error { return fmt.Errorf("error while taking data backup: %w", err) } - // backup is done, lets check endtime to calculate total time taken for backup process + // backup is done, lets check endtime to calculate total time taken for the backup process et := time.Now() l.logger.Info("backup completed", "backup saved at", dst, "backup completion time", et, "time taken to complete backup", et.Sub(st)) } @@ -468,7 +468,7 @@ func (l *Launcher) executePreUpgradeCmd() error { return nil } -// IsSkipUpgradeHeight checks if pre-upgrade script must be run. +// IsSkipUpgradeHeight checks if the pre-upgrade script must be run. // If the height in the upgrade plan matches any of the heights provided in --unsafe-skip-upgrades, the script is not run. func IsSkipUpgradeHeight(args []string, upgradeInfo upgradetypes.Plan) bool { skipUpgradeHeights := UpgradeSkipHeights(args) diff --git a/tools/cosmovisor/process_test.go b/tools/cosmovisor/process_test.go index 7d91c90e17..0435e17eab 100644 --- a/tools/cosmovisor/process_test.go +++ b/tools/cosmovisor/process_test.go @@ -194,7 +194,7 @@ func TestLaunchProcessWithRestartDelay(t *testing.T) { } } -// TestPlanShutdownGrace will test upgrades without lower case plan names +// TestPlanShutdownGrace will test the shutdown grace period functionality func TestPlanShutdownGrace(t *testing.T) { // binaries from testdata/validate directory cfg := prepareConfig( @@ -466,7 +466,7 @@ func TestLaunchProcessWithDownloadsAndPreupgrade(t *testing.T) { require.Equal(t, rPath, currentBin) } -// TestSkipUpgrade tests heights that are identified to be skipped and return if upgrade height matches the skip heights +// TestSkipUpgrade tests heights that are identified to be skipped and returns whether the upgrade height matches the skip heights func TestSkipUpgrade(t *testing.T) { cases := []struct { args []string diff --git a/types/address/hash.go b/types/address/hash.go index 73d34e3698..2956cd12cd 100644 --- a/types/address/hash.go +++ b/types/address/hash.go @@ -27,7 +27,7 @@ type Addressable interface { func Hash(typ string, key []byte) []byte { hasher := sha256.New() _, err := hasher.Write(conv.UnsafeStrToBytes(typ)) - // the error always nil, it's here only to satisfy the io.Writer interface + // the error is always nil, it's here only to satisfy the io.Writer interface errors.AssertNil(err) th := hasher.Sum(nil) @@ -67,7 +67,7 @@ func Compose(typ string, subAddresses []Addressable) ([]byte, error) { // is constructed from a module name and a sequence of derivation keys (at least one // derivation key must be provided). The derivation keys must be unique // in the module scope, and is usually constructed from some object id. Example, let's -// a x/dao module, and a new DAO object, it's address would be: +// a x/dao module, and a new DAO object, its address would be: // // address.Module(dao.ModuleName, newDAO.ID) func Module(moduleName string, derivationKeys ...[]byte) []byte { @@ -86,7 +86,7 @@ func Module(moduleName string, derivationKeys ...[]byte) []byte { } // Derive derives a new address from the main `address` and a derivation `key`. -// This function is used to create a sub accounts. To create a module accounts use the +// This function is used to create sub accounts. To create a module accounts use the // `Module` function. func Derive(address, key []byte) []byte { return Hash(conv.UnsafeBytesToStr(address), key) diff --git a/types/bech32/bech32.go b/types/bech32/bech32.go index 8356fa92d3..a7cc622b0f 100644 --- a/types/bech32/bech32.go +++ b/types/bech32/bech32.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/btcutil/bech32" ) -// ConvertAndEncode converts from a base256 encoded byte string to base32 encoded byte string and then to bech32. +// ConvertAndEncode converts from a base256 encoded byte string to a base32 encoded byte string and then to bech32. func ConvertAndEncode(hrp string, data []byte) (string, error) { converted, err := bech32.ConvertBits(data, 8, 5, true) if err != nil { diff --git a/types/errors/errors.go b/types/errors/errors.go index b7cda44e9a..8258df9719 100644 --- a/types/errors/errors.go +++ b/types/errors/errors.go @@ -131,7 +131,7 @@ var ( // non-DB domain errors). ErrIO = errorsmod.Register(RootCodespace, 39, "internal IO error") - // ErrAppConfig defines an error occurred if application configuration is + // ErrAppConfig defines an error that occurs if application configuration is // misconfigured. ErrAppConfig = errorsmod.Register(RootCodespace, 40, "error in app.toml")