fix(web)[gloas]: flag serving checkpoint by block root, not epoch#244
Open
barnabasbusa wants to merge 1 commit intobbusa/fix-list-finalized-slots-underflow-gloasfrom
Open
Conversation
The historical-checkpoints table flags the row currently being served by the checkpointz instance. It did this by comparing each row's epoch against `status.data.finality.finalized.epoch`. Two issues: 1. The slots list is built from `d.head` (majority-decided finality), but the status's `finality.finalized` is `d.servingBundle` (the last fully-downloaded bundle). When bundle downloads lag — e.g. after an upstream blip or on short-lived devnets — `d.head` advances while `d.servingBundle` stays behind, so the slots list contains rows for epochs that don't yet have a serving bundle. The flag then either appears on a non-top row with no explanation or disappears entirely until the bundle catches up. 2. Epoch-only comparison is ambiguous in principle (two different roots can share the same finalized epoch across restarts / reorgs, however rare post-finality). Matching by block root is the semantically correct signal: "which row's bundle is the one we're serving". Prefer matching by `slot.block_root === status.finality.finalized.root` and fall back to the old epoch-based comparison for rows whose block_root hasn't been populated yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on top of #242 (targeted at
release/gloas) so a gloas-based build picks up both the slots-list underflow fix and the flag-rendering fix in a single rebuild.Same change as #243 (targeted at master).
The historical-checkpoints table flags the row currently being served. Previously it matched by epoch (
status.data.finality.finalized.epoch === slot.epoch), which has two problems:d.head(majority-decided finality) whilestatus.data.finalitycomes fromd.servingBundle(last fully-downloaded bundle). When bundle downloads lag — typical on short-lived kurtosis gloas devnets where bundle fetches may retry —d.headadvances whiled.servingBundlestays behind. Result: the slots list contains rows for epochs that aren't yet serving, so the flag appears on a non-top row or disappears until the bundle catches up.Switch to
slot.block_root === status.finality.finalized.root, with a fallback to the old epoch comparison for rows whoseblock_roothasn't been populated yet.Merge order
Once #242 lands on
release/gloas, rebase this PR ontorelease/gloasand flip its base. If #242 is merged into a squash commit that changes, rebase first.Test plan
npx tsc --noEmitcleannpm run lintcleanblock_rootmatchesstatus.data.finality.finalized.root