> ## 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.

# Blockchain forks and recovery

> How Portal reports a chain reorganization while a client reads recent blocks.

A blockchain can reorganize, or **reorg**, when blocks on the current chain are
replaced by blocks from another branch. Data derived from the replaced blocks
must also be removed or recalculated.

Portal can detect this when a client resumes a standard stream with:

* `fromBlock`: the next block the client wants
* `parentBlockHash`: the hash of the block immediately before `fromBlock`

Portal compares the hash with the parent of `fromBlock` on the current chain.
If the hashes do not match, Portal returns HTTP `409 Conflict`. The client must
then find a block shared by its stored chain and the current chain, remove data
derived from later blocks, and resume after the shared block.

<Warning>
  Send `parentBlockHash` when resuming a standard stream near the chain head.
  Without it, Portal cannot report that the client's stored chain differs from
  the current chain.
</Warning>

The response shape, request examples, and recovery procedure are documented in
the chain-specific API guides:

<CardGroup cols={2}>
  <Card title="EVM fork recovery" icon="bolt" href="/en/portal/evm/api#handling-reorgs-near-the-chain-head">
    Handle HTTP 409 while reading recent EVM blocks.
  </Card>

  <Card title="Solana fork recovery" icon="bolt" href="/en/portal/solana/api#handling-reorgs-near-the-chain-head">
    Handle HTTP 409 while reading recent Solana blocks.
  </Card>
</CardGroup>

If recent blocks are not required, [use the finalized
stream](/en/portal/introduction/finalized-and-recent-data) instead.


## Related topics

- [Fork handling](/en/sdk/pipes-sdk/solana/guides/architecture-deep-dives/fork-handling.md)
- [Migrate to 1.0](/en/sdk/pipes-sdk/solana/migration.md)
- [ClickHouse](/en/sdk/pipes-sdk/solana/guides/basic-development/targets/clickhouse.md)
- [Cursor management](/en/sdk/pipes-sdk/solana/guides/architecture-deep-dives/cursor-management.md)
- [Stateful transforms](/en/sdk/pipes-sdk/solana/guides/advanced-topics/stateful-transforms.md)
