From 2f15fc56cd2045c990f4c885c1b28591c2829912 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sat, 30 Apr 2022 18:17:46 -0400 Subject: [PATCH] reduce cache size --- scribe/db/db.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scribe/db/db.py b/scribe/db/db.py index e00b0cf..7e48067 100644 --- a/scribe/db/db.py +++ b/scribe/db/db.py @@ -91,7 +91,7 @@ class HubDB: # lru cache of tx_hash: (tx_bytes, tx_num, position, tx_height) self.tx_cache = LRUCacheWithMetrics(2 ** 14, metric_name='tx', namespace=NAMESPACE) # lru cache of block heights to merkle trees of the block tx hashes - self.merkle_cache = LRUCacheWithMetrics(2 ** 15, metric_name='merkle', namespace=NAMESPACE) + self.merkle_cache = LRUCacheWithMetrics(2 ** 13, metric_name='merkle', namespace=NAMESPACE) # these are only used if the cache_all_tx_hashes setting is on self.total_transactions: List[bytes] = [] @@ -100,10 +100,8 @@ class HubDB: # these are only used if the cache_all_claim_txos setting is on self.claim_to_txo: Dict[bytes, ClaimToTXOValue] = {} self.txo_to_claim: DefaultDict[int, Dict[int, bytes]] = defaultdict(dict) - self.genesis_bytes = bytes.fromhex(self.coin.GENESIS_HASH) - def get_claim_from_txo(self, tx_num: int, tx_idx: int) -> Optional[TXOToClaimValue]: claim_hash_and_name = self.prefix_db.txo_to_claim.get(tx_num, tx_idx) if not claim_hash_and_name: