rm unused key and cache

This commit is contained in:
jagdeep sidhu 2024-10-10 21:13:03 -07:00
parent 5c2e3d48ee
commit 8c969f21e3
2 changed files with 0 additions and 9 deletions

View file

@ -70,7 +70,6 @@ type HeaderChain struct {
tdCache *lru.Cache[common.Hash, *big.Int] // most recent total difficulties tdCache *lru.Cache[common.Hash, *big.Int] // most recent total difficulties
numberCache *lru.Cache[common.Hash, uint64] // most recent block numbers numberCache *lru.Cache[common.Hash, uint64] // most recent block numbers
// SYSCOIN // SYSCOIN
NEVMCache *lru.Cache[common.Hash, []byte] // Cache for NEVM blocks existing
SYSHashCache *lru.Cache[uint64, []byte] // Cache for SYS hash SYSHashCache *lru.Cache[uint64, []byte] // Cache for SYS hash
DataHashCache *lru.Cache[common.Hash, []byte] // Cache for Data availability DataHashCache *lru.Cache[common.Hash, []byte] // Cache for Data availability
NEVMAddressCache *rawdb.NEVMAddressMapping NEVMAddressCache *rawdb.NEVMAddressMapping
@ -90,7 +89,6 @@ func NewHeaderChain(chainDb ethdb.Database, config *params.ChainConfig, engine c
// SYSCOIN // SYSCOIN
SYSHashCache: lru.NewCache[uint64, []byte](SYSBlockCacheLimit), SYSHashCache: lru.NewCache[uint64, []byte](SYSBlockCacheLimit),
DataHashCache: lru.NewCache[common.Hash, []byte](SYSBlockCacheLimit), DataHashCache: lru.NewCache[common.Hash, []byte](SYSBlockCacheLimit),
NEVMCache: lru.NewCache[common.Hash, []byte](headerCacheLimit),
procInterrupt: procInterrupt, procInterrupt: procInterrupt,
engine: engine, engine: engine,
} }
@ -718,7 +716,6 @@ func (hc *HeaderChain) setHead(headBlock uint64, headTime uint64, updateFn Updat
hc.numberCache.Purge() hc.numberCache.Purge()
// SYSCOIN // SYSCOIN
hc.SYSHashCache.Purge() hc.SYSHashCache.Purge()
hc.NEVMCache.Purge()
hc.DataHashCache.Purge() hc.DataHashCache.Purge()
} }

View file

@ -115,7 +115,6 @@ var (
skeletonHeaderPrefix = []byte("S") // skeletonHeaderPrefix + num (uint64 big endian) -> header skeletonHeaderPrefix = []byte("S") // skeletonHeaderPrefix + num (uint64 big endian) -> header
// SYSCOIN // SYSCOIN
nevmToSysPrefix = []byte("x") // nevmToSysPrefix + nevm block hash -> nevmBlock
blockNumToSysKeyPrefix = []byte("z") // blockNumToSysKeyPrefix + block number -> SYS block hash blockNumToSysKeyPrefix = []byte("z") // blockNumToSysKeyPrefix + block number -> SYS block hash
dataHashesKeyPrefix = []byte("y") // dataHashesKeyPrefix + block number -> versioned hashes dataHashesKeyPrefix = []byte("y") // dataHashesKeyPrefix + block number -> versioned hashes
dataHashKeyPrefix = []byte("w") // dataHashKeyPrefix + versioned hash -> versioned hash dataHashKeyPrefix = []byte("w") // dataHashKeyPrefix + versioned hash -> versioned hash
@ -356,11 +355,6 @@ func IsStorageTrieNode(key []byte) bool {
} }
// SYSCOIN // SYSCOIN
// nevmToSysKey = nevmToSysPrefix + hash
func nevmToSysKey(hash common.Hash) []byte {
return append(nevmToSysPrefix, hash.Bytes()...)
}
// blockNumToSysKey = blockNumToSysKeyPrefix + blocknumber // blockNumToSysKey = blockNumToSysKeyPrefix + blocknumber
func blockNumToSysKey(n uint64) []byte { func blockNumToSysKey(n uint64) []byte {
return append(blockNumToSysKeyPrefix, []byte(new(big.Int).SetUint64(n).String())...) return append(blockNumToSysKeyPrefix, []byte(new(big.Int).SetUint64(n).String())...)