diff --git a/accounts/abi/bind/bind_test.go b/accounts/abi/bind/bind_test.go index 1289b4c8b1..318247b6cf 100644 --- a/accounts/abi/bind/bind_test.go +++ b/accounts/abi/bind/bind_test.go @@ -1677,7 +1677,7 @@ var bindTests = []struct { } sim.Commit() - // This test the existence of the free retreiver call for view and pure functions + // This test the existence of the free retriever call for view and pure functions if num, err := pav.PureFunc(nil); err != nil { t.Fatalf("Failed to call anonymous field retriever: %v", err) } else if num.Cmp(big.NewInt(42)) != 0 { diff --git a/accounts/keystore/watch.go b/accounts/keystore/watch.go index 11468aaca1..20718e7f77 100644 --- a/accounts/keystore/watch.go +++ b/accounts/keystore/watch.go @@ -130,7 +130,7 @@ func (w *watcher) loop() { return } - log.Info("Filsystem watcher error", "err", err) + log.Info("Filesystem watcher error", "err", err) case <-debounce.C: w.ac.scanAccounts() diff --git a/accounts/scwallet/hub.go b/accounts/scwallet/hub.go index 062a2a770c..c01959371b 100644 --- a/accounts/scwallet/hub.go +++ b/accounts/scwallet/hub.go @@ -256,7 +256,7 @@ func (hub *Hub) refreshWallets() { continue } - // Card connected, start tracking in amongs the wallets + // Card connected, start tracking in amongst the wallets hub.wallets[reader] = wallet events = append(events, accounts.WalletEvent{Wallet: wallet, Kind: accounts.WalletArrived}) } diff --git a/build/ci.go b/build/ci.go index 4f39782242..67cdf373ba 100644 --- a/build/ci.go +++ b/build/ci.go @@ -145,7 +145,7 @@ var ( // // This version is fine to be old and full of security holes, we just use it // to build the latest Go. Don't change it. If it ever becomes insufficient, - // we need to switch over to a recursive builder to jumpt across supported + // we need to switch over to a recursive builder to jump across supported // versions. gobootVersion = "1.19.6" ) diff --git a/consensus/bor/heimdall/client_test.go b/consensus/bor/heimdall/client_test.go index 737875028c..0fa7665048 100644 --- a/consensus/bor/heimdall/client_test.go +++ b/consensus/bor/heimdall/client_test.go @@ -256,8 +256,8 @@ func TestFetchShutdown(t *testing.T) { // Expect this to fail due to timeout _, err = client.FetchCheckpoint(ctx, -1) - require.Equal(t, "context deadline exceeded", err.Error(), "expect the function error to be a context deadline exeeded error") - require.Equal(t, "context deadline exceeded", ctx.Err().Error(), "expect the ctx error to be a context deadline exeeded error") + require.Equal(t, "context deadline exceeded", err.Error(), "expect the function error to be a context deadline exceeded error") + require.Equal(t, "context deadline exceeded", ctx.Err().Error(), "expect the ctx error to be a context deadline exceeded error") cancel() @@ -346,7 +346,7 @@ func TestContext(t *testing.T) { select { case <-ctx.Done(): // Expect this to never occur, throw explicit error - errCh <- errors.New("unexpectecd call to `ctx.Done()`") + errCh <- errors.New("unexpected call to `ctx.Done()`") case <-time.After(2 * time.Second): // Case for safely exiting the tests errCh <- nil diff --git a/core/blockchain.go b/core/blockchain.go index b63ab6378c..39b7fb5ec7 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -694,7 +694,7 @@ func (bc *BlockChain) SetHead(head uint64) error { block := bc.GetBlock(header.Hash(), header.Number.Uint64()) if block == nil { - // This should never happen. In practice, previsouly currentBlock + // This should never happen. In practice, previously currentBlock // contained the entire block whereas now only a "marker", so there // is an ever so slight chance for a race we should handle. log.Error("Current block not found in database", "block", header.Number, "hash", header.Hash()) @@ -719,7 +719,7 @@ func (bc *BlockChain) SetHeadWithTimestamp(timestamp uint64) error { block := bc.GetBlock(header.Hash(), header.Number.Uint64()) if block == nil { - // This should never happen. In practice, previsouly currentBlock + // This should never happen. In practice, previously currentBlock // contained the entire block whereas now only a "marker", so there // is an ever so slight chance for a race we should handle. log.Error("Current block not found in database", "block", header.Number, "hash", header.Hash()) @@ -2055,7 +2055,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error) // The chain importer is starting and stopping trie prefetchers. If a bad // block or other error is hit however, an early return may not properly // terminate the background threads. This defer ensures that we clean up - // and dangling prefetcher, without defering each and holding on live refs. + // and dangling prefetcher, without deferring each and holding on live refs. if activeState != nil { activeState.StopPrefetcher() } diff --git a/core/rawdb/bor_receipt.go b/core/rawdb/bor_receipt.go index 456000f821..68a436a081 100644 --- a/core/rawdb/bor_receipt.go +++ b/core/rawdb/bor_receipt.go @@ -76,7 +76,7 @@ func ReadRawBorReceipt(db ethdb.Reader, hash common.Hash, number uint64) *types. } // ReadBorReceipt retrieves all the bor block receipts belonging to a block, including -// its correspoinding metadata fields. If it is unable to populate these metadata +// its corresponding metadata fields. If it is unable to populate these metadata // fields then nil is returned. func ReadBorReceipt(db ethdb.Reader, hash common.Hash, number uint64, config *params.ChainConfig) *types.Receipt { if config != nil && config.Bor != nil && config.Bor.Sprint != nil && !config.Bor.IsSprintStart(number) { diff --git a/core/rawdb/database.go b/core/rawdb/database.go index 3aaa6fcf3e..ac88e7eb8e 100644 --- a/core/rawdb/database.go +++ b/core/rawdb/database.go @@ -259,7 +259,7 @@ func NewDatabaseWithFreezer(db ethdb.KeyValueStore, ancient string, namespace st break } } - // We are about to exit on error. Print database metdata beore exiting + // We are about to exit on error. Print database metadata before exiting printChainMetadata(db) return nil, fmt.Errorf("gap in the chain between ancients [0 - #%d] and leveldb [#%d - #%d] ", @@ -669,7 +669,7 @@ func printChainMetadata(db ethdb.KeyValueStore) { fmt.Fprintf(os.Stderr, "\n\n") } -// ReadChainMetadata returns a set of key/value pairs that contains informatin +// ReadChainMetadata returns a set of key/value pairs that contains information // about the database chain status. This can be used for diagnostic purposes // when investigating the state of the node. func ReadChainMetadata(db ethdb.KeyValueStore) [][]string { diff --git a/core/rawdb/databases_64bit.go b/core/rawdb/databases_64bit.go index ae2ba7f2a0..9d7a620d5c 100644 --- a/core/rawdb/databases_64bit.go +++ b/core/rawdb/databases_64bit.go @@ -23,7 +23,7 @@ import ( "github.com/ethereum/go-ethereum/ethdb/pebble" ) -// Pebble is unsuported on 32bit architecture +// Pebble is unsupported on 32bit architecture const PebbleEnabled = true // NewPebbleDBDatabase creates a persistent key-value database without a freezer diff --git a/core/rawdb/freezer_table_test.go b/core/rawdb/freezer_table_test.go index d680b41c29..c5f1e32c80 100644 --- a/core/rawdb/freezer_table_test.go +++ b/core/rawdb/freezer_table_test.go @@ -917,7 +917,7 @@ func getChunk(size int, b int) []byte { } // TODO (?) -// - test that if we remove several head-files, aswell as data last data-file, +// - test that if we remove several head-files, as well as data last data-file, // the index is truncated accordingly // Right now, the freezer would fail on these conditions: // 1. have data files d0, d1, d2, d3 diff --git a/core/state/pruner/pruner.go b/core/state/pruner/pruner.go index 64c4a3a6eb..5a4fb8a1b7 100644 --- a/core/state/pruner/pruner.go +++ b/core/state/pruner/pruner.go @@ -118,7 +118,7 @@ func prune(snaptree *snapshot.Tree, root common.Hash, maindb ethdb.Database, sta // the trie nodes(and codes) belong to the active state will be filtered // out. A very small part of stale tries will also be filtered because of // the false-positive rate of bloom filter. But the assumption is held here - // that the false-positive is low enough(~0.05%). The probablity of the + // that the false-positive is low enough(~0.05%). The probability of the // dangling node is the state root is super low. So the dangling nodes in // theory will never ever be visited again. var ( diff --git a/core/state/snapshot/difflayer.go b/core/state/snapshot/difflayer.go index 2df11a88f7..76fce22d1c 100644 --- a/core/state/snapshot/difflayer.go +++ b/core/state/snapshot/difflayer.go @@ -43,7 +43,7 @@ var ( aggregatorMemoryLimit = uint64(4 * 1024 * 1024) // aggregatorItemLimit is an approximate number of items that will end up - // in the agregator layer before it's flushed out to disk. A plain account + // in the aggregator layer before it's flushed out to disk. A plain account // weighs around 14B (+hash), a storage slot 32B (+hash), a deleted slot // 0B (+hash). Slots are mostly set/unset in lockstep, so that average at // 16B (+hash). All in all, the average entry seems to be 15+32=47B. Use a diff --git a/core/state/snapshot/disklayer_test.go b/core/state/snapshot/disklayer_test.go index 29e7e37a85..79d920eaba 100644 --- a/core/state/snapshot/disklayer_test.go +++ b/core/state/snapshot/disklayer_test.go @@ -141,7 +141,7 @@ func TestDiskMerge(t *testing.T) { // Retrieve all the data through the disk layer and validate it base = snaps.Snapshot(diffRoot) if _, ok := base.(*diskLayer); !ok { - t.Fatalf("update not flattend into the disk layer") + t.Fatalf("update not flattened into the disk layer") } // assertAccount ensures that an account matches the given blob. @@ -374,7 +374,7 @@ func TestDiskPartialMerge(t *testing.T) { // Retrieve all the data through the disk layer and validate it base = snaps.Snapshot(diffRoot) if _, ok := base.(*diskLayer); !ok { - t.Fatalf("test %d: update not flattend into the disk layer", i) + t.Fatalf("test %d: update not flattened into the disk layer", i) } assertAccount(accNoModNoCache, accNoModNoCache[:]) diff --git a/core/state/sync_test.go b/core/state/sync_test.go index d9f7736680..7e4bf9cb3e 100644 --- a/core/state/sync_test.go +++ b/core/state/sync_test.go @@ -229,7 +229,7 @@ func testIterativeStateSync(t *testing.T, count int, commit bool, bypath bool) { stTrie, err := trie.New(id, srcDb.TrieDB()) if err != nil { - t.Fatalf("failed to retriev storage trie for path %x: %v", node.syncPath[1], err) + t.Fatalf("failed to retrieve storage trie for path %x: %v", node.syncPath[1], err) } data, _, err := stTrie.GetNode(node.syncPath[1]) diff --git a/core/txpool/blobpool/blobpool.go b/core/txpool/blobpool/blobpool.go index 8edca18122..d3ada76e82 100644 --- a/core/txpool/blobpool/blobpool.go +++ b/core/txpool/blobpool/blobpool.go @@ -458,7 +458,7 @@ func (p *BlobPool) parseTransaction(id uint64, size uint32, blob []byte) error { item := new(blobTx) if err := rlp.DecodeBytes(blob, item); err != nil { // This path is impossible unless the disk data representation changes - // across restarts. For that ever unprobable case, recover gracefully + // across restarts. For that ever improbable case, recover gracefully // by ignoring this data entry. log.Error("Failed to decode blob pool entry", "id", id, "err", err) return err @@ -468,7 +468,7 @@ func (p *BlobPool) parseTransaction(id uint64, size uint32, blob []byte) error { sender, err := p.signer.Sender(item.Tx) if err != nil { // This path is impossible unless the signature validity changes across - // restarts. For that ever unprobable case, recover gracefully by ignoring + // restarts. For that ever improbable case, recover gracefully by ignoring // this data entry. log.Error("Failed to recover blob tx sender", "id", id, "hash", item.Tx.Hash(), "err", err) return err @@ -708,7 +708,7 @@ func (p *BlobPool) recheck(addr common.Address, inclusions map[common.Hash]uint6 // offload removes a tracked blob transaction from the pool and moves it into the // limbo for tracking until finality. // -// The method may log errors for various unexpcted scenarios but will not return +// The method may log errors for various unexpected scenarios but will not return // any of it since there's no clear error case. Some errors may be due to coding // issues, others caused by signers mining MEV stuff or swapping transactions. In // all cases, the pool needs to continue operating. @@ -735,7 +735,7 @@ func (p *BlobPool) offload(addr common.Address, nonce uint64, id uint64, inclusi } // Reset implements txpool.SubPool, allowing the blob pool's internal state to be -// kept in sync with the main transacion pool's internal state. +// kept in sync with the main transaction pool's internal state. func (p *BlobPool) Reset(oldHead, newHead *types.Header) { waitStart := time.Now() p.lock.Lock() @@ -939,7 +939,7 @@ func (p *BlobPool) reinject(addr common.Address, tx *types.Transaction) { log.Error("Failed to write transaction into storage", "hash", tx.Hash(), "err", err) return } - // Update the indixes and metrics + // Update the indexes and metrics meta := newBlobTxMeta(id, p.store.Size(id), tx) if _, ok := p.index[addr]; !ok { @@ -959,7 +959,7 @@ func (p *BlobPool) reinject(addr common.Address, tx *types.Transaction) { } // SetGasTip implements txpool.SubPool, allowing the blob pool's gas requirements -// to be kept in sync with the main transacion pool's gas requirements. +// to be kept in sync with the main transaction pool's gas requirements. func (p *BlobPool) SetGasTip(tip *big.Int) { p.lock.Lock() defer p.lock.Unlock() @@ -1153,7 +1153,7 @@ func (p *BlobPool) Get(hash common.Hash) *txpool.Transaction { } // Add inserts a set of blob transactions into the pool if they pass validation (both -// consensus validity and pool restictions). +// consensus validity and pool restrictions). func (p *BlobPool) Add(txs []*txpool.Transaction, local bool, sync bool) []error { errs := make([]error, len(txs)) for i, tx := range txs { @@ -1163,7 +1163,7 @@ func (p *BlobPool) Add(txs []*txpool.Transaction, local bool, sync bool) []error } // Add inserts a new blob transaction into the pool if it passes validation (both -// consensus validity and pool restictions). +// consensus validity and pool restrictions). func (p *BlobPool) add(tx *types.Transaction, blobs []kzg4844.Blob, commits []kzg4844.Commitment, proofs []kzg4844.Proof) (err error) { // The blob pool blocks on adding a transaction. This is because blob txs are // only even pulled form the network, so this method will act as the overload diff --git a/core/txpool/blobpool/blobpool_test.go b/core/txpool/blobpool/blobpool_test.go index 33826c7338..9e33eaefef 100644 --- a/core/txpool/blobpool/blobpool_test.go +++ b/core/txpool/blobpool/blobpool_test.go @@ -593,9 +593,9 @@ func TestOpenDrops(t *testing.T) { verifyPoolInternals(t, pool) } -// Tests that transactions loaded from disk are indexed corrently. +// Tests that transactions loaded from disk are indexed correctly. // -// - 1. Transactions must be groupped by sender, sorted by nonce +// - 1. Transactions must be grouped by sender, sorted by nonce // - 2. Eviction thresholds are calculated correctly for the sequences // - 3. Balance usage of an account is totals across all transactions func TestOpenIndex(t *testing.T) { @@ -1208,7 +1208,7 @@ func TestAdd(t *testing.T) { keys[acc], _ = crypto.GenerateKey() addrs[acc] = crypto.PubkeyToAddress(keys[acc].PublicKey) - // Seed the state database with this acocunt + // Seed the state database with this account statedb.AddBalance(addrs[acc], new(big.Int).SetUint64(seed.balance)) statedb.SetNonce(addrs[acc], seed.nonce) diff --git a/core/txpool/blobpool/limbo.go b/core/txpool/blobpool/limbo.go index 4cb5042c2b..e7f49109bf 100644 --- a/core/txpool/blobpool/limbo.go +++ b/core/txpool/blobpool/limbo.go @@ -57,7 +57,7 @@ func newLimbo(datadir string) (*limbo, error) { index: make(map[common.Hash]uint64), groups: make(map[uint64]map[uint64]common.Hash), } - // Index all limboed blobs on disk and delete anything inprocessable + // Index all limboed blobs on disk and delete anything unprocessable var fails []uint64 index := func(id uint64, size uint32, data []byte) { if l.parseBlob(id, data) != nil { @@ -93,7 +93,7 @@ func (l *limbo) parseBlob(id uint64, data []byte) error { item := new(limboBlob) if err := rlp.DecodeBytes(data, item); err != nil { // This path is impossible unless the disk data representation changes - // across restarts. For that ever unprobable case, recover gracefully + // across restarts. For that ever improbable case, recover gracefully // by ignoring this data entry. log.Error("Failed to decode blob limbo entry", "id", id, "err", err) return err @@ -176,7 +176,7 @@ func (l *limbo) pull(tx common.Hash) ([]kzg4844.Blob, []kzg4844.Commitment, []kz // update changes the block number under which a blob transaction is tracked. This // method should be used when a reorg changes a transaction's inclusion block. // -// The method may log errors for various unexpcted scenarios but will not return +// The method may log errors for various unexpected scenarios but will not return // any of it since there's no clear error case. Some errors may be due to coding // issues, others caused by signers mining MEV stuff or swapping transactions. In // all cases, the pool needs to continue operating. @@ -195,7 +195,7 @@ func (l *limbo) update(tx common.Hash, block uint64) { log.Trace("Blob transaction unchanged in limbo", "tx", tx, "block", block) return } - // Retrieve the old blobs from the data store and write tehm back with a new + // Retrieve the old blobs from the data store and write them back with a new // block number. IF anything fails, there's not much to do, go on. item, err := l.getAndDrop(id) if err != nil { diff --git a/core/txpool/blobpool/metrics.go b/core/txpool/blobpool/metrics.go index 070cc5ca47..587804cc61 100644 --- a/core/txpool/blobpool/metrics.go +++ b/core/txpool/blobpool/metrics.go @@ -65,7 +65,7 @@ var ( pooltipGauge = metrics.NewRegisteredGauge("blobpool/pooltip", nil) // addwait/time, resetwait/time and getwait/time track the rough health of - // the pool and wether or not it's capable of keeping up with the load from + // the pool and whether or not it's capable of keeping up with the load from // the network. addwaitHist = metrics.NewRegisteredHistogram("blobpool/addwait", nil, metrics.NewExpDecaySample(1028, 0.015)) addtimeHist = metrics.NewRegisteredHistogram("blobpool/addtime", nil, metrics.NewExpDecaySample(1028, 0.015)) diff --git a/core/txpool/legacypool/legacypool.go b/core/txpool/legacypool/legacypool.go index db4af0ee8d..47cac42eb2 100644 --- a/core/txpool/legacypool/legacypool.go +++ b/core/txpool/legacypool/legacypool.go @@ -419,7 +419,7 @@ func (pool *LegacyPool) Close() error { } // Reset implements txpool.SubPool, allowing the legacy pool's internal state to be -// kept in sync with the main transacion pool's internal state. +// kept in sync with the main transaction pool's internal state. func (pool *LegacyPool) Reset(oldHead, newHead *types.Header) { wait := pool.requestReset(oldHead, newHead) <-wait @@ -914,7 +914,7 @@ func (pool *LegacyPool) promoteTx(addr common.Address, hash common.Hash, tx *typ } // Add enqueues a batch of transactions into the pool if they are valid. Depending -// on the local flag, full pricing contraints will or will not be applied. +// on the local flag, full pricing constraints will or will not be applied. // // If sync is set, the method will block until all internal maintenance related // to the add is finished. Only use this during tests for determinism! diff --git a/core/txpool/legacypool/legacypool_test.go b/core/txpool/legacypool/legacypool_test.go index 27cd244294..ea191b42ca 100644 --- a/core/txpool/legacypool/legacypool_test.go +++ b/core/txpool/legacypool/legacypool_test.go @@ -3778,7 +3778,7 @@ func newTxs(pool *LegacyPool) *types.Transaction { // txCount++ // } else { -// // we don't maximize fulfilment of the block. just fill somehow +// // we don't maximize fulfillment of the block. just fill somehow // return blockGasLimit, txCount // } // } diff --git a/core/txpool/subpool.go b/core/txpool/subpool.go index 70c0918e14..a1dbd57337 100644 --- a/core/txpool/subpool.go +++ b/core/txpool/subpool.go @@ -69,7 +69,7 @@ type AddressReserver func(addr common.Address, reserve bool) error // production, this interface defines the common methods that allow the primary // transaction pool to manage the subpools. type SubPool interface { - // Filter is a selector used to decide whether a transaction whould be added + // Filter is a selector used to decide whether a transaction would be added // to this particular subpool. Filter(tx *types.Transaction) bool diff --git a/core/txpool/txpool.go b/core/txpool/txpool.go index b0e91fee6c..7cf94a3ffc 100644 --- a/core/txpool/txpool.go +++ b/core/txpool/txpool.go @@ -70,7 +70,7 @@ type TxPool struct { reservations map[common.Address]SubPool // Map with the account to pool reservations reserveLock sync.Mutex // Lock protecting the account reservations - subs event.SubscriptionScope // Subscription scope to unscubscribe all on shutdown + subs event.SubscriptionScope // Subscription scope to unsubscribe all on shutdown quit chan chan error // Quit channel to tear down the head updater } diff --git a/core/txpool/validation.go b/core/txpool/validation.go index 7479438e8d..80ca237334 100644 --- a/core/txpool/validation.go +++ b/core/txpool/validation.go @@ -110,7 +110,7 @@ func ValidateTransaction(tx *types.Transaction, blobs []kzg4844.Blob, commits [] } // Ensure blob transactions have valid commitments if tx.Type() == types.BlobTxType { - // Ensure the number of items in the blob transaction and vairous side + // Ensure the number of items in the blob transaction and various side // data match up before doing any expensive validations hashes := tx.BlobHashes() if len(hashes) == 0 { @@ -171,7 +171,7 @@ type ValidationOptionsWithState struct { // be rejected once the number of remaining slots reaches zero. UsedAndLeftSlots func(addr common.Address) (int, int) - // ExistingExpenditure is a mandatory callback to retrieve the cummulative + // ExistingExpenditure is a mandatory callback to retrieve the cumulative // cost of the already pooled transactions to check for overdrafts. ExistingExpenditure func(addr common.Address) *big.Int @@ -226,7 +226,7 @@ func ValidateTransactionWithState(tx *types.Transaction, signer types.Signer, op return fmt.Errorf("%w: balance %v, queued cost %v, tx cost %v, overshot %v", core.ErrInsufficientFunds, balance, spent, cost, new(big.Int).Sub(need, balance)) } // Transaction takes a new nonce value out of the pool. Ensure it doesn't - // overflow the number of permitted transactions from a single accoun + // overflow the number of permitted transactions from a single account // (i.e. max cancellable via out-of-bound transaction). if used, left := opts.UsedAndLeftSlots(from); left <= 0 { return fmt.Errorf("%w: pooled %d txs", ErrAccountLimitExceeded, used) diff --git a/core/types/transaction.go b/core/types/transaction.go index 6f2fa21aa5..91542110aa 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -308,7 +308,7 @@ func (tx *Transaction) BlobGas() uint64 { return tx.inner.blobGas() } // BlobGasFeeCap returns the blob gas fee cap per blob gas of the transaction for blob transactions, nil otherwise. func (tx *Transaction) BlobGasFeeCap() *big.Int { return tx.inner.blobGasFeeCap() } -// BlobHashes returns the hases of the blob commitments for blob transactions, nil otherwise. +// BlobHashes returns the hashes of the blob commitments for blob transactions, nil otherwise. func (tx *Transaction) BlobHashes() []common.Hash { return tx.inner.blobHashes() } // Value returns the ether amount of the transaction. diff --git a/core/types/transaction_signing_test.go b/core/types/transaction_signing_test.go index eee933f1b7..4cce32f208 100644 --- a/core/types/transaction_signing_test.go +++ b/core/types/transaction_signing_test.go @@ -43,7 +43,7 @@ func TestEIP155Signing(t *testing.T) { } if from != addr { - t.Errorf("exected from and address to be equal. Got %x want %x", from, addr) + t.Errorf("expected from and address to be equal. Got %x want %x", from, addr) } } diff --git a/core/vm/contracts_test.go b/core/vm/contracts_test.go index 021dfe48eb..b95aea5a68 100644 --- a/core/vm/contracts_test.go +++ b/core/vm/contracts_test.go @@ -233,7 +233,7 @@ func BenchmarkPrecompiledRipeMD(bench *testing.B) { benchmarkPrecompiled("03", t, bench) } -// Benchmarks the sample inputs from the identiy precompile. +// Benchmarks the sample inputs from the identity precompile. func BenchmarkPrecompiledIdentity(bench *testing.B) { t := precompiledTest{ Input: "38d18acb67d25c8bb9942764b62f18e17054f66a817bd4295423adf9ed98873e000000000000000000000000000000000000000000000000000000000000001b38d18acb67d25c8bb9942764b62f18e17054f66a817bd4295423adf9ed98873e789d1dd423d25f0772d2748d60f7e4b81bb14d086eba8e8e8efb6dcff8a4ae02", diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index e91d80b811..9fab1d73ae 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -242,7 +242,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool, i debug = in.evm.Config.Tracer != nil ) // Don't move this deferred function, it's placed before the capturestate-deferred method, - // so that it get's executed _after_: the capturestate needs the stacks before + // so that it gets executed _after_: the capturestate needs the stacks before // they are returned to the pools defer func() { returnStack(stack) @@ -411,7 +411,7 @@ func (in *EVMInterpreter) RunWithDelay(contract *Contract, input []byte, readOnl debug = in.evm.Config.Tracer != nil ) // Don't move this deferrred function, it's placed before the capturestate-deferred method, - // so that it get's executed _after_: the capturestate needs the stacks before + // so that it gets executed _after_: the capturestate needs the stacks before // they are returned to the pools defer func() { returnStack(stack) diff --git a/core/vm/jump_table_export.go b/core/vm/jump_table_export.go index 2ea2e421a9..33e7785206 100644 --- a/core/vm/jump_table_export.go +++ b/core/vm/jump_table_export.go @@ -57,7 +57,7 @@ func LookupInstructionSet(rules params.Rules) (JumpTable, error) { return newFrontierInstructionSet(), nil } -// Stack returns the mininum and maximum stack requirements. +// Stack returns the minimum and maximum stack requirements. func (op *operation) Stack() (int, int) { return op.minStack, op.maxStack } diff --git a/core/vm/jump_table_test.go b/core/vm/jump_table_test.go index 6230032905..9a3574a3f2 100644 --- a/core/vm/jump_table_test.go +++ b/core/vm/jump_table_test.go @@ -22,7 +22,7 @@ import ( "github.com/stretchr/testify/require" ) -// TestJumpTableCopy tests that deep copy is necessery to prevent modify shared jump table +// TestJumpTableCopy tests that deep copy is necessary to prevent modify shared jump table func TestJumpTableCopy(t *testing.T) { t.Parallel() diff --git a/core/vm/runtime/runtime_test.go b/core/vm/runtime/runtime_test.go index 627947c6d4..674e2176fe 100644 --- a/core/vm/runtime/runtime_test.go +++ b/core/vm/runtime/runtime_test.go @@ -703,7 +703,7 @@ func TestColdAccountAccessCost(t *testing.T) { t.Logf("%d: %v %d", ii, op.OpName(), op.GasCost) } - t.Fatalf("tescase %d, gas report wrong, step %d, have %d want %d", i, tc.step, have, want) + t.Fatalf("testcase %d, gas report wrong, step %d, have %d want %d", i, tc.step, have, want) } } } diff --git a/crypto/bls12381/g2.go b/crypto/bls12381/g2.go index c181e821f5..6fe7a77430 100644 --- a/crypto/bls12381/g2.go +++ b/crypto/bls12381/g2.go @@ -27,7 +27,7 @@ import ( // If z is equal to one the point is considered as in affine form. type PointG2 [3]fe2 -// Set copies valeus of one point to another. +// Set copies values of one point to another. func (p *PointG2) Set(p2 *PointG2) *PointG2 { p[0].set(&p2[0]) p[1].set(&p2[1]) diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index f6369f8f4b..785b84cf8a 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -621,7 +621,7 @@ func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, td, ttd * // For non-merged networks, if there is a checkpoint available, then calculate // the ancientLimit through that. Otherwise calculate the ancient limit through // the advertised height of the remote peer. This most is mostly a fallback for - // legacy networks, but should eventually be droppped. TODO(karalabe). + // legacy networks, but should eventually be dropped. TODO(karalabe). if beaconMode { // Beacon sync, use the latest finalized block as the ancient limit // or a reasonable height if no finalized block is yet announced. diff --git a/eth/downloader/resultstore.go b/eth/downloader/resultstore.go index a26387905a..f03d88498c 100644 --- a/eth/downloader/resultstore.go +++ b/eth/downloader/resultstore.go @@ -154,7 +154,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/eth/downloader/skeleton.go b/eth/downloader/skeleton.go index d5df9b2b21..86fc51f090 100644 --- a/eth/downloader/skeleton.go +++ b/eth/downloader/skeleton.go @@ -430,7 +430,7 @@ func (s *skeleton) sync(head *types.Header) (*types.Header, error) { for _, peer := range s.peers.AllPeers() { s.idles[peer.id] = peer } - // Nofity any tester listening for startup events + // Notify any tester listening for startup events if s.syncStarting != nil { s.syncStarting() } diff --git a/eth/downloader/whitelist/milestone.go b/eth/downloader/whitelist/milestone.go index d2ea7f7bed..e82b53c08b 100644 --- a/eth/downloader/whitelist/milestone.go +++ b/eth/downloader/whitelist/milestone.go @@ -290,7 +290,7 @@ func (m *milestone) enqueueFutureMilestone(key uint64, hash common.Hash) { return } - log.Debug("Enqueing new future milestone", "endBlockNumber", key, "futureMilestoneHash", hash) + log.Debug("Enqueuing new future milestone", "endBlockNumber", key, "futureMilestoneHash", hash) m.FutureMilestoneList[key] = hash m.FutureMilestoneOrder = append(m.FutureMilestoneOrder, key) diff --git a/eth/downloader/whitelist/service.go b/eth/downloader/whitelist/service.go index 08b92c536e..3c23e4a268 100644 --- a/eth/downloader/whitelist/service.go +++ b/eth/downloader/whitelist/service.go @@ -191,7 +191,7 @@ func isValidChain(currentHeader *types.Header, chain []*types.Header, doExist bo pastChain, _ := splitChain(current, chain) // Iterate over the chain and validate against the last milestone - // It will handle all cases when the incoming chain has atleast one milestone + // It will handle all cases when the incoming chain has at least one milestone for i := len(pastChain) - 1; i >= 0; i-- { if pastChain[i].Number.Uint64() == number { res := pastChain[i].Hash() == hash @@ -205,7 +205,7 @@ func isValidChain(currentHeader *types.Header, chain []*types.Header, doExist bo // FIXME: remoteHeader is not used func isValidPeer(fetchHeadersByNumber func(number uint64, amount int, skip int, reverse bool) ([]*types.Header, []common.Hash, error), doExist bool, number uint64, hash common.Hash) (bool, error) { - // Check for availaibility of the last milestone block. + // Check for availability of the last milestone block. // This can be also be empty if our heimdall is not responding // or we're running without it. if !doExist { diff --git a/eth/downloader/whitelist/service_test.go b/eth/downloader/whitelist/service_test.go index f37af30f0c..aace6ff0e0 100644 --- a/eth/downloader/whitelist/service_test.go +++ b/eth/downloader/whitelist/service_test.go @@ -240,13 +240,13 @@ func TestMilestone(t *testing.T) { require.Equal(t, order[0], uint64(16), "expected number to be 16 but got", order[0]) require.Equal(t, list[order[0]], common.Hash{16}, "expected value is", common.Hash{16}.String()[2:], "but got", list[order[0]]) - capicity := milestone.MaxCapacity - for i := 16; i <= 16*(capicity+1); i = i + 16 { + capacity := milestone.MaxCapacity + for i := 16; i <= 16*(capacity+1); i = i + 16 { s.ProcessFutureMilestone(uint64(i), common.Hash{16}) } - require.Equal(t, len(milestone.FutureMilestoneOrder), capicity, "expected length is", capicity) - require.Equal(t, milestone.FutureMilestoneOrder[capicity-1], uint64(16*capicity), "expected value is", uint64(16*capicity), "but got", milestone.FutureMilestoneOrder[capicity-1]) + require.Equal(t, len(milestone.FutureMilestoneOrder), capacity, "expected length is", capacity) + require.Equal(t, milestone.FutureMilestoneOrder[capacity-1], uint64(16*capacity), "expected value is", uint64(16*capacity), "but got", milestone.FutureMilestoneOrder[capacity-1]) } // TestIsValidPeer checks the IsValidPeer function in isolation diff --git a/eth/protocols/eth/dispatcher.go b/eth/protocols/eth/dispatcher.go index 3c0f36fc08..23fd05157c 100644 --- a/eth/protocols/eth/dispatcher.go +++ b/eth/protocols/eth/dispatcher.go @@ -41,7 +41,7 @@ var ( // Request is a pending request to allow tracking it and delivering a response // back to the requester on their chosen channel. type Request struct { - peer *Peer // Peer to which this request belogs for untracking + peer *Peer // Peer to which this request belongs for untracking id uint64 // Request ID to match up replies to sink chan *Response // Channel to deliver the response on @@ -228,7 +228,7 @@ func (p *Peer) dispatcher() { switch { case res.Req == nil: // Response arrived with an untracked ID. Since even cancelled - // requests are tracked until fulfilment, a dangling response + // requests are tracked until fulfillment, a dangling response // means the remote peer implements the protocol badly. resOp.fail <- errDanglingResponse diff --git a/eth/protocols/eth/peer.go b/eth/protocols/eth/peer.go index 219f486c8e..45236fea8e 100644 --- a/eth/protocols/eth/peer.go +++ b/eth/protocols/eth/peer.go @@ -84,7 +84,7 @@ type Peer struct { txBroadcast chan []common.Hash // Channel used to queue transaction propagation requests txAnnounce chan []common.Hash // Channel used to queue transaction announcement requests - reqDispatch chan *request // Dispatch channel to send requests and track then until fulfilment + reqDispatch chan *request // Dispatch channel to send requests and track then until fulfillment reqCancel chan *cancel // Dispatch channel to cancel pending requests and untrack them resDispatch chan *response // Dispatch channel to fulfil pending requests and untrack them diff --git a/eth/tracers/api_bor.go b/eth/tracers/api_bor.go index 565148c384..3172784b15 100644 --- a/eth/tracers/api_bor.go +++ b/eth/tracers/api_bor.go @@ -140,7 +140,7 @@ type TraceBlockRequest struct { Config *TraceConfig } -// If you use context as first parameter this function gets exposed automaticall on rpc endpoint +// If you use context as first parameter this function gets exposed automatically on rpc endpoint func (api *API) TraceBorBlock(req *TraceBlockRequest) (*BlockTraceResult, error) { ctx := context.Background() diff --git a/eth/tracers/js/internal/tracers/call_tracer_legacy.js b/eth/tracers/js/internal/tracers/call_tracer_legacy.js index 451a644b91..0760bb1e3f 100644 --- a/eth/tracers/js/internal/tracers/call_tracer_legacy.js +++ b/eth/tracers/js/internal/tracers/call_tracer_legacy.js @@ -219,7 +219,7 @@ return this.finalize(result); }, - // finalize recreates a call object using the final desired field oder for json + // finalize recreates a call object using the final desired field order for json // serialization. This is a nicety feature to pass meaningfully ordered results // to users who don't interpret it, just display it. finalize: function(call) { diff --git a/eth/tracers/tracers_test.go b/eth/tracers/tracers_test.go index 5990b40e8b..4d661c15be 100644 --- a/eth/tracers/tracers_test.go +++ b/eth/tracers/tracers_test.go @@ -133,9 +133,9 @@ func TestMemCopying(t *testing.T) { {0, 100, 0, "", 0}, // No need to pad (0 size) {100, 50, 100, "", 100}, // Should pad 100-150 {100, 50, 5, "", 5}, // Wanted range fully within memory - {100, -50, 0, "offset or size must not be negative", 0}, // Errror - {0, 1, 1024*1024 + 1, "reached limit for padding memory slice: 1048578", 0}, // Errror - {10, 0, 1024*1024 + 100, "reached limit for padding memory slice: 1048666", 0}, // Errror + {100, -50, 0, "offset or size must not be negative", 0}, // Error + {0, 1, 1024*1024 + 1, "reached limit for padding memory slice: 1048578", 0}, // Error + {10, 0, 1024*1024 + 100, "reached limit for padding memory slice: 1048666", 0}, // Error } { mem := vm.NewMemory() diff --git a/ethclient/gethclient/gethclient_test.go b/ethclient/gethclient/gethclient_test.go index d06ef8e055..9b459c7503 100644 --- a/ethclient/gethclient/gethclient_test.go +++ b/ethclient/gethclient/gethclient_test.go @@ -452,7 +452,7 @@ func TestOverrideAccountMarshal(t *testing.T) { om := map[common.Address]OverrideAccount{ {0x11}: { - // Zero-valued nonce is not overriddden, but simply dropped by the encoder. + // Zero-valued nonce is not overridden, but simply dropped by the encoder. Nonce: 0, }, {0xaa}: { diff --git a/internal/cli/flagset/flagset.go b/internal/cli/flagset/flagset.go index 85a846a40b..6443d4f8b7 100644 --- a/internal/cli/flagset/flagset.go +++ b/internal/cli/flagset/flagset.go @@ -368,7 +368,7 @@ func (i *SliceStringFlag) String() string { } func (i *SliceStringFlag) Set(value string) error { - // overwritting insted of appending + // overwriting instead of appending *i.Value = SplitAndTrim(value) return nil } diff --git a/internal/cli/server/command.go b/internal/cli/server/command.go index 817c09b670..5170acab77 100644 --- a/internal/cli/server/command.go +++ b/internal/cli/server/command.go @@ -94,7 +94,7 @@ func (c *Command) extractFlags(args []string) error { log.Warn("Config set via config file will be overridden by cli flags") - // Initialse a flagset based on the config created above + // Initialise a flagset based on the config created above flags := c.Flags(cfg) // Check for explicit cli args diff --git a/internal/flags/helpers.go b/internal/flags/helpers.go index 21689840f0..10765f932b 100644 --- a/internal/flags/helpers.go +++ b/internal/flags/helpers.go @@ -113,7 +113,7 @@ func doMigrateFlags(ctx *cli.Context) { for _, parent := range ctx.Lineage()[1:] { if parent.IsSet(name) { // When iterating across the lineage, we will be served both - // the 'canon' and alias formats of all commmands. In most cases, + // the 'canon' and alias formats of all commands. In most cases, // it's fine to set it in the ctx multiple times (one for each // name), however, the Slice-flags are not fine. // The slice-flags accumulate, so if we set it once as diff --git a/internal/jsre/deps/web3.js b/internal/jsre/deps/web3.js index a8ca37cec5..70bd4b1508 100644 --- a/internal/jsre/deps/web3.js +++ b/internal/jsre/deps/web3.js @@ -2031,7 +2031,7 @@ var fromAscii = function(str) { * * @method transformToFullName * @param {Object} json-abi - * @return {String} full fnction/event name + * @return {String} full function/event name */ var transformToFullName = function (json) { if (json.name.indexOf('(') !== -1) { @@ -2089,7 +2089,7 @@ var fromDecimal = function (value) { /** * Auto converts any given value into it's hex representation. * - * And even stringifys objects before. + * And even stringifies objects before. * * @method toHex * @param {String|Number|BigNumber|Object} @@ -2361,7 +2361,7 @@ var isFunction = function (object) { }; /** - * Returns true if object is Objet, otherwise false + * Returns true if object is Object, otherwise false * * @method isObject * @param {Object} @@ -2757,7 +2757,7 @@ var Batch = function (web3) { * Should be called to add create new request to batch request * * @method add - * @param {Object} jsonrpc requet object + * @param {Object} jsonrpc request object */ Batch.prototype.add = function (request) { this.requests.push(request); @@ -4557,7 +4557,7 @@ Iban.createIndirect = function (options) { }; /** - * Thos method should be used to check if given string is valid iban object + * This method should be used to check if given string is valid iban object * * @method isValid * @param {String} iban string @@ -6721,7 +6721,7 @@ var exchangeAbi = require('../contracts/SmartExchange.json'); * @method transfer * @param {String} from * @param {String} to iban - * @param {Value} value to be tranfered + * @param {Value} value to be transferred * @param {Function} callback, callback */ var transfer = function (eth, from, to, value, callback) { @@ -6751,7 +6751,7 @@ var transfer = function (eth, from, to, value, callback) { * @method transferToAddress * @param {String} from * @param {String} to - * @param {Value} value to be tranfered + * @param {Value} value to be transferred * @param {Function} callback, callback */ var transferToAddress = function (eth, from, to, value, callback) { @@ -7105,7 +7105,7 @@ module.exports = transfer; /** * Initializes a newly created cipher. * - * @param {number} xformMode Either the encryption or decryption transormation mode constant. + * @param {number} xformMode Either the encryption or decryption transformation mode constant. * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * @@ -9459,7 +9459,7 @@ module.exports = transfer; var M_offset_14 = M[offset + 14]; var M_offset_15 = M[offset + 15]; - // Working varialbes + // Working variables var a = H[0]; var b = H[1]; var c = H[2]; diff --git a/les/utils/timeutils_test.go b/les/utils/timeutils_test.go index b219d0439d..165f37352e 100644 --- a/les/utils/timeutils_test.go +++ b/les/utils/timeutils_test.go @@ -42,6 +42,6 @@ func TestUpdateTimer(t *testing.T) { } timer = NewUpdateTimer(sim, 0) if updated := timer.Update(func(diff time.Duration) bool { return true }); !updated { - t.Fatalf("Doesn't update the clock without threshold limitaion") + t.Fatalf("Doesn't update the clock without threshold limitation") } } diff --git a/log/doc.go b/log/doc.go index d2e15140e4..f533364d0f 100644 --- a/log/doc.go +++ b/log/doc.go @@ -195,7 +195,7 @@ on log level. # Error Handling -Becasuse log15 allows you to step around the type system, there are a few ways you can specify +Because log15 allows you to step around the type system, there are a few ways you can specify invalid arguments to the logging functions. You could, for example, wrap something that is not a zero-argument function with log.Lazy or pass a context key that is not a string. Since logging libraries are typically the mechanism by which errors are reported, it would be onerous for the logging functions diff --git a/log/format.go b/log/format.go index 6a03013b81..8d72d8ce09 100644 --- a/log/format.go +++ b/log/format.go @@ -39,7 +39,7 @@ func PrintOrigins(print bool) { // should append the log locations too when printing entries. var locationEnabled atomic.Bool -// locationLength is the maxmimum path length encountered, which all logs are +// locationLength is the maximum path length encountered, which all logs are // padded to to aid in alignment. var locationLength atomic.Uint32 diff --git a/miner/payload_building_test.go b/miner/payload_building_test.go index 02f1008f4c..c2d9262de2 100644 --- a/miner/payload_building_test.go +++ b/miner/payload_building_test.go @@ -56,23 +56,23 @@ func TestBuildPayload(t *testing.T) { verify := func(outer *engine.ExecutionPayloadEnvelope, txs int) { payload := outer.ExecutionPayload if payload.ParentHash != b.chain.CurrentBlock().Hash() { - t.Fatal("Unexpect parent hash") + t.Fatal("Unexpected parent hash") } if payload.Random != (common.Hash{}) { - t.Fatal("Unexpect random value") + t.Fatal("Unexpected random value") } if payload.Timestamp != timestamp { - t.Fatal("Unexpect timestamp") + t.Fatal("Unexpected timestamp") } if payload.FeeRecipient != recipient { - t.Fatal("Unexpect fee recipient") + t.Fatal("Unexpected fee recipient") } if len(payload.Transactions) != txs { - t.Fatal("Unexpect transaction set") + t.Fatal("Unexpected transaction set") } } empty := payload.ResolveEmpty() diff --git a/miner/worker.go b/miner/worker.go index 3573eccfee..af7534a479 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1174,7 +1174,7 @@ mainloop: // generateParams wraps various of settings for generating sealing task. type generateParams struct { - timestamp uint64 // The timstamp for sealing task + timestamp uint64 // The timestamp for sealing task forceTime bool // Flag whether the given timestamp is immutable or not parentHash common.Hash // Parent block hash, empty means the latest chain head coinbase common.Address // The fee recipient address for including transaction diff --git a/p2p/msgrate/msgrate.go b/p2p/msgrate/msgrate.go index 36a6cbb213..e1be1e227c 100644 --- a/p2p/msgrate/msgrate.go +++ b/p2p/msgrate/msgrate.go @@ -80,7 +80,7 @@ const ttlLimit = time.Minute // tuningConfidenceCap is the number of active peers above which to stop detuning // the confidence number. The idea here is that once we hone in on the capacity -// of a meaningful number of peers, adding one more should ot have a significant +// of a meaningful number of peers, adding one more should not have a significant // impact on things, so just ron with the originals. const tuningConfidenceCap = 10 diff --git a/p2p/rlpx/rlpx_test.go b/p2p/rlpx/rlpx_test.go index 46ae3eba21..955215eb5c 100644 --- a/p2p/rlpx/rlpx_test.go +++ b/p2p/rlpx/rlpx_test.go @@ -450,7 +450,7 @@ func BenchmarkThroughput(b *testing.B) { conn2.SetSnappy(true) if err := <-handshakeDone; err != nil { - b.Fatal("server hanshake error:", err) + b.Fatal("server handshake error:", err) } // Read N messages. diff --git a/p2p/simulations/adapters/inproc.go b/p2p/simulations/adapters/inproc.go index e8d2d1a886..79faf0ba75 100644 --- a/p2p/simulations/adapters/inproc.go +++ b/p2p/simulations/adapters/inproc.go @@ -177,7 +177,7 @@ type SimNode struct { registerOnce sync.Once } -// Close closes the underlaying node.Node to release +// Close closes the underlying node.Node to release // acquired resources. func (sn *SimNode) Close() error { return sn.node.Close() diff --git a/p2p/simulations/network_test.go b/p2p/simulations/network_test.go index 2eaa0e452a..232d356250 100644 --- a/p2p/simulations/network_test.go +++ b/p2p/simulations/network_test.go @@ -740,7 +740,7 @@ func triggerChecks(ctx context.Context, ids []enode.ID, trigger chan enode.ID, i } } -// \todo: refactor to implement shapshots +// \todo: refactor to implement snapshots // and connect configuration methods once these are moved from // swarm/network/simulations/connect.go func BenchmarkMinimalService(b *testing.B) { diff --git a/rlp/rlpgen/gen.go b/rlp/rlpgen/gen.go index e0bdc75bb5..ce427f601b 100644 --- a/rlp/rlpgen/gen.go +++ b/rlp/rlpgen/gen.go @@ -166,7 +166,7 @@ type op interface { // basicOp handles basic types bool, uint*, string. type basicOp struct { typ types.Type - writeMethod string // calle write the value + writeMethod string // calls write value writeArgType types.Type // parameter type of writeMethod decMethod string decResultType types.Type // return type of decMethod diff --git a/signer/core/api.go b/signer/core/api.go index cd505c720a..0691e98a58 100644 --- a/signer/core/api.go +++ b/signer/core/api.go @@ -692,7 +692,7 @@ func (api *SignerAPI) SignGnosisSafeTx(ctx context.Context, signerAddress common } typedData := gnosisTx.ToTypedData() - // might aswell error early. + // might as well error early. // we are expected to sign. If our calculated hash does not match what they want, // The gnosis safetx input contains a 'safeTxHash' which is the expected safeTxHash that sighash, _, err := apitypes.TypedDataAndHash(typedData) diff --git a/tests/bor/bor_test.go b/tests/bor/bor_test.go index 07c9ecc5dc..ec389a30ca 100644 --- a/tests/bor/bor_test.go +++ b/tests/bor/bor_test.go @@ -298,7 +298,7 @@ func TestForkWithBlockTime(t *testing.T) { // Iterate over all the nodes and start mining for _, node := range nodes { if err := node.StartMining(); err != nil { - t.Fatal("Error occured while starting miner", "node", node, "error", err) + t.Fatal("Error occurred while starting miner", "node", node, "error", err) } } var wg sync.WaitGroup @@ -332,22 +332,22 @@ func TestForkWithBlockTime(t *testing.T) { author0, err := nodes[0].Engine().Author(blockHeaderVal0) if err != nil { - t.Error("Error occured while fetching author", "err", err) + t.Error("Error occurred while fetching author", "err", err) } author1, err := nodes[1].Engine().Author(blockHeaderVal1) if err != nil { - t.Error("Error occured while fetching author", "err", err) + t.Error("Error occurred while fetching author", "err", err) } assert.Equal(t, author0, author1) // After the end of sprint author2, err := nodes[0].Engine().Author(blockHeaders[0]) if err != nil { - t.Error("Error occured while fetching author", "err", err) + t.Error("Error occurred while fetching author", "err", err) } author3, err := nodes[1].Engine().Author(blockHeaders[1]) if err != nil { - t.Error("Error occured while fetching author", "err", err) + t.Error("Error occurred while fetching author", "err", err) } if test.forkExpected { diff --git a/tests/bor/helper.go b/tests/bor/helper.go index cc17dc9647..2d3dd030e5 100644 --- a/tests/bor/helper.go +++ b/tests/bor/helper.go @@ -91,7 +91,7 @@ func setupMiner(t *testing.T, n int, genesis *core.Genesis) ([]*node.Node, []*et // Start the node and wait until it's up stack, ethBackend, err := InitMiner(genesis, keys[i], true) if err != nil { - t.Fatal("Error occured while initialising miner", "error", err) + t.Fatal("Error occurred while initialising miner", "error", err) } for stack.Server().NodeInfo().Ports.Listener == 0 { diff --git a/trie/proof.go b/trie/proof.go index 55edb54669..0a0e9257d5 100644 --- a/trie/proof.go +++ b/trie/proof.go @@ -428,7 +428,7 @@ func unset(parent node, child node, key []byte, pos int, removeLeft bool) error } else { if bytes.Compare(cld.Key, key[pos:]) > 0 { // The key of fork shortnode is greater than the - // path(it belongs to the range), unset the entrie + // path(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/sync.go b/trie/sync.go index 48918908bb..fa3f94ec6d 100644 --- a/trie/sync.go +++ b/trie/sync.go @@ -302,7 +302,7 @@ func (s *Sync) Missing(max int) ([]string, []common.Hash, []common.Hash) { } // ProcessCode injects the received data for requested item. Note it can -// happpen that the single response commits two pending requests(e.g. +// happen that the single response commits two pending requests(e.g. // there are two requests one for code and one for node but the hash // is same). In this case the second response for the same hash will // be treated as "non-requested" item or "already-processed" item but diff --git a/trie/trie_test.go b/trie/trie_test.go index a4a7ed17a4..9eaf4676c5 100644 --- a/trie/trie_test.go +++ b/trie/trie_test.go @@ -349,7 +349,7 @@ func TestLargeValue(t *testing.T) { trie.Hash() } -// TestRandomCases tests som cases that were found via random fuzzing +// TestRandomCases tests some cases that were found via random fuzzing func TestRandomCases(t *testing.T) { var rt = []randTestStep{ {op: 6, key: common.Hex2Bytes(""), value: common.Hex2Bytes("")}, // step 0