I've added the --debug flag and the first indexer_for_explorer debug message to reason about how the cache is working, it should allow us to put some more logs if needed
Add ReceiptCache which is a HashMap of accordance between Receipt ID and parent Transaction hash.
The working flow looks like this:
First we handle transactions and we store the pair converted_into_receipt_id: transaction_hash to the cache
When processing receipts we look into the cache to get a parent transaction hash for each of the receipts
[Fallback logic] If we don't observe parent transaction hash for specific receipts we are looking for them in the database
ExecutionOutcomes stage. We are interested in those outcomes that result in another receipt(s). We get all those receipts' ids and we take the parent transaction hash for the original receipt from the cache. Then we put receipt_id: transaction_hash for each of the new receipts.
Resolves #229
--debug
flag and the firstindexer_for_explorer
debug message to reason about how the cache is working, it should allow us to put some more logs if neededReceiptCache
which is aHashMap
of accordance between Receipt ID and parent Transaction hash. The working flow looks like this:converted_into_receipt_id: transaction_hash
to the cachereceipt_id: transaction_hash
for each of the new receipts.