Skip to content
Prev Previous commit
Next Next commit
#409 remove unused variables
  • Loading branch information
otselnik committed Dec 26, 2021
commit 3e1e825473031a960d95193c9cc84de3db563c58
3 changes: 0 additions & 3 deletions proxy/indexer/indexer_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,12 @@ def __init__(self,
self.evm_loader_id = evm_loader_id
self.client = Client(solana_url)
self.transaction_receipts = SQLDictBinKey(tablename="known_transactions")
self.last_slot = start_slot
self.current_slot = 0
self.counter_ = 0

if len(self.transaction_receipts) > 0:
self.min_known_tx = min(self.transaction_receipts)
self.max_known_tx = max(self.transaction_receipts)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems this call can cause unnecessary iteration over all table. I'd rather prefer to explicitely define methods min_key and max_key in SQLDictBinKey that will execute corresponding optimized queries in DB.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is impossible in the current realization of SQLDictBinKey. It stores the key as serialized binary.

Copy link
Contributor

@ivandzen ivandzen Dec 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to separate current key column by two columns: 'slot', 'signature' and use it in composite key. The 'slot' column then can be used to create index. This will allow to create optimized queries for airdropper and also to find min and max txs

else:
self.min_known_tx = (0, None)
self.max_known_tx = (0, None)

self._move_data_from_old_table()
Expand Down