there was a problem with the canonical head selection:
if the number of "fork heads" is less than 2, dora skips the head comparison and just uses the block with highest slot number as the canonical head.
that's great to save some cycles if everything works fine.. if there's only one fork detected, the best slot is just the one with the highest number 😉
unfortunately that breaks in some situations:
if there is a chain that forked off before the finalization checkpoint, dora doesn't recognize that chain as potentially canonical anymore. This is correct as the finalization of the canonical chain prevents the fork chain from ever finalizing in future.
This breaks the assumption I've made before that I can use the block with highest number if there is only one fork detected.
This PR fixes the canonical head selection, so dora always runs though the head comparison, even if there is only 1 fork detected.
The old code that uses the block with highest slot number is now the fallback that's used if no head block can be selected via the head comparison.
This fixes the canonical head selection.
there was a problem with the canonical head selection: if the number of "fork heads" is less than 2, dora skips the head comparison and just uses the block with highest slot number as the canonical head. that's great to save some cycles if everything works fine.. if there's only one fork detected, the best slot is just the one with the highest number 😉
unfortunately that breaks in some situations: if there is a chain that forked off before the finalization checkpoint, dora doesn't recognize that chain as potentially canonical anymore. This is correct as the finalization of the canonical chain prevents the fork chain from ever finalizing in future. This breaks the assumption I've made before that I can use the block with highest number if there is only one fork detected.
This PR fixes the canonical head selection, so dora always runs though the head comparison, even if there is only 1 fork detected. The old code that uses the block with highest slot number is now the fallback that's used if no head block can be selected via the head comparison.