> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Unfinalized blocks and reorgs

> How Squid SDK handles unfinalized blocks and reorgs.

The Tron processor can index blocks all the way to the current chain head, including blocks that have not yet been finalized. Real-time data requires an HTTP API data source - add one with [`setHttpApi()`](../../reference/tron-processor/general#set-http-api).

## Indexing unfinalized blocks

To index unfinalized ("hot") blocks and stay correct across chain reorganizations, a squid must use a [`Database`](../../reference/data-stores/store-interface) with hot block support (e.g. [`TypeormDatabase`](../writing-to-postgres)) in its `processor.run()` call, and not cap its block range below the chain head.

When a blockchain reorganization happens, the [processor](../../reference/tron-processor/general) rolls back any changes to the database made due to orphaned blocks, then re-runs its batch handler on consensus blocks, so that the state of the `Database` reflects the current chain consensus at all times.

<Warning>
  Database rollback does not undo external side effects such as Kafka messages or
  HTTP requests. Make those effects idempotent and reconcile provisional records
  by block height and hash, or delay irreversible actions until finality. See
  [Make external side effects reorg-safe](./tips-and-troubleshooting#make-external-side-effects-reorg-safe).
</Warning>


## Related topics

- [Unfinalized blocks and reorgs](/en/sdk/squid-sdk/evm/guides/advanced/unfinalized-blocks.md)
- [RPC ingestion and reorgs](/en/sdk/squid-sdk/substrate/guides/advanced/unfinalized-blocks.md)
- [Squid SDK tips and troubleshooting](/en/sdk/squid-sdk/evm/guides/advanced/tips-and-troubleshooting.md)
- [EVM Portal stream](/en/sdk/squid-sdk/evm/reference/evm-stream.md)
- [FAQ](/en/sdk/squid-sdk/evm/faq.md)
