We maintain a candidate index index and a confirmed index. The candidate chain is the next strongest relative to the confirmed. When it becomes stronger it’s reorged into the confirmed chain. At equilibrium they are the same. Lesser branches are maintained in an in memory tree relative to the candidate index and are purged based on configurable max confirmable depth.
(edited)