BNB Smart Chain
Chain Reorganizations
A chain reorganization, or reorg, is when the node you read from switches its view of the canonical chain: it discards one or more recently seen blocks and adopts a different sequence at the same heights. On BNB Smart Chain reorgs stay uncommon and nearly always shallow. PoSA hands each ~3s slot to a scheduled validator, and fast finality commits blocks within a couple of slots, so the only window where the tip can move is the brief one created by propagation timing. That window is small, but it is real. If your application credits a balance, emits a webhook, or mutates internal state the instant a block appears, a reorg can pin those actions to a block that no longer exists, and out come duplicated events, phantom balances, inconsistent records. Any backend or dApp that acts on recent BSC blocks has to handle reorgs.
Understanding Reorgs
- Causes on BSC. A brief fork forms when a validator's sealed block reaches parts of the network late, leaving nodes to momentarily disagree on the tip until PoSA finality settles which branch is canonical. Consensus then prunes the losing branch.
- Shallow versus deep. Deep reorgs spanning many blocks belong to probabilistic PoW chains. On BSC a reorg runs one or two blocks deep at most, because finalized blocks cannot be reverted under PoSA.
- Effect on transactions. A pending transaction rides it out and gets re-included on the new branch. A transaction confirmed only inside a discarded block falls back to pending and may land in a different block, or, if it was a competing transaction, be dropped outright.
- Detection signals. At the JSON-RPC level, two things tip you off: the hash at a known height changes, or a new header arrives whose
parentHashdoes not match the block you last recorded as the tip. Either one means the canonical chain moved.
Implementation Examples
Mitigation Strategies
- Wait enough confirmations. BSC reorgs are shallow, so treating a transaction as final after roughly a dozen confirmations for ordinary value (more for large transfers) puts it well past any realistic reorg depth.
- Detect in either model. Polling system: re-fetch the block at your recorded tip height each cycle and compare hashes, as the
monitorReorgshelper does. Subscription system: verify each new header'sparentHashchains cleanly onto the previous one, and flag a reorg when it does not. - Resubmit safely. Resubmission means re-broadcasting a transaction that fell back to pending after its block was dropped. Reuse the same nonce so the network treats it as one transaction, and make every dependent state change idempotent so re-processing cannot double-credit.
- Restore consistency. Once detected, walk back to the common ancestor with
findCommonAncestor, roll back each state change derived from the orphaned blocks, then replay your processing against the new canonical blocks above that ancestor. - Listeners versus polling. WebSocket
newBlockHeaderssubscriptions give low-latency detection on live BSC traffic and are the default choice. Fall back to interval polling for batch indexers, or when a stable long-lived socket to the endpoint is impractical.
See also
- eth_getBlockByHash - Retrieve block by hash
- Block Confirmations Guide - Understanding transaction finality
- Working with Blocks - General block handling