From 5a02b2d6d0a8d5c8ebf170505c681f7b19df7ed9 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Tue, 11 Oct 2022 09:37:00 +0200 Subject: [PATCH] all: fix spelling mistakes (#25961) --- accounts/manager.go | 2 +- cmd/devp2p/internal/ethtest/snap.go | 2 +- cmd/evm/internal/t8ntool/transition.go | 2 +- consensus/clique/snapshot_test.go | 2 +- core/bloombits/matcher.go | 2 +- core/state/dump.go | 2 +- core/state/snapshot/conversion.go | 2 +- core/state/snapshot/iterator_fast.go | 2 +- core/state/snapshot/iterator_test.go | 2 +- core/state/snapshot/metrics.go | 2 +- core/state/snapshot/snapshot_test.go | 4 ++-- core/state/statedb.go | 6 +++--- core/tx_list.go | 2 +- core/tx_pool.go | 4 ++-- core/tx_pool_test.go | 2 +- core/vm/contracts.go | 2 +- crypto/signature_cgo.go | 2 +- eth/catalyst/api.go | 2 +- eth/downloader/queue.go | 2 +- eth/downloader/skeleton.go | 2 +- eth/fetcher/tx_fetcher.go | 4 ++-- eth/protocols/eth/dispatcher.go | 2 +- eth/protocols/eth/handler_test.go | 2 +- eth/protocols/eth/peer.go | 2 +- eth/protocols/snap/handler.go | 4 ++-- eth/protocols/snap/range_test.go | 2 +- eth/protocols/snap/sync.go | 6 +++--- eth/tracers/internal/tracetest/calltrace_test.go | 2 +- eth/tracers/internal/tracetest/prestate_test.go | 2 +- eth/tracers/internal/tracetest/util.go | 2 +- ethclient/ethclient_test.go | 2 +- internal/ethapi/api.go | 4 ++-- internal/version/version.go | 2 +- les/downloader/resultstore.go | 2 +- les/fetcher_test.go | 2 +- les/flowcontrol/manager.go | 2 +- les/odr.go | 2 +- les/server_requests.go | 2 +- les/vflux/server/clientpool.go | 2 +- light/txpool.go | 2 +- miner/stress/1559/main.go | 2 +- mobile/interface.go | 2 +- p2p/msgrate/msgrate.go | 10 +++++----- signer/core/api.go | 4 ++-- tests/fuzzers/rangeproof/rangeproof-fuzzer.go | 2 +- tests/fuzzers/runtime/runtime_fuzz.go | 2 +- trie/proof.go | 2 +- trie/stacktrie.go | 2 +- trie/trie_test.go | 4 ++-- 49 files changed, 64 insertions(+), 64 deletions(-) diff --git a/accounts/manager.go b/accounts/manager.go index 1e111d194..a0b5c329c 100644 --- a/accounts/manager.go +++ b/accounts/manager.go @@ -257,7 +257,7 @@ func merge(slice []Wallet, wallets ...Wallet) []Wallet { return slice } -// drop is the couterpart of merge, which looks up wallets from within the sorted +// drop is the counterpart of merge, which looks up wallets from within the sorted // cache and removes the ones specified. func drop(slice []Wallet, wallets ...Wallet) []Wallet { for _, wallet := range wallets { diff --git a/cmd/devp2p/internal/ethtest/snap.go b/cmd/devp2p/internal/ethtest/snap.go index 6d5a5c17a..754d7850d 100644 --- a/cmd/devp2p/internal/ethtest/snap.go +++ b/cmd/devp2p/internal/ethtest/snap.go @@ -90,7 +90,7 @@ func (s *Suite) TestSnapGetAccountRange(t *utesting.T) { {4000, s.chain.RootAt(0), zero, ffHash, 0, zero, zero}, // A 127 block old stateroot, expected to be served {4000, s.chain.RootAt(999 - 127), zero, ffHash, 77, firstKey, common.HexToHash("0xe4c6fdef5dd4e789a2612390806ee840b8ec0fe52548f8b4efe41abb20c37aac")}, - // A root which is not actually an account root, but a storage orot + // A root which is not actually an account root, but a storage root {4000, storageRoot, zero, ffHash, 0, zero, zero}, // And some non-sensical requests diff --git a/cmd/evm/internal/t8ntool/transition.go b/cmd/evm/internal/t8ntool/transition.go index e2d9cced2..0a0ba4ea5 100644 --- a/cmd/evm/internal/t8ntool/transition.go +++ b/cmd/evm/internal/t8ntool/transition.go @@ -394,7 +394,7 @@ func (g Alloc) OnAccount(addr common.Address, dumpAccount state.DumpAccount) { g[addr] = genesisAccount } -// saveFile marshalls the object to the given file +// saveFile marshals the object to the given file func saveFile(baseDir, filename string, data interface{}) error { b, err := json.MarshalIndent(data, "", " ") if err != nil { diff --git a/consensus/clique/snapshot_test.go b/consensus/clique/snapshot_test.go index 1a3955710..66e667276 100644 --- a/consensus/clique/snapshot_test.go +++ b/consensus/clique/snapshot_test.go @@ -86,7 +86,7 @@ func (ap *testerAccountPool) sign(header *types.Header, signer string) { copy(header.Extra[len(header.Extra)-extraSeal:], sig) } -// testerVote represents a single block signed by a parcitular account, where +// testerVote represents a single block signed by a particular account, where // the account may or may not have cast a Clique vote. type testerVote struct { signer string diff --git a/core/bloombits/matcher.go b/core/bloombits/matcher.go index f2a8bda17..0d2f6f950 100644 --- a/core/bloombits/matcher.go +++ b/core/bloombits/matcher.go @@ -612,7 +612,7 @@ func (s *MatcherSession) Multiplex(batch int, wait time.Duration, mux chan chan return case <-time.After(wait): - // Throttling up, fetch whatever's available + // Throttling up, fetch whatever is available } } // Allocate as much as we can handle and request servicing diff --git a/core/state/dump.go b/core/state/dump.go index bfcc03543..d97520f08 100644 --- a/core/state/dump.go +++ b/core/state/dump.go @@ -29,7 +29,7 @@ import ( "github.com/ethereum/go-ethereum/trie" ) -// DumpConfig is a set of options to control what portions of the statewill be +// DumpConfig is a set of options to control what portions of the state will be // iterated and collected. type DumpConfig struct { SkipCode bool diff --git a/core/state/snapshot/conversion.go b/core/state/snapshot/conversion.go index 0f3934cb4..c15b17aa8 100644 --- a/core/state/snapshot/conversion.go +++ b/core/state/snapshot/conversion.go @@ -136,7 +136,7 @@ func (stat *generateStats) progressAccounts(account common.Hash, done uint64) { stat.head = account } -// finishAccounts updates the gemerator stats for the finished account range. +// finishAccounts updates the generator stats for the finished account range. func (stat *generateStats) finishAccounts(done uint64) { stat.lock.Lock() defer stat.lock.Unlock() diff --git a/core/state/snapshot/iterator_fast.go b/core/state/snapshot/iterator_fast.go index 435c28e96..1a042c7cd 100644 --- a/core/state/snapshot/iterator_fast.go +++ b/core/state/snapshot/iterator_fast.go @@ -276,7 +276,7 @@ func (fi *fastIterator) next(idx int) bool { return false } // The elem we're placing it next to has the same value, - // so whichever winds up on n+1 will need further iteraton + // so whichever winds up on n+1 will need further iteration clash = n + 1 return cur.priority < fi.iterators[n+1].priority diff --git a/core/state/snapshot/iterator_test.go b/core/state/snapshot/iterator_test.go index 2c7e876e0..7420a2dc2 100644 --- a/core/state/snapshot/iterator_test.go +++ b/core/state/snapshot/iterator_test.go @@ -819,7 +819,7 @@ func TestStorageIteratorDeletions(t *testing.T) { // only spit out 200 values eventually. // // The value-fetching benchmark is easy on the binary iterator, since it never has to reach -// down at any depth for retrieving the values -- all are on the toppmost layer +// down at any depth for retrieving the values -- all are on the topmost layer // // BenchmarkAccountIteratorTraversal/binary_iterator_keys-6 2239 483674 ns/op // BenchmarkAccountIteratorTraversal/binary_iterator_values-6 2403 501810 ns/op diff --git a/core/state/snapshot/metrics.go b/core/state/snapshot/metrics.go index 43f417a0d..b2e884588 100644 --- a/core/state/snapshot/metrics.go +++ b/core/state/snapshot/metrics.go @@ -36,7 +36,7 @@ var ( snapAccountProveCounter = metrics.NewRegisteredCounter("state/snapshot/generation/duration/account/prove", nil) // snapAccountTrieReadCounter measures time spent on the account trie iteration snapAccountTrieReadCounter = metrics.NewRegisteredCounter("state/snapshot/generation/duration/account/trieread", nil) - // snapAccountSnapReadCounter measues time spent on the snapshot account iteration + // snapAccountSnapReadCounter measures time spent on the snapshot account iteration snapAccountSnapReadCounter = metrics.NewRegisteredCounter("state/snapshot/generation/duration/account/snapread", nil) // snapAccountWriteCounter measures time spent on writing/updating/deleting accounts snapAccountWriteCounter = metrics.NewRegisteredCounter("state/snapshot/generation/duration/account/write", nil) diff --git a/core/state/snapshot/snapshot_test.go b/core/state/snapshot/snapshot_test.go index 7c8077b65..bbb2650aa 100644 --- a/core/state/snapshot/snapshot_test.go +++ b/core/state/snapshot/snapshot_test.go @@ -166,7 +166,7 @@ func TestDiskLayerExternalInvalidationPartialFlatten(t *testing.T) { if err := snaps.Cap(common.HexToHash("0x03"), 1); err != nil { t.Fatalf("failed to merge accumulator onto disk: %v", err) } - // Since the base layer was modified, ensure that data retrievald on the external reference fail + // Since the base layer was modified, ensure that data retrievals on the external reference fail if acc, err := ref.Account(common.HexToHash("0x01")); err != ErrSnapshotStale { t.Errorf("stale reference returned account: %#x (err: %v)", acc, err) } @@ -224,7 +224,7 @@ func TestDiffLayerExternalInvalidationPartialFlatten(t *testing.T) { if err := snaps.Cap(common.HexToHash("0x04"), 1); err != nil { t.Fatalf("failed to flatten diff layer into accumulator: %v", err) } - // Since the accumulator diff layer was modified, ensure that data retrievald on the external reference fail + // Since the accumulator diff layer was modified, ensure that data retrievals on the external reference fail if acc, err := ref.Account(common.HexToHash("0x01")); err != ErrSnapshotStale { t.Errorf("stale reference returned account: %#x (err: %v)", acc, err) } diff --git a/core/state/statedb.go b/core/state/statedb.go index 29a1ccf2d..72c2aede1 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -667,7 +667,7 @@ func (s *StateDB) Copy() *StateDB { // nil if object, exist := s.stateObjects[addr]; exist { // Even though the original object is dirty, we are not copying the journal, - // so we need to make sure that anyside effect the journal would have caused + // so we need to make sure that any side-effect the journal would have caused // during a commit (or similar op) is already applied to the copy. state.stateObjects[addr] = object.deepCopy(state) @@ -796,8 +796,8 @@ func (s *StateDB) Finalise(deleteEmptyObjects bool) { // resurrect an account; but the snapshotter needs both events. if s.snap != nil { s.snapDestructs[obj.addrHash] = struct{}{} // We need to maintain account deletions explicitly (will remain set indefinitely) - delete(s.snapAccounts, obj.addrHash) // Clear out any previously updated account data (may be recreated via a ressurrect) - delete(s.snapStorage, obj.addrHash) // Clear out any previously updated storage data (may be recreated via a ressurrect) + delete(s.snapAccounts, obj.addrHash) // Clear out any previously updated account data (may be recreated via a resurrect) + delete(s.snapStorage, obj.addrHash) // Clear out any previously updated storage data (may be recreated via a resurrect) } } else { obj.finalise(true) // Prefetch slots in the background diff --git a/core/tx_list.go b/core/tx_list.go index f141a03bb..274061c59 100644 --- a/core/tx_list.go +++ b/core/tx_list.go @@ -469,7 +469,7 @@ func (h *priceHeap) Pop() interface{} { } // txPricedList is a price-sorted heap to allow operating on transactions pool -// contents in a price-incrementing way. It's built opon the all transactions +// contents in a price-incrementing way. It's built upon the all transactions // in txpool but only interested in the remote part. It means only remote transactions // will be considered for tracking, sorting, eviction, etc. // diff --git a/core/tx_pool.go b/core/tx_pool.go index 940678d9b..a7142978c 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -65,7 +65,7 @@ var ( // configured for the transaction pool. ErrUnderpriced = errors.New("transaction underpriced") - // ErrTxPoolOverflow is returned if the transaction pool is full and can't accpet + // ErrTxPoolOverflow is returned if the transaction pool is full and can't accept // another remote transaction. ErrTxPoolOverflow = errors.New("txpool is full") @@ -850,7 +850,7 @@ func (pool *TxPool) AddLocals(txs []*types.Transaction) []error { } // AddLocal enqueues a single local transaction into the pool if it is valid. This is -// a convenience wrapper aroundd AddLocals. +// a convenience wrapper around AddLocals. func (pool *TxPool) AddLocal(tx *types.Transaction) error { errs := pool.AddLocals([]*types.Transaction{tx}) return errs[0] diff --git a/core/tx_pool_test.go b/core/tx_pool_test.go index 2fd0f529f..adc7e4fe1 100644 --- a/core/tx_pool_test.go +++ b/core/tx_pool_test.go @@ -2158,7 +2158,7 @@ func TestTransactionReplacementDynamicFee(t *testing.T) { stages := []string{"pending", "queued"} for _, stage := range stages { // Since state is empty, 0 nonce txs are "executable" and can go - // into pending immediately. 2 nonce txs are "happed + // into pending immediately. 2 nonce txs are "gapped" nonce := uint64(0) if stage == "queued" { nonce = 2 diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 44aa930d4..054c3b66e 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -935,7 +935,7 @@ func (c *bls12381Pairing) Run(input []byte) ([]byte, error) { return nil, errBLS12381G2PointSubgroup } - // Update pairing engine with G1 and G2 ponits + // Update pairing engine with G1 and G2 points e.AddPair(p1, p2) } // Prepare 32 byte output diff --git a/crypto/signature_cgo.go b/crypto/signature_cgo.go index bd72d97d3..3a32755f5 100644 --- a/crypto/signature_cgo.go +++ b/crypto/signature_cgo.go @@ -48,7 +48,7 @@ func SigToPub(hash, sig []byte) (*ecdsa.PublicKey, error) { // // This function is susceptible to chosen plaintext attacks that can leak // information about the private key that is used for signing. Callers must -// be aware that the given digest cannot be chosen by an adversery. Common +// be aware that the given digest cannot be chosen by an adversary. Common // solution is to hash any input before calculating the signature. // // The produced signature is in the [R || S || V] format where V is 0 or 1. diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index 2756a02e2..6653f719f 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -105,7 +105,7 @@ type ConsensusAPI struct { // problematic, so we will only track the head chain segment of a bad // chain to allow discarding progressing bad chains and side chains, // without tracking too much bad data. - invalidBlocksHits map[common.Hash]int // Emhemeral cache to track invalid blocks and their hit count + invalidBlocksHits map[common.Hash]int // Ephemeral cache to track invalid blocks and their hit count invalidTipsets map[common.Hash]*types.Header // Ephemeral cache to track invalid tipsets and their bad ancestor invalidLock sync.Mutex // Protects the invalid maps from concurrent access diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index ab3ae3d77..0b500484b 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -632,7 +632,7 @@ func (q *queue) ExpireReceipts(peer string) int { // lock is not obtained in here is that the parameters already need to access // the queue, so they already need a lock anyway. func (q *queue) expire(peer string, pendPool map[string]*fetchRequest, taskQueue *prque.Prque) int { - // Retrieve the request being expired and log an error if it's non-existnet, + // Retrieve the request being expired and log an error if it's non-existent, // as there's no order of events that should lead to such expirations. req := pendPool[peer] if req == nil { diff --git a/eth/downloader/skeleton.go b/eth/downloader/skeleton.go index 517b8378c..8dcec2292 100644 --- a/eth/downloader/skeleton.go +++ b/eth/downloader/skeleton.go @@ -35,7 +35,7 @@ import ( // scratchHeaders is the number of headers to store in a scratch space to allow // concurrent downloads. A header is about 0.5KB in size, so there is no worry // about using too much memory. The only catch is that we can only validate gaps -// afer they're linked to the head, so the bigger the scratch space, the larger +// after they're linked to the head, so the bigger the scratch space, the larger // potential for invalid headers. // // The current scratch space of 131072 headers is expected to use 64MB RAM. diff --git a/eth/fetcher/tx_fetcher.go b/eth/fetcher/tx_fetcher.go index 677a6422b..d1d62eb6e 100644 --- a/eth/fetcher/tx_fetcher.go +++ b/eth/fetcher/tx_fetcher.go @@ -154,7 +154,7 @@ type TxFetcher struct { // broadcast without needing explicit request/reply round trips. waitlist map[common.Hash]map[string]struct{} // Transactions waiting for an potential broadcast waittime map[common.Hash]mclock.AbsTime // Timestamps when transactions were added to the waitlist - waitslots map[string]map[common.Hash]struct{} // Waiting announcement sgroupped by peer (DoS protection) + waitslots map[string]map[common.Hash]struct{} // Waiting announcements grouped by peer (DoS protection) // Stage 2: Queue of transactions that waiting to be allocated to some peer // to be retrieved directly. @@ -218,7 +218,7 @@ func (f *TxFetcher) Notify(peer string, hashes []common.Hash) error { txAnnounceInMeter.Mark(int64(len(hashes))) // Skip any transaction announcements that we already know of, or that we've - // previously marked as cheap and discarded. This check is of course racey, + // previously marked as cheap and discarded. This check is of course racy, // because multiple concurrent notifies will still manage to pass it, but it's // still valuable to check here because it runs concurrent to the internal // loop, so anything caught here is time saved internally. diff --git a/eth/protocols/eth/dispatcher.go b/eth/protocols/eth/dispatcher.go index 65a935d55..3f81e045b 100644 --- a/eth/protocols/eth/dispatcher.go +++ b/eth/protocols/eth/dispatcher.go @@ -203,7 +203,7 @@ func (p *Peer) dispatcher() { } case cancelOp := <-p.reqCancel: - // Retrieve the pendign request to cancel and short circuit if it + // Retrieve the pending request to cancel and short circuit if it // has already been serviced and is not available anymore req := pending[cancelOp.id] if req == nil { diff --git a/eth/protocols/eth/handler_test.go b/eth/protocols/eth/handler_test.go index ef534ba37..8c0c59ba3 100644 --- a/eth/protocols/eth/handler_test.go +++ b/eth/protocols/eth/handler_test.go @@ -335,7 +335,7 @@ func testGetBlockBodies(t *testing.T, protocol uint) { } // Run each of the tests and verify the results against the chain for i, tt := range tests { - // Collect the hashes to request, and the response to expectva + // Collect the hashes to request, and the response to expect var ( hashes []common.Hash bodies []*BlockBody diff --git a/eth/protocols/eth/peer.go b/eth/protocols/eth/peer.go index a23726384..0a3b7bd56 100644 --- a/eth/protocols/eth/peer.go +++ b/eth/protocols/eth/peer.go @@ -188,7 +188,7 @@ func (p *Peer) markTransaction(hash common.Hash) { // not be managed directly. // // The reasons this is public is to allow packages using this protocol to write -// tests that directly send messages without having to do the asyn queueing. +// tests that directly send messages without having to do the async queueing. func (p *Peer) SendTransactions(txs types.Transactions) error { // Mark all the transactions as known, but ensure we don't overflow our limits for _, tx := range txs { diff --git a/eth/protocols/snap/handler.go b/eth/protocols/snap/handler.go index e001a3883..60f9898f4 100644 --- a/eth/protocols/snap/handler.go +++ b/eth/protocols/snap/handler.go @@ -139,7 +139,7 @@ func HandleMessage(backend Backend, peer *Peer) error { } defer msg.Discard() start := time.Now() - // Track the emount of time it takes to serve the request and run the handler + // Track the amount of time it takes to serve the request and run the handler if metrics.Enabled { h := fmt.Sprintf("%s/%s/%d/%#02x", p2p.HandleHistName, ProtocolName, peer.Version(), msg.Code) defer func(start time.Time) { @@ -343,7 +343,7 @@ func ServiceGetStorageRangesQuery(chain *core.BlockChain, req *GetStorageRangesP req.Bytes = softResponseLimit } // TODO(karalabe): Do we want to enforce > 0 accounts and 1 account if origin is set? - // TODO(karalabe): - Logging locally is not ideal as remote faulst annoy the local user + // TODO(karalabe): - Logging locally is not ideal as remote faults annoy the local user // TODO(karalabe): - Dropping the remote peer is less flexible wrt client bugs (slow is better than non-functional) // Calculate the hard limit at which to abort, even if mid storage trie diff --git a/eth/protocols/snap/range_test.go b/eth/protocols/snap/range_test.go index c6dc8fb71..3461439e5 100644 --- a/eth/protocols/snap/range_test.go +++ b/eth/protocols/snap/range_test.go @@ -95,7 +95,7 @@ func TestHashRanges(t *testing.T) { // meaningful space size for manual verification. // - The head being 0xff...f0, we have 14 hashes left in the space // - Chunking up 14 into 3 pieces is 4.(6), but we need the ceil of 5 to avoid a micro-last-chunk - // - Since the range is not divisible, the last interval will be shrter, capped at 0xff...f + // - Since the range is not divisible, the last interval will be shorter, capped at 0xff...f // - The chunk ranges thus needs to be [..0, ..5], [..6, ..b], [..c, ..f] { head: common.HexToHash("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0"), diff --git a/eth/protocols/snap/sync.go b/eth/protocols/snap/sync.go index f262824f9..6e8c450f5 100644 --- a/eth/protocols/snap/sync.go +++ b/eth/protocols/snap/sync.go @@ -70,7 +70,7 @@ const ( // and waste round trip times. If it's too high, we're capping responses and // waste bandwidth. // - // Depoyed bytecodes are currently capped at 24KB, so the minimum request + // Deployed bytecodes are currently capped at 24KB, so the minimum request // size should be maxRequestSize / 24K. Assuming that most contracts do not // come close to that, requesting 4x should be a good approximation. maxCodeRequestCount = maxRequestSize / (24 * 1024) * 4 @@ -87,8 +87,8 @@ const ( trienodeHealRateMeasurementImpact = 0.005 // minTrienodeHealThrottle is the minimum divisor for throttling trie node - // heal requests to avoid overloading the local node and exessively expanding - // the state trie bedth wise. + // heal requests to avoid overloading the local node and excessively expanding + // the state trie breadth wise. minTrienodeHealThrottle = 1 // maxTrienodeHealThrottle is the maximum divisor for throttling trie node diff --git a/eth/tracers/internal/tracetest/calltrace_test.go b/eth/tracers/internal/tracetest/calltrace_test.go index 08b935918..ca93ad95c 100644 --- a/eth/tracers/internal/tracetest/calltrace_test.go +++ b/eth/tracers/internal/tracetest/calltrace_test.go @@ -138,7 +138,7 @@ func testCallTracer(tracerName string, dirPath string, t *testing.T) { if _, err = st.TransitionDb(); err != nil { t.Fatalf("failed to execute transaction: %v", err) } - // Retrieve the trace result and compare against the etalon + // Retrieve the trace result and compare against the expected. res, err := tracer.GetResult() if err != nil { t.Fatalf("failed to retrieve trace result: %v", err) diff --git a/eth/tracers/internal/tracetest/prestate_test.go b/eth/tracers/internal/tracetest/prestate_test.go index 2873dfb23..084bcb8ed 100644 --- a/eth/tracers/internal/tracetest/prestate_test.go +++ b/eth/tracers/internal/tracetest/prestate_test.go @@ -122,7 +122,7 @@ func testPrestateDiffTracer(tracerName string, dirPath string, t *testing.T, typ if _, err = st.TransitionDb(); err != nil { t.Fatalf("failed to execute transaction: %v", err) } - // Retrieve the trace result and compare against the etalon + // Retrieve the trace result and compare against the expected res, err := tracer.GetResult() if err != nil { t.Fatalf("failed to retrieve trace result: %v", err) diff --git a/eth/tracers/internal/tracetest/util.go b/eth/tracers/internal/tracetest/util.go index b75d785a0..f56d9246b 100644 --- a/eth/tracers/internal/tracetest/util.go +++ b/eth/tracers/internal/tracetest/util.go @@ -6,7 +6,7 @@ import ( "strings" "unicode" - // Force-load native and js pacakges, to trigger registration + // Force-load native and js packages, to trigger registration _ "github.com/ethereum/go-ethereum/eth/tracers/js" _ "github.com/ethereum/go-ethereum/eth/tracers/native" ) diff --git a/ethclient/ethclient_test.go b/ethclient/ethclient_test.go index 67b1fde75..8bd8b0614 100644 --- a/ethclient/ethclient_test.go +++ b/ethclient/ethclient_test.go @@ -392,7 +392,7 @@ func testTransactionInBlockInterrupted(t *testing.T, client *rpc.Client) { t.Fatalf("unexpected error: %v", err) } - // Test tx in block interupted. + // Test tx in block interrupted. ctx, cancel := context.WithCancel(context.Background()) cancel() tx, err := ec.TransactionInBlock(ctx, block.Hash(), 0) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 64b389612..1a2f8bdd5 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -456,7 +456,7 @@ func (s *PersonalAccountAPI) signTransaction(ctx context.Context, args *Transact // passwd isn't able to decrypt the key it fails. func (s *PersonalAccountAPI) SendTransaction(ctx context.Context, args TransactionArgs, passwd string) (common.Hash, error) { if args.Nonce == nil { - // Hold the addresse's mutex around signing to prevent concurrent assignment of + // Hold the mutex around signing to prevent concurrent assignment of // the same nonce to multiple accounts. s.nonceLock.LockAddr(args.from()) defer s.nonceLock.UnlockAddr(args.from()) @@ -1719,7 +1719,7 @@ func (s *TransactionAPI) SendTransaction(ctx context.Context, args TransactionAr } if args.Nonce == nil { - // Hold the addresse's mutex around signing to prevent concurrent assignment of + // Hold the mutex around signing to prevent concurrent assignment of // the same nonce to multiple accounts. s.nonceLock.LockAddr(args.from()) defer s.nonceLock.UnlockAddr(args.from()) diff --git a/internal/version/version.go b/internal/version/version.go index 4959102f7..0daea02b5 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -95,7 +95,7 @@ func Info() (version, vcs string) { // versionInfo returns version information for the currently executing // implementation. // -// Depending on how the code is instansiated, it returns different amounts of +// Depending on how the code is instantiated, it returns different amounts of // information. If it is unable to determine which module is related to our // package it falls back to the hardcoded values in the params package. func versionInfo(info *debug.BuildInfo) string { diff --git a/les/downloader/resultstore.go b/les/downloader/resultstore.go index a550f8c10..7fcade294 100644 --- a/les/downloader/resultstore.go +++ b/les/downloader/resultstore.go @@ -142,7 +142,7 @@ func (r *resultStore) HasCompletedItems() bool { // countCompleted returns the number of items ready for delivery, stopping at // the first non-complete item. // -// The mthod assumes (at least) rlock is held. +// The method assumes (at least) rlock is held. func (r *resultStore) countCompleted() int { // We iterate from the already known complete point, and see // if any more has completed since last count diff --git a/les/fetcher_test.go b/les/fetcher_test.go index 6a17e7375..2f3a80aa5 100644 --- a/les/fetcher_test.go +++ b/les/fetcher_test.go @@ -282,7 +282,7 @@ func testInvalidAnnounces(t *testing.T, protocol int) { peer.cpeer.sendAnnounce(announce) <-done // Wait syncing - // Ensure the bad peer is evicited + // Ensure the bad peer is evicted if c.handler.backend.peers.len() != 0 { t.Fatalf("Failed to evict invalid peer") } diff --git a/les/flowcontrol/manager.go b/les/flowcontrol/manager.go index 10b6615e0..497f91eed 100644 --- a/les/flowcontrol/manager.go +++ b/les/flowcontrol/manager.go @@ -223,7 +223,7 @@ func (cm *ClientManager) processed(node *ClientNode, maxCost, realCost uint64, n cm.updateBuffer(node, int64(maxCost-realCost), now) } -// updateBuffer recalulates the corrected buffer value, adds the given value to it +// updateBuffer recalculates the corrected buffer value, adds the given value to it // and updates the node's actual buffer value if possible func (cm *ClientManager) updateBuffer(node *ClientNode, add int64, now mclock.AbsTime) { cm.lock.Lock() diff --git a/les/odr.go b/les/odr.go index 2643a5347..da2121fc5 100644 --- a/les/odr.go +++ b/les/odr.go @@ -119,7 +119,7 @@ func (h peerByTxHistory) Less(i, j int) bool { func (h peerByTxHistory) Swap(i, j int) { h[i], h[j] = h[j], h[i] } const ( - maxTxStatusRetry = 3 // The maximum retrys will be made for tx status request. + maxTxStatusRetry = 3 // The maximum retries will be made for tx status request. maxTxStatusCandidates = 5 // The maximum les servers the tx status requests will be sent to. ) diff --git a/les/server_requests.go b/les/server_requests.go index b0eb2371e..aa9b70899 100644 --- a/les/server_requests.go +++ b/les/server_requests.go @@ -434,7 +434,7 @@ func handleGetProofs(msg Decoder) (serveRequestFn, uint64, uint64, error) { continue } } - // Prove the user's request from the account or stroage trie + // Prove the user's request from the account or storage trie if err := trie.Prove(request.Key, request.FromLevel, nodes); err != nil { p.Log().Warn("Failed to prove state request", "block", header.Number, "hash", header.Hash(), "err", err) continue diff --git a/les/vflux/server/clientpool.go b/les/vflux/server/clientpool.go index 734d74f45..a525f8636 100644 --- a/les/vflux/server/clientpool.go +++ b/les/vflux/server/clientpool.go @@ -53,7 +53,7 @@ var ( // each client can have several minutes of connection time. // // Balances of disconnected clients are stored in nodeDB including positive balance -// and negative banalce. Boeth positive balance and negative balance will decrease +// and negative balance. Both positive balance and negative balance will decrease // exponentially. If the balance is low enough, then the record will be dropped. type ClientPool struct { *priorityPool diff --git a/light/txpool.go b/light/txpool.go index 1daeea0ad..0de132788 100644 --- a/light/txpool.go +++ b/light/txpool.go @@ -182,7 +182,7 @@ func (pool *TxPool) checkMinedTxs(ctx context.Context, hash common.Hash, number } // If some transactions have been mined, write the needed data to disk and update if list != nil { - // Retrieve all the receipts belonging to this block and write the loopup table + // Retrieve all the receipts belonging to this block and write the lookup table if _, err := GetBlockReceipts(ctx, pool.odr, hash, number); err != nil { // ODR caches, ignore results return err } diff --git a/miner/stress/1559/main.go b/miner/stress/1559/main.go index 9c1ab0f4a..2e0a4f6c7 100644 --- a/miner/stress/1559/main.go +++ b/miner/stress/1559/main.go @@ -169,7 +169,7 @@ func makeTransaction(nonce uint64, privKey *ecdsa.PrivateKey, signer types.Signe if baseFee == nil { baseFee = new(big.Int).SetInt64(int64(rand.Int31())) } - // Generate the feecap, 75% valid feecap and 25% unguaranted. + // Generate the feecap, 75% valid feecap and 25% unguaranteed. var gasFeeCap *big.Int if rand.Intn(4) == 0 { rand.Read(buf) diff --git a/mobile/interface.go b/mobile/interface.go index d5200d5b1..132f7ac9a 100644 --- a/mobile/interface.go +++ b/mobile/interface.go @@ -31,7 +31,7 @@ import ( // Since it's impossible to get the arbitrary-ness converted between Go and mobile // platforms, we're using explicit getters and setters for the conversions. There // is of course no point in enumerating everything, just enough to support the -// contract bindins requiring client side generated code. +// contract bindings requiring client side generated code. type Interface struct { object interface{} } diff --git a/p2p/msgrate/msgrate.go b/p2p/msgrate/msgrate.go index adc3758f5..ff29c9620 100644 --- a/p2p/msgrate/msgrate.go +++ b/p2p/msgrate/msgrate.go @@ -73,7 +73,7 @@ const rttMinConfidence = 0.1 const ttlScaling = 3 // ttlLimit is the maximum timeout allowance to prevent reaching crazy numbers -// if some unforeseen network events shappen. As much as we try to hone in on +// if some unforeseen network events happen. As much as we try to hone in on // the most optimal values, it doesn't make any sense to go above a threshold, // even if everything is slow and screwy. const ttlLimit = time.Minute @@ -92,9 +92,9 @@ const tuningImpact = 0.25 // Tracker estimates the throughput capacity of a peer with regard to each data // type it can deliver. The goal is to dynamically adjust request sizes to max -// out network throughput without overloading either the peer or th elocal node. +// out network throughput without overloading either the peer or the local node. // -// By tracking in real time the latencies and bandiwdths peers exhibit for each +// By tracking in real time the latencies and bandwidths peers exhibit for each // packet type, it's possible to prevent overloading by detecting a slowdown on // one type when another type is pushed too hard. // @@ -214,7 +214,7 @@ type Trackers struct { // confidence represents the probability that the estimated roundtrip value // is the real one across all our peers. The confidence value is used as an // impact factor of new measurements on old estimates. As our connectivity - // stabilizes, this value gravitates towards 1, new measurements havinng + // stabilizes, this value gravitates towards 1, new measurements having // almost no impact. If there's a large peer churn and few peers, then new // measurements will impact it more. The confidence is increased with every // packet and dropped with every new connection. @@ -316,7 +316,7 @@ func (t *Trackers) medianRoundTrip() time.Duration { } // MeanCapacities returns the capacities averaged across all the added trackers. -// The purpos of the mean capacities are to initialize a new peer with some sane +// The purpose of the mean capacities are to initialize a new peer with some sane // starting values that it will hopefully outperform. If the mean overshoots, the // peer will be cut back to minimal capacity and given another chance. func (t *Trackers) MeanCapacities() map[uint64]float64 { diff --git a/signer/core/api.go b/signer/core/api.go index f10f03d83..61793a0e5 100644 --- a/signer/core/api.go +++ b/signer/core/api.go @@ -409,7 +409,7 @@ func (api *SignerAPI) List(ctx context.Context) ([]common.Address, error) { // New creates a new password protected Account. The private key is protected with // the given password. Users are responsible to backup the private key that is stored -// in the keystore location thas was specified when this API was created. +// in the keystore location that was specified when this API was created. func (api *SignerAPI) New(ctx context.Context) (common.Address, error) { if be := api.am.Backends(keystore.KeyStoreType); len(be) == 0 { return common.Address{}, errors.New("password based accounts not supported") @@ -635,7 +635,7 @@ func (api *SignerAPI) SignGnosisSafeTx(ctx context.Context, signerAddress common gnosisTx.Signature = signature gnosisTx.SafeTxHash = common.BytesToHash(preimage) - gnosisTx.Sender = *checkSummedSender // Must be checksumed to be accepted by relay + gnosisTx.Sender = *checkSummedSender // Must be checksummed to be accepted by relay return &gnosisTx, nil } diff --git a/tests/fuzzers/rangeproof/rangeproof-fuzzer.go b/tests/fuzzers/rangeproof/rangeproof-fuzzer.go index 70f26be71..bca93bbe1 100644 --- a/tests/fuzzers/rangeproof/rangeproof-fuzzer.go +++ b/tests/fuzzers/rangeproof/rangeproof-fuzzer.go @@ -179,7 +179,7 @@ func (f *fuzzer) fuzz() int { return ok } -// Fuzz is the fuzzing entryy-point. +// Fuzz is the fuzzing entry-point. // The function must return // // - 1 if the fuzzer should increase priority of the diff --git a/tests/fuzzers/runtime/runtime_fuzz.go b/tests/fuzzers/runtime/runtime_fuzz.go index 9b9604575..b30e9243d 100644 --- a/tests/fuzzers/runtime/runtime_fuzz.go +++ b/tests/fuzzers/runtime/runtime_fuzz.go @@ -22,7 +22,7 @@ import ( // Fuzz is the basic entry point for the go-fuzz tool // -// This returns 1 for valid parsable/runable code, 0 +// This returns 1 for valid parse:able/runnable code, 0 // for invalid opcode. func Fuzz(input []byte) int { _, _, err := runtime.Execute(input, input, &runtime.Config{ diff --git a/trie/proof.go b/trie/proof.go index 8e706f886..af49ce36b 100644 --- a/trie/proof.go +++ b/trie/proof.go @@ -373,7 +373,7 @@ func unset(parent node, child node, key []byte, pos int, removeLeft bool) error if removeLeft { if bytes.Compare(cld.Key, key[pos:]) < 0 { // The key of fork shortnode is less than the path - // (it belongs to the range), unset the entrie + // (it belongs to the range), unset the entire // branch. The parent must be a fullnode. fn := parent.(*fullNode) fn.Children[key[pos-1]] = nil diff --git a/trie/stacktrie.go b/trie/stacktrie.go index d37375d35..2df2cd6ed 100644 --- a/trie/stacktrie.go +++ b/trie/stacktrie.go @@ -494,7 +494,7 @@ func (st *StackTrie) Hash() (h common.Hash) { return h } -// Commit will firstly hash the entrie trie if it's still not hashed +// Commit will firstly hash the entire trie if it's still not hashed // and then commit all nodes to the associated database. Actually most // of the trie nodes MAY have been committed already. The main purpose // here is to commit the root node. diff --git a/trie/trie_test.go b/trie/trie_test.go index d2a599ffd..832546b1e 100644 --- a/trie/trie_test.go +++ b/trie/trie_test.go @@ -609,7 +609,7 @@ func benchUpdate(b *testing.B, e binary.ByteOrder) *Trie { } // Benchmarks the trie hashing. Since the trie caches the result of any operation, -// we cannot use b.N as the number of hashing rouns, since all rounds apart from +// we cannot use b.N as the number of hashing rounds, since all rounds apart from // the first one will be NOOP. As such, we'll use b.N as the number of account to // insert into the trie before measuring the hashing. // BenchmarkHash-6 288680 4561 ns/op 682 B/op 9 allocs/op @@ -644,7 +644,7 @@ func BenchmarkHash(b *testing.B) { } // Benchmarks the trie Commit following a Hash. Since the trie caches the result of any operation, -// we cannot use b.N as the number of hashing rouns, since all rounds apart from +// we cannot use b.N as the number of hashing rounds, since all rounds apart from // the first one will be NOOP. As such, we'll use b.N as the number of account to // insert into the trie before measuring the hashing. func BenchmarkCommitAfterHash(b *testing.B) {