Skip to content

Commit bebf9ba

Browse files
committed
memory improvement
1 parent 41ef817 commit bebf9ba

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ethereum/pow/ethpow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def hashimoto_slow(
3636
hashimoto = hashimoto_slow
3737
elif ETHASH_LIB == "pyethash":
3838

39-
@lru_cache(10)
39+
@lru_cache(2)
4040
def calculate_cache(n):
4141
return pyethash.mkcache_bytes(n * EPOCH_LENGTH)
4242

quarkchain/cluster/shard_db_operator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,10 @@ def put_minor_block(self, m_block, x_shard_receive_tx_list):
332332
self.height_to_minor_block_hashes.setdefault(m_block.header.height, set()).add(
333333
m_block.header.get_hash()
334334
)
335+
if m_block.header.height - 4096 in self.height_to_minor_block_hashes:
336+
del self.height_to_minor_block_hashes[
337+
m_block.header.height - 4096
338+
]
335339

336340
self.put_confirmed_cross_shard_transaction_deposit_list(
337341
m_block_hash, x_shard_receive_tx_list

0 commit comments

Comments
 (0)