From b009a75eeaced5e1b2c4ded73bf4e5147d12aae7 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 31 Mar 2023 00:27:39 +0700 Subject: [PATCH] style: make lint-fix everything (#15631) Co-authored-by: Julien Robert --- .golangci.yml | 52 ++++++++++++++++--- baseapp/baseapp.go | 4 +- client/v2/autocli/app.go | 2 +- client/v2/autocli/msg.go | 2 +- client/v2/autocli/msg_test.go | 6 +-- .../autocli/testdata/help-toplevel-msg.golden | 2 +- collections/colltest/codec.go | 4 +- collections/indexed_map.go | 6 +-- collections/indexes_generic_multi.go | 2 +- collections/sequence.go | 2 +- crypto/codec/proto.go | 2 +- errors/abci_test.go | 4 +- log/level.go | 2 +- math/dec_internal_test.go | 2 +- simapp/export.go | 2 +- store/rootmulti/store.go | 2 +- store/types/gas.go | 2 +- store/types/proof.go | 2 +- tests/e2e/upgrade/suite.go | 2 +- tests/integration/aminojson/aminojson_test.go | 2 +- .../integration/staking/keeper/slash_test.go | 4 +- tools/rosetta/lib/errors/errors.go | 2 +- x/params/keeper/keeper_test.go | 2 +- x/tx/decode/unknown_test.go | 4 +- x/tx/signing/textual/int.go | 4 +- x/upgrade/doc.go | 2 +- x/upgrade/keeper/keeper.go | 2 +- x/upgrade/keeper/msg_server_test.go | 2 +- 28 files changed, 83 insertions(+), 43 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index d0c4eec858..2d8691018d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -53,22 +53,62 @@ issues: max-same-issues: 10000 linters-settings: + gosec: + # To select a subset of rules to run. + # Available rules: https://github.com/securego/gosec#available-rules + # Default: [] - means include all rules + includes: + # - G101 # Look for hard coded credentials + - G102 # Bind to all interfaces + - G103 # Audit the use of unsafe block + - G104 # Audit errors not checked + - G106 # Audit the use of ssh.InsecureIgnoreHostKey + - G107 # Url provided to HTTP request as taint input + - G108 # Profiling endpoint automatically exposed on /debug/pprof + - G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32 + - G110 # Potential DoS vulnerability via decompression bomb + - G111 # Potential directory traversal + - G112 # Potential slowloris attack + - G113 # Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772) + - G114 # Use of net/http serve function that has no support for setting timeouts + - G201 # SQL query construction using format string + - G202 # SQL query construction using string concatenation + - G203 # Use of unescaped data in HTML templates + - G204 # Audit use of command execution + - G301 # Poor file permissions used when creating a directory + - G302 # Poor file permissions used with chmod + - G303 # Creating tempfile using a predictable path + - G304 # File path provided as taint input + - G305 # File traversal when extracting zip/tar archive + - G306 # Poor file permissions used when writing to a new file + - G307 # Deferring a method which returns an error + - G401 # Detect the usage of DES, RC4, MD5 or SHA1 + - G402 # Look for bad TLS connection settings + - G403 # Ensure minimum RSA key length of 2048 bits + - G404 # Insecure random number source (rand) + - G501 # Import blocklist: crypto/md5 + - G502 # Import blocklist: crypto/des + - G503 # Import blocklist: crypto/rc4 + - G504 # Import blocklist: net/http/cgi + - G505 # Import blocklist: crypto/sha1 + - G601 # Implicit memory aliasing of items from a range statement misspell: - # Correct spellings using locale preferences for US or UK. - # Setting locale to US will correct the British spelling of 'colour' to 'color'. - # Default is to use a neutral variety of English. locale: US gofumpt: - # Choose whether to use the extra rules. - # Default: false extra-rules: true dogsled: max-blank-identifiers: 5 maligned: - # print struct with more effective memory layout or not, false by default suggest-new: true nolintlint: allow-unused: false allow-leading-space: true require-explanation: true require-specific: false + gosimple: + checks: ["all"] + + gocritic: + disabled-checks: + - regexpMust + - appendAssign diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 073e148470..791444dc50 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -861,7 +861,7 @@ func (app *BaseApp) PrepareProposalVerifyTx(tx sdk.Tx) ([]byte, error) { return nil, err } - _, _, _, _, err = app.runTx(runTxPrepareProposal, bz) + _, _, _, _, err = app.runTx(runTxPrepareProposal, bz) if err != nil { return nil, err } @@ -880,7 +880,7 @@ func (app *BaseApp) ProcessProposalVerifyTx(txBz []byte) (sdk.Tx, error) { return nil, err } - _, _, _, _, err = app.runTx(runTxProcessProposal, txBz) + _, _, _, _, err = app.runTx(runTxProcessProposal, txBz) if err != nil { return nil, err } diff --git a/client/v2/autocli/app.go b/client/v2/autocli/app.go index d42838765f..280afce7e9 100644 --- a/client/v2/autocli/app.go +++ b/client/v2/autocli/app.go @@ -132,7 +132,7 @@ func (appOptions AppOptions) EnhanceRootCommandWithBuilder(rootCmd *cobra.Comman enhanceMsg := func(cmd *cobra.Command, modOpts *autocliv1.ModuleOptions, moduleName string) error { txCmdDesc := modOpts.Tx if txCmdDesc != nil { - subCmd := topLevelCmd(moduleName, fmt.Sprintf("Transations commands for the %s module", moduleName)) + subCmd := topLevelCmd(moduleName, fmt.Sprintf("Transactions commands for the %s module", moduleName)) err := builder.AddQueryServiceCommands(cmd, txCmdDesc) if err != nil { return err diff --git a/client/v2/autocli/msg.go b/client/v2/autocli/msg.go index 14b5e8113b..c15d750756 100644 --- a/client/v2/autocli/msg.go +++ b/client/v2/autocli/msg.go @@ -19,7 +19,7 @@ func (b *Builder) BuildMsgCommand(moduleOptions map[string]*autocliv1.ModuleOpti enhanceMsg := func(cmd *cobra.Command, modOpts *autocliv1.ModuleOptions, moduleName string) error { txCmdDesc := modOpts.Tx if txCmdDesc != nil { - subCmd := topLevelCmd(moduleName, fmt.Sprintf("Transations commands for the %s module", moduleName)) + subCmd := topLevelCmd(moduleName, fmt.Sprintf("Transactions commands for the %s module", moduleName)) err := b.AddMsgServiceCommands(subCmd, txCmdDesc) if err != nil { return err diff --git a/client/v2/autocli/msg_test.go b/client/v2/autocli/msg_test.go index b46c11974c..0009ad94ff 100644 --- a/client/v2/autocli/msg_test.go +++ b/client/v2/autocli/msg_test.go @@ -17,7 +17,7 @@ import ( ) var buildModuleMsgCommand = func(moduleName string, b *Builder) (*cobra.Command, error) { - cmd := topLevelCmd(moduleName, fmt.Sprintf("Transations commands for the %s module", moduleName)) + cmd := topLevelCmd(moduleName, fmt.Sprintf("Transactions commands for the %s module", moduleName)) err := b.AddMsgServiceCommands(cmd, testCmdMsgDesc) return cmd, err @@ -281,7 +281,7 @@ func TestErrorBuildMsgCommand(t *testing.T) { func TestNotFoundErrorsMsg(t *testing.T) { b := &Builder{} buildModuleMsgCommand := func(moduleName string, cmdDescriptor *autocliv1.ServiceCommandDescriptor) (*cobra.Command, error) { - cmd := topLevelCmd(moduleName, fmt.Sprintf("Transations commands for the %s module", moduleName)) + cmd := topLevelCmd(moduleName, fmt.Sprintf("Transactions commands for the %s module", moduleName)) err := b.AddMsgServiceCommands(cmd, cmdDescriptor) return cmd, err @@ -331,7 +331,7 @@ func TestEnhanceMessageCommand(t *testing.T) { enhanceMsg := func(cmd *cobra.Command, modOpts *autocliv1.ModuleOptions, moduleName string) error { txCmdDesc := modOpts.Tx if txCmdDesc != nil { - subCmd := topLevelCmd(moduleName, fmt.Sprintf("Transations commands for the %s module", moduleName)) + subCmd := topLevelCmd(moduleName, fmt.Sprintf("Transactions commands for the %s module", moduleName)) err := b.AddMsgServiceCommands(cmd, txCmdDesc) if err != nil { return err diff --git a/client/v2/autocli/testdata/help-toplevel-msg.golden b/client/v2/autocli/testdata/help-toplevel-msg.golden index 12fdc0fbdc..0eac1e006f 100644 --- a/client/v2/autocli/testdata/help-toplevel-msg.golden +++ b/client/v2/autocli/testdata/help-toplevel-msg.golden @@ -1,4 +1,4 @@ -Transations commands for the test module +Transactions commands for the test module Usage: test [flags] diff --git a/collections/colltest/codec.go b/collections/colltest/codec.go index 0991647971..dddd2df0d0 100644 --- a/collections/colltest/codec.go +++ b/collections/colltest/codec.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" ) -// TestKeyCodec asserts the correct behaviour of a KeyCodec over the type T. +// TestKeyCodec asserts the correct behavior of a KeyCodec over the type T. func TestKeyCodec[T any](t *testing.T, keyCodec codec.KeyCodec[T], key T) { buffer := make([]byte, keyCodec.Size(key)) written, err := keyCodec.Encode(buffer, key) @@ -43,7 +43,7 @@ func TestKeyCodec[T any](t *testing.T, keyCodec codec.KeyCodec[T], key T) { require.Equal(t, key, decoded, "json encoding and decoding did not produce the same results") } -// TestValueCodec asserts the correct behaviour of a ValueCodec over the type T. +// TestValueCodec asserts the correct behavior of a ValueCodec over the type T. func TestValueCodec[T any](t *testing.T, encoder codec.ValueCodec[T], value T) { encodedValue, err := encoder.Encode(value) require.NoError(t, err) diff --git a/collections/indexed_map.go b/collections/indexed_map.go index 5c97a2ae5a..3736e824cc 100644 --- a/collections/indexed_map.go +++ b/collections/indexed_map.go @@ -40,10 +40,10 @@ type IndexedMap[PrimaryKey, Value any, Idx Indexes[PrimaryKey, Value]] struct { } // NewIndexedMap instantiates a new IndexedMap. Accepts a SchemaBuilder, a Prefix, -// a humanised name that defines the name of the collection, the primary key codec +// a humanized name that defines the name of the collection, the primary key codec // which is basically what IndexedMap uses to encode the primary key to bytes, // the value codec which is what the IndexedMap uses to encode the value. -// Then it expects the initialised indexes. +// Then it expects the initialized indexes. func NewIndexedMap[PrimaryKey, Value any, Idx Indexes[PrimaryKey, Value]]( schema *SchemaBuilder, prefix Prefix, @@ -105,7 +105,7 @@ func (m *IndexedMap[PrimaryKey, Value, Idx]) Set(ctx context.Context, pk Primary func (m *IndexedMap[PrimaryKey, Value, Idx]) Remove(ctx context.Context, pk PrimaryKey) error { oldValue, err := m.m.Get(ctx, pk) if err != nil { - // TODO retain Map behaviour? which does not error in case we remove a non-existing object + // TODO retain Map behavior? which does not error in case we remove a non-existing object return err } diff --git a/collections/indexes_generic_multi.go b/collections/indexes_generic_multi.go index fdb59d55af..97def1725e 100644 --- a/collections/indexes_generic_multi.go +++ b/collections/indexes_generic_multi.go @@ -42,7 +42,7 @@ type GenericMultiIndex[ReferencingKey, ReferencedKey, PrimaryKey, Value any] str } // NewGenericMultiIndex instantiates a GenericMultiIndex, given -// schema, Prefix, humanised name, the key codec used to encode the referencing key +// schema, Prefix, humanized name, the key codec used to encode the referencing key // to bytes, the key codec used to encode the referenced key to bytes and a function // which given the primary key and a value of an object being saved or removed in IndexedMap // returns all the possible IndexReference of that object. diff --git a/collections/sequence.go b/collections/sequence.go index 4b4b86beaa..b56e4a0468 100644 --- a/collections/sequence.go +++ b/collections/sequence.go @@ -12,7 +12,7 @@ const DefaultSequenceStart uint64 = 1 type Sequence Item[uint64] // NewSequence instantiates a new sequence given -// a Schema, a Prefix and humanised name for the sequence. +// a Schema, a Prefix and humanized name for the sequence. func NewSequence(schema *SchemaBuilder, prefix Prefix, name string) Sequence { return (Sequence)(NewItem(schema, prefix, name, Uint64Value)) } diff --git a/crypto/codec/proto.go b/crypto/codec/proto.go index 1340dab03d..45cd5b4c35 100644 --- a/crypto/codec/proto.go +++ b/crypto/codec/proto.go @@ -20,6 +20,6 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { var priv *cryptotypes.PrivKey registry.RegisterInterface("cosmos.crypto.PrivKey", priv) registry.RegisterImplementations(priv, &secp256k1.PrivKey{}) - registry.RegisterImplementations(priv, &ed25519.PrivKey{}) //nolint + registry.RegisterImplementations(priv, &ed25519.PrivKey{}) secp256r1.RegisterInterfaces(registry) } diff --git a/errors/abci_test.go b/errors/abci_test.go index 0982709bf7..333731d015 100644 --- a/errors/abci_test.go +++ b/errors/abci_test.go @@ -66,12 +66,12 @@ func (s *abciTestSuite) TestABCInfo() { }, // This is hard to test because of attached stacktrace. This // case is tested in an another test. - //"wrapped stdlib is a full message in debug mode": { + // "wrapped stdlib is a full message in debug mode": { // err: Wrap(io.EOF, "cannot read file"), // debug: true, // wantLog: "cannot read file: EOF", // wantCode: 1, - //}, + // }, "custom error": { err: customErr{}, debug: false, diff --git a/log/level.go b/log/level.go index 105b4a10fa..9a4f094f2c 100644 --- a/log/level.go +++ b/log/level.go @@ -21,7 +21,7 @@ type FilterFunc func(key, level string) bool // Example: // ParseLogLevel("consensus:debug,mempool:debug,*:error") // -// This function attemps to keep the same behavior as the CometBFT ParseLogLevel +// This function attempts to keep the same behavior as the CometBFT ParseLogLevel // However the level `none` is replaced by `disabled`. func ParseLogLevel(levelStr string) (FilterFunc, error) { if levelStr == "" { diff --git a/math/dec_internal_test.go b/math/dec_internal_test.go index 0680cf0094..8b899300e3 100644 --- a/math/dec_internal_test.go +++ b/math/dec_internal_test.go @@ -98,7 +98,7 @@ func (s *decimalInternalTestSuite) TestDecMarshalJSON() { return } if !tt.wantErr { - s.Require().Equal(tt.want, string(got), "incorrect marshalled value") + s.Require().Equal(tt.want, string(got), "incorrect marshaled value") unmarshalledDec := LegacyNewDec(0) err := unmarshalledDec.UnmarshalJSON(got) s.Require().NoError(err) diff --git a/simapp/export.go b/simapp/export.go index 65d570aa0a..42fc8fce1a 100644 --- a/simapp/export.go +++ b/simapp/export.go @@ -51,7 +51,7 @@ func (app *SimApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAd // prepare for fresh start at zero height // NOTE zero height genesis is a temporary feature which will be deprecated // -// in favour of export at a block height +// in favor of export at a block height func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { applyAllowedAddrs := false diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 68512fe509..a47a9beaee 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -1104,7 +1104,7 @@ type storeParams struct { initialVersion uint64 } -func newStoreParams(key types.StoreKey, db dbm.DB, typ types.StoreType, initialVersion uint64) storeParams { // nolint +func newStoreParams(key types.StoreKey, db dbm.DB, typ types.StoreType, initialVersion uint64) storeParams { return storeParams{ key: key, db: db, diff --git a/store/types/gas.go b/store/types/gas.go index e0c950476b..baceb7ce25 100644 --- a/store/types/gas.go +++ b/store/types/gas.go @@ -163,7 +163,7 @@ func (g *infiniteGasMeter) GasConsumed() Gas { } // GasConsumedToLimit returns the gas consumed from the GasMeter since the gas is not confined to a limit. -// NOTE: This behaviour is only called when recovering from panic when BlockGasMeter consumes gas past the limit. +// NOTE: This behavior is only called when recovering from panic when BlockGasMeter consumes gas past the limit. func (g *infiniteGasMeter) GasConsumedToLimit() Gas { return g.consumed } diff --git a/store/types/proof.go b/store/types/proof.go index bb3abdc855..acc94f387c 100644 --- a/store/types/proof.go +++ b/store/types/proof.go @@ -61,7 +61,7 @@ func NewSmtCommitmentOp(key []byte, proof *ics23.CommitmentProof) CommitmentOp { } // CommitmentOpDecoder takes a merkle.ProofOp and attempts to decode it into a CommitmentOp ProofOperator -// The proofOp.Data is just a marshalled CommitmentProof. The Key of the CommitmentOp is extracted +// The proofOp.Data is just a marshaled CommitmentProof. The Key of the CommitmentOp is extracted // from the unmarshalled proof. func CommitmentOpDecoder(pop cmtprotocrypto.ProofOp) (merkle.ProofOperator, error) { var spec *ics23.ProofSpec diff --git a/tests/e2e/upgrade/suite.go b/tests/e2e/upgrade/suite.go index 16cf1734b1..8e500050b2 100644 --- a/tests/e2e/upgrade/suite.go +++ b/tests/e2e/upgrade/suite.go @@ -93,7 +93,7 @@ func (s *E2ETestSuite) TestModuleVersionsCLI() { } jsonVM, _ := clientCtx.Codec.MarshalJSON(&pm) expectedRes := string(jsonVM) - // append new line to match behaviour of PrintProto + // append new line to match behavior of PrintProto expectedRes += "\n" // get actual module versions list response from cli diff --git a/tests/integration/aminojson/aminojson_test.go b/tests/integration/aminojson/aminojson_test.go index 5f629e9485..403775d4ff 100644 --- a/tests/integration/aminojson/aminojson_test.go +++ b/tests/integration/aminojson/aminojson_test.go @@ -408,7 +408,7 @@ func TestAminoJSON_LegacyParity(t *testing.T) { // represent the array as nil, and a subsequent marshal to JSON represent the array as null instead of empty. roundTripUnequal bool - // pulsar does not support marshalling a math.Dec as anything except a string. Therefore, we cannot unmarshal + // pulsar does not support marshaling a math.Dec as anything except a string. Therefore, we cannot unmarshal // a pulsar encoded Math.dec (the string representation of a Decimal) into a gogo Math.dec (expecting an int64). protoUnmarshalFails bool }{ diff --git a/tests/integration/staking/keeper/slash_test.go b/tests/integration/staking/keeper/slash_test.go index e2944aa588..769450e2f9 100644 --- a/tests/integration/staking/keeper/slash_test.go +++ b/tests/integration/staking/keeper/slash_test.go @@ -297,7 +297,7 @@ func TestSlashWithUnbondingDelegation(t *testing.T) { // slash validator again // all originally bonded stake has been slashed, so this will have no effect // on the unbonding delegation, but it will slash stake bonded since the infraction - // this may not be the desirable behaviour, ref https://github.com/cosmos/cosmos-sdk/issues/1440 + // this may not be the desirable behavior, ref https://github.com/cosmos/cosmos-sdk/issues/1440 ctx = ctx.WithBlockHeight(13) app.StakingKeeper.Slash(ctx, consAddr, 9, 10, fraction) @@ -323,7 +323,7 @@ func TestSlashWithUnbondingDelegation(t *testing.T) { // slash validator again // all originally bonded stake has been slashed, so this will have no effect // on the unbonding delegation, but it will slash stake bonded since the infraction - // this may not be the desirable behaviour, ref https://github.com/cosmos/cosmos-sdk/issues/1440 + // this may not be the desirable behavior, ref https://github.com/cosmos/cosmos-sdk/issues/1440 ctx = ctx.WithBlockHeight(13) app.StakingKeeper.Slash(ctx, consAddr, 9, 10, fraction) diff --git a/tools/rosetta/lib/errors/errors.go b/tools/rosetta/lib/errors/errors.go index 3f03c31aeb..4ad034fc3d 100644 --- a/tools/rosetta/lib/errors/errors.go +++ b/tools/rosetta/lib/errors/errors.go @@ -133,7 +133,7 @@ var ( ErrOffline = RegisterError(1, "cannot query endpoint in offline mode", false, "returned when querying an online endpoint in offline mode") // ErrNetworkNotSupported is returned when there is an attempt to query a network which is not supported ErrNetworkNotSupported = RegisterError(2, "network is not supported", false, "returned when querying a non supported network") - // ErrCodec is returned when there's an error while marshalling or unmarshalling data + // ErrCodec is returned when there's an error while marshaling or unmarshalling data ErrCodec = RegisterError(3, "encode/decode error", true, "returned when there are errors encoding or decoding information to and from the node") // ErrInvalidOperation is returned when the operation supplied to rosetta is not a valid one ErrInvalidOperation = RegisterError(4, "invalid operation", false, "returned when the operation is not valid") diff --git a/x/params/keeper/keeper_test.go b/x/params/keeper/keeper_test.go index 1b0a655e0e..4abc039932 100644 --- a/x/params/keeper/keeper_test.go +++ b/x/params/keeper/keeper_test.go @@ -153,7 +153,7 @@ func indirect(ptr interface{}) interface{} { } func TestGetSubspaces(t *testing.T) { - _, _, _, _, keeper := testComponents() + _, _, _, _, keeper := testComponents() table := types.NewKeyTable( types.NewParamSetPair([]byte("string"), "", validateNoOp), diff --git a/x/tx/decode/unknown_test.go b/x/tx/decode/unknown_test.go index f497cabf05..f47fca8a53 100644 --- a/x/tx/decode/unknown_test.go +++ b/x/tx/decode/unknown_test.go @@ -657,11 +657,11 @@ func TestRejectUnknownFieldsFlat(t *testing.T) { func TestPackedEncoding(t *testing.T) { data := &testpb.TestRepeatedUints{Nums: []uint64{12, 13}} - marshalled, err := proto.Marshal(data) + marshaled, err := proto.Marshal(data) require.NoError(t, err) unmarshalled := data.ProtoReflect().Descriptor() - _, err = decode.RejectUnknownFields(marshalled, unmarshalled, false, ProtoResolver) + _, err = decode.RejectUnknownFields(marshaled, unmarshalled, false, ProtoResolver) require.NoError(t, err) } diff --git a/x/tx/signing/textual/int.go b/x/tx/signing/textual/int.go index c04a85d05d..c4a64c72eb 100644 --- a/x/tx/signing/textual/int.go +++ b/x/tx/signing/textual/int.go @@ -46,7 +46,7 @@ func (vr intValueRenderer) Parse(_ context.Context, screens []Screen) (protorefl if err != nil { return nilValue, err } - return protoreflect.ValueOfUint32(uint32(value)), nil //nolint:gosec + return protoreflect.ValueOfUint32(uint32(value)), nil case protoreflect.Uint64Kind: value, err := strconv.ParseUint(parsedInt, 10, 64) @@ -60,7 +60,7 @@ func (vr intValueRenderer) Parse(_ context.Context, screens []Screen) (protorefl if err != nil { return nilValue, err } - return protoreflect.ValueOfInt32(int32(value)), nil //nolint:gosec + return protoreflect.ValueOfInt32(int32(value)), nil case protoreflect.Int64Kind: value, err := strconv.ParseInt(parsedInt, 10, 64) diff --git a/x/upgrade/doc.go b/x/upgrade/doc.go index 8b101c39a6..4ebab204f7 100644 --- a/x/upgrade/doc.go +++ b/x/upgrade/doc.go @@ -117,7 +117,7 @@ specified here https://github.com/cosmos/cosmos-sdk/tree/main/cosmovisor/README. This will allow a properly configured cosmsod daemon to auto-download new binaries and auto-upgrade. As noted there, this is intended more for full nodes than validators. -# Cancelling Upgrades +# Canceling Upgrades There are two ways to cancel a planned upgrade - with on-chain governance or off-chain social consensus. For the first one, there is a CancelSoftwareUpgrade proposal type, which can be voted on and will diff --git a/x/upgrade/keeper/keeper.go b/x/upgrade/keeper/keeper.go index f4ac2d612c..45555dd7ab 100644 --- a/x/upgrade/keeper/keeper.go +++ b/x/upgrade/keeper/keeper.go @@ -35,7 +35,7 @@ type Keeper struct { upgradeHandlers map[string]types.UpgradeHandler // map of plan name to upgrade handler versionSetter xp.ProtocolVersionSetter // implements setting the protocol version field on BaseApp downgradeVerified bool // tells if we've already sanity checked that this binary version isn't being used against an old state. - authority string // the address capable of executing and cancelling an upgrade. Usually the gov module account + authority string // the address capable of executing and canceling an upgrade. Usually the gov module account initVersionMap module.VersionMap // the module version map at init genesis } diff --git a/x/upgrade/keeper/msg_server_test.go b/x/upgrade/keeper/msg_server_test.go index 6833d7e3c5..2d0b690c16 100644 --- a/x/upgrade/keeper/msg_server_test.go +++ b/x/upgrade/keeper/msg_server_test.go @@ -94,7 +94,7 @@ func (s *KeeperTestSuite) TestCancelUpgrade() { "expected gov account as only signer for proposal message", }, { - "upgrade cancelled successfully", + "upgrade canceled successfully", &types.MsgCancelUpgrade{ Authority: govAccAddr, },