core/state: fix typos in comments (#29767)

pull/29768/head^2
gitglorythegreat 4 months ago committed by GitHub
parent 42471d7a3e
commit 871e55d93e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      core/state/state_object.go
  2. 8
      core/state/trie_prefetcher.go

@ -127,7 +127,7 @@ func (s *stateObject) touch() {
} }
} }
// getTrie returns the associated storage trie. The trie will be opened if it' // getTrie returns the associated storage trie. The trie will be opened if it's
// not loaded previously. An error will be returned if trie can't be loaded. // not loaded previously. An error will be returned if trie can't be loaded.
// //
// If a new trie is opened, it will be cached within the state object to allow // If a new trie is opened, it will be cached within the state object to allow
@ -156,7 +156,7 @@ func (s *stateObject) getPrefetchedTrie() (Trie, error) {
if s.data.Root == types.EmptyRootHash || s.db.prefetcher == nil { if s.data.Root == types.EmptyRootHash || s.db.prefetcher == nil {
return nil, nil return nil, nil
} }
// Attempt to retrieve the trie from the pretecher // Attempt to retrieve the trie from the prefetcher
return s.db.prefetcher.trie(s.addrHash, s.data.Root) return s.db.prefetcher.trie(s.addrHash, s.data.Root)
} }
@ -311,7 +311,7 @@ func (s *stateObject) updateTrie() (Trie, error) {
if len(s.pendingStorage) == 0 { if len(s.pendingStorage) == 0 {
return s.trie, nil return s.trie, nil
} }
// Retrieve a pretecher populated trie, or fall back to the database // Retrieve a prefetcher populated trie, or fall back to the database
tr, err := s.getPrefetchedTrie() tr, err := s.getPrefetchedTrie()
switch { switch {
case err != nil: case err != nil:

@ -72,7 +72,7 @@ func newTriePrefetcher(db Database, root common.Hash, namespace string) *triePre
} }
} }
// terminate iterates over all the subfetchers and issues a terminateion request // terminate iterates over all the subfetchers and issues a termination request
// to all of them. Depending on the async parameter, the method will either block // to all of them. Depending on the async parameter, the method will either block
// until all subfetchers spin down, or return immediately. // until all subfetchers spin down, or return immediately.
func (p *triePrefetcher) terminate(async bool) { func (p *triePrefetcher) terminate(async bool) {
@ -234,7 +234,7 @@ func (sf *subfetcher) schedule(keys [][]byte) error {
case sf.wake <- struct{}{}: case sf.wake <- struct{}{}:
// Wake signal sent // Wake signal sent
default: default:
// Wake signal not sent as a previous is already queued // Wake signal not sent as a previous one is already queued
} }
return nil return nil
} }
@ -250,7 +250,7 @@ func (sf *subfetcher) wait() {
// peeks for the original data. The method will block until all the scheduled // peeks for the original data. The method will block until all the scheduled
// data has been loaded and the fethcer terminated. // data has been loaded and the fethcer terminated.
func (sf *subfetcher) peek() Trie { func (sf *subfetcher) peek() Trie {
// Block until the fertcher terminates, then retrieve the trie // Block until the fetcher terminates, then retrieve the trie
sf.wait() sf.wait()
return sf.trie return sf.trie
} }
@ -296,7 +296,7 @@ func (sf *subfetcher) loop() {
for { for {
select { select {
case <-sf.wake: case <-sf.wake:
// Execute all remaining tasks in single run // Execute all remaining tasks in a single run
sf.lock.Lock() sf.lock.Lock()
tasks := sf.tasks tasks := sf.tasks
sf.tasks = nil sf.tasks = nil

Loading…
Cancel
Save