If I got it right, I can (in essence) detect a reorg by detecting two blocks with identical block numbers but different hashes.
I believe your idea is to store confirmed blocks together with their hashes. As an example, I would be able to search old events by block 12990639
and eliminate those events whose hash differs from 0x9e77b2e848c5bfa67cdd46a4fsd12df0daa2e8fde18f35db58c0406fe43e766f
. That would work.
However, I see one problem here. Assume the transaction from block 12990639
gets dropped. Itās gone and I never get the confirmation from Moralis. The next relevant transaction appears in block 12990641. This transaction ends up being confirmed at some point in time.
The event from block 12990639
would still hang in my database. Since there were no other relevant events in that block, and the new event appears in a later block, I have no way of detecting that I should remove the event from block 12990639
(using only Moralis).