When the indexer starts fresh or restarts, it should backfill all past contract events from the deployment block to the current block before switching to live subscription mode. Store the last indexed block in the database and resume from there on restart to avoid re-indexing everything each time.
When the indexer starts fresh or restarts, it should backfill all past contract events from the deployment block to the current block before switching to live subscription mode. Store the last indexed block in the database and resume from there on restart to avoid re-indexing everything each time.