safe-global / safe-transaction-service

Keeps track of transactions sent via Safe contacts and confirmed transactions. It also keeps track of Ether and ERC20 token transfers to Safe contracts.
MIT License
182 stars 246 forks source link

[ Indexer ] `process_decoded_internal_txs_for_safe_task` is able to mark as unprocessed million of transactions for a Safe. #2102

Closed moisses89 closed 4 days ago

moisses89 commented 1 week ago

Describe the bug The task process_decoded_internal_txs_for_safe_task check if a new decoded tx appeared before other already processed (due to a reindex). If it happen the function call reprocess_addresses with the affected address. This function will remove all the stored safe statuses and will mark as not processed all the transactions for a given Safe.
When this situation is happening for a Safe with millions of transactions, this Safe will be reprocessed from scratch consuming a lot of resources and taking long time to do it.

Expected behavior Reprocess just from a prudential number of transactions before the affected transaction, just several blocks instead all from scratch.