diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 09734550a6..1bd2d42cc1 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -1,6 +1,6 @@ name: "ReviewDog workflow" env: - GOLANGCI_LINT_VERSION: "v2.5.0" + GOLANGCI_LINT_VERSION: "v2.5.1-0.20251021235302-b99da877a247" on: push: branches: @@ -23,17 +23,39 @@ jobs: # move go out of the way temporarily to avoid "go list ./..." from installing modules - name: Make libsodium.a run: sudo mv /usr/bin/go /usr/bin/go.bak && make libsodium && sudo mv /usr/bin/go.bak /usr/bin/go - - name: reviewdog-golangci-lint - uses: reviewdog/action-golangci-lint@v2.8.0 - with: - go_version_file: go.mod - golangci_lint_version: ${{ env.GOLANGCI_LINT_VERSION }} - golangci_lint_flags: "-c .golangci.yml --allow-parallel-runners" - reporter: "github-pr-check" - tool_name: "Lint Errors" - level: "error" - fail_level: any - filter_mode: "nofilter" + - name: Add bin to PATH + run: | + echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH + echo "$RUNNER_WORKSPACE/$(basename $GITHUB_REPOSITORY)/bin" >> $GITHUB_PATH + - name: Set up Go + uses: ./.github/actions/setup-go + - name: Install golangci-lint + run: | + go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${{ env.GOLANGCI_LINT_VERSION }} + golangci-lint --version + - name: Install reviewdog + run: | + curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/v0.21.0/install.sh | sh -s -- v0.21.0 + reviewdog --version + - name: Run golangci-lint with reviewdog + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -e + + golangci-lint run \ + --output.text.path stdout \ + -c .golangci.yml \ + --issues-exit-code 0 \ + --allow-parallel-runners > temp_golangci-lint-errors.txt + + cat temp_golangci-lint-errors.txt | reviewdog \ + -f=golangci-lint \ + -name="Lint Errors" \ + -reporter=github-pr-check \ + -filter-mode=nofilter \ + -fail-level=any \ + -level=error # Non-Blocking Warnings Section reviewdog-warnings: runs-on: ubuntu-latest diff --git a/.golangci.yml b/.golangci.yml index ccfdc51bb7..dcc6dc017e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,6 +6,7 @@ linters: default: none enable: - copyloopvar + - dupword - errcheck - govet - ineffassign @@ -18,6 +19,10 @@ linters: - unused settings: + dupword: + comments-only: true + ignore: + - long # "long long" is OK errcheck: exclude-functions: # We do this 121 times and never check the error. @@ -28,6 +33,8 @@ linters: # Enables these linters in addition to the default ones. enable: - shadow + disable: + - buildtag settings: printf: # Comma-separated list of print function names to check (in addition to default, see `go tool vet help printf`). @@ -89,7 +96,6 @@ linters: linters: - errcheck - ineffassign - - misspell - nolintlint - staticcheck - unused diff --git a/agreement/state_machine_test.go b/agreement/state_machine_test.go index 7a17b2147e..437ec6799a 100644 --- a/agreement/state_machine_test.go +++ b/agreement/state_machine_test.go @@ -391,7 +391,7 @@ func (blackhole) Write(data []byte) (int, error) { return len(data), nil } -// deterministicTraceTestCase encapsulates a traditional unit test test case. +// deterministicTraceTestCase encapsulates a traditional unit test case. type determisticTraceTestCase struct { inputs []event expectedOutputs []event diff --git a/catchup/service_test.go b/catchup/service_test.go index e375f354f8..4d28ad92c9 100644 --- a/catchup/service_test.go +++ b/catchup/service_test.go @@ -1088,7 +1088,7 @@ func TestServiceLedgerUnavailable(t *testing.T) { require.Less(t, local.LastRound(), remote.LastRound()) } -// TestServiceNoBlockForRound checks if fetchAndWrite does not repeats 500 times if a block not avaialble +// TestServiceNoBlockForRound checks if fetchAndWrite does not repeats 500 times if a block not available func TestServiceNoBlockForRound(t *testing.T) { partitiontest.PartitionTest(t) diff --git a/config/localTemplate.go b/config/localTemplate.go index e487091820..003e1ddd62 100644 --- a/config/localTemplate.go +++ b/config/localTemplate.go @@ -326,7 +326,7 @@ type Local struct { // determining the source of a connection. If used, it should be set to the string "X-Forwarded-For", unless the // proxy vendor provides another header field. In the case of CloudFlare proxy, the "CF-Connecting-IP" header // field can be used. - // This setting does not support multiple X-Forwarded-For HTTP headers or multiple values in in the header and always uses the last value + // This setting does not support multiple X-Forwarded-For HTTP headers or multiple values in the header and always uses the last value // from the last X-Forwarded-For HTTP header that corresponds to a single reverse proxy (even if it received the request from another reverse proxy or adversary node). // // WARNING: By enabling this option, you are trusting peers to provide accurate forwarding addresses. diff --git a/crypto/merklearray/merkle_test.go b/crypto/merklearray/merkle_test.go index 4c15f74df6..b84beef624 100644 --- a/crypto/merklearray/merkle_test.go +++ b/crypto/merklearray/merkle_test.go @@ -485,7 +485,7 @@ func TestSizeLimitsMerkle(t *testing.T) { for depth := uint64(0); depth < uint64(18); depth = depth + increment { size := uint64(1) << depth - // eltCoefficient is the coefficent to determine how many elements are in the proof. + // eltCoefficient is the coefficient to determine how many elements are in the proof. // There will be 1/eltCoefficient elements of all possible element (2^treeDepth) // numElts = 2^(depth-eltCoefficient) diff --git a/crypto/multisig_test.go b/crypto/multisig_test.go index 11e1dd791c..2527fda740 100644 --- a/crypto/multisig_test.go +++ b/crypto/multisig_test.go @@ -310,7 +310,7 @@ func TestMoreThanMaxSigsInMultisig(t *testing.T) { } msig, err := MultisigAssemble(sigs) - require.NoError(t, err, "Multisig: error assmeble multisig") + require.NoError(t, err, "Multisig: error assemble multisig") err = MultisigVerify(txid, addr, msig) require.Error(t, err, "Multisig: did not return error as expected") br := MakeBatchVerifier() @@ -346,7 +346,7 @@ func TestOneSignatureIsEmpty(t *testing.T) { } msig, err := MultisigAssemble(sigs) - require.NoError(t, err, "Multisig: error assmeble multisig") + require.NoError(t, err, "Multisig: error assemble multisig") msig.Subsigs[0].Sig = Signature{} err = MultisigVerify(txid, addr, msig) require.Error(t, err, "Multisig: did not return error as expected") @@ -386,7 +386,7 @@ func TestOneSignatureIsInvalid(t *testing.T) { sigs[1].Subsigs[1].Sig[5] = sigs[1].Subsigs[1].Sig[5] + 1 msig, err := MultisigAssemble(sigs) - require.NoError(t, err, "Multisig: error assmeble multisig") + require.NoError(t, err, "Multisig: error assemble multisig") err = MultisigVerify(txid, addr, msig) require.Error(t, err, "Multisig: did not return error as expected") br := MakeBatchVerifier() diff --git a/daemon/algod/api/server/v1/routes/routes.go b/daemon/algod/api/server/v1/routes/routes.go index fe0684637d..6bf85e2851 100644 --- a/daemon/algod/api/server/v1/routes/routes.go +++ b/daemon/algod/api/server/v1/routes/routes.go @@ -22,7 +22,7 @@ import ( ) // V1Routes contains all routes for v1 -// v1 algod paths will route to the sunset message, resulting in a 410 Gone response. +// These algod paths will route to the sunset message, resulting in a 410 Gone response. var V1Routes = lib.Routes{ lib.Route{ Name: "status", diff --git a/daemon/kmd/api/v1/handlers.go b/daemon/kmd/api/v1/handlers.go index ac2624110b..d8b33cc87b 100644 --- a/daemon/kmd/api/v1/handlers.go +++ b/daemon/kmd/api/v1/handlers.go @@ -38,7 +38,7 @@ type reqContext struct { sm *session.Manager } -// errorResponse sets the specified status code (should != 200), and fills in the +// errorResponse sets the specified status code (should != 200), and fills in // the response envelope by setting Error to true and a Message to the passed // user-readable error message. func errorResponse(w http.ResponseWriter, status int, err error) { diff --git a/daemon/kmd/config/config.go b/daemon/kmd/config/config.go index 95bce23129..f2aae3816e 100644 --- a/daemon/kmd/config/config.go +++ b/daemon/kmd/config/config.go @@ -104,7 +104,7 @@ func (k KMDConfig) Validate() error { return nil } -// LoadKMDConfig tries to read the the kmd configuration from disk, merging the +// LoadKMDConfig tries to read the kmd configuration from disk, merging the // default kmd configuration with what it finds func LoadKMDConfig(dataDir string) (cfg KMDConfig, err error) { cfg = defaultConfig(dataDir) diff --git a/daemon/kmd/wallet/driver/sqlite_crypto.go b/daemon/kmd/wallet/driver/sqlite_crypto.go index 618cb9345d..f30ac6d937 100644 --- a/daemon/kmd/wallet/driver/sqlite_crypto.go +++ b/daemon/kmd/wallet/driver/sqlite_crypto.go @@ -232,7 +232,7 @@ func decryptBlobWithPassword(blob []byte, ptType plaintextType, password []byte) // extractKeyWithIndex accepts the master derivation key and an index which // specifies the key to be derived func extractKeyWithIndex(derivationKey []byte, index uint64) (pk crypto.PublicKey, sk crypto.PrivateKey, err error) { - // The info tag is just the the utf-8 string representation of the index + // The info tag is just the utf-8 string representation of the index info := []byte(fmt.Sprintf(hkdfInfoFormat, index)) // We can skip hkdf.Extract since our key is long and uniformly random diff --git a/data/accountManager_test.go b/data/accountManager_test.go index 87dae6e59d..8cce9ce945 100644 --- a/data/accountManager_test.go +++ b/data/accountManager_test.go @@ -185,7 +185,7 @@ func testAccountManagerKeys(t *testing.T, registry account.ParticipationRegistry <-keyDeletionDone testDuration := time.Since(testStartTime) t.Logf("testDuration %v keysTotalDuration %v\n", testDuration, keysTotalDuration) - require.Lessf(t, keysTotalDuration, testDuration/100, fmt.Sprintf("the time to aquire the keys via Keys() was %v whereas blocking on keys deletion took %v", keysTotalDuration, testDuration)) + require.Lessf(t, keysTotalDuration, testDuration/100, fmt.Sprintf("the time to acquire the keys via Keys() was %v whereas blocking on keys deletion took %v", keysTotalDuration, testDuration)) t.Logf("Calling AccountManager.Keys() while AccountManager.DeleteOldKeys() was busy, 10 times in a row, resulted in accumulated delay of %v\n", keysTotalDuration) } diff --git a/data/appRateLimiter_test.go b/data/appRateLimiter_test.go index 6a9efbd30a..472731ac15 100644 --- a/data/appRateLimiter_test.go +++ b/data/appRateLimiter_test.go @@ -230,7 +230,7 @@ func TestAppRateLimiter_IntervalSkip(t *testing.T) { now := time.Date(2023, 9, 11, 10, 10, 11, 0, time.UTC).UnixNano() // 11 sec => 1 sec into the interval // fill 80% of the current interval - // switch to the next next interval + // switch to the next interval // ensure all capacity is available for i := 0; i < int(0.8*float64(rate)); i++ { diff --git a/data/basics/userBalance.go b/data/basics/userBalance.go index 431f9abe84..4ad24579b1 100644 --- a/data/basics/userBalance.go +++ b/data/basics/userBalance.go @@ -194,7 +194,7 @@ type AccountData struct { Assets map[AssetIndex]AssetHolding `codec:"asset,allocbound=bounds.EncodedMaxAssetsPerAccount"` // AuthAddr is the address against which signatures/multisigs/logicsigs should be checked. - // If empty, the address of the account whose AccountData this is is used. + // If empty, the address of the account whose AccountData this is used. // A transaction may change an account's AuthAddr to "re-key" the account. // This allows key rotation, changing the members in a multisig, etc. AuthAddr Address `codec:"spend"` diff --git a/data/pools/transactionPool.go b/data/pools/transactionPool.go index 936f849922..98e8e69c54 100644 --- a/data/pools/transactionPool.go +++ b/data/pools/transactionPool.go @@ -640,7 +640,7 @@ func (pool *TransactionPool) addToPendingBlockEvaluatorOnce(txgroup []transactio pool.assemblyMu.Lock() defer pool.assemblyMu.Unlock() if evalRnd := pool.pendingBlockEvaluator.Round(); pool.assemblyRound > evalRnd { - // the block we're assembling now isn't the one the the AssembleBlock is waiting for. While it would be really cool + // the block we're assembling now isn't the one the AssembleBlock is waiting for. While it would be really cool // to finish generating the block, it would also be pointless to spend time on it. // we're going to set the ok and assemblyCompletedOrAbandoned to "true" so we can complete this loop asap pool.assemblyResults.ok = true diff --git a/data/pools/transactionPool_test.go b/data/pools/transactionPool_test.go index 475cb27e94..73a06892d1 100644 --- a/data/pools/transactionPool_test.go +++ b/data/pools/transactionPool_test.go @@ -1546,7 +1546,7 @@ func TestStateProofLogging(t *testing.T) { _, err = transactionPool.AssembleBlock(514, time.Time{}) require.NoError(t, err) - // parse the log messages and retreive the Metrics for SP in assmbe block + // parse the log messages and retrieve the Metrics for SP in assemble block scanner := bufio.NewScanner(strings.NewReader(buf.String())) lines := make([]string, 0) for scanner.Scan() { diff --git a/data/transactions/logic/assembler_test.go b/data/transactions/logic/assembler_test.go index e1de89a72d..455a287836 100644 --- a/data/transactions/logic/assembler_test.go +++ b/data/transactions/logic/assembler_test.go @@ -3560,7 +3560,7 @@ add: exp(3, "Cannot create label with same name as macro: coolLabel"), ) testProg(t, `#define 👩 123`, AssemblerMaxVersion, exp(1, "👩 character not allowed in macro name")) - // These two tests are just for coverage, they really really can't happen + // These two tests are just for coverage, they really can't happen ops := newOpStream(AssemblerMaxVersion) err := define(&ops, []token{{str: "not#define"}}) require.EqualError(t, err, "0: invalid syntax: not#define") diff --git a/data/transactions/logic/crypto_test.go b/data/transactions/logic/crypto_test.go index d510f27e10..6d5cba7eb4 100644 --- a/data/transactions/logic/crypto_test.go +++ b/data/transactions/logic/crypto_test.go @@ -141,7 +141,7 @@ func TestMimc(t *testing.T) { // output does not change under the hood with new versions. // // We test that malformed inputs panic, in particular we test malfornmed inputs of: - // 0 length, lenghts not multiple of 32 bytes, chunks representing values greater than the modulus. + // 0 length, lengths not multiple of 32 bytes, chunks representing values greater than the modulus. // We test that well formed inputs hash correctly, testing both single chunk inputs (32-byte) and // multiple chunk inputs (96 bytes). partitiontest.PartitionTest(t) diff --git a/data/transactions/logic/eval.go b/data/transactions/logic/eval.go index b3e8f3488d..ca1f2e07cf 100644 --- a/data/transactions/logic/eval.go +++ b/data/transactions/logic/eval.go @@ -3956,7 +3956,7 @@ func opGetBit(cx *EvalContext) error { var bit uint64 if target.avmType() == avmUint64 { if idx > 63 { - return errors.New("getbit index > 63 with with Uint") + return errors.New("getbit index > 63 with Uint") } mask := uint64(1) << idx bit = (target.Uint & mask) >> idx @@ -4686,7 +4686,7 @@ func opAppGlobalDel(cx *EvalContext) error { } // We have a difficult naming problem here. Some opcodes allow (and used to -// require) ASAs and Apps to to be referenced by their "index" in an app call +// require) ASAs and Apps to be referenced by their "index" in an app call // txn's foreign-apps or foreign-assets arrays. That was a small integer, no // more than 2 or so, and was often called an "index". But it was not a // basics.AssetIndex or basics.ApplicationIndex. diff --git a/data/transactions/logic/evalAppTxn_test.go b/data/transactions/logic/evalAppTxn_test.go index 21dbc52087..23f9701731 100644 --- a/data/transactions/logic/evalAppTxn_test.go +++ b/data/transactions/logic/evalAppTxn_test.go @@ -108,7 +108,7 @@ func TestFieldTypes(t *testing.T) { TestApp(t, NoTrack("itxn_begin; int 7; itxn_field Receiver;"), ep, "not an address") TestApp(t, NoTrack("itxn_begin; byte \"\"; itxn_field CloseRemainderTo;"), ep, "not an address") TestApp(t, NoTrack("itxn_begin; byte \"\"; itxn_field AssetSender;"), ep, "not an address") - // can't really tell if it's an addres, so 32 bytes gets further + // can't really tell if it's an address, so 32 bytes gets further TestApp(t, "itxn_begin; byte \"01234567890123456789012345678901\"; itxn_field AssetReceiver; int 1", ep, "unavailable Account") // but a b32 string rep is not an account @@ -1897,7 +1897,7 @@ func TestTxIDAndGroupIDCalculation(t *testing.T) { }) require.Equal(t, crypto.Digest{0x96, 0x90, 0x1, 0x64, 0x24, 0xa5, 0xda, 0x4, 0x3d, 0xd, 0x40, 0xc9, 0xf6, 0xfa, 0xc3, 0xa6, 0x26, 0x19, 0xd3, 0xf0, 0xb7, 0x28, 0x87, 0xf8, 0x5a, 0xd1, 0xa7, 0xbc, 0x1d, 0xad, 0x8b, 0xfc}, gcBCDgroup) } else { - // these calculations are "wrong," but they're here to maintain backwards compatability with the original implementation + // these calculations are "wrong," but they're here to maintain backwards compatibility with the original implementation gcAAtxid = actual[grandchildAAIndex].txn.InnerID(childAtxn.ID(), 0) require.Equal(t, transactions.Txid{0xb5, 0xa, 0x16, 0x90, 0x78, 0x21, 0xf6, 0x96, 0x1b, 0x9c, 0x72, 0x5e, 0xf4, 0x8b, 0xe7, 0xb8, 0x2b, 0xd, 0x74, 0xd4, 0x71, 0xa2, 0x43, 0xb0, 0xfc, 0x19, 0xbc, 0x1c, 0xda, 0x95, 0x8f, 0xd0}, gcAAtxid) @@ -2276,7 +2276,7 @@ func TestInnerTxIDCalculation(t *testing.T) { gcBDtxid = actual[grandchildBDIndex].txn.InnerID(childBtxid, 3) require.Equal(t, transactions.Txid{0xcd, 0x15, 0x47, 0x3f, 0x42, 0xf5, 0x9c, 0x4a, 0x11, 0xa4, 0xe3, 0x92, 0x30, 0xf, 0x97, 0x1d, 0x3b, 0x1, 0x7, 0xbc, 0x1f, 0x3f, 0xcc, 0x9d, 0x43, 0x5b, 0xb2, 0xa4, 0x15, 0x8b, 0x89, 0x4e}, gcBDtxid) } else { - // these calculations are "wrong," but they're here to maintain backwards compatability with the original implementation + // these calculations are "wrong," but they're here to maintain backwards compatibility with the original implementation childAtxid = childAtxn.ID() require.Equal(t, transactions.Txid{0xc9, 0xa4, 0x41, 0xff, 0x9c, 0x62, 0x40, 0x6e, 0x63, 0xd9, 0x5, 0x19, 0x3b, 0x32, 0x43, 0x3d, 0xba, 0x80, 0x9f, 0xa3, 0xe4, 0xed, 0x2f, 0xa4, 0x19, 0x2b, 0x3f, 0x21, 0x96, 0xe2, 0xec, 0x21}, childAtxid) diff --git a/data/transactions/logic/evalStateful_test.go b/data/transactions/logic/evalStateful_test.go index 40251e7551..63733389d3 100644 --- a/data/transactions/logic/evalStateful_test.go +++ b/data/transactions/logic/evalStateful_test.go @@ -665,7 +665,7 @@ func testAppFull(t *testing.T, program []byte, gi int, aid basics.AppIndex, ep * // that something STOPS working as of a particular version. Note that this does // *not* use different consensus versions. It is tempting to make it find the // lowest possible consensus version in the loop in order to support the `v` it -// it working on. For super confidence, one might argue this should be a nested +// is working on. For super confidence, one might argue this should be a nested // loop over all of the consensus versions that work with the `v`, from the // first possible, to vFuture. func testLogicRange(t *testing.T, start, stop int, test func(t *testing.T, ep *EvalParams, tx *transactions.Transaction, ledger *Ledger)) { @@ -1107,7 +1107,7 @@ int 4141 == ` // check that even during application creation (Txn.ApplicationID == 0) - // we will use the the kvCow if the exact application ID (100) is + // we will use the kvCow if the exact application ID (100) is // specified in the transaction now.TxnGroup[0].Txn.ApplicationID = 0 now.TxnGroup[0].Txn.ForeignApps = []basics.AppIndex{100} diff --git a/data/transactions/logic/eval_test.go b/data/transactions/logic/eval_test.go index 3fc3028596..ac72f68567 100644 --- a/data/transactions/logic/eval_test.go +++ b/data/transactions/logic/eval_test.go @@ -88,7 +88,7 @@ func makeTestProto(opts ...protoOpt) *config.ConsensusParams { // With the addition of itxn_field, itxn_submit, which rely on // machinery outside logic package for validity checking, we - // need a more realistic set of consensus paramaters. + // need a more realistic set of consensus parameters. Asset: true, MaxAssetNameBytes: 12, MaxAssetUnitNameBytes: 6, diff --git a/data/txHandler_test.go b/data/txHandler_test.go index 4deee00c81..455b6195f0 100644 --- a/data/txHandler_test.go +++ b/data/txHandler_test.go @@ -2491,7 +2491,7 @@ func TestTxHandlerRestartWithBacklogAndTxPool(t *testing.T) { //nolint:parallelt inputGoodTxnCount := len(signedTransactionGroups) - len(badTxnGroups) tp := handler.txPool - // Wait untill all the expected transactions are in the pool + // Wait until all the expected transactions are in the pool for x := 0; x < 100; x++ { if len(tp.PendingTxGroups()) == inputGoodTxnCount { break @@ -2918,7 +2918,7 @@ func TestTxHandlerErlClientMapper(t *testing.T) { // TestTxHandlerERLIPClient checks that ERL properly handles sender with the same and different addresses: // Configure ERL in following way: // 1. Small maxCapacity=10 fully shared by two IP senders (TxBacklogReservedCapacityPerPeer=5, IncomingConnectionsLimit=0) -// 2. Submit one from both IP senders to initalize per peer-queues and exhaust shared capacity +// 2. Submit one from both IP senders to initialize per peer-queues and exhaust shared capacity // 3. Make sure the third peer does not come through // 4. Make sure extra messages from the first peer and second peer are accepted func TestTxHandlerERLIPClient(t *testing.T) { diff --git a/ledger/acctdeltas_test.go b/ledger/acctdeltas_test.go index 5b656b3018..021d23597a 100644 --- a/ledger/acctdeltas_test.go +++ b/ledger/acctdeltas_test.go @@ -1806,7 +1806,7 @@ func compactResourcesDeltasPermutations(a *require.Assertions, crd compactResour // Investigation shown there was another account YF5GJTPPMOUPU2GRGGVP2PGJTQZWGSWZISFHNIKDJSZ2CDPPWN4KKKYVQE // opted in into the same app 22045503. During the commit range the following happened: // at 16541783 YF5 made a payment txn (one acct delta) -// at 16541785 RGJ has been funded and and opted in into app 22045503 (one acct delta, one res delta) +// at 16541785 RGJ has been funded and opted in into app 22045503 (one acct delta, one res delta) // at 16541788 YF5 address had clear state txn for 22045503, and close out txn for the entire account (one acct delta, one res delta) // Because YF5 had modifications before RGJ, all its acct deltas were compacted into a single entry before RGJ (delete, create) // In the same time, the order in resources delta remained the same (opt-in, delete). @@ -2776,6 +2776,8 @@ func TestAccountOnlineRoundParams(t *testing.T) { // onlineAccountsDelete(2): A online // onlineAccountsDelete(3): A offline, B online // etc +// +//nolint:dupword // ignore func TestOnlineAccountsDeletion(t *testing.T) { partitiontest.PartitionTest(t) diff --git a/ledger/acctonline.go b/ledger/acctonline.go index a66b993ced..ec4cb0e590 100644 --- a/ledger/acctonline.go +++ b/ledger/acctonline.go @@ -345,6 +345,7 @@ func (ao *onlineAccounts) consecutiveVersion(offset uint64) uint64 { if ao.onlineRoundParamsData[startIndex+1].CurrentProtocol != ao.onlineRoundParamsData[startIndex+int(offset)].CurrentProtocol { // find the tip point. tipPoint := sort.Search(int(offset), func(i int) bool { + //nolint:dupword // ignore // we're going to search here for version inequality, with the assumption that consensus versions won't repeat. // that allow us to support [ver1, ver1, ..., ver2, ver2, ..., ver3, ver3] but not [ver1, ver1, ..., ver2, ver2, ..., ver1, ver3]. return ao.onlineRoundParamsData[startIndex+1].CurrentProtocol != ao.onlineRoundParamsData[startIndex+1+i].CurrentProtocol diff --git a/ledger/acctonline_test.go b/ledger/acctonline_test.go index 6969d48b0b..6654e8718c 100644 --- a/ledger/acctonline_test.go +++ b/ledger/acctonline_test.go @@ -305,7 +305,7 @@ func TestAcctOnline(t *testing.T) { require.NoError(t, err) require.Empty(t, oad) } - // check next next account + // check next-next account // for the account 2, it set to Offline at round 3 // at round 1 + 1 = 2 it online and should te correctly retrieved from DB and lookup nextNextAcctIdx := nextAcctIdx + 1 diff --git a/ledger/acctupdates_test.go b/ledger/acctupdates_test.go index 0d380c3cce..71cf03d981 100644 --- a/ledger/acctupdates_test.go +++ b/ledger/acctupdates_test.go @@ -1117,7 +1117,7 @@ func TestKVCache(t *testing.T) { require.False(t, has) } - // verify commited kvs appear in the kv cache + // verify committed kvs appear in the kv cache for ; currentDBRound <= au.cachedDBRound; currentDBRound++ { startKV := (currentDBRound - 1) * basics.Round(kvsPerBlock) for j := 0; j < kvsPerBlock; j++ { @@ -1161,7 +1161,7 @@ func TestKVCache(t *testing.T) { } } - // verify commited updated kv values appear in the kv cache + // verify committed updated kv values appear in the kv cache for ; currentDBRound <= au.cachedDBRound; currentDBRound++ { lookback := basics.Round(kvCnt/kvsPerBlock + int(conf.MaxAcctLookback) + 1) if currentDBRound < lookback { @@ -1213,7 +1213,7 @@ func TestKVCache(t *testing.T) { } } - // verify commited updated kv values appear in the kv cache + // verify committed updated kv values appear in the kv cache for ; currentDBRound <= au.cachedDBRound; currentDBRound++ { lookback := basics.Round(2*(kvCnt/kvsPerBlock+int(conf.MaxAcctLookback)) + 1) if currentDBRound < lookback { @@ -1946,7 +1946,7 @@ func TestAcctUpdatesResources(t *testing.T) { updates.UpsertAssetResource(addr1, aidx, ledgercore.AssetParamsDelta{}, ledgercore.AssetHoldingDelta{Holding: &basics.AssetHolding{Amount: 200}}) } - // test 2: send back to creator creator + // test 2: send back to creator // expect matching balances at the end creatorParams := ledgercore.AssetParamsDelta{Params: &basics.AssetParams{Total: 1000}} if i == 4 { diff --git a/ledger/boxtxn_test.go b/ledger/boxtxn_test.go index 1f0eafe614..a4f5b1c5d0 100644 --- a/ledger/boxtxn_test.go +++ b/ledger/boxtxn_test.go @@ -346,7 +346,7 @@ func TestBoxCreateAvailability(t *testing.T) { itxn_field TypeEnum itxn_submit - // Now invoke it, so it can intialize (and create the "hello" box) + // Now invoke it, so it can initialize (and create the "hello" box) itxn_begin itxn_field ApplicationID int appl @@ -773,7 +773,7 @@ func testNewAppBoxCreate(t *testing.T, requestedTealVersion int) { // transaction counter, so it can know what the later create will be, // and compute it's app address. - // 2) a) Use the the predicted appID to name the box ref. + // 2) a) Use the predicted appID to name the box ref. // or b) Use 0 as the app in the box ref, meaning "this app" // or c) EnableUnnamedBoxCreate will allow such a creation if there are empty box refs. @@ -800,7 +800,7 @@ func testNewAppBoxCreate(t *testing.T, requestedTealVersion int) { // doubleSrc tries to create TWO boxes. The second is always named by ApplicationArgs 1 doubleSrc := createSrcVer + `txn ApplicationArgs 1; int 24; box_create; pop;` // return result of FIRST box_create - // need to call one inner txn, and have have mbr for itself and inner created app + // need to call one inner txn, and have mbr for itself and inner created app passID := dl.fundedApp(addrs[0], 200_000+proto.MinTxnFee, passThruCreator) // Will be used to show inners have same power // Since we used fundedApp, the next app created would be passID+2. diff --git a/ledger/catchpointfilewriter_test.go b/ledger/catchpointfilewriter_test.go index 1ff274c8fd..c7f786a60d 100644 --- a/ledger/catchpointfilewriter_test.go +++ b/ledger/catchpointfilewriter_test.go @@ -943,7 +943,7 @@ func testExactAccountChunk(t *testing.T, proto protocol.ConsensusVersion, extraB var onlineExcludeBefore basics.Round // we added so many blocks that lowestRound is stuck at first state proof, round 240? if normalHorizon := catchpointLookbackHorizonForNextRound(genDBRound, params); normalHorizon <= genLowestRound { - t.Logf("subtest is exercising case where lowestRound from votersTracker is satsified by the existing history") + t.Logf("subtest is exercising case where lowestRound from votersTracker is satisfied by the existing history") require.EqualValues(t, genLowestRound, params.StateProofInterval-params.StateProofVotersLookback) onlineExcludeBefore = 0 require.False(t, longHistory) @@ -1238,7 +1238,7 @@ assert var onlineExcludeBefore basics.Round normalOnlineHorizon := catchpointLookbackHorizonForNextRound(genDBRound, config.Consensus[proto]) if normalOnlineHorizon <= genLowestRound { - t.Logf("lowestRound from votersTracker is satsified by the existing history") + t.Logf("lowestRound from votersTracker is satisfied by the existing history") onlineExcludeBefore = 0 require.False(t, longHistory) } else if normalOnlineHorizon > genLowestRound { diff --git a/ledger/catchpointtracker_test.go b/ledger/catchpointtracker_test.go index a55116757c..9f8df68b7c 100644 --- a/ledger/catchpointtracker_test.go +++ b/ledger/catchpointtracker_test.go @@ -1603,7 +1603,7 @@ func TestCatchpointSecondStageDeletesUnfinishedCatchpointRecord(t *testing.T) { secondStageRound := basics.Round(36) - // Add blocks that preceed the first catchpoint round. + // Add blocks that precede the first catchpoint round. for i := basics.Round(1); i < secondStageRound; i++ { blk := bookkeeping.Block{ BlockHeader: bookkeeping.BlockHeader{ @@ -2113,7 +2113,7 @@ func TestMakeCatchpointFilePath(t *testing.T) { // deadlock detection) and concurrent reads (from transaction evaluation, stake lookups, etc) can // cause the SQLite implementation in util/db/dbutil.go to retry the function looping over all // tracker commitRound implementations. Since catchpointtracker' commitRound updates a merkle trie's -// DB storage and its in-memory cache, the retry can cause the the balancesTrie's cache to become +// DB storage and its in-memory cache, the retry can cause the balancesTrie's cache to become // corrupted and out of sync with the DB (which uses transaction rollback between retries). The // merkle trie corruption manifests as error log messages like: // - "attempted to add duplicate hash 'X' to merkle trie for account Y" diff --git a/ledger/catchupaccessor.go b/ledger/catchupaccessor.go index 114dd7f91a..741e7a30db 100644 --- a/ledger/catchupaccessor.go +++ b/ledger/catchupaccessor.go @@ -454,7 +454,7 @@ func (c *catchpointCatchupAccessorImpl) processStagingContent(ctx context.Contex // the following fields are now going to be ignored. We could add these to the database and validate these // later on: - // TotalAccounts, TotalAccounts, Catchpoint, BlockHeaderDigest, BalancesRound + // TotalAccounts, Catchpoint, BlockHeaderDigest, BalancesRound start := time.Now() ledgerProcessstagingcontentCount.Inc(nil) err = c.ledger.trackerDB().Transaction(func(ctx context.Context, tx trackerdb.TransactionScope) (err error) { diff --git a/ledger/eval/txntracer_test.go b/ledger/eval/txntracer_test.go index 89f672867c..ca00414dba 100644 --- a/ledger/eval/txntracer_test.go +++ b/ledger/eval/txntracer_test.go @@ -250,7 +250,7 @@ int 1` expectedAddr2 := genesisBalance + 1_000_000 // addrs[3]: received CloseRemainderTo from addrs[1] - // addrs[1] started with genesisBalance, paid 1 fee (payTxn), sent 1_000_000, remainder to addrs[3] + // addrs[1]: started with genesisBalance, paid 1 fee (payTxn), sent 1_000_000, remainder to addrs[3] expectedAddr3 := genesisBalance + (genesisBalance - proto.MinTxnFee - 1_000_000) // innerAppAddress: started with 1_000_000, spawned 3 inner txns (1 app call + 2 payments) diff --git a/ledger/ledger_test.go b/ledger/ledger_test.go index 8c6bdf7b7e..4dc915050f 100644 --- a/ledger/ledger_test.go +++ b/ledger/ledger_test.go @@ -1169,7 +1169,7 @@ func testLedgerSingleTxApplyData(t *testing.T, version protocol.ConsensusVersion VoteLast: 10000, } - // depends on what the concensus is need to generate correct KeyregTxnFields. + // depends on what the consensus is need to generate correct KeyregTxnFields. if proto.EnableStateProofKeyregCheck { frst, lst := uint64(correctKeyregFields.VoteFirst), uint64(correctKeyregFields.VoteLast) store, err := db.MakeAccessor("test-DB", false, true) @@ -2268,7 +2268,7 @@ func TestLedgerReloadShrinkDeltas(t *testing.T) { } func resetAccountDBToV6(t *testing.T, l *Ledger) { - // reset tables and re-init again, similary to the catchpount apply code + // reset tables and re-init again, similarly to the catchpount apply code // since the ledger has only genesis accounts, this recreates them err := l.trackerDBs.Transaction(func(ctx context.Context, tx trackerdb.TransactionScope) error { arw, err := tx.MakeAccountsWriter() @@ -2328,7 +2328,7 @@ func TestLedgerReloadTxTailHistoryAccess(t *testing.T) { l.Close() }() - // reset tables and re-init again, similary to the catchpount apply code + // reset tables and re-init again, similarly to the catchpount apply code // since the ledger has only genesis accounts, this recreates them err = l.trackerDBs.Transaction(func(ctx context.Context, tx trackerdb.TransactionScope) error { arw, err := tx.MakeAccountsWriter() diff --git a/ledger/ledgercore/statedelta.go b/ledger/ledgercore/statedelta.go index 4748a5da9f..55d947ee28 100644 --- a/ledger/ledgercore/statedelta.go +++ b/ledger/ledgercore/statedelta.go @@ -33,7 +33,7 @@ const ( stateDeltaTargetOptimizationThreshold = uint64(50000000) ) -// ModifiedCreatable defines the changes to a single single creatable state +// ModifiedCreatable defines the changes to a single creatable state type ModifiedCreatable struct { // Type of the creatable: app or asset Ctype basics.CreatableType diff --git a/ledger/simulation/simulation_eval_test.go b/ledger/simulation/simulation_eval_test.go index bfdc4e7df2..899dfc6b3f 100644 --- a/ledger/simulation/simulation_eval_test.go +++ b/ledger/simulation/simulation_eval_test.go @@ -9331,7 +9331,7 @@ func TestFixSigners(t *testing.T) { }) txgroup := txntest.Group(&noBalPay1, &appCall, &noBalPay2) - // Testing that our ledger lookup of accounts to retreive their AuthAddr does not crash + // Testing that our ledger lookup of accounts to retrieve their AuthAddr does not crash // and burn when the account is empty. return simulationTestCase{ diff --git a/ledger/simulation/simulator_test.go b/ledger/simulation/simulator_test.go index a08225153e..07ba377d56 100644 --- a/ledger/simulation/simulator_test.go +++ b/ledger/simulation/simulator_test.go @@ -38,15 +38,15 @@ import ( // We want to be careful that the Algod ledger does not move on to another round // so we confirm here that all ledger methods which implicitly access the current round -// are overriden within the `simulatorLedger`. +// are overridden within the `simulatorLedger`. func TestNonOverridenDataLedgerMethodsUseRoundParameter(t *testing.T) { partitiontest.PartitionTest(t) t.Parallel() env := simulationtesting.PrepareSimulatorTest(t) - // methods overriden by `simulatorLedger`` - overridenMethods := []string{ + // methods overridden by `simulatorLedger`` + overriddenMethods := []string{ "Latest", "LookupLatest", "LatestTotals", @@ -60,7 +60,7 @@ func TestNonOverridenDataLedgerMethodsUseRoundParameter(t *testing.T) { } methodIsSkipped := func(methodName string) bool { - if slices.Contains(overridenMethods, methodName) { + if slices.Contains(overriddenMethods, methodName) { return true } return slices.Contains(excludedMethods, methodName) diff --git a/ledger/store/trackerdb/generickv/migrations.go b/ledger/store/trackerdb/generickv/migrations.go index 0613daa4d0..3fc31ec7d5 100644 --- a/ledger/store/trackerdb/generickv/migrations.go +++ b/ledger/store/trackerdb/generickv/migrations.go @@ -103,7 +103,7 @@ func (m *migrator) Migrate(ctx context.Context) error { if m.currentVersion > m.targetVersion { return nil } - // upgrade the db one version at at time + // upgrade the db one version at a time for m.currentVersion < m.targetVersion { // run next version upgrade switch m.currentVersion { diff --git a/ledger/store/trackerdb/testinterface.go b/ledger/store/trackerdb/testinterface.go index 14e73b5c86..ce90faabb7 100644 --- a/ledger/store/trackerdb/testinterface.go +++ b/ledger/store/trackerdb/testinterface.go @@ -26,7 +26,7 @@ import ( ) // testinterface.go contains interface extensions specific to testing -// testing interfaces should be made accessible by calling the Testing() method +// Testing interfaces should be made accessible by calling the Testing() method // on the related interface. Example: // testTx := tx.Testing() // these can also be inlined: diff --git a/ledger/store/trackerdb/testsuite/dbsemantics_test.go b/ledger/store/trackerdb/testsuite/dbsemantics_test.go index b1cdf9956f..d38f2ddf34 100644 --- a/ledger/store/trackerdb/testsuite/dbsemantics_test.go +++ b/ledger/store/trackerdb/testsuite/dbsemantics_test.go @@ -75,7 +75,7 @@ func CustomTestTransaction(t *customT) { }) require.NoError(t, err) - // read the updated record outside the transaction to make sure it was commited + // read the updated record outside the transaction to make sure it was committed padA, err := aor.LookupAccount(addrA) require.NoError(t, err) require.Equal(t, uint64(98287), padA.AccountData.RewardsBase) // same updated data diff --git a/logging/cyclicWriter.go b/logging/cyclicWriter.go index 978052d105..f2f75c7831 100644 --- a/logging/cyclicWriter.go +++ b/logging/cyclicWriter.go @@ -118,7 +118,7 @@ func procWait(cmd *exec.Cmd, cause string) { } } -// Write ensures the the underlying file can store an additional len(p) bytes. If there is not enough room left it seeks +// Write ensures the underlying file can store an additional len(p) bytes. If there is not enough room left it seeks // to the beginning of the file. func (cyclic *CyclicFileWriter) Write(p []byte) (n int, err error) { cyclic.mu.Lock() diff --git a/logging/telemetry.go b/logging/telemetry.go index acdd3f4ddf..8e69ec02a4 100644 --- a/logging/telemetry.go +++ b/logging/telemetry.go @@ -115,7 +115,7 @@ func ReadTelemetryConfigOrDefault(dataDir string, globalDir string) (cfg Telemet // Create an ephemeral config cfg = createTelemetryConfig() - // If the error was that the the config wasn't there then it wasn't really an error + // If the error was that the config wasn't there then it wasn't really an error if os.IsNotExist(err) { err = nil } else { diff --git a/netdeploy/networkTemplate.go b/netdeploy/networkTemplate.go index 92a7691e16..85f63997ed 100644 --- a/netdeploy/networkTemplate.go +++ b/netdeploy/networkTemplate.go @@ -48,7 +48,7 @@ type NetworkTemplate struct { // TemplateKMDConfig is a subset of the kmd configuration that can be overridden in the network template // by using OverrideKmdConfig TemplateOverride opts. -// The reason why config.KMDConfig cannot be used directly is that it contains DataDir field which is +// The reason why config.KMDConfig cannot be used directly is that it contains DataDir field which // is not known until the template instantiation. type TemplateKMDConfig struct { SessionLifetimeSecs uint64 diff --git a/network/gossipNode.go b/network/gossipNode.go index 10bbf2d27d..9594ee5e11 100644 --- a/network/gossipNode.go +++ b/network/gossipNode.go @@ -224,7 +224,7 @@ func (f HandlerFunc) Handle(message IncomingMessage) OutgoingMessage { // MessageValidatorHandler takes a IncomingMessage (e.g., vote, transaction), processes it, and returns what (if anything) // to send to the network in response. // it supposed to perform synchronous validation and return the result of the validation -// so that network knows immediately if the message should be be broadcasted or not. +// so that network knows immediately if the message should be broadcasted or not. type MessageValidatorHandler interface { ValidateHandle(message IncomingMessage) OutgoingMessage } diff --git a/network/hybridNetwork_test.go b/network/hybridNetwork_test.go index 911db9f410..213f88b535 100644 --- a/network/hybridNetwork_test.go +++ b/network/hybridNetwork_test.go @@ -215,7 +215,7 @@ func TestHybridNetwork_HybridRelayStrategy(t *testing.T) { startNewRelayNode := func(name string, phonebook []string) (*HybridP2PNetwork, []string) { relayCfg := cfg relayCfg.ForceRelayMessages = true - // no phonebook addresses since we start and and stop it to collect the ws address + // no phonebook addresses since we start and stop it to collect the ws address net, err := NewHybridP2PNetwork(log.With("node", name), relayCfg, "", nil, genesisInfo, &nopeNodeInfo{}, nil) require.NoError(t, err) diff --git a/network/netidentity_test.go b/network/netidentity_test.go index ce3240698f..03c345fe79 100644 --- a/network/netidentity_test.go +++ b/network/netidentity_test.go @@ -323,7 +323,7 @@ func TestIdentityTrackerRemoveIdentity(t *testing.T) { require.True(t, exists) // check that removing a peer who does not exist in the map (but whos identity does) - // not not result in the wrong peer being removed + // not result in the wrong peer being removed tracker.removeIdentity(&p2) _, exists = tracker.peersByID[p.identity] require.True(t, exists) diff --git a/network/p2pNetwork.go b/network/p2pNetwork.go index 09db008e65..021853ce8e 100644 --- a/network/p2pNetwork.go +++ b/network/p2pNetwork.go @@ -722,7 +722,7 @@ func (n *P2PNetwork) GetPeers(options ...PeerOption) []Peer { n.log.Debugf("Relay node(s) from peerstore: %v", addrs) } case PeersPhonebookArchivalNodes: - // query known archival nodes that came from from DHT if enabled (or DNS if configured) + // query known archival nodes that came from DHT if enabled (or DNS if configured) addrInfos := n.pstore.GetAddresses(numArchivalPeersToFind, phonebook.ArchivalRole) for _, peerInfo := range addrInfos { if peerInfo.ID == n.service.ID() { diff --git a/network/websocketProxy_test.go b/network/websocketProxy_test.go index fdb27bcaa8..753430a965 100644 --- a/network/websocketProxy_test.go +++ b/network/websocketProxy_test.go @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with go-algorand. If not, see . -// This is a simple reverse proxy for websocket connections. It is used to to test +// This is a simple reverse proxy for websocket connections. It is used to test // ws network behavior when UseXForwardedForAddressField is enabled. // Not suitable for production use. package network diff --git a/network/wsNetwork.go b/network/wsNetwork.go index 356cad1561..c30dfa09d2 100644 --- a/network/wsNetwork.go +++ b/network/wsNetwork.go @@ -2032,7 +2032,7 @@ func (t *HTTPPAddressBoundTransport) RoundTrip(req *http.Request) (*http.Respons return t.InnerTransport.RoundTrip(req) } -// filterASCII filter out the non-ascii printable characters out of the given input string and +// filterASCII filter out the non-ascii printable characters out of the given input string // and replace these with unprintableCharacterGlyph. // It's used as a security qualifier before logging a network-provided data. // The function allows only characters in the range of [32..126], which excludes all the diff --git a/network/wsNetwork_test.go b/network/wsNetwork_test.go index c1758504ca..a0085a2937 100644 --- a/network/wsNetwork_test.go +++ b/network/wsNetwork_test.go @@ -407,7 +407,7 @@ func TestWebsocketNetworkBasicInvalidTags(t *testing.T) { // nolint:paralleltest })}}) // send a message with an invalid tag which is in defaultSendMessageTags. // it should not go through because the defaultSendMessageTags should not be accepted - // and the connection should be dropped dropped + // and the connection should be dropped netA.Broadcast(context.Background(), "XX", []byte("foo"), false, nil) for p := 0; p < 100; p++ { if strings.Contains(logOutput.String(), "wsPeer handleMessageOfInterest: could not unmarshall message from") { @@ -4068,7 +4068,7 @@ func TestTryConnectEarlyWrite(t *testing.T) { time.Sleep(2 * time.Millisecond) } - // Confirm that we successfuly received a message of interest + // Confirm that we successfully received a message of interest assert.Len(t, netA.peers, 1) fmt.Printf("MI Message Count: %v\n", netA.peers[0].miMessageCount.Load()) assert.Equal(t, uint64(1), netA.peers[0].miMessageCount.Load()) diff --git a/node/node_test.go b/node/node_test.go index 7213eaf848..a9990d971e 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -868,7 +868,7 @@ func TestMaxSizesCorrect(t *testing.T) { // subtract out the two smaller signature sizes (logicsig is biggest, it can *contain* the others) maxCombinedTxnSize -= uint64(crypto.SignatureMaxSize() + crypto.MultisigSigMaxSize()) // the logicsig size is *also* an overestimate, because it thinks that the logicsig and - // the logicsig args can both be up to to MaxLogicSigMaxSize, but that's the max for + // the logicsig args can both be up to MaxLogicSigMaxSize, but that's the max for // them combined, so it double counts and we have to subtract one. maxCombinedTxnSize -= uint64(bounds.MaxLogicSigMaxSize) diff --git a/protocol/codec.go b/protocol/codec.go index 7aed14f09a..f85d67b9bc 100644 --- a/protocol/codec.go +++ b/protocol/codec.go @@ -258,7 +258,7 @@ type MsgpDecoderBytes struct { pos int } -// Decode an objptr from from a byte stream +// Decode an objptr from a byte stream func (d *MsgpDecoderBytes) Decode(objptr msgp.Unmarshaler) error { if !objptr.CanUnmarshalMsg(objptr) { return fmt.Errorf("object %T cannot be msgp-unmashalled", objptr) diff --git a/rpcs/blockService_test.go b/rpcs/blockService_test.go index 9178143455..494b4772ae 100644 --- a/rpcs/blockService_test.go +++ b/rpcs/blockService_test.go @@ -309,7 +309,7 @@ func TestRedirectOnFullCapacity(t *testing.T) { var blk bookkeeping.Block var l2Failed bool xDone := 1000 - // Keep on sending 4 simultanious requests to the first node, to force it to redirect to node 2 + // Keep on sending 4 simultaneous requests to the first node, to force it to redirect to node 2 // then check the timestamp from the block header to confirm the redirection took place var x int forloop: @@ -344,8 +344,7 @@ forloop: require.Equal(t, "3", responses[p].Header["Retry-After"][0]) continue } - // parse the block to get the header timestamp - // timestamp is needed to know which node served the block + // parse the block to get the header timestamp which is needed to know which node served the block require.Equal(t, http.StatusOK, responses[p].StatusCode) bodyData, err := io.ReadAll(responses[p].Body) require.NoError(t, err) diff --git a/scripts/buildtools/versions b/scripts/buildtools/versions index 04ae69bf2b..a1f7a67d0b 100644 --- a/scripts/buildtools/versions +++ b/scripts/buildtools/versions @@ -3,4 +3,4 @@ golang.org/x/tools v0.27.0 github.com/algorand/msgp v1.1.61 github.com/algorand/go-swagger v0.0.0-20251018003531-2ea7c750dcac gotest.tools/gotestsum v1.13.0 -github.com/golangci/golangci-lint/v2/cmd/golangci-lint v2.5.0 +github.com/golangci/golangci-lint/v2/cmd/golangci-lint v2.5.1-0.20251021235302-b99da877a247 diff --git a/shared/algoh/config.go b/shared/algoh/config.go index a11c60c548..d079510ca5 100644 --- a/shared/algoh/config.go +++ b/shared/algoh/config.go @@ -83,13 +83,13 @@ func LoadConfigFromFile(file string) (cfg HostConfig, err error) { return cfg, err } -// Save pretty-prints the configuration into the the specified file. +// Save pretty-prints the configuration into the specified file. func (cfg HostConfig) Save(file string) error { prettyPrint := true return codecs.SaveObjectToFile(file, cfg, prettyPrint) } -// Dump pretty-prints the configuration into the the specified stream. +// Dump pretty-prints the configuration into the specified stream. func (cfg HostConfig) Dump(stream io.Writer) { enc := codecs.NewFormattedJSONEncoder(stream) enc.Encode(cfg) diff --git a/test/e2e-go/features/accountPerf/sixMillion_test.go b/test/e2e-go/features/accountPerf/sixMillion_test.go index 03b05d8823..c5ab87da38 100644 --- a/test/e2e-go/features/accountPerf/sixMillion_test.go +++ b/test/e2e-go/features/accountPerf/sixMillion_test.go @@ -600,7 +600,7 @@ func scenarioA( require.NoError(t, err) log.Infof("Verifying assets...") - // Verify the assets are transfered here + // Verify the assets are transferred here tAssetAmt := uint64(0) for nai, nacc := range keys { if nacc == ownAllAccount { diff --git a/test/e2e-go/features/catchup/basicCatchup_test.go b/test/e2e-go/features/catchup/basicCatchup_test.go index b0422a9790..1fadd93e49 100644 --- a/test/e2e-go/features/catchup/basicCatchup_test.go +++ b/test/e2e-go/features/catchup/basicCatchup_test.go @@ -332,7 +332,7 @@ func shutdownClonedNode(nodeDataDir string, f *fixtures.RestClientFixture, t *te } } -// TestBasicCatchupCompletes confirms the the catchup eventually completes and stops. +// TestBasicCatchupCompletes confirms that catchup eventually completes and stops. func TestBasicCatchupCompletes(t *testing.T) { partitiontest.PartitionTest(t) defer fixtures.ShutdownSynchronizedTest(t) diff --git a/tools/network/dnssec/client.go b/tools/network/dnssec/client.go index d485c3812a..1caf39d0bd 100644 --- a/tools/network/dnssec/client.go +++ b/tools/network/dnssec/client.go @@ -87,7 +87,7 @@ func (r *dnsClient) query(ctx context.Context, name string, qtype uint16) (resp return nil, fmt.Errorf("no answer for (%s, %d) from DNS servers %v", name, qtype, r.servers) } -// QueryRRSet returns resource records of qtype for name and and its signatures +// QueryRRSet returns resource records of qtype for name and its signatures func (r *dnsClient) QueryRRSet(ctx context.Context, name string, qtype uint16) ([]dns.RR, []dns.RRSIG, error) { msg, err := r.query(ctx, name, qtype) if err != nil { diff --git a/tools/network/resolver.go b/tools/network/resolver.go index 2c159fc644..42716ac5eb 100644 --- a/tools/network/resolver.go +++ b/tools/network/resolver.go @@ -28,7 +28,7 @@ const ( // Resolver provides equivalent functionality to the net.Resolver with one exception - it allows to use a provided DNS server instead of relying on the existing default resolver. type Resolver struct { - // DNSAddress is the the DNS server that we'll be trying to connect to. + // DNSAddress is the DNS server that we'll be trying to connect to. dnsAddress net.IPAddr resolver ResolverIf } diff --git a/util/metrics/counter_test.go b/util/metrics/counter_test.go index 6602dce0bb..ab50110e7d 100644 --- a/util/metrics/counter_test.go +++ b/util/metrics/counter_test.go @@ -66,7 +66,7 @@ func TestMetricCounter(t *testing.T) { test.Lock() defer test.Unlock() - // the the loop above we've created a single metric name with five different labels set ( host0, host1 .. host 4) + // the loop above we've created a single metric name with five different labels set ( host0, host1 .. host 4) // let's see if we received all the 5 different labels. require.Equal(t, 5, len(test.metrics), "Missing metric counts were reported: %+v", test.metrics) @@ -113,7 +113,7 @@ func TestMetricCounterFastInts(t *testing.T) { test.Lock() defer test.Unlock() - // the the loop above we've created a single metric name with five different labels set ( host0, host1 .. host 4) + // the loop above we've created a single metric name with five different labels set ( host0, host1 .. host 4) // let's see if we received all the 5 different labels. require.Equal(t, 1, len(test.metrics), "Missing metric counts were reported: %+v", test.metrics) @@ -162,7 +162,7 @@ func TestMetricCounterMixed(t *testing.T) { test.Lock() defer test.Unlock() - // the the loop above we've created a single metric name with five different labels set ( host0, host1 .. host 4) + // the loop above we've created a single metric name with five different labels set ( host0, host1 .. host 4) // let's see if we received all the 5 different labels. require.Equal(t, 1, len(test.metrics), "Missing metric counts were reported: %+v", test.metrics) diff --git a/util/metrics/gauge_test.go b/util/metrics/gauge_test.go index a2c9051482..c6c5c24afc 100644 --- a/util/metrics/gauge_test.go +++ b/util/metrics/gauge_test.go @@ -68,7 +68,7 @@ func TestMetricGauge(t *testing.T) { test.Lock() defer test.Unlock() - // the the loop above we've created 3 separate gauges + // in the loop above we've created 3 separate gauges // let's see if we received all 3 metrics require.Equal(t, 3, len(test.metrics), "Missing metric counts were reported: %+v", test.metrics) diff --git a/util/rateLimit.go b/util/rateLimit.go index 8406711418..3b089e4a1b 100644 --- a/util/rateLimit.go +++ b/util/rateLimit.go @@ -507,7 +507,7 @@ func (cm *redCongestionManager) arrivalRateFor(arrivals *[]time.Time) float64 { // client1 will be throttled proportional to its usage of the service rate. // over time, client2 will fall in line with the appropriate service rate, while other clients will be able to use the newly freed capacity // The net effect is that clients who are disproportionately noisy are dropped more often, -// while quieter ones are are dropped less often. +// while quieter ones are dropped less often. // The reason this works is that the serviceRate represents the ability for the given resource to be serviced (ie, the rate at which work is dequeued). // When congestion management is required, the service should attempt a fair distribution of servicing to all clients. // clients who are making requests in excess of our known ability to fairly service requests should be reduced.