FFORGE//RS
← Roadmap

blockchain / LEVEL 3

The block that came back

EST.35 MIN
01

THEORY / RETRIEVAL

What to restore

  • Distinguish probabilistic and deterministic finality
  • Detect the common ancestor of competing branches

Fork choice is not always finality

A fork-choice rule selects the canonical head from currently known branches. Finality describes when reverting a block becomes impossible under protocol rules or sufficiently improbable under an explicit risk model.

Reorg handling starts at the common ancestor

Indexers must roll back orphaned blocks to the common ancestor and then apply the new canonical branch. Treating the latest observed head as irreversible corrupts derived state.

CHECKPOINT

An indexer sees a longer competing branch. What is the safest generic action before applying its blocks?

ISOLATED RUST 1.96
src/main.rsEDIT

02 / DEBUGGING

Find and fix the defect

Return the highest common block height for two ancestor paths ordered from genesis to head. Do not allocate another collection.

Initializing editor…
CLOUD SANDBOXnetwork off · 256 MB · 12 s
1 / 64 KB
OUTPUT
Runner is waiting for a submission.