Skip to content

Commit

Permalink
fix: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
flywukong committed Jul 12, 2024
1 parent 8fa7895 commit 1b7bb5d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
6 changes: 2 additions & 4 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,8 @@ type txLookup struct {
// included in the canonical one where as GetBlockByNumber always represents the
// canonical chain.
type BlockChain struct {
chainConfig *params.ChainConfig // Chain & network configuration
cacheConfig *CacheConfig // Cache configuration for pruning

hasBadBlock bool
chainConfig *params.ChainConfig // Chain & network configuration
cacheConfig *CacheConfig // Cache configuration for pruning
db ethdb.Database // Low level persistent database to store final content in
snaps *snapshot.Tree // Snapshot tree for fast trie leaf access
triegc *prque.Prque[int64, common.Hash] // Priority queue mapping block numbers to tries to gc
Expand Down
4 changes: 2 additions & 2 deletions core/state/shared_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func (s *StoragePool) getStorage(address common.Address) *sync.Map {
// CacheAmongBlocks is used to store difflayer data in a flat cache,
// it only stores the latest version of the data
type CacheAmongBlocks struct {
cacheRoot common.Hash
sMux sync.Mutex // TODO use mutex to update the cache if pipeline used the cache
cacheRoot common.Hash
// sMux sync.Mutex // TODO use mutex to update the cache if pipeline used the cache
accountsCache *fastcache.Cache
storagesCache *fastcache.Cache
}
Expand Down
1 change: 0 additions & 1 deletion core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ func (s *stateObject) GetCommittedState(key common.Hash) common.Hash {
} else {
SnapshotBlockCacheStorageMissMeter.Mark(1)
}

}
if !exist {
enc, err = s.db.snap.Storage(s.addrHash, storageKey)
Expand Down
7 changes: 1 addition & 6 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ const (
storageDeleteLimit = 512 * 1024 * 1024
)

var HasBadBlock bool

type revision struct {
id int
journalIndex int
Expand All @@ -69,7 +67,6 @@ type revision struct {
// commit states.
type StateDB struct {
db Database
hasbadblock bool
prefetcherLock sync.Mutex
prefetcher *triePrefetcher
trie Trie
Expand Down Expand Up @@ -751,7 +748,7 @@ func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject {
SnapshotBlockCacheAccountMissMeter.Mark(1)
}
}
if exist == false {
if !exist {
acc, err = s.snap.Account(accounthash)
if metrics.EnabledExpensive {
s.SnapshotAccountReads += time.Since(start)
Expand All @@ -762,7 +759,6 @@ func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject {
}
}
}

if err == nil || exist {
data = &types.StateAccount{
Nonce: acc.Nonce,
Expand Down Expand Up @@ -1822,7 +1818,6 @@ func (s *StateDB) SnapToDiffLayer() ([]common.Address, []types.DiffAccount, []ty
s.cacheAmongBlocks.PurgeStorageCache()
}
}

}

accounts := make([]types.DiffAccount, 0, len(s.accounts))
Expand Down

0 comments on commit 1b7bb5d

Please sign in to comment.