Skip to content

fix(slot-detail): prefer canonical block when slot has competing fork#434

Merged
samcm merged 1 commit into
masterfrom
fix/slot-prefer-canonical-block
May 5, 2026
Merged

fix(slot-detail): prefer canonical block when slot has competing fork#434
samcm merged 1 commit into
masterfrom
fix/slot-prefer-canonical-block

Conversation

@samcm
Copy link
Copy Markdown
Member

@samcm samcm commented May 5, 2026

Sorts canonical first in the slot detail data hook when fct_block_head and fct_block return multiple rows for a slot. The slot page now shows the canonical block_root instead of sometimes picking the orphan, which depended on whichever row order the API happened to return.

Reproduces on slot 13640826: pre-fix the page rendered 0x1fe6d769… (orphan, proposer 340513, EL block 24408745); post-fix it renders 0x6bb4d0df… (canonical, proposer 2132049, EL block 24408804).

fct_block_head and fct_block can return multiple rows for a slot when a
fork produces a competing block (canonical + orphaned). Row order from
the API is non-deterministic, so data.blockHead[0] sometimes pointed at
the orphan and the slot detail page rendered the wrong block_root.

Sort both arrays canonical-first inside the hook so all consumers using
[0] pick the canonical row. FctBlockHead lacks a status field, so the
canonical block_root from fct_block is used to identify its match.
@samcm samcm requested a review from Savid as a code owner May 5, 2026 01:13
@samcm samcm merged commit 172fd23 into master May 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants