Reorg Handling
Arc can reorganise its most recent blocks. ChainForge indexes to the head with a two-block lag and repairs any block whose hash changes.
Detection
On every new block, the indexer compares the parent hash with the stored hash at height − 1. A mismatch marks a reorg starting at the deepest divergent height.
Repair
procedure
1. find divergence height h 2. delete rows where block_number >= h (all layers, one transaction) 3. re-ingest h … head 4. re-run decoders and canonical models for the range 5. emit reorg event to status page
Idempotency
All writes are keyed by (block_number, block_hash). Re-processing a block replaces its rows rather than appending, so a repair leaves no duplicates.
LiveReorgs deeper than 64 blocks trigger a full-range audit and are recorded on the status page.