Skip to content

Commit

Permalink
497 proxy high memory usage (#504)
Browse files Browse the repository at this point in the history
* Add limit 1 for fetchone requests to db. #497
* Remove moving of old transactions. #497
* Add limit on number of return logs. #497
  • Loading branch information
afalaleev authored Jan 27, 2022
1 parent 842cff9 commit d74fb89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 0 additions & 7 deletions proxy/indexer/indexer_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def __init__(self,
self.evm_loader_id = evm_loader_id
self.client = Client(solana_url)
self.transaction_receipts = TrxReceiptsStorage('transaction_receipts')
self._move_data_from_old_table()
self.max_known_tx = self.transaction_receipts.max_known_trx()
self.last_slot = self._init_last_slot('receipt', last_slot)
self.current_slot = 0
Expand Down Expand Up @@ -72,12 +71,6 @@ def _init_last_slot(self, name: str, last_known_slot: int):
self.info(f'START_SLOT={START_SLOT}: started the {name} from {start_int_slot}')
return start_int_slot

def _move_data_from_old_table(self):
if self.transaction_receipts.size() == 0:
transaction_receipts_old = SQLDict(tablename="known_transactions")
for signature, trx in transaction_receipts_old.iteritems():
self._add_trx(signature, trx)

def run(self):
while (True):
try:
Expand Down
2 changes: 2 additions & 0 deletions proxy/indexer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ def get_logs(self, fromBlock = None, toBlock = None, address = None, topics = No
if idx < len(queries) - 1:
query_string += " AND "

query_string += ' ORDER BY slot desc LIMIT 1000'

self.debug(query_string)
self.debug(params)

Expand Down

0 comments on commit d74fb89

Please sign in to comment.