From faf37deceda2f17279c1bd97f1bc4df622787b80 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Tue, 19 May 2026 14:58:04 +0200 Subject: [PATCH] all: fix all typos, as reported to crates-ci/typos --- accounts/abi/bind/v2/dep_tree_test.go | 2 +- build/ci.go | 6 ++--- cmd/devp2p/internal/ethtest/suite.go | 6 ++--- core/blockchain_test.go | 6 ++--- core/dao_test.go | 4 +-- core/filtermaps/matcher.go | 2 +- core/rawdb/accessors_indexes.go | 2 +- core/rawdb/database.go | 2 +- core/state/snapshot/difflayer.go | 4 +-- core/state/snapshot/disklayer.go | 4 +-- core/state/snapshot/generate_test.go | 2 +- core/state/snapshot/iterator.go | 4 +-- core/state/snapshot/snapshot.go | 8 +++--- core/state_transition.go | 2 +- core/stateless.go | 2 +- core/txpool/blobpool/blobpool.go | 4 +-- core/txpool/blobpool/blobpool_test.go | 4 +-- core/txpool/blobpool/lookup.go | 2 +- core/txpool/legacypool/legacypool_test.go | 2 +- core/vm/runtime/runtime_test.go | 4 +-- eth/dropper.go | 2 +- eth/protocols/snap/sync.go | 2 +- eth/tracers/api_test.go | 30 +++++++++++------------ internal/build/archive.go | 2 +- signer/core/cliui.go | 2 +- tests/fuzzers/bn256/bn256_fuzz.go | 4 +-- trie/iterator_test.go | 8 +++--- trie/node_test.go | 6 ++--- triedb/pathdb/difflayer.go | 4 +-- triedb/pathdb/disklayer.go | 16 ++++++------ triedb/pathdb/history_index_block_test.go | 12 ++++----- triedb/pathdb/iterator.go | 4 +-- triedb/pathdb/metrics.go | 8 +++--- 33 files changed, 86 insertions(+), 86 deletions(-) diff --git a/accounts/abi/bind/v2/dep_tree_test.go b/accounts/abi/bind/v2/dep_tree_test.go index b2470d8a16..8c2510d7a8 100644 --- a/accounts/abi/bind/v2/dep_tree_test.go +++ b/accounts/abi/bind/v2/dep_tree_test.go @@ -329,7 +329,7 @@ func TestContractLinking(t *testing.T) { map[rune]struct{}{}, }, // two contracts ('a' and 'f') share some dependencies. contract 'a' is marked as an override. expect that any of - // its depdencies that aren't shared with 'f' are not deployed. + // its dependencies that aren't shared with 'f' are not deployed. linkTestCaseInput{map[rune][]rune{ 'a': {'b', 'c', 'd', 'e'}, 'f': {'g', 'c', 'd', 'h'}}, diff --git a/build/ci.go b/build/ci.go index 173a3280ce..ebce73be02 100644 --- a/build/ci.go +++ b/build/ci.go @@ -852,9 +852,9 @@ func doDockerBuildx(cmdline []string) { pass := getenvBase64("DOCKER_HUB_PASSWORD") if len(user) > 0 && len(pass) > 0 { - auther := exec.Command("docker", "login", "-u", string(user), "--password-stdin") - auther.Stdin = bytes.NewReader(pass) - build.MustRun(auther) + author := exec.Command("docker", "login", "-u", string(user), "--password-stdin") + author.Stdin = bytes.NewReader(pass) + build.MustRun(author) } // Retrieve the version infos to build and push to the following paths: // - ethereum/client-go:latest - Pushes to the master branch, Geth only diff --git a/cmd/devp2p/internal/ethtest/suite.go b/cmd/devp2p/internal/ethtest/suite.go index d710f98428..01ef49ae73 100644 --- a/cmd/devp2p/internal/ethtest/suite.go +++ b/cmd/devp2p/internal/ethtest/suite.go @@ -338,7 +338,7 @@ func (s *Suite) checkHeadersAgainstChain(req *eth.GetBlockHeadersPacket, resp *e } // collectResponses waits for n messages of type T on the given connection. -// The messsages are collected according to the 'identity' function. +// The messages are collected according to the 'identity' function. // // This function is written in a generic way to handle func collectHeaderResponses(conn *Conn, n int, identity func(*eth.BlockHeadersPacket) uint64) (map[uint64]*eth.BlockHeadersPacket, error) { @@ -665,7 +665,7 @@ func (s *Suite) TestBlockRangeUpdateInvalid(t *utesting.T) { func (s *Suite) TestBlockRangeUpdateFuture(t *utesting.T) { t.Log(`This test sends a BlockRangeUpdate that is beyond the chain head. -The node should accept the update and should not disonnect.`) +The node should accept the update and should not disconnect.`) conn, err := s.dialAndPeer(nil) if err != nil { t.Fatal(err) @@ -701,7 +701,7 @@ The node should accept the update and should not disonnect.`) func (s *Suite) TestBlockRangeUpdateHistoryExp(t *utesting.T) { t.Log(`This test sends a BlockRangeUpdate announcing incomplete (expired) history. -The node should accept the update and should not disonnect.`) +The node should accept the update and should not disconnect.`) conn, err := s.dialAndPeer(nil) if err != nil { t.Fatal(err) diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 1a2ee45291..a3abd038c1 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -4412,9 +4412,9 @@ func testInsertChainWithCutoff(t *testing.T, cutoff uint64, ancientLimit uint64, if receipts == nil || len(receipts) != 1 { t.Fatalf("Missed block receipts: %d, cutoff: %d", num, cutoffBlock.NumberU64()) } - for indx, receipt := range receipts { - receiptByLookup, err := chain.GetCanonicalReceipt(body.Transactions[indx], receipt.BlockHash, - receipt.BlockNumber.Uint64(), uint64(indx)) + for index, receipt := range receipts { + receiptByLookup, err := chain.GetCanonicalReceipt(body.Transactions[index], receipt.BlockHash, + receipt.BlockNumber.Uint64(), uint64(index)) assert.NoError(t, err) assert.Equal(t, receipt, receiptByLookup) } diff --git a/core/dao_test.go b/core/dao_test.go index 2d4a20e6b9..6ecf4cbf17 100644 --- a/core/dao_test.go +++ b/core/dao_test.go @@ -119,7 +119,7 @@ func TestDAOForkRangeExtradata(t *testing.T) { t.Fatalf("pro-fork chain didn't accepted pro-fork block: %v", err) } } - // Verify that contra-forkers accept pro-fork extra-datas after forking finishes + // Verify that contra-forkers accept pro-fork extra-data after forking finishes bc, _ := NewBlockChain(rawdb.NewMemoryDatabase(), congspec, ethash.NewFaker(), nil) defer bc.Stop() @@ -137,7 +137,7 @@ func TestDAOForkRangeExtradata(t *testing.T) { if _, err := conBc.InsertChain(blocks); err != nil { t.Fatalf("contra-fork chain didn't accept pro-fork block post-fork: %v", err) } - // Verify that pro-forkers accept contra-fork extra-datas after forking finishes + // Verify that pro-forkers accept contra-fork extra-data after forking finishes bc, _ = NewBlockChain(rawdb.NewMemoryDatabase(), progspec, ethash.NewFaker(), nil) defer bc.Stop() diff --git a/core/filtermaps/matcher.go b/core/filtermaps/matcher.go index 238723fe1d..f4d630b590 100644 --- a/core/filtermaps/matcher.go +++ b/core/filtermaps/matcher.go @@ -445,7 +445,7 @@ func (m *singleMatcherInstance) cleanMapIndices() { m.mapIndices = m.mapIndices[:j] } -// matchAny combinines a set of matchers and returns a match for every position +// matchAny combines a set of matchers and returns a match for every position // where any of the underlying matchers signaled a match. A zero-length matchAny // acts as a "wild card" that signals a potential match at every position. type matchAny []matcher diff --git a/core/rawdb/accessors_indexes.go b/core/rawdb/accessors_indexes.go index 8c8c3ec9bb..154516a6a4 100644 --- a/core/rawdb/accessors_indexes.go +++ b/core/rawdb/accessors_indexes.go @@ -563,7 +563,7 @@ func DeleteBlockLvPointers(db ethdb.KeyValueStore, blocks common.Range[uint64], } // FilterMapsRange is a storage representation of the block range covered by the -// filter maps structure and the corresponting log value index range. +// filter maps structure and the corresponding log value index range. type FilterMapsRange struct { Version uint32 HeadIndexed bool diff --git a/core/rawdb/database.go b/core/rawdb/database.go index 39e1a64e5a..11e63dd0b9 100644 --- a/core/rawdb/database.go +++ b/core/rawdb/database.go @@ -746,7 +746,7 @@ func ReadChainMetadata(db ethdb.KeyValueStore) [][]string { // is periodically called and if it returns an error then SafeDeleteRange // stops and also returns that error. The callback is not called if native // range delete is used or there are a small number of keys only. The bool -// argument passed to the callback is true if enrties have actually been +// argument passed to the callback is true if entries have actually been // deleted already. func SafeDeleteRange(db ethdb.KeyValueStore, start, end []byte, hashScheme bool, stopCallback func(bool) bool) error { if !hashScheme { diff --git a/core/state/snapshot/difflayer.go b/core/state/snapshot/difflayer.go index 1286ded7e1..9fffa07cdd 100644 --- a/core/state/snapshot/difflayer.go +++ b/core/state/snapshot/difflayer.go @@ -280,7 +280,7 @@ func (dl *diffLayer) accountRLP(hash common.Hash, depth int) ([]byte, error) { if n := len(data); n > 0 { snapshotDirtyAccountReadMeter.Mark(int64(n)) } else { - snapshotDirtyAccountInexMeter.Mark(1) + snapshotDirtyAccountIndexMeter.Mark(1) } snapshotBloomAccountTrueHitMeter.Mark(1) return data, nil @@ -345,7 +345,7 @@ func (dl *diffLayer) storage(accountHash, storageHash common.Hash, depth int) ([ if n := len(data); n > 0 { snapshotDirtyStorageReadMeter.Mark(int64(n)) } else { - snapshotDirtyStorageInexMeter.Mark(1) + snapshotDirtyStorageIndexMeter.Mark(1) } snapshotBloomStorageTrueHitMeter.Mark(1) return data, nil diff --git a/core/state/snapshot/disklayer.go b/core/state/snapshot/disklayer.go index 202e6c70ed..e5a3429764 100644 --- a/core/state/snapshot/disklayer.go +++ b/core/state/snapshot/disklayer.go @@ -132,7 +132,7 @@ func (dl *diskLayer) AccountRLP(hash common.Hash) ([]byte, error) { if n := len(blob); n > 0 { snapshotCleanAccountWriteMeter.Mark(int64(n)) } else { - snapshotCleanAccountInexMeter.Mark(1) + snapshotCleanAccountIndexMeter.Mark(1) } return blob, nil } @@ -172,7 +172,7 @@ func (dl *diskLayer) Storage(accountHash, storageHash common.Hash) ([]byte, erro if n := len(blob); n > 0 { snapshotCleanStorageWriteMeter.Mark(int64(n)) } else { - snapshotCleanStorageInexMeter.Mark(1) + snapshotCleanStorageIndexMeter.Mark(1) } return blob, nil } diff --git a/core/state/snapshot/generate_test.go b/core/state/snapshot/generate_test.go index 7fb4c152dc..91fa7305a0 100644 --- a/core/state/snapshot/generate_test.go +++ b/core/state/snapshot/generate_test.go @@ -721,7 +721,7 @@ func testGenerateWithExtraBeforeAndAfter(t *testing.T, scheme string) { <-stop } -// TestGenerateWithMalformedSnapdata tests what happes if we have some junk +// TestGenerateWithMalformedSnapdata tests what happens if we have some junk // in the snapshot database, which cannot be parsed back to an account func TestGenerateWithMalformedSnapdata(t *testing.T) { testGenerateWithMalformedSnapdata(t, rawdb.HashScheme) diff --git a/core/state/snapshot/iterator.go b/core/state/snapshot/iterator.go index cd9c225844..f0170aad9f 100644 --- a/core/state/snapshot/iterator.go +++ b/core/state/snapshot/iterator.go @@ -89,7 +89,7 @@ func (dl *diffLayer) AccountIterator(seek common.Hash) AccountIterator { index := sort.Search(len(hashes), func(i int) bool { return bytes.Compare(seek[:], hashes[i][:]) <= 0 }) - // Assemble and returned the already seeked iterator + // Assemble and returned the already sought iterator return &diffAccountIterator{ layer: dl, keys: hashes[index:], @@ -252,7 +252,7 @@ func (dl *diffLayer) StorageIterator(account common.Hash, seek common.Hash) Stor index := sort.Search(len(hashes), func(i int) bool { return bytes.Compare(seek[:], hashes[i][:]) <= 0 }) - // Assemble and returned the already seeked iterator + // Assemble and returned the already sought iterator return &diffStorageIterator{ layer: dl, account: account, diff --git a/core/state/snapshot/snapshot.go b/core/state/snapshot/snapshot.go index f0f6296433..f1a907f49b 100644 --- a/core/state/snapshot/snapshot.go +++ b/core/state/snapshot/snapshot.go @@ -36,25 +36,25 @@ import ( var ( snapshotCleanAccountHitMeter = metrics.NewRegisteredMeter("state/snapshot/clean/account/hit", nil) snapshotCleanAccountMissMeter = metrics.NewRegisteredMeter("state/snapshot/clean/account/miss", nil) - snapshotCleanAccountInexMeter = metrics.NewRegisteredMeter("state/snapshot/clean/account/inex", nil) + snapshotCleanAccountIndexMeter = metrics.NewRegisteredMeter("state/snapshot/clean/account/inex", nil) snapshotCleanAccountReadMeter = metrics.NewRegisteredMeter("state/snapshot/clean/account/read", nil) snapshotCleanAccountWriteMeter = metrics.NewRegisteredMeter("state/snapshot/clean/account/write", nil) snapshotCleanStorageHitMeter = metrics.NewRegisteredMeter("state/snapshot/clean/storage/hit", nil) snapshotCleanStorageMissMeter = metrics.NewRegisteredMeter("state/snapshot/clean/storage/miss", nil) - snapshotCleanStorageInexMeter = metrics.NewRegisteredMeter("state/snapshot/clean/storage/inex", nil) + snapshotCleanStorageIndexMeter = metrics.NewRegisteredMeter("state/snapshot/clean/storage/inex", nil) snapshotCleanStorageReadMeter = metrics.NewRegisteredMeter("state/snapshot/clean/storage/read", nil) snapshotCleanStorageWriteMeter = metrics.NewRegisteredMeter("state/snapshot/clean/storage/write", nil) snapshotDirtyAccountHitMeter = metrics.NewRegisteredMeter("state/snapshot/dirty/account/hit", nil) snapshotDirtyAccountMissMeter = metrics.NewRegisteredMeter("state/snapshot/dirty/account/miss", nil) - snapshotDirtyAccountInexMeter = metrics.NewRegisteredMeter("state/snapshot/dirty/account/inex", nil) + snapshotDirtyAccountIndexMeter = metrics.NewRegisteredMeter("state/snapshot/dirty/account/inex", nil) snapshotDirtyAccountReadMeter = metrics.NewRegisteredMeter("state/snapshot/dirty/account/read", nil) snapshotDirtyAccountWriteMeter = metrics.NewRegisteredMeter("state/snapshot/dirty/account/write", nil) snapshotDirtyStorageHitMeter = metrics.NewRegisteredMeter("state/snapshot/dirty/storage/hit", nil) snapshotDirtyStorageMissMeter = metrics.NewRegisteredMeter("state/snapshot/dirty/storage/miss", nil) - snapshotDirtyStorageInexMeter = metrics.NewRegisteredMeter("state/snapshot/dirty/storage/inex", nil) + snapshotDirtyStorageIndexMeter = metrics.NewRegisteredMeter("state/snapshot/dirty/storage/inex", nil) snapshotDirtyStorageReadMeter = metrics.NewRegisteredMeter("state/snapshot/dirty/storage/read", nil) snapshotDirtyStorageWriteMeter = metrics.NewRegisteredMeter("state/snapshot/dirty/storage/write", nil) diff --git a/core/state_transition.go b/core/state_transition.go index 0a6994505d..9335be9f7b 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -727,7 +727,7 @@ func (st *stateTransition) validateAuthorization(auth *types.SetCodeAuthorizatio return authority, fmt.Errorf("%w: %v", ErrAuthorizationInvalidSignature, err) } // Check the authority account - // 1) doesn't have code or has exisiting delegation + // 1) doesn't have code or has existing delegation // 2) matches the auth's nonce // // Note it is added to the access list even if the authorization is invalid. diff --git a/core/stateless.go b/core/stateless.go index 86d4dc304b..5cd36f1fab 100644 --- a/core/stateless.go +++ b/core/stateless.go @@ -38,7 +38,7 @@ import ( // need the other side to explicitly check. // // This method is a bit of a sore thumb here, but: -// - It cannot be placed in core/stateless, because state.New prodces a circular dep +// - It cannot be placed in core/stateless, because state.New produces a circular dep // - It cannot be placed outside of core, because it needs to construct a dud headerchain // // TODO(karalabe): Would be nice to resolve both issues above somehow and move it. diff --git a/core/txpool/blobpool/blobpool.go b/core/txpool/blobpool/blobpool.go index d33629365f..0d3ad3539c 100644 --- a/core/txpool/blobpool/blobpool.go +++ b/core/txpool/blobpool/blobpool.go @@ -107,7 +107,7 @@ const ( // notifyThreshold is the eviction priority threshold above which a transaction // is considered close enough to being includable to be announced to peers. - // Setting this to zero will disable announcements for anyting not immediately + // Setting this to zero will disable announcements for anything not immediately // includable. Setting it to -1 allows transactions that are close to being // includable, maybe already in the next block if fees go down, to be announced. @@ -1913,7 +1913,7 @@ func (p *BlobPool) addLocked(tx *types.Transaction, checkGapped bool) (err error addValidMeter.Mark(1) - // Transaction was addded successfully, but we only announce if it is (close to being) + // Transaction was added successfully, but we only announce if it is (close to being) // includable and the previous one was already announced. if p.isAnnouncable(meta) && (meta.nonce == next || (len(txs) > 1 && txs[offset-1].announced)) { meta.announced = true diff --git a/core/txpool/blobpool/blobpool_test.go b/core/txpool/blobpool/blobpool_test.go index 8032e21e8a..19bb38190f 100644 --- a/core/txpool/blobpool/blobpool_test.go +++ b/core/txpool/blobpool/blobpool_test.go @@ -241,7 +241,7 @@ func encodeForPool(tx *types.Transaction) []byte { return blob } -// makeMultiBlobTx is a utility method to construct a ramdom blob tx with +// makeMultiBlobTx is a utility method to construct a random blob tx with // certain number of blobs in its sidecar. func makeMultiBlobTx(nonce uint64, gasTipCap uint64, gasFeeCap uint64, blobFeeCap uint64, blobCount int, blobOffset int, key *ecdsa.PrivateKey, version byte) *types.Transaction { var ( @@ -558,7 +558,7 @@ func TestOpenDrops(t *testing.T) { id, _ := store.Put(blob) dangling[id] = struct{}{} } - // Insert a sequence of transactions with already passed nonces to veirfy + // Insert a sequence of transactions with already passed nonces to verify // that the entire set will get dropped (case 4). var ( filler, _ = crypto.GenerateKey() diff --git a/core/txpool/blobpool/lookup.go b/core/txpool/blobpool/lookup.go index 7607cd487a..2911d696d2 100644 --- a/core/txpool/blobpool/lookup.go +++ b/core/txpool/blobpool/lookup.go @@ -21,7 +21,7 @@ import ( ) type txMetadata struct { - id uint64 // the billy id of transction + id uint64 // the billy id of transaction size uint64 // the RLP encoded size of transaction (blobs are included) } diff --git a/core/txpool/legacypool/legacypool_test.go b/core/txpool/legacypool/legacypool_test.go index f8592ba001..49b5ec5fe7 100644 --- a/core/txpool/legacypool/legacypool_test.go +++ b/core/txpool/legacypool/legacypool_test.go @@ -2428,7 +2428,7 @@ func TestSetCodeTransactions(t *testing.T) { if err := pool.addRemoteSync(pricedSetCodeTx(0, 250000, uint256.NewInt(3000), uint256.NewInt(300), keyA, []unsignedAuth{{0, keyC}})); err != nil { t.Fatalf("%s: failed to add with remote setcode transaction: %v", name, err) } - // B should not be considred as having an in-flight delegation, so + // B should not be considered as having an in-flight delegation, so // should allow more than one pooled transaction. if err := pool.addRemoteSync(pricedTransaction(0, 100000, big.NewInt(10), keyB)); err != nil { t.Fatalf("%s: failed to replace with remote transaction: %v", name, err) diff --git a/core/vm/runtime/runtime_test.go b/core/vm/runtime/runtime_test.go index bc2ffd622d..c55e7ec3f0 100644 --- a/core/vm/runtime/runtime_test.go +++ b/core/vm/runtime/runtime_test.go @@ -475,7 +475,7 @@ func BenchmarkSimpleLoop(b *testing.B) { Op(vm.POP).Jump(lbl).Bytes() // pop return value and jump to label p, lbl = program.New().Jumpdest() - callInexistant := p. + callInexistent := p. Call(nil, 0xff, 0, 0, 0, 0, 0). Op(vm.POP).Jump(lbl).Bytes() // pop return value and jump to label @@ -515,7 +515,7 @@ func BenchmarkSimpleLoop(b *testing.B) { benchmarkNonModifyingCode(100000000, callIdentity, "call-identity-100M", "", b) benchmarkNonModifyingCode(100000000, loopingCode, "loop-100M", "", b) benchmarkNonModifyingCode(100000000, loopingCode2, "loop2-100M", "", b) - benchmarkNonModifyingCode(100000000, callInexistant, "call-nonexist-100M", "", b) + benchmarkNonModifyingCode(100000000, callInexistent, "call-nonexist-100M", "", b) benchmarkNonModifyingCode(100000000, callEOA, "call-EOA-100M", "", b) benchmarkNonModifyingCode(100000000, callRevertingContractWithInput, "call-reverting-100M", "", b) diff --git a/eth/dropper.go b/eth/dropper.go index dada5d07c0..4cbe52ed98 100644 --- a/eth/dropper.go +++ b/eth/dropper.go @@ -53,7 +53,7 @@ var ( // - during sync the Downloader handles peer connections, so dropper is disabled // - if not syncing and the peer count is close to the limit, it drops peers // randomly every peerDropInterval to make space for new peers -// - peers are dropped separately from the inboud pool and from the dialed pool +// - peers are dropped separately from the inbound pool and from the dialed pool type dropper struct { maxDialPeers int // maximum number of dialed peers maxInboundPeers int // maximum number of inbound peers diff --git a/eth/protocols/snap/sync.go b/eth/protocols/snap/sync.go index 841bfb446e..39534865c1 100644 --- a/eth/protocols/snap/sync.go +++ b/eth/protocols/snap/sync.go @@ -82,7 +82,7 @@ const ( minTrienodeHealThrottle = 1 // maxTrienodeHealThrottle is the maximum divisor for throttling trie node - // heal requests to avoid overloading the local node and exessively expanding + // heal requests to avoid overloading the local node and excessively expanding // the state trie bedth wise. maxTrienodeHealThrottle = maxTrieRequestCount diff --git a/eth/tracers/api_test.go b/eth/tracers/api_test.go index 0e62b9631d..932719bbed 100644 --- a/eth/tracers/api_test.go +++ b/eth/tracers/api_test.go @@ -1473,7 +1473,7 @@ func TestStandardTraceBlockToFile(t *testing.T) { }, }, } - txHashs := make([]common.Hash, 0, 2) + txHashes := make([]common.Hash, 0, 2) backend := newTestBackend(t, 1, genesis, func(i int, b *core.BlockGen) { b.SetCoinbase(common.Address{1}) // first tx to aa @@ -1486,7 +1486,7 @@ func TestStandardTraceBlockToFile(t *testing.T) { Data: nil, }), types.HomesteadSigner{}, key) b.AddTx(tx) - txHashs = append(txHashs, tx.Hash()) + txHashes = append(txHashes, tx.Hash()) // second tx to bb tx, _ = types.SignTx(types.NewTx(&types.LegacyTx{ Nonce: 1, @@ -1497,7 +1497,7 @@ func TestStandardTraceBlockToFile(t *testing.T) { Data: nil, }), types.HomesteadSigner{}, key) b.AddTx(tx) - txHashs = append(txHashs, tx.Hash()) + txHashes = append(txHashes, tx.Hash()) }) defer backend.teardown() @@ -1526,7 +1526,7 @@ func TestStandardTraceBlockToFile(t *testing.T) { { // test that only a specific tx is traced if specified blockNumber: rpc.LatestBlockNumber, - config: &StdTraceConfig{TxHash: txHashs[1]}, + config: &StdTraceConfig{TxHash: txHashes[1]}, want: []string{ `{"pc":0,"op":97,"gas":"0x13498","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH2"} {"pc":3,"op":80,"gas":"0x13495","gasCost":"0x2","memSize":0,"stack":["0x1"],"depth":1,"refund":0,"opName":"POP"} @@ -1563,7 +1563,7 @@ func TestTraceBadBlock(t *testing.T) { accounts = newAccounts(2) storageContract = common.HexToAddress("0x00000000000000000000000000000000deadbeef") signer = types.HomesteadSigner{} - txHashs = make([]common.Hash, 0, 2) + txHashes = make([]common.Hash, 0, 2) genesis = &core.Genesis{ Config: params.TestChainConfig, Alloc: types.GenesisAlloc{ @@ -1593,7 +1593,7 @@ func TestTraceBadBlock(t *testing.T) { Data: nil}), signer, accounts[0].key) b.AddTx(tx) - txHashs = append(txHashs, tx.Hash()) + txHashes = append(txHashes, tx.Hash()) // tx 1: call storage contract (executes PUSH1, PUSH1, SSTORE, STOP) tx, _ = types.SignTx(types.NewTx(&types.LegacyTx{ @@ -1605,7 +1605,7 @@ func TestTraceBadBlock(t *testing.T) { Data: nil}), signer, accounts[0].key) b.AddTx(tx) - txHashs = append(txHashs, tx.Hash()) + txHashes = append(txHashes, tx.Hash()) }) defer backend.teardown() @@ -1635,8 +1635,8 @@ func TestTraceBadBlock(t *testing.T) { if err := json.Unmarshal(have, &traces); err != nil { t.Fatalf("failed to unmarshal traces: %v", err) } - if traces[0].TxHash != txHashs[0] { - t.Errorf("tx 0: hash mismatch, have %v, want %v", traces[0].TxHash, txHashs[0]) + if traces[0].TxHash != txHashes[0] { + t.Errorf("tx 0: hash mismatch, have %v, want %v", traces[0].TxHash, txHashes[0]) } if traces[0].Result.Gas != params.TxGas { t.Errorf("tx 0: gas mismatch, have %d, want %d", traces[0].Result.Gas, params.TxGas) @@ -1646,8 +1646,8 @@ func TestTraceBadBlock(t *testing.T) { } // Second tx: contract call - if traces[1].TxHash != txHashs[1] { - t.Errorf("tx 1: hash mismatch, have %v, want %v", traces[1].TxHash, txHashs[1]) + if traces[1].TxHash != txHashes[1] { + t.Errorf("tx 1: hash mismatch, have %v, want %v", traces[1].TxHash, txHashes[1]) } if traces[1].Result.Failed { t.Error("tx 1: expected success, got failed") @@ -1811,7 +1811,7 @@ func TestStandardTraceBadBlockToFile(t *testing.T) { }, }, } - txHashs := make([]common.Hash, 0, 2) + txHashes := make([]common.Hash, 0, 2) backend := newTestBackend(t, 1, genesis, func(i int, b *core.BlockGen) { b.SetCoinbase(common.Address{1}) tx, _ := types.SignTx(types.NewTx(&types.LegacyTx{ @@ -1823,7 +1823,7 @@ func TestStandardTraceBadBlockToFile(t *testing.T) { Data: nil, }), types.HomesteadSigner{}, key) b.AddTx(tx) - txHashs = append(txHashs, tx.Hash()) + txHashes = append(txHashes, tx.Hash()) tx, _ = types.SignTx(types.NewTx(&types.LegacyTx{ Nonce: 1, @@ -1834,7 +1834,7 @@ func TestStandardTraceBadBlockToFile(t *testing.T) { Data: nil, }), types.HomesteadSigner{}, key) b.AddTx(tx) - txHashs = append(txHashs, tx.Hash()) + txHashes = append(txHashes, tx.Hash()) }) defer backend.teardown() @@ -1864,7 +1864,7 @@ func TestStandardTraceBadBlockToFile(t *testing.T) { }, { // Specific tx traced - config: &StdTraceConfig{TxHash: txHashs[1]}, + config: &StdTraceConfig{TxHash: txHashes[1]}, want: []string{ `{"pc":0,"op":97,"gas":"0x13498","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH2"} {"pc":3,"op":80,"gas":"0x13495","gasCost":"0x2","memSize":0,"stack":["0x1"],"depth":1,"refund":0,"opName":"POP"} diff --git a/internal/build/archive.go b/internal/build/archive.go index 645921c690..4fbb74eb3f 100644 --- a/internal/build/archive.go +++ b/internal/build/archive.go @@ -272,7 +272,7 @@ func extractFile(arpath string, armode os.FileMode, data io.Reader, dest string) return fmt.Errorf("path %q escapes archive destination", target) } - // Remove the preivously-extracted file if it exists + // Remove the previously-extracted file if it exists if err := os.RemoveAll(target); err != nil { return err } diff --git a/signer/core/cliui.go b/signer/core/cliui.go index e04077865d..bca09ae897 100644 --- a/signer/core/cliui.go +++ b/signer/core/cliui.go @@ -46,7 +46,7 @@ func (ui *CommandlineUI) RegisterUIServer(api *UIServerAPI) { } // readString reads a single line from stdin, trimming if from spaces, enforcing -// non-emptyness. +// non-emptiness. func (ui *CommandlineUI) readString() string { for { fmt.Printf("> ") diff --git a/tests/fuzzers/bn256/bn256_fuzz.go b/tests/fuzzers/bn256/bn256_fuzz.go index d53bdbb4b9..542eea46b1 100644 --- a/tests/fuzzers/bn256/bn256_fuzz.go +++ b/tests/fuzzers/bn256/bn256_fuzz.go @@ -184,7 +184,7 @@ func fuzzUnmarshalG1(input []byte) int { } return 1 } else { - panic(fmt.Sprintf("error missmatch: cf: %v g: %v gn: %v", errC, errG, errS)) + panic(fmt.Sprintf("error mismatch: cf: %v g: %v gn: %v", errC, errG, errS)) } } @@ -211,7 +211,7 @@ func fuzzUnmarshalG2(input []byte) int { } return 1 } else { - panic(fmt.Sprintf("error missmatch: cf: %v g: %v gn: %v", errC, errG, errS)) + panic(fmt.Sprintf("error mismatch: cf: %v g: %v gn: %v", errC, errG, errS)) } } diff --git a/trie/iterator_test.go b/trie/iterator_test.go index 3e0ef126be..66e1795bed 100644 --- a/trie/iterator_test.go +++ b/trie/iterator_test.go @@ -1128,7 +1128,7 @@ func TestPrefixIteratorWithDescend(t *testing.T) { // Count nodes at each level nodesVisited := 0 - leafsFound := make(map[string]bool) + leavesFound := make(map[string]bool) // First call with descend=true to enter the "a" subtree if !iter.Next(true) { @@ -1141,20 +1141,20 @@ func TestPrefixIteratorWithDescend(t *testing.T) { for i := 0; iter.Next(descendPattern[i%len(descendPattern)]); i++ { nodesVisited++ if iter.Leaf() { - leafsFound[string(iter.LeafKey())] = true + leavesFound[string(iter.LeafKey())] = true } } // We should still respect the prefix boundary even when skipping prefix := []byte("a") - for key := range leafsFound { + for key := range leavesFound { if !bytes.HasPrefix([]byte(key), prefix) { t.Errorf("Found key outside prefix when using descend=false: %s", key) } } // Should not have found "b" even if we skip some subtrees - if leafsFound["b"] { + if leavesFound["b"] { t.Error("Iterator leaked outside prefix boundary with descend=false") } }) diff --git a/trie/node_test.go b/trie/node_test.go index b4f427ca77..c19458adba 100644 --- a/trie/node_test.go +++ b/trie/node_test.go @@ -283,7 +283,7 @@ func TestNodeDifference(t *testing.T) { t.Fatalf("Expect error, got nil %d", i) } if !test.expErr && err != nil { - t.Fatalf("Unexpect error, %v", err) + t.Fatalf("Unexpected error, %v", err) } if err == nil { if !slices.Equal(indices, test.expIndices) { @@ -342,7 +342,7 @@ func TestReassembleFullNode(t *testing.T) { fn.encode(buf2) enc2 := buf2.ToBytes() if !reflect.DeepEqual(enc2, reassembled) { - t.Fatalf("Unexpeted reassembled node") + t.Fatalf("Unexpected reassembled node") } } @@ -374,7 +374,7 @@ func TestReassembleShortNode(t *testing.T) { ln.encode(buf2) enc2 := buf2.ToBytes() if !reflect.DeepEqual(enc2, reassembled) { - t.Fatalf("Unexpeted reassembled node") + t.Fatalf("Unexpected reassembled node") } } diff --git a/triedb/pathdb/difflayer.go b/triedb/pathdb/difflayer.go index 8ca3a39cf3..710cfdf04f 100644 --- a/triedb/pathdb/difflayer.go +++ b/triedb/pathdb/difflayer.go @@ -113,7 +113,7 @@ func (dl *diffLayer) account(hash common.Hash, depth int) ([]byte, error) { dirtyStateReadMeter.Mark(int64(len(blob))) if len(blob) == 0 { - stateAccountInexMeter.Mark(1) + stateAccountIndexMeter.Mark(1) } else { stateAccountExistMeter.Mark(1) } @@ -139,7 +139,7 @@ func (dl *diffLayer) storage(accountHash, storageHash common.Hash, depth int) ([ dirtyStateReadMeter.Mark(int64(len(blob))) if len(blob) == 0 { - stateStorageInexMeter.Mark(1) + stateStorageIndexMeter.Mark(1) } else { stateStorageExistMeter.Mark(1) } diff --git a/triedb/pathdb/disklayer.go b/triedb/pathdb/disklayer.go index 50c7279d0e..2f72a16005 100644 --- a/triedb/pathdb/disklayer.go +++ b/triedb/pathdb/disklayer.go @@ -187,7 +187,7 @@ func (dl *diskLayer) account(hash common.Hash, depth int) ([]byte, error) { dirtyStateHitDepthHist.Update(int64(depth)) if len(blob) == 0 { - stateAccountInexMeter.Mark(1) + stateAccountIndexMeter.Mark(1) } else { stateAccountExistMeter.Mark(1) } @@ -210,7 +210,7 @@ func (dl *diskLayer) account(hash common.Hash, depth int) ([]byte, error) { cleanStateReadMeter.Mark(int64(len(blob))) if len(blob) == 0 { - stateAccountInexMeter.Mark(1) + stateAccountIndexMeter.Mark(1) } else { stateAccountExistMeter.Mark(1) } @@ -231,8 +231,8 @@ func (dl *diskLayer) account(hash common.Hash, depth int) ([]byte, error) { cleanStateWriteMeter.Mark(int64(len(blob))) } if len(blob) == 0 { - stateAccountInexMeter.Mark(1) - stateAccountInexDiskMeter.Mark(1) + stateAccountIndexMeter.Mark(1) + stateAccountIndexDiskMeter.Mark(1) } else { stateAccountExistMeter.Mark(1) stateAccountExistDiskMeter.Mark(1) @@ -264,7 +264,7 @@ func (dl *diskLayer) storage(accountHash, storageHash common.Hash, depth int) ([ dirtyStateHitDepthHist.Update(int64(depth)) if len(blob) == 0 { - stateStorageInexMeter.Mark(1) + stateStorageIndexMeter.Mark(1) } else { stateStorageExistMeter.Mark(1) } @@ -288,7 +288,7 @@ func (dl *diskLayer) storage(accountHash, storageHash common.Hash, depth int) ([ cleanStateReadMeter.Mark(int64(len(blob))) if len(blob) == 0 { - stateStorageInexMeter.Mark(1) + stateStorageIndexMeter.Mark(1) } else { stateStorageExistMeter.Mark(1) } @@ -309,8 +309,8 @@ func (dl *diskLayer) storage(accountHash, storageHash common.Hash, depth int) ([ cleanStateWriteMeter.Mark(int64(len(blob))) } if len(blob) == 0 { - stateStorageInexMeter.Mark(1) - stateStorageInexDiskMeter.Mark(1) + stateStorageIndexMeter.Mark(1) + stateStorageIndexDiskMeter.Mark(1) } else { stateStorageExistMeter.Mark(1) stateStorageExistDiskMeter.Mark(1) diff --git a/triedb/pathdb/history_index_block_test.go b/triedb/pathdb/history_index_block_test.go index 923ae29348..4de5a41c47 100644 --- a/triedb/pathdb/history_index_block_test.go +++ b/triedb/pathdb/history_index_block_test.go @@ -222,18 +222,18 @@ func testBlockWriterDelete(t *testing.T, bitmapSize int) { } newMax := uint64(i - 1) if bw.desc.max != newMax { - t.Fatalf("Maxmium element is not matched, want: %d, got: %d", newMax, bw.desc.max) + t.Fatalf("Maximum element is not matched, want: %d, got: %d", newMax, bw.desc.max) } } } -func TestBlcokWriterDeleteWithData(t *testing.T) { - testBlcokWriterDeleteWithData(t, 0) - testBlcokWriterDeleteWithData(t, 2) - testBlcokWriterDeleteWithData(t, 34) +func TestBlockWriterDeleteWithData(t *testing.T) { + testBlockWriterDeleteWithData(t, 0) + testBlockWriterDeleteWithData(t, 2) + testBlockWriterDeleteWithData(t, 34) } -func testBlcokWriterDeleteWithData(t *testing.T, bitmapSize int) { +func testBlockWriterDeleteWithData(t *testing.T, bitmapSize int) { elements := []uint64{ 1, 5, 10, 11, 20, } diff --git a/triedb/pathdb/iterator.go b/triedb/pathdb/iterator.go index 2d333dfa1b..9ca56c6995 100644 --- a/triedb/pathdb/iterator.go +++ b/triedb/pathdb/iterator.go @@ -63,7 +63,7 @@ func newDiffAccountIterator(seek common.Hash, accountList []common.Hash, fn load index := sort.Search(len(accountList), func(i int) bool { return bytes.Compare(seek[:], accountList[i][:]) <= 0 }) - // Assemble and returned the already seeked iterator + // Assemble and returned the already sought iterator return &diffAccountIterator{ keys: accountList[index:], loadFn: fn, @@ -206,7 +206,7 @@ func newDiffStorageIterator(account common.Hash, seek common.Hash, storageList [ index := sort.Search(len(storageList), func(i int) bool { return bytes.Compare(seek[:], storageList[i][:]) <= 0 }) - // Assemble and returned the already seeked iterator + // Assemble and returned the already sought iterator return &diffStorageIterator{ account: account, keys: storageList[index:], diff --git a/triedb/pathdb/metrics.go b/triedb/pathdb/metrics.go index e01dfdfb86..e23b413521 100644 --- a/triedb/pathdb/metrics.go +++ b/triedb/pathdb/metrics.go @@ -35,10 +35,10 @@ var ( dirtyNodeWriteMeter = metrics.NewRegisteredMeter("pathdb/dirty/node/write", nil) dirtyNodeHitDepthHist = metrics.NewRegisteredHistogram("pathdb/dirty/node/depth", nil, metrics.NewExpDecaySample(1028, 0.015)) - stateAccountInexMeter = metrics.NewRegisteredMeter("pathdb/state/account/inex/total", nil) - stateStorageInexMeter = metrics.NewRegisteredMeter("pathdb/state/storage/inex/total", nil) - stateAccountInexDiskMeter = metrics.NewRegisteredMeter("pathdb/state/account/inex/disk", nil) - stateStorageInexDiskMeter = metrics.NewRegisteredMeter("pathdb/state/storage/inex/disk", nil) + stateAccountIndexMeter = metrics.NewRegisteredMeter("pathdb/state/account/inex/total", nil) + stateStorageIndexMeter = metrics.NewRegisteredMeter("pathdb/state/storage/inex/total", nil) + stateAccountIndexDiskMeter = metrics.NewRegisteredMeter("pathdb/state/account/inex/disk", nil) + stateStorageIndexDiskMeter = metrics.NewRegisteredMeter("pathdb/state/storage/inex/disk", nil) stateAccountExistMeter = metrics.NewRegisteredMeter("pathdb/state/account/exist/total", nil) stateStorageExistMeter = metrics.NewRegisteredMeter("pathdb/state/storage/exist/total", nil)