fix typos

This commit is contained in:
Dimitris Apostolou 2024-01-25 21:44:14 +02:00
parent 241af1fa1e
commit ce68cb17ac
No known key found for this signature in database
GPG key ID: 4B5D20E938204A8A
63 changed files with 108 additions and 108 deletions

View file

@ -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 {

View file

@ -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()

View file

@ -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})
}

View file

@ -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"
)

View file

@ -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

View file

@ -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()
}

View file

@ -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) {

View file

@ -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 {

View file

@ -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

View file

@ -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

View file

@ -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 (

View file

@ -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

View file

@ -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[:])

View file

@ -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])

View file

@ -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

View file

@ -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)

View file

@ -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 {

View file

@ -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))

View file

@ -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!

View file

@ -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
// }
// }

View file

@ -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

View file

@ -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
}

View file

@ -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)

View file

@ -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.

View file

@ -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)
}
}

View file

@ -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",

View file

@ -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)

View file

@ -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
}

View file

@ -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()

View file

@ -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)
}
}
}

View file

@ -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])

View file

@ -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.

View file

@ -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

View file

@ -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()
}

View file

@ -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)

View file

@ -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 {

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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()

View file

@ -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) {

View file

@ -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()

View file

@ -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}: {

View file

@ -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
}

View file

@ -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

View file

@ -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

View file

@ -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];

View file

@ -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")
}
}

View file

@ -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

View file

@ -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

View file

@ -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()

View file

@ -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

View file

@ -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

View file

@ -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.

View file

@ -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()

View file

@ -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) {

View file

@ -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

View file

@ -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)

View file

@ -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 {

View file

@ -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 {

View file

@ -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

View file

@ -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

View file

@ -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