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

View file

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