Overview
A blockchain reorganization (re-org) occurs when a previously accepted block is replaced by another block at the same height. Re-orgs are a normal part of blockchain operation, especially on:- High-throughput chains
- L2s
- Testnets
How Streams Handles Re-orgs
When a re-org occurs:- Streams detects the replaced block
- Events from the dropped block are invalidated
- Replacement block events are processed
- Confirmation logic is recalculated
Impact on Webhooks
Re-org handling is reflected through:confirmed: falseevents that may not be finalizedconfirmed: trueevents only sent after finality
- It will not receive a confirmed webhook
- Replacement transactions will be delivered instead
Why This Matters
Without re-org handling, applications risk:- Double-counting transactions
- Incorrect balances
- Invalid ownership state
- Only finalized state is confirmed
- Re-orgs do not corrupt downstream systems
Replays & Recovery
If your system was offline during a re-org:- You can replay affected blocks
- You can replay failed webhooks
Best Practices
- Treat
confirmed: falseas provisional - Persist only confirmed state
- Make handlers idempotent
- Use replays for recovery, not polling

