From ff6bb7ac130a4729318b07f1e676f80ebd018387 Mon Sep 17 00:00:00 2001 From: rotcivegaf Date: Mon, 12 May 2025 02:27:39 -0300 Subject: [PATCH] Fix typos --- core/blockchain.go | 16 ++++++++-------- core/blockchain_sethead_test.go | 8 ++++---- core/blockchain_test.go | 8 ++++---- core/filtermaps/matcher.go | 2 +- core/filtermaps/matcher_backend.go | 2 +- core/headerchain.go | 4 ++-- core/rawdb/accessors_indexes.go | 2 +- core/rawdb/freezer_test.go | 2 +- core/rawdb/freezer_utils.go | 2 +- core/state/snapshot/difflayer.go | 2 +- core/state/snapshot/iterator_fast.go | 2 +- core/state/state_object.go | 2 +- core/state/statedb.go | 6 +++--- core/state/statedb_fuzz_test.go | 4 ++-- core/state/statedb_test.go | 4 ++-- core/state_prefetcher.go | 2 +- core/state_processor.go | 2 +- core/state_transition.go | 4 ++-- core/txpool/blobpool/blobpool.go | 6 +++--- core/txpool/blobpool/lookup.go | 2 +- core/txpool/legacypool/legacypool_test.go | 2 +- core/txpool/legacypool/list.go | 2 +- core/txpool/txpool.go | 2 +- core/types/block.go | 2 +- core/types/log.go | 2 +- core/vm/contract.go | 4 ++-- core/vm/evm.go | 12 ++++++------ core/vm/interface.go | 2 +- core/vm/interpreter.go | 4 ++-- core/vm/program/program.go | 2 +- 30 files changed, 58 insertions(+), 58 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 302ab14cf0..2a44d7a992 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -218,7 +218,7 @@ type txLookup struct { } // BlockChain represents the canonical chain given a database with a genesis -// block. The Blockchain manages chain imports, reverts, chain reorganisations. +// block. The Blockchain manages chain imports, reverts, chain reorganizations. // // Importing blocks in to the block chain happens according to the set of rules // defined by the two stage Validator. Processing of blocks is done using the @@ -287,8 +287,8 @@ type BlockChain struct { lastForkReadyAlert time.Time // Last time there was a fork readiness print out } -// NewBlockChain returns a fully initialised block chain using information -// available in the database. It initialises the default Ethereum Validator +// NewBlockChain returns a fully initialized block chain using information +// available in the database. It initializes the default Ethereum Validator // and Processor. func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis, overrides *ChainOverrides, engine consensus.Engine, vmConfig vm.Config, txLookupLimit *uint64) (*BlockChain, error) { if cacheConfig == nil { @@ -916,7 +916,7 @@ func (bc *BlockChain) setHeadBeyondRoot(head uint64, time uint64, root common.Ha rootNumber uint64 // (no root == always 0) // Retrieve the last pivot block to short circuit rollbacks beyond it - // and the current freezer limit to start nuking it's underflown. + // and the current freezer limit to start nuking it's underflow. pivot = rawdb.ReadLastPivotNumber(bc.db) ) updateFn := func(db ethdb.KeyValueWriter, header *types.Header) (*types.Header, bool) { @@ -967,7 +967,7 @@ func (bc *BlockChain) setHeadBeyondRoot(head uint64, time uint64, root common.Ha headHeader = bc.CurrentBlock() headNumber = headHeader.Number.Uint64() ) - // If setHead underflown the freezer threshold and the block processing + // If setHead underflow the freezer threshold and the block processing // intent afterwards is full block importing, delete the chain segment // between the stateful-block and the sethead target. var wipe bool @@ -1085,7 +1085,7 @@ func (bc *BlockChain) ResetWithGenesisBlock(genesis *types.Block) error { } defer bc.chainmu.Unlock() - // Prepare the genesis block and reinitialise the chain + // Prepare the genesis block and reinitialize the chain batch := bc.db.NewBatch() rawdb.WriteBlock(batch, genesis) if err := batch.Write(); err != nil { @@ -1596,7 +1596,7 @@ func (bc *BlockChain) writeBlockAndSetHead(block *types.Block, receipts []*types } currentBlock := bc.CurrentBlock() - // Reorganise the chain if the parent is not the head block + // Reorganize the chain if the parent is not the head block if block.ParentHash() != currentBlock.Hash() { if err := bc.reorg(currentBlock, block.Header()); err != nil { return NonStatTy, err @@ -1661,7 +1661,7 @@ func (bc *BlockChain) InsertChain(chain types.Blocks) (int, error) { // // This method is split out so that import batches that require re-injecting // historical blocks can do so without releasing the lock, which could lead to -// racey behaviour. If a sidechain import is in progress, and the historic state +// racey behavior. If a sidechain import is in progress, and the historic state // is imported, but then new canon-head is added before the actual sidechain // completes, then the historic state could be pruned again func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool, makeWitness bool) (*stateless.Witness, int, error) { diff --git a/core/blockchain_sethead_test.go b/core/blockchain_sethead_test.go index 424854b2bf..45a7a9f14d 100644 --- a/core/blockchain_sethead_test.go +++ b/core/blockchain_sethead_test.go @@ -785,7 +785,7 @@ func testLongShallowSetHead(t *testing.T, snapshots bool) { // Tests a sethead for a long canonical chain with frozen blocks where a recent // block - older than the ancient limit - was already committed to disk and then // sethead was called. In this case we expect the full chain to be rolled back -// to the committed block. Since the ancient limit was underflown, everything +// to the committed block. Since the ancient limit was underflow, everything // needs to be deleted onwards to avoid creating a gap. func TestLongDeepSetHead(t *testing.T) { testLongDeepSetHead(t, false) } func TestLongDeepSetHeadWithSnapshots(t *testing.T) { testLongDeepSetHead(t, true) } @@ -883,7 +883,7 @@ func testLongSnapSyncedShallowSetHead(t *testing.T, snapshots bool) { // Tests a sethead for a long canonical chain with frozen blocks where the fast // sync pivot point - older than the ancient limit - was already committed, after // which sethead was called. In this case we expect the full chain to be rolled -// back to the committed block. Since the ancient limit was underflown, everything +// back to the committed block. Since the ancient limit was underflow, everything // needs to be deleted onwards to avoid creating a gap. func TestLongSnapSyncedDeepSetHead(t *testing.T) { testLongSnapSyncedDeepSetHead(t, false) } func TestLongSnapSyncedDeepSetHeadWithSnapshots(t *testing.T) { testLongSnapSyncedDeepSetHead(t, true) } @@ -1085,7 +1085,7 @@ func testLongOldForkedShallowSetHead(t *testing.T, snapshots bool) { // chain, where a recent block - older than the ancient limit - was already committed // to disk and then sethead was called. In this case we expect the canonical full // chain to be rolled back to the committed block. Since the ancient limit was -// underflown, everything needs to be deleted onwards to avoid creating a gap. The +// underflow, everything needs to be deleted onwards to avoid creating a gap. The // side chain is nuked by the freezer. func TestLongOldForkedDeepSetHead(t *testing.T) { testLongOldForkedDeepSetHead(t, false) } func TestLongOldForkedDeepSetHeadWithSnapshots(t *testing.T) { testLongOldForkedDeepSetHead(t, true) } @@ -1189,7 +1189,7 @@ func testLongOldForkedSnapSyncedShallowSetHead(t *testing.T, snapshots bool) { // was already committed to disk and then sethead was called. In this test scenario // the side chain is below the committed block. In this case we expect the canonical // full chain to be rolled back to the committed block. Since the ancient limit was -// underflown, everything needs to be deleted onwards to avoid creating a gap. The +// underflow, everything needs to be deleted onwards to avoid creating a gap. The // side chain is nuked by the freezer. func TestLongOldForkedSnapSyncedDeepSetHead(t *testing.T) { testLongOldForkedSnapSyncedDeepSetHead(t, false) diff --git a/core/blockchain_test.go b/core/blockchain_test.go index b981c33f21..8248d1b8ac 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -183,7 +183,7 @@ func testHeaderChainImport(chain []*types.Header, blockchain *BlockChain) error if err := blockchain.engine.VerifyHeader(blockchain, header); err != nil { return err } - // Manually insert the header into the database, but don't reorganise (allows subsequent testing) + // Manually insert the header into the database, but don't reorganize (allows subsequent testing) blockchain.chainmu.MustLock() rawdb.WriteHeader(blockchain.db, header) blockchain.chainmu.Unlock() @@ -521,7 +521,7 @@ func testBrokenChain(t *testing.T, full bool, scheme string) { } } -// Tests that reorganising a long difficult chain after a short easy one +// Tests that reorganizing a long difficult chain after a short easy one // overwrites the canonical numbers and links in the database. func TestReorgLongHeaders(t *testing.T) { testReorgLong(t, false, rawdb.HashScheme) @@ -536,7 +536,7 @@ func testReorgLong(t *testing.T, full bool, scheme string) { testReorg(t, []int64{0, 0, -9}, []int64{0, 0, 0, -9}, 393280+params.GenesisDifficulty.Int64(), full, scheme) } -// Tests that reorganising a short difficult chain after a long easy one +// Tests that reorganizing a short difficult chain after a long easy one // overwrites the canonical numbers and links in the database. func TestReorgShortHeaders(t *testing.T) { testReorgShort(t, false, rawdb.HashScheme) @@ -913,7 +913,7 @@ func testLightVsFastVsFullChainHeads(t *testing.T, scheme string) { assert(t, "light", light, height/2, 0, 0) } -// Tests that chain reorganisations handle transaction removals and reinsertions. +// Tests that chain reorganizations handle transaction removals and reinsertions. func TestChainTxReorgs(t *testing.T) { testChainTxReorgs(t, rawdb.HashScheme) testChainTxReorgs(t, rawdb.PathScheme) diff --git a/core/filtermaps/matcher.go b/core/filtermaps/matcher.go index a5eeaaa5f0..351c468055 100644 --- a/core/filtermaps/matcher.go +++ b/core/filtermaps/matcher.go @@ -439,7 +439,7 @@ func (m *singleMatcherInstance) cleanMapIndices() { m.mapIndices = m.mapIndices[:j] } -// matchAny combinines a set of matchers and returns a match for every position +// matchAny combines a set of matchers and returns a match for every position // where any of the underlying matchers signaled a match. A zero-length matchAny // acts as a "wild card" that signals a potential match at every position. type matchAny []matcher diff --git a/core/filtermaps/matcher_backend.go b/core/filtermaps/matcher_backend.go index e19a63e18b..ccbc672f2e 100644 --- a/core/filtermaps/matcher_backend.go +++ b/core/filtermaps/matcher_backend.go @@ -121,7 +121,7 @@ func (fm *FilterMapsMatcherBackend) GetLogByLvIndex(ctx context.Context, lvIndex return fm.f.getLogByLvIndex(lvIndex) } -// synced signals to the matcher that has triggered a synchronisation that it +// synced signals to the matcher that has triggered a synchronization that it // has been finished and the log index is consistent with the chain head passed // as a parameter. // diff --git a/core/headerchain.go b/core/headerchain.go index 6e70dfa865..39e533e8b9 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -240,7 +240,7 @@ func (hc *HeaderChain) WriteHeaders(headers []*types.Header) (int, error) { // header as the chain head. // // Note: This method is not concurrent-safe with inserting blocks simultaneously -// into the chain, as side effects caused by reorganisations cannot be emulated +// into the chain, as side effects caused by reorganizations cannot be emulated // without the real blocks. Hence, writing headers directly should only be done // in two scenarios: pure-header mode of operation (light clients), or properly // separated header/block phases (non-archive clients). @@ -308,7 +308,7 @@ func (hc *HeaderChain) ValidateHeaderChain(chain []*types.Header) (int, error) { return 0, nil } -// InsertHeaderChain inserts the given headers and does the reorganisations. +// InsertHeaderChain inserts the given headers and does the reorganizations. // // The validity of the headers is NOT CHECKED by this method, i.e. they need to be // validated by ValidateHeaderChain before calling InsertHeaderChain. diff --git a/core/rawdb/accessors_indexes.go b/core/rawdb/accessors_indexes.go index 1a5c414c8e..21af1cc232 100644 --- a/core/rawdb/accessors_indexes.go +++ b/core/rawdb/accessors_indexes.go @@ -432,7 +432,7 @@ func DeleteBlockLvPointers(db ethdb.KeyValueStore, blocks common.Range[uint64], } // FilterMapsRange is a storage representation of the block range covered by the -// filter maps structure and the corresponting log value index range. +// filter maps structure and the corresponding log value index range. type FilterMapsRange struct { Version uint32 HeadIndexed bool diff --git a/core/rawdb/freezer_test.go b/core/rawdb/freezer_test.go index a7a3559ec4..1205c0a273 100644 --- a/core/rawdb/freezer_test.go +++ b/core/rawdb/freezer_test.go @@ -382,7 +382,7 @@ func TestFreezerCloseSync(t *testing.T) { f, _ := newFreezerForTesting(t, map[string]freezerTableConfig{"a": {noSnappy: true}, "b": {noSnappy: true}}) defer f.Close() - // Now, close and sync. This mimics the behaviour if the node is shut down, + // Now, close and sync. This mimics the behavior if the node is shut down, // just as the chain freezer is writing. // 1: thread-1: chain treezer writes, via freezeRange (holds lock) // 2: thread-2: Close called, waits for write to finish diff --git a/core/rawdb/freezer_utils.go b/core/rawdb/freezer_utils.go index 752e95ba6a..2ccccfe317 100644 --- a/core/rawdb/freezer_utils.go +++ b/core/rawdb/freezer_utils.go @@ -79,7 +79,7 @@ func copyFrom(srcPath, destPath string, offset uint64, before func(f *os.File) e // openFreezerFileForAppend opens a freezer table file and seeks to the end func openFreezerFileForAppend(filename string) (*os.File, error) { // Open the file without the O_APPEND flag - // because it has differing behaviour during Truncate operations + // because it has differing behavior during Truncate operations // on different OS's file, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE, 0644) if err != nil { diff --git a/core/state/snapshot/difflayer.go b/core/state/snapshot/difflayer.go index 28957051d4..d3edd14335 100644 --- a/core/state/snapshot/difflayer.go +++ b/core/state/snapshot/difflayer.go @@ -72,7 +72,7 @@ var ( // the bloom offsets are runtime constants which determines which part of the // account/storage hash the hasher functions looks at, to determine the // bloom key for an account/slot. This is randomized at init(), so that the - // global population of nodes do not all display the exact same behaviour with + // global population of nodes do not all display the exact same behavior with // regards to bloom content bloomAccountHasherOffset = 0 bloomStorageHasherOffset = 0 diff --git a/core/state/snapshot/iterator_fast.go b/core/state/snapshot/iterator_fast.go index 61fc434178..3671d68972 100644 --- a/core/state/snapshot/iterator_fast.go +++ b/core/state/snapshot/iterator_fast.go @@ -26,7 +26,7 @@ import ( "github.com/ethereum/go-ethereum/common" ) -// weightedIterator is an iterator with an assigned weight. It is used to prioritise +// weightedIterator is an iterator with an assigned weight. It is used to prioritize // which account or storage slot is the correct one if multiple iterators find the // same one (modified in multiple consecutive blocks). type weightedIterator struct { diff --git a/core/state/state_object.go b/core/state/state_object.go index a6979bd361..8e400ed1f0 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -233,7 +233,7 @@ func (s *stateObject) setState(key common.Hash, value common.Hash, origin common s.dirtyStorage[key] = value } -// finalise moves all dirty storage slots into the pending area to be hashed or +// finalize moves all dirty storage slots into the pending area to be hashed or // committed later. It is invoked at the end of every transaction. func (s *stateObject) finalise() { slotsToPrefetch := make([]common.Hash, 0, len(s.dirtyStorage)) diff --git a/core/state/statedb.go b/core/state/statedb.go index 9378cae7de..d440b6dca0 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -733,8 +733,8 @@ func (s *StateDB) GetRefund() uint64 { return s.refund } -// Finalise finalises the state by removing the destructed objects and clears -// the journal as well as the refunds. Finalise, however, will not push any updates +// Finalize finalizes the state by removing the destructed objects and clears +// the journal as well as the refunds. Finalize, however, will not push any updates // into the tries just yet. Only IntermediateRoot or Commit will do that. func (s *StateDB) Finalise(deleteEmptyObjects bool) { addressesToPrefetch := make([]common.Address, 0, len(s.journal.dirties)) @@ -780,7 +780,7 @@ func (s *StateDB) Finalise(deleteEmptyObjects bool) { // It is called in between transactions to get the root hash that // goes into transaction receipts. func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash { - // Finalise all the dirty storage states and write them into the tries + // Finalize all the dirty storage states and write them into the tries s.Finalise(deleteEmptyObjects) // If there was a trie prefetcher operating, terminate it async so that the diff --git a/core/state/statedb_fuzz_test.go b/core/state/statedb_fuzz_test.go index 7dada63d45..177ee0c4f6 100644 --- a/core/state/statedb_fuzz_test.go +++ b/core/state/statedb_fuzz_test.go @@ -216,7 +216,7 @@ func (test *stateTest) run() bool { for i, action := range actions { if i%test.chunk == 0 && i != 0 { if byzantium { - state.Finalise(true) // call finalise at the transaction boundary + state.Finalise(true) // call finalize at the transaction boundary } else { state.IntermediateRoot(true) // call intermediateRoot at the transaction boundary } @@ -224,7 +224,7 @@ func (test *stateTest) run() bool { action.fn(action, state) } if byzantium { - state.Finalise(true) // call finalise at the transaction boundary + state.Finalise(true) // call finalize at the transaction boundary } else { state.IntermediateRoot(true) // call intermediateRoot at the transaction boundary } diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index e740c64faa..f09dd0f29d 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -196,7 +196,7 @@ func TestCopy(t *testing.T) { ccopy.updateStateObject(copyObj) } - // Finalise the changes on all concurrently + // Finalize the changes on all concurrently finalise := func(wg *sync.WaitGroup, db *StateDB) { defer wg.Done() db.Finalise(true) @@ -320,7 +320,7 @@ func TestSnapshotRandom(t *testing.T) { // // A new state is created and all actions are applied to it. Several snapshots are taken // in between actions. The test then reverts each snapshot. For each snapshot the actions -// leading up to it are replayed on a fresh, empty state. The behaviour of all public +// leading up to it are replayed on a fresh, empty state. The behavior of all public // accessor methods on the reverted state must match the return value of the equivalent // methods on the replayed state. type snapshotTest struct { diff --git a/core/state_prefetcher.go b/core/state_prefetcher.go index f3129f57cd..a08b10f45c 100644 --- a/core/state_prefetcher.go +++ b/core/state_prefetcher.go @@ -38,7 +38,7 @@ type statePrefetcher struct { chain *HeaderChain // Canonical block chain } -// newStatePrefetcher initialises a new statePrefetcher. +// newStatePrefetcher initializes a new statePrefetcher. func newStatePrefetcher(config *params.ChainConfig, chain *HeaderChain) *statePrefetcher { return &statePrefetcher{ config: config, diff --git a/core/state_processor.go b/core/state_processor.go index 322bd24f41..26d7028337 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -39,7 +39,7 @@ type StateProcessor struct { chain *HeaderChain // Canonical header chain } -// NewStateProcessor initialises a new StateProcessor. +// NewStateProcessor initializes a new StateProcessor. func NewStateProcessor(config *params.ChainConfig, chain *HeaderChain) *StateProcessor { return &StateProcessor{ config: config, diff --git a/core/state_transition.go b/core/state_transition.go index ff2051ddd2..1dd3e0d87a 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -241,7 +241,7 @@ type stateTransition struct { evm *vm.EVM } -// newStateTransition initialises and returns a new state transition object. +// newStateTransition initializes and returns a new state transition object. func newStateTransition(evm *vm.EVM, msg *Message, gp *GasPool) *stateTransition { return &stateTransition{ gp: gp, @@ -580,7 +580,7 @@ func (st *stateTransition) validateAuthorization(auth *types.SetCodeAuthorizatio return authority, fmt.Errorf("%w: %v", ErrAuthorizationInvalidSignature, err) } // Check the authority account - // 1) doesn't have code or has exisiting delegation + // 1) doesn't have code or has existing delegation // 2) matches the auth's nonce // // Note it is added to the access list even if the authorization is invalid. diff --git a/core/txpool/blobpool/blobpool.go b/core/txpool/blobpool/blobpool.go index e506da228d..a9d3fd12f6 100644 --- a/core/txpool/blobpool/blobpool.go +++ b/core/txpool/blobpool/blobpool.go @@ -134,7 +134,7 @@ func newBlobTxMeta(id uint64, size uint64, storageSize uint32, tx *types.Transac // // Blob transactions are special snowflakes that are designed for a very specific // purpose (rollups) and are expected to adhere to that specific use case. These -// behavioural expectations allow us to design a transaction pool that is more robust +// behavioral expectations allow us to design a transaction pool that is more robust // (i.e. resending issues) and more resilient to DoS attacks (e.g. replace-flush // attacks) than the generic tx pool. These improvements will also mean, however, // that we enforce a significantly more aggressive strategy on entering and exiting @@ -193,7 +193,7 @@ func newBlobTxMeta(id uint64, size uint64, storageSize uint32, tx *types.Transac // are immediately evicted from the pool since they are contained in the // including block. Blobs however are not included in the execution chain, // so a mini reorg cannot re-pool "lost" blob transactions. To support reorgs, -// blobs are retained on disk until they are finalised. +// blobs are retained on disk until they are finalized. // // - Blobs can arrive via flashbots. Blocks might contain blob transactions we // have never seen on the network. Since we cannot recover them from blocks @@ -288,7 +288,7 @@ func newBlobTxMeta(id uint64, size uint64, storageSize uint32, tx *types.Transac // // priority = min(deltaBasefee, deltaBlobfee, 0) // -// Optimisation tradeoffs: +// Optimization tradeoffs: // // - Eviction relies on 3 fee minimums per account (exec tip, exec cap and blob // cap). Maintaining these values across all transactions from the account is diff --git a/core/txpool/blobpool/lookup.go b/core/txpool/blobpool/lookup.go index 7607cd487a..2911d696d2 100644 --- a/core/txpool/blobpool/lookup.go +++ b/core/txpool/blobpool/lookup.go @@ -21,7 +21,7 @@ import ( ) type txMetadata struct { - id uint64 // the billy id of transction + id uint64 // the billy id of transaction size uint64 // the RLP encoded size of transaction (blobs are included) } diff --git a/core/txpool/legacypool/legacypool_test.go b/core/txpool/legacypool/legacypool_test.go index 2fdf890320..8ebc020c9b 100644 --- a/core/txpool/legacypool/legacypool_test.go +++ b/core/txpool/legacypool/legacypool_test.go @@ -814,7 +814,7 @@ func TestPostponing(t *testing.T) { if pool.all.Count() != len(txs) { t.Errorf("total transaction mismatch: have %d, want %d", pool.all.Count(), len(txs)) } - // Reduce the balance of the account, and check that transactions are reorganised + // Reduce the balance of the account, and check that transactions are reorganized for _, addr := range accs { testAddBalance(pool, addr, big.NewInt(-1)) } diff --git a/core/txpool/legacypool/list.go b/core/txpool/legacypool/list.go index 736c28ec4a..943cfcab13 100644 --- a/core/txpool/legacypool/list.go +++ b/core/txpool/legacypool/list.go @@ -109,7 +109,7 @@ func (m *SortedMap) Forward(threshold uint64) types.Transactions { // Filter iterates over the list of transactions and removes all of them for which // the specified function evaluates to true. -// Filter, as opposed to 'filter', re-initialises the heap after the operation is done. +// Filter, as opposed to 'filter', re-initializes the heap after the operation is done. // If you want to do several consecutive filterings, it's therefore better to first // do a .filter(func1) followed by .Filter(func2) or reheap() func (m *SortedMap) Filter(filter func(*types.Transaction) bool) types.Transactions { diff --git a/core/txpool/txpool.go b/core/txpool/txpool.go index cc8f74c1b8..24a73dc796 100644 --- a/core/txpool/txpool.go +++ b/core/txpool/txpool.go @@ -481,7 +481,7 @@ func (p *TxPool) Status(hash common.Hash) TxStatus { // Sync is a helper method for unit tests or simulator runs where the chain events // are arriving in quick succession, without any time in between them to run the // internal background reset operations. This method will run an explicit reset -// operation to ensure the pool stabilises, thus avoiding flakey behavior. +// operation to ensure the pool stabilizes, thus avoiding flakey behavior. // // Note, this method is only used for testing and is susceptible to DoS vectors. // In production code, the pool is meant to reset on a separate thread. diff --git a/core/types/block.go b/core/types/block.go index b284fb3b16..7c3de0e8dc 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -429,7 +429,7 @@ func (b *Block) BlobGasUsed() *uint64 { return blobGasUsed } -// ExecutionWitness returns the verkle execution witneess + proof for a block +// ExecutionWitness returns the verkle execution witness + proof for a block func (b *Block) ExecutionWitness() *ExecutionWitness { return b.witness } // Size returns the true RLP encoded storage size of the block, either by encoding diff --git a/core/types/log.go b/core/types/log.go index 54c7ff6372..72b0f5b9e6 100644 --- a/core/types/log.go +++ b/core/types/log.go @@ -48,7 +48,7 @@ type Log struct { // index of the log in the block Index uint `json:"logIndex" rlp:"-"` - // The Removed field is true if this log was reverted due to a chain reorganisation. + // The Removed field is true if this log was reverted due to a chain reorganization. // You must pay attention to this field if you receive logs through a filter query. Removed bool `json:"removed" rlp:"-"` } diff --git a/core/vm/contract.go b/core/vm/contract.go index 0eaa91d959..2d061ba9cc 100644 --- a/core/vm/contract.go +++ b/core/vm/contract.go @@ -25,9 +25,9 @@ import ( // Contract represents an ethereum contract in the state database. It contains // the contract code, calling arguments. Contract implements ContractRef type Contract struct { - // caller is the result of the caller which initialised this + // caller is the result of the caller which initialized this // contract. However, when the "call method" is delegated this - // value needs to be initialised to that of the caller's caller. + // value needs to be initialized to that of the caller's caller. caller common.Address address common.Address diff --git a/core/vm/evm.go b/core/vm/evm.go index ecb0f118ec..5515cbe754 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -104,7 +104,7 @@ type EVM struct { // chain rules contains the chain rules for the current epoch chainRules params.Rules - // virtual machine configuration options used to initialise the evm + // virtual machine configuration options used to initialize the evm Config Config // global (to this context) ethereum virtual machine used throughout @@ -226,7 +226,7 @@ func (evm *EVM) Call(caller common.Address, addr common.Address, input []byte, g if isPrecompile { ret, gas, err = RunPrecompiledContract(p, input, gas, evm.Config.Tracer) } else { - // Initialise a new contract and set the code that is to be used by the EVM. + // Initialize a new contract and set the code that is to be used by the EVM. code := evm.resolveCode(addr) if len(code) == 0 { ret, err = nil, nil // gas is unchanged @@ -290,7 +290,7 @@ func (evm *EVM) CallCode(caller common.Address, addr common.Address, input []byt if p, isPrecompile := evm.precompile(addr); isPrecompile { ret, gas, err = RunPrecompiledContract(p, input, gas, evm.Config.Tracer) } else { - // Initialise a new contract and set the code that is to be used by the EVM. + // Initialize a new contract and set the code that is to be used by the EVM. // The contract is a scoped environment for this execution context only. contract := NewContract(caller, caller, value, gas, evm.jumpDests) contract.SetCallCode(evm.resolveCodeHash(addr), evm.resolveCode(addr)) @@ -333,7 +333,7 @@ func (evm *EVM) DelegateCall(originCaller common.Address, caller common.Address, if p, isPrecompile := evm.precompile(addr); isPrecompile { ret, gas, err = RunPrecompiledContract(p, input, gas, evm.Config.Tracer) } else { - // Initialise a new contract and make initialise the delegate values + // Initialize a new contract and make initialize the delegate values // // Note: The value refers to the original value from the parent call. contract := NewContract(originCaller, caller, value, gas, evm.jumpDests) @@ -385,7 +385,7 @@ func (evm *EVM) StaticCall(caller common.Address, addr common.Address, input []b if p, isPrecompile := evm.precompile(addr); isPrecompile { ret, gas, err = RunPrecompiledContract(p, input, gas, evm.Config.Tracer) } else { - // Initialise a new contract and set the code that is to be used by the EVM. + // Initialize a new contract and set the code that is to be used by the EVM. // The contract is a scoped environment for this execution context only. contract := NewContract(caller, addr, new(uint256.Int), gas, evm.jumpDests) contract.SetCallCode(evm.resolveCodeHash(addr), evm.resolveCode(addr)) @@ -492,7 +492,7 @@ func (evm *EVM) create(caller common.Address, code []byte, gas uint64, value *ui } evm.Context.Transfer(evm.StateDB, caller, address, value) - // Initialise a new contract and set the code that is to be used by the EVM. + // Initialize a new contract and set the code that is to be used by the EVM. // The contract is a scoped environment for this execution context only. contract := NewContract(caller, address, value, gas, evm.jumpDests) diff --git a/core/vm/interface.go b/core/vm/interface.go index 57f35cb249..f7a10e6ee1 100644 --- a/core/vm/interface.go +++ b/core/vm/interface.go @@ -99,6 +99,6 @@ type StateDB interface { AccessEvents() *state.AccessEvents - // Finalise must be invoked at the end of a transaction + // Finalize must be invoked at the end of a transaction Finalise(bool) } diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index a62c3c843d..a0faf2826c 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -103,7 +103,7 @@ type EVMInterpreter struct { // NewEVMInterpreter returns a new instance of the Interpreter. func NewEVMInterpreter(evm *EVM) *EVMInterpreter { - // If jump table was not initialised we set the default one. + // If jump table was not initialized we set the default one. var table *JumpTable switch { case evm.chainRules.IsVerkle: @@ -189,7 +189,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) ( Stack: stack, Contract: contract, } - // For optimisation reason we're using uint64 as the program counter. + // For optimization reason we're using uint64 as the program counter. // It's theoretically possible to go above 2^64. The YP defines the PC // to be uint256. Practically much less so feasible. pc = uint64(0) // program counter diff --git a/core/vm/program/program.go b/core/vm/program/program.go index 5b9cfdcc5f..2fe07e39c1 100644 --- a/core/vm/program/program.go +++ b/core/vm/program/program.go @@ -332,7 +332,7 @@ func (p *Program) MemToStorage(memStart, memSize, startSlot int) *Program { return p } -// ReturnViaCodeCopy utilises CODECOPY to place the given data in the bytecode of +// ReturnViaCodeCopy utilizes CODECOPY to place the given data in the bytecode of // p, loads into memory (offset 0) and returns the code. // This is a typical "constructor". // Note: since all indexing is calculated immediately, the preceding bytecode